/* =========================================================================
   Anson Chiu — Portfolio
   Modern design system (vanilla CSS, light/dark, responsive)
   ========================================================================= */

/* ----------------------------- Design tokens ---------------------------- */
:root {
  --font-sans: "Inter", "Noto Sans TC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Noto Sans TC", system-ui, sans-serif;

  /* brand — Slate / Mono */
  --brand: #334155;
  --brand-2: #475569;
  --brand-grad: linear-gradient(135deg, #1e293b 0%, #334155 55%, #475569 100%);
  --on-brand: #ffffff;       /* text color on top of brand fills */

  /* light theme — clean cool white */
  --bg: #f8fafc;
  --bg-soft: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-soft: #475569;
  --text-mute: #64748b;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 2px 8px rgba(15, 23, 42, .05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, .10);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .16);
  --nav-bg: rgba(255, 255, 255, .72);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 26px;
  --maxw: 1140px;
  --nav-h: 68px;
}

html[data-theme="dark"] {
  /* slate dark + light slate accent */
  --brand: #94a3b8;
  --brand-2: #cbd5e1;
  --brand-grad: linear-gradient(135deg, #64748b 0%, #94a3b8 55%, #cbd5e1 100%);
  --on-brand: #0b1120;

  --bg: #0b1120;
  --bg-soft: #0f172a;
  --surface: #131c2e;
  --surface-2: #1e293b;
  --border: #2a3650;
  --text: #e8edf5;
  --text-soft: #aebacd;
  --text-mute: #7c889e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, .5);
  --shadow-lg: 0 30px 70px rgba(0, 0, 0, .6);
  --nav-bg: rgba(11, 17, 32, .72);
}

/* ----------------------------- Base ------------------------------------- */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; font-weight: 700; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
section { scroll-margin-top: calc(var(--nav-h) + 12px); }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 22px;
}

/* decorative page background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60vw 60vw at 85% -10%, color-mix(in srgb, var(--brand) 20%, transparent), transparent 60%),
    radial-gradient(50vw 50vw at -10% 10%, color-mix(in srgb, var(--brand-2) 18%, transparent), transparent 60%);
  pointer-events: none;
}

/* ----------------------------- Reveal animation ------------------------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ----------------------------- Progress bar ----------------------------- */
#progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--brand-grad);
  z-index: 1200;
  transition: width .08s linear;
}

/* ----------------------------- Navbar ----------------------------------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 1100;
  background: var(--nav-bg);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  max-width: var(--maxw);
  height: 100%;
  margin-inline: auto;
  padding-inline: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.nav__brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.05rem;
  margin-right: auto;
}
.nav__brand img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.nav__brand .accent { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__links a {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: .92rem;
  font-weight: 500;
  color: var(--text-soft);
  transition: color .2s, background .2s;
}
.nav__links a:hover { color: var(--text); background: var(--surface-2); }
.nav__links a.active { color: var(--on-brand); background: var(--brand); }

.nav__tools { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  border-radius: 12px;
  font-size: .95rem;
  transition: transform .15s, color .2s, border-color .2s;
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-2px); }
.lang-btn { width: auto; padding: 0 14px; font-weight: 600; font-size: .85rem; }

.nav__burger { display: none; }

/* ----------------------------- Hero ------------------------------------- */
.hero {
  position: relative;
  padding-top: calc(var(--nav-h) + 56px);
  padding-bottom: 64px;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 48px;
  align-items: center;
}
.hero__eyebrow {
  display: inline-block;
  font-weight: 600;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .9rem;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 3.9rem);
  margin: 0 0 6px;
  letter-spacing: -.02em;
}
.hero h1 .grad { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__role {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  color: var(--text-soft);
  margin: 0 0 20px;
}
.hero__intro { color: var(--text-soft); max-width: 60ch; margin: 0 0 28px; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid transparent;
  transition: transform .15s, box-shadow .2s, background .2s, color .2s, border-color .2s;
}
.btn-primary { background: var(--brand-grad); color: var(--on-brand); box-shadow: 0 10px 26px color-mix(in srgb, var(--brand) 38%, transparent); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 34px color-mix(in srgb, var(--brand) 48%, transparent); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--brand); color: var(--brand); }

.hero__socials { display: flex; gap: 12px; }
.hero__socials a {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 1.1rem;
  transition: transform .15s, color .2s, border-color .2s;
}
.hero__socials a:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-3px); }

/* hero portrait */
.hero__photo { position: relative; display: grid; place-items: center; }
.hero__photo .ring {
  position: absolute;
  width: 108%; aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--brand), var(--brand-2), var(--brand), var(--brand-2));
  filter: blur(6px);
  opacity: .55;
  animation: spin 14s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hero__photo img {
  position: relative;
  width: min(330px, 76vw);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 5px solid var(--surface);
  box-shadow: var(--shadow-lg);
}

/* stats */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 8px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  background: var(--brand-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat__label { font-size: .82rem; color: var(--text-mute); margin-top: 2px; }

/* ----------------------------- Section shell ---------------------------- */
.section { padding: 72px 0; }
.section__head { text-align: center; margin-bottom: 44px; }
.section__eyebrow {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .76rem;
  font-weight: 700;
  color: var(--brand);
}
.section__title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin: 8px 0 0;
  letter-spacing: -.02em;
}
.section__title::after {
  content: "";
  display: block;
  width: 56px; height: 4px;
  margin: 14px auto 0;
  border-radius: 4px;
  background: var(--brand-grad);
}

/* ----------------------------- About ------------------------------------ */
.about {
  max-width: 820px;
  margin-inline: auto;
  text-align: center;
  font-size: 1.12rem;
  color: var(--text-soft);
}

/* ----------------------------- Timeline (experience) -------------------- */
.timeline { position: relative; max-width: 860px; margin-inline: auto; }
.timeline::before {
  content: "";
  position: absolute;
  left: 19px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--brand), var(--brand-2));
  opacity: .35;
}
.tl-item { position: relative; padding-left: 60px; margin-bottom: 26px; }
.tl-item::before {
  content: "";
  position: absolute;
  left: 11px; top: 26px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--brand-grad);
  border: 4px solid var(--bg);
  box-shadow: 0 0 0 2px var(--brand);
}
.tl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s, transform .25s;
}
.tl-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.tl-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; }
.tl-role { font-size: 1.22rem; margin: 0; }
.tl-company { color: var(--brand); font-weight: 600; font-size: .98rem; }
.tl-duration {
  font-size: .8rem;
  color: var(--text-mute);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.tl-logo { height: 26px; width: auto; border-radius: 6px; background: #fff; padding: 2px 4px; }
.tl-body { margin-top: 14px; }
.tl-subrole { font-weight: 700; font-size: .98rem; margin: 14px 0 8px; color: var(--text); }
.tl-subrole a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.tl-list { margin: 0; padding-left: 20px; color: var(--text-soft); }
.tl-list li { margin-bottom: 8px; }
.tl-shots { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 4px; }
.tl-shots img { height: 110px; width: auto; border-radius: 10px; border: 1px solid var(--border); cursor: zoom-in; }

.tl-collapse { max-height: 0; overflow: hidden; transition: max-height .45s ease; }
.tl-item.open .tl-collapse { max-height: 3000px; }
.tl-toggle {
  margin-top: 14px;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-soft);
  padding: 7px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .85rem;
  transition: color .2s, border-color .2s;
}
.tl-toggle:hover { color: var(--brand); border-color: var(--brand); }
.tl-toggle i { transition: transform .3s; }
.tl-item.open .tl-toggle i { transform: rotate(180deg); }

/* ----------------------------- Skills ----------------------------------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  max-width: 980px;
  margin-inline: auto;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s, box-shadow .25s;
}
.skill-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.skill-card h3 {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.05rem; margin: 0 0 14px;
}
.skill-card h3 i { color: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .85rem;
  font-weight: 500;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-soft);
}
.chip i { font-size: 1.05em; line-height: 1; }
.chip.lang,
.chip.core {
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  border-color: color-mix(in srgb, var(--brand) 30%, transparent);
  color: var(--brand);
  font-weight: 600;
}
/* "currently exploring" chips read as in-progress */
.chip.learning {
  border-style: dashed;
  background: transparent;
  color: var(--text-soft);
}
.skill-list { list-style: none; margin: 0; padding: 0; }
.skill-list li { display: flex; align-items: center; gap: 9px; color: var(--text-soft); padding: 4px 0; }
.skill-list li i { color: var(--brand-2); font-size: .8rem; }

/* ----------------------------- Projects --------------------------------- */
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 36px; }
.filter-btn {
  padding: 9px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-weight: 600;
  font-size: .9rem;
  transition: all .2s;
}
.filter-btn:hover { border-color: var(--brand); color: var(--brand); }
.filter-btn.active { background: var(--brand-grad); color: var(--on-brand); border-color: transparent; box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 32%, transparent); }

.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}
.proj-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: flex; flex-direction: column;
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s;
  animation: card-in .5s ease both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(16px); } }
.proj-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.proj-card__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
/* blurred ambient backdrop fills the gaps left by tall/narrow screenshots */
.proj-card__bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: blur(20px) saturate(1.15);
  transform: scale(1.2);
  opacity: .5;
}
html[data-theme="dark"] .proj-card__bg { opacity: .38; }
.proj-card__media img {
  position: relative; z-index: 1;
  width: 100%; height: 100%;
  object-fit: contain;            /* show the whole image, never crop */
  transition: transform .5s ease;
}
.proj-card:hover .proj-card__media img { transform: scale(1.05); }
.proj-card__cat {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  font-size: .72rem; font-weight: 700;
  padding: 4px 11px; border-radius: 999px;
  color: #fff; backdrop-filter: blur(4px);
}
.cat-industry { background: rgba(51, 65, 85, .92); }
.cat-academic { background: rgba(16, 185, 129, .92); }
.cat-personal { background: rgba(244, 114, 182, .92); }
.proj-card__award {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  font-size: .72rem; font-weight: 700;
  padding: 4px 11px; border-radius: 999px;
  background: rgba(251, 191, 36, .95); color: #3b2f00;
  display: flex; align-items: center; gap: 5px;
}
.proj-card__body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.proj-card__title { font-size: 1.12rem; margin: 0; }
.proj-card__desc {
  color: var(--text-soft); font-size: .9rem; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.proj-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tag {
  font-size: .72rem; font-weight: 600;
  padding: 3px 9px; border-radius: 7px;
  background: var(--surface-2); color: var(--text-mute);
  border: 1px solid var(--border);
}
.proj-card__more {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--brand); font-weight: 600; font-size: .85rem; margin-top: 4px;
}
.proj-card__more i { transition: transform .2s; }
.proj-card:hover .proj-card__more i { transform: translateX(4px); }

/* ----------------------------- Education -------------------------------- */
.edu-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; max-width: 980px; margin-inline: auto; align-items: start; }
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.panel h3 { margin: 0 0 4px; font-size: 1.25rem; }
.panel .muted { color: var(--text-mute); font-size: .9rem; }
.edu-degree { color: var(--brand); font-weight: 600; margin: 6px 0; }
.gpa-badge { display: inline-block; margin-top: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 14px; font-weight: 600; font-size: .85rem; }
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub-list li { padding: 12px 0; border-bottom: 1px dashed var(--border); }
.pub-list li:last-child { border-bottom: none; }
.pub-list strong { display: block; margin-bottom: 3px; }
.pub-list .muted { font-style: italic; }
.pub-list a { color: var(--brand); font-weight: 600; font-size: .88rem; text-decoration: underline; text-underline-offset: 3px; }

/* ----------------------------- Interests -------------------------------- */
.interests-text { max-width: 820px; margin: 0 auto 32px; color: var(--text-soft); text-align: center; }
.interests-text p { margin: 0 0 14px; }
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.gallery img {
  width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: zoom-in;
  transition: transform .3s, box-shadow .3s;
}
.gallery img:hover { transform: scale(1.03); box-shadow: var(--shadow-md); }
.gallery img:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }

/* ----------------------------- Contact / footer ------------------------- */
.contact {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 46px 24px;
  max-width: 860px;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
}
.contact h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 8px; }
.contact p { color: var(--text-soft); margin: 0 0 22px; }
.contact .hero__socials { justify-content: center; }

.footer {
  text-align: center;
  padding: 36px 0 28px;
  color: var(--text-mute);
  font-size: .88rem;
}
.footer .accent { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }

/* ----------------------------- Back to top ------------------------------ */
#toTop {
  position: fixed; right: 22px; bottom: 22px;
  width: 46px; height: 46px;
  border-radius: 14px;
  border: none;
  background: var(--brand-grad);
  color: var(--on-brand); font-size: 1.1rem;
  box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none;
  transform: translateY(12px);
  transition: opacity .25s, transform .25s;
  z-index: 900;
}
#toTop.show { opacity: 1; pointer-events: auto; transform: none; }

/* ----------------------------- Modal ------------------------------------ */
.modal {
  position: fixed; inset: 0;
  z-index: 1300;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(7, 10, 20, .65);
  backdrop-filter: blur(4px);
}
.modal.open { display: flex; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } }
.modal__box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: min(820px, 100%);
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
  animation: pop .3s ease;
}
@keyframes pop { from { transform: translateY(24px) scale(.98); opacity: 0; } }
.modal__close {
  position: sticky; top: 12px;
  margin-left: auto; margin-right: 12px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 1rem;
  float: right;
}
.modal__close:hover { color: var(--brand); border-color: var(--brand); }
.modal__media { width: 100%; aspect-ratio: 16/9; background: #000; }
.modal__media iframe { width: 100%; height: 100%; border: 0; display: block; }
.modal__gallery { display: flex; gap: 8px; overflow-x: auto; padding: 12px; background: var(--surface-2); }
.modal__gallery img { height: 150px; width: auto; border-radius: 8px; border: 1px solid var(--border); }
.modal__content { padding: 22px 26px 28px; }
.modal__cat { font-size: .76rem; font-weight: 700; padding: 4px 11px; border-radius: 999px; color: #fff; display: inline-block; }
.modal__content h3 { font-size: 1.5rem; margin: 12px 0 12px; }
.modal__content .proj-card__tags { margin: 0 0 16px; }
.modal__content .modal__desc { color: var(--text-soft); margin: 0 0 22px; }
.modal__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ----------------------------- Lightbox --------------------------------- */
.lightbox {
  position: fixed; inset: 0;
  z-index: 1400;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .88);
  padding: 30px;
}
.lightbox.open { display: flex; animation: fade .25s ease; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 12px; box-shadow: var(--shadow-lg); }
.lightbox__close { position: fixed; top: 20px; right: 24px; background: none; border: none; color: #fff; font-size: 2rem; line-height: 1; }

/* ----------------------------- Mobile menu ------------------------------ */
@media (max-width: 860px) {
  .nav__burger {
    display: grid; place-items: center;
    width: 42px; height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 1.1rem;
  }
  .nav__links {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--nav-bg);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 12px 18px 18px;
    transform: translateY(-130%);
    transition: transform .3s ease;
  }
  .nav__links.open { transform: none; }
  .nav__links a { padding: 12px 14px; }
}

/* ----------------------------- Responsive ------------------------------- */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; text-align: center; }
  .hero__cta, .hero__socials { justify-content: center; }
  .hero__intro { margin-inline: auto; }
  .hero__photo { order: -1; }
  .edu-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .section { padding: 56px 0; }
  .stats { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery img:first-child { grid-column: span 2; grid-row: auto; aspect-ratio: 16/10; }
  .tl-item { padding-left: 48px; }
}
