/* =====================================================
   VARIABLES
===================================================== */

:root {
  --page-bg:    #0d1117;
  --window-bg:  #161b22;
  --text:       #e6edf3;
  --muted:      #8b949e;
  --accent:     #58a6ff;
  --btn-bg:     #21262d;
  --btn-text:   #c9d1d9;
  --btn-border: #30363d;
  --btn-hover:  #30363d;
  --border:     #30363d;
  --tag-bg:     #1a2740;
  --tag-text:   #79c0ff;
}

/* =====================================================
   BASE
===================================================== */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--page-bg);
  color: var(--text);
  line-height: 1.5;
}

::selection {
  background: rgba(88, 166, 255, 0.25);
  color: var(--text);
}

/* =====================================================
   SCROLLBAR
===================================================== */

::-webkit-scrollbar              { width: 8px; height: 8px; }
::-webkit-scrollbar-track        { background: var(--page-bg); }
::-webkit-scrollbar-thumb        { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover  { background: var(--muted); }

/* =====================================================
   LAYOUT
===================================================== */

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

/* =====================================================
   NAVIGATION
===================================================== */

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 600;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s;
}

.logo:hover { opacity: 0.75; }

.lang { display: flex; gap: 0.5rem; }

.lang a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s;
  cursor: pointer;
}

.lang a.active {
  color: var(--text);
  font-weight: 700;
}

.lang a:hover { color: var(--text); }

/* =====================================================
   PROFILE (photo + heading row)
===================================================== */

.profile {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin-bottom: 0.25rem;
}

.profile-photo {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
  border: 2px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.profile-text { flex: 1; min-width: 0; }
.profile-text h1 { margin-bottom: 0.2rem; }
.profile-text h2 { margin-bottom: 0.5rem; }
.profile-text .stack { margin-top: 0; }

@media (max-width: 560px) {
  .profile { flex-direction: column; align-items: flex-start; gap: 1.25rem; }
  .profile-photo { width: 88px; height: 88px; }
}

/* =====================================================
   HERO / MAIN SECTION
===================================================== */

.hero { margin-top: 2rem; }
.home .hero { margin-top: 4rem; }

h1 { font-size: 2.4rem; margin: 0 0 0.4rem; }
h2 { font-size: 1.35rem; font-weight: 400; color: var(--muted); margin: 0 0 1rem; }
h3 { font-size: 1.1rem; margin: 0 0 0.75rem; }

.stack {
  margin: 1rem 0 0;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.intro {
  max-width: 620px;
  margin: 1.25rem 0 0;
  line-height: 1.65;
  color: var(--muted);
}

/* =====================================================
   ACTIONS / BUTTONS
===================================================== */

.actions { margin-top: 2rem; }

.btn {
  display: inline-block;
  margin: 0 0.6rem 0.6rem 0;
  padding: 0.5rem 1.15rem;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: 1px solid var(--btn-border);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn:hover { background: var(--btn-hover); border-color: var(--muted); }

.btn.primary {
  background: var(--accent);
  color: #0d1117;
  border-color: var(--accent);
}

.btn.primary:hover { background: #79c0ff; border-color: #79c0ff; }

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn.btn-demo {
  background: rgba(255, 68, 68, 0.1);
  color: #ff6b6b;
  border-color: #ff4444;
}

.btn.btn-demo:hover {
  background: rgba(255, 68, 68, 0.2);
  border-color: #ff6b6b;
}

.btn.btn-web {
  background: rgba(63, 185, 80, 0.1);
  color: #56d364;
  border-color: #3fb950;
}

.btn.btn-web:hover {
  background: rgba(63, 185, 80, 0.2);
  border-color: #56d364;
}

/* =====================================================
   WINDOW (macOS style)
===================================================== */

.window {
  background: var(--window-bg);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.window-content { padding: 2.25rem 2.5rem; }

/* =====================================================
   SECTIONS
===================================================== */

section { margin-top: 2rem; }

section + section {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* =====================================================
   TECH TAGS
===================================================== */

.tech-tags { margin: 0.5rem 0 1rem; }

.tag {
  display: inline-block;
  margin: 2px 3px 2px 0;
  padding: 3px 10px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

.project-badge {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 2px 10px;
  background: rgba(63, 185, 80, 0.15);
  color: #3fb950;
  border: 1px solid rgba(63, 185, 80, 0.4);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* =====================================================
   PROJECT CARDS
===================================================== */

.project-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  grid-template-rows: auto auto;
  column-gap: 1.25rem;
  padding: 1.25rem 0.75rem;
  margin: 0 -0.75rem;
  border-bottom: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.project-card:hover { background: rgba(88, 166, 255, 0.05); }

.project-card:last-child { border-bottom: none; }

.project-thumb-wrap {
  grid-column: 1;
  grid-row: 1;
}

.project-thumb {
  width: 160px;
  height: 120px;
  object-fit: cover;
  object-position: top center;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: block;
  pointer-events: none;
}

.project-card-body {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.project-card-body h3 { margin-bottom: 0.5rem; }

.project-card-footer {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.project-card-footer .tech-tags { flex: 1; margin: 0; }

.project-card-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Project Modal */
#proj-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  place-items: center;
  padding: 1rem;
}

#proj-modal.active { display: grid; }

#proj-modal-inner {
  background: var(--window-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

#proj-modal-img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  object-position: top center;
  border-radius: 14px 14px 0 0;
  display: block;
}

#proj-modal-img.portrait {
  height: 480px;
  object-fit: contain;
  object-position: center;
  background: var(--page-bg);
}

.project-thumb-wrap[data-portrait] .project-thumb {
  object-position: center;
}

#proj-modal-body { padding: 1.5rem; }

#proj-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

#proj-modal-title { margin: 0; font-size: 1.1rem; line-height: 1.3; }

#proj-modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.15s;
}

#proj-modal-close:hover { color: var(--text); }

#proj-modal-desc {
  color: var(--muted);
  line-height: 1.65;
  margin: 0 0 1rem;
}

#proj-modal-features {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

#proj-modal-features li {
  color: var(--muted);
  margin-bottom: 0.3rem;
  line-height: 1.5;
}

#proj-modal .tech-tags { margin: 0 0 1.25rem; }

.modal-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .project-card { grid-template-columns: 1fr; }
  .project-thumb-wrap { grid-column: 1; }
  .project-card-body { grid-column: 1; grid-row: 2; }
  .project-card-footer { grid-row: 3; }
  .project-thumb { width: 100%; height: 160px; }
  #proj-modal-img { height: 220px; }
}

/* =====================================================
   OTHER PROJECTS LIST
===================================================== */

.project-list {
  padding-left: 1.25rem;
  margin: 0;
}

.project-list li {
  margin-bottom: 0.9rem;
  line-height: 1.6;
}

.project-list a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  margin-left: 0.25rem;
}

.project-list a:hover { text-decoration: underline; }

.project-list a.link-demo { color: #ff6b6b; }
.project-list a.link-web  { color: #56d364; }

.certs-details .project-list {
  padding: 0.75rem 1.5rem 1rem;
  border-top: 1px solid var(--border);
}

/* =====================================================
   JOB CARD (experience)
===================================================== */

.job-card { padding: 0.5rem 0; }
.job-card h3 { font-size: 1.15rem; margin-bottom: 0.3rem; }
.job-card p   { margin: 0 0 0.85rem; line-height: 1.65; }
.job-meta { color: var(--muted); font-size: 0.88rem; margin-bottom: 1.1rem !important; }
.job-card ul  { padding-left: 1.25rem; margin: 0 0 0.85rem; }
.job-card li  { line-height: 1.65; margin-bottom: 0.35rem; }
.job-card li:last-child { margin-bottom: 0; }
.job-card .job-letter { margin-top: 1.5rem; }
.job-card .letter-btn {
  background: #1f6feb;
  color: #ffffff;
  border-color: #388bfd;
  box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.18);
}

.job-card .letter-btn:hover {
  background: #388bfd;
  border-color: #58a6ff;
}

/* =====================================================
   EDUCATION CARD (courses)
===================================================== */

.edu-card {
  padding: 1.25rem 1.5rem;
  background: var(--page-bg);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.edu-card p { margin: 0 0 0.3rem; }
.edu-card p:last-child { margin-bottom: 0; }

/* =====================================================
   COURSE / LANGUAGE LISTS
===================================================== */

ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0 0;
}

ul li {
  margin-bottom: 0.45rem;
  line-height: 1.6;
}

/* =====================================================
   CERTIFICATE GRID (professional programs)
===================================================== */

.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.cert-card {
  padding: 1.1rem 1.25rem;
  background: var(--page-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s;
}

.cert-card:hover { border-color: var(--muted); }

.cert-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.cert-provider {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.cert-year {
  font-size: 0.78rem;
  color: var(--muted);
}

.cert-name {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

/* =====================================================
   CERTIFICATE BADGES (link buttons)
===================================================== */

.cert-badges { display: flex; flex-wrap: wrap; gap: 6px; }

.cert-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: opacity 0.15s;
}

.cert-badge:hover { opacity: 0.75; }

.cert-badge--edx    { background: #02262b; color: #ffffff; }
.cert-badge--cs50   { background: #c00000; color: #ffffff; }
.cert-badge--credly { background: #f47920; color: #ffffff; }

/* =====================================================
   INDIVIDUAL COURSES LIST (collapsible)
===================================================== */

.certs-details {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.certs-details summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  font-weight: 500;
  list-style: none;
  user-select: none;
}

.certs-details summary::-webkit-details-marker { display: none; }

.certs-details summary::before {
  content: '▶';
  font-size: 0.65rem;
  color: var(--muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.certs-details[open] summary::before { transform: rotate(90deg); }

.certs-details summary:hover { background: var(--page-bg); }

.cert-count { color: var(--muted); font-size: 0.875rem; }

.cert-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--border);
}

.cert-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.cert-item:last-child { border-bottom: none; }

.cert-item-name {
  font-size: 0.875rem;
  line-height: 1.4;
}

.cert-item-provider {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .cert-item {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .cert-grid {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   RESPONSIVE — MOBILE
===================================================== */

@media (max-width: 768px) {
  .container      { padding: 1rem; }
  .hero           { margin-top: 1rem; }
  .home .hero     { margin-top: 2rem; }
  .window-content { padding: 1.5rem 1.25rem; }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.1rem; }

  .btn { margin-bottom: 0.5rem; }

  .project-card { padding: 1.25rem 0; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  .window-content { padding: 1.25rem 1rem; }
}
