/* ============================================================
   Seokwon Kim — portfolio
   ============================================================ */

:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --surface-2: #f0f0ec;
  --text: #15171c;
  --muted: #5d6472;
  --faint: #8a909c;
  --line: #e4e4de;
  --accent: #2d55e0;
  --accent-ink: #ffffff;
  --accent-soft: #e9eeff;
  --gold: #a86b00;
  --gold-soft: #fff3da;
  --shadow: 0 1px 2px rgba(20, 22, 30, .04), 0 8px 24px -12px rgba(20, 22, 30, .12);
  --radius: 16px;
  --maxw: 1080px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0e12;
    --surface: #14171e;
    --surface-2: #1b1f28;
    --text: #e9ebf0;
    --muted: #a0a7b5;
    --faint: #737b8a;
    --line: #262b36;
    --accent: #7d9bff;
    --accent-ink: #0c0e12;
    --accent-soft: #1b2442;
    --gold: #f0b54a;
    --gold-soft: #2e2412;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -16px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0e12;
  --surface: #14171e;
  --surface-2: #1b1f28;
  --text: #e9ebf0;
  --muted: #a0a7b5;
  --faint: #737b8a;
  --line: #262b36;
  --accent: #7d9bff;
  --accent-ink: #0c0e12;
  --accent-soft: #1b2442;
  --gold: #f0b54a;
  --gold-soft: #2e2412;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -16px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 24px;
}
.brand { font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  color: var(--muted); font-size: 14px; font-weight: 500;
  padding: 6px 12px; border-radius: 999px;
  transition: color .15s, background-color .15s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-links a.active { color: var(--text); background: var(--surface-2); }
.theme-toggle {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--muted);
}
.theme-toggle:hover { color: var(--text); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}

/* ---------- Layout ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0 8px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 24px;
}
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; line-height: 1.25; }
h2 { font-size: 28px; font-weight: 750; }
h2::after {
  content: ""; display: block; width: 28px; height: 3px; border-radius: 2px;
  background: var(--accent); margin-top: 10px;
}

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1fr 260px; gap: 56px; align-items: center;
  padding: 72px 0 24px;
}
.eyebrow {
  font-family: var(--mono); font-size: 13px; color: var(--accent);
  margin: 0 0 14px; letter-spacing: .01em;
}
.hero h1 { font-size: clamp(40px, 6vw, 60px); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; }
.lead { font-size: 17.5px; color: var(--text); margin: 22px 0 0; max-width: 62ch; }
.lead strong { font-weight: 600; }
.lead.secondary { color: var(--muted); font-size: 16px; margin-top: 12px; }

.chips { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-size: 13px; font-weight: 500; color: var(--accent);
  background: var(--accent-soft); padding: 5px 12px; border-radius: 999px;
}
.chips.small { margin-top: 8px; }
.chips.small li { background: var(--surface-2); color: var(--text); font-size: 13px; }

.social { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--text);
  background: var(--surface); border: 1px solid var(--line);
  padding: 9px 15px; border-radius: 10px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn svg { color: var(--muted); }
.btn:hover svg { color: var(--accent); }

.hero-photo { margin: 0; position: relative; }
.hero-photo::before {
  content: ""; position: absolute; inset: 14px -14px -14px 14px;
  border-radius: 22px; background: var(--accent-soft); z-index: -1;
}
.hero-photo img {
  width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%;
  border-radius: 22px; border: 1px solid var(--line); box-shadow: var(--shadow);
  background: var(--surface);
}

/* ---------- News ---------- */
.news { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.news li {
  display: grid; grid-template-columns: 96px 1fr; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.news time { font-family: var(--mono); font-size: 13.5px; color: var(--faint); padding-top: 2px; }
.news p { margin: 0; }
.news em { font-style: normal; font-weight: 600; color: var(--accent); }

/* ---------- Publications ---------- */
.filters { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 999px; }
.filter {
  border: 0; background: transparent; color: var(--muted);
  font-size: 13.5px; font-weight: 600; padding: 6px 14px; border-radius: 999px;
  transition: background-color .15s, color .15s;
}
.filter:hover { color: var(--text); }
.filter.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.note { font-size: 13px; color: var(--faint); margin: -8px 0 16px; }

.pubs { display: flex; flex-direction: column; gap: 20px; }
.pub {
  display: grid; grid-template-columns: 340px 1fr; gap: 28px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; transition: border-color .2s, box-shadow .2s;
}
.pub:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); box-shadow: var(--shadow); }
.pub.hide, .mini-pubs li.hide { display: none; }

.pub-fig {
  position: relative; align-self: start;
  padding: 12px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; overflow: hidden; cursor: zoom-in;
  aspect-ratio: 16 / 10; display: grid; place-items: center;
}
.pub-fig img {
  width: 100%; height: 100%; object-fit: contain;
  transition: transform .35s ease;
}
.pub-fig:hover img { transform: scale(1.035); }
.zoom {
  position: absolute; right: 8px; bottom: 8px;
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: rgba(20, 22, 28, .72); color: #fff;
  opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s;
}
.pub-fig:hover .zoom, .pub-fig:focus-visible .zoom { opacity: 1; transform: none; }

.pub-body { min-width: 0; }
.pub-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.venue {
  font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  color: var(--accent-ink); background: var(--accent);
  padding: 3px 10px; border-radius: 6px; white-space: nowrap;
}
.badge {
  font-size: 12px; font-weight: 600; color: var(--gold); background: var(--gold-soft);
  padding: 3px 9px; border-radius: 6px;
}
.pub h3 { font-size: 18.5px; font-weight: 700; letter-spacing: -.015em; }
.pub h3 a { color: var(--text); }
.pub h3 a:hover { color: var(--accent); text-decoration: none; }
.authors { margin: 8px 0 0; font-size: 14.5px; color: var(--muted); }
.authors b { color: var(--text); font-weight: 650; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 2px; }
.et-al {
  border: 0; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 600;
  padding: 1px 8px; border-radius: 999px; vertical-align: 1px;
}
.et-al:hover { filter: brightness(.97); }
.where { margin: 2px 0 0; font-size: 14px; color: var(--faint); font-style: italic; }
.tldr { margin: 12px 0 0; font-size: 15px; color: var(--muted); }
.tldr em { font-style: normal; color: var(--text); font-weight: 550; }

.pub-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pub-links a, .bib-toggle {
  font-size: 13px; font-weight: 600; color: var(--text);
  border: 1px solid var(--line); background: var(--surface);
  padding: 5px 12px; border-radius: 8px; transition: border-color .15s, color .15s, background-color .15s;
}
.pub-links a:hover, .bib-toggle:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.bib-toggle[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.bib { position: relative; margin-top: 12px; }
.bib pre {
  margin: 0; padding: 14px 16px; overflow-x: auto;
  font-family: var(--mono); font-size: 12px; line-height: 1.55;
  background: var(--surface-2); border-radius: 10px; color: var(--text);
}
.copy {
  position: absolute; top: 8px; right: 8px;
  font-size: 12px; font-weight: 600; border: 1px solid var(--line); background: var(--surface);
  padding: 3px 10px; border-radius: 6px;
}

.subhead { font-size: 15px; font-weight: 700; color: var(--muted); margin: 36px 0 12px; text-transform: uppercase; letter-spacing: .06em; }
.mini-pubs { list-style: none; margin: 0; padding: 0; }
.mini-pubs li {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.mini-pubs .venue { background: var(--surface-2); color: var(--text); margin-top: 2px; }
.mini-title { margin: 0; font-weight: 650; }
.mini-pubs .authors { margin-top: 2px; font-size: 14px; }

.collab { margin: 8px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.collab span {
  display: inline-block; font-size: 11.5px; font-weight: 650; letter-spacing: .02em;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--line);
  padding: 1px 8px; border-radius: 999px; margin-right: 2px; vertical-align: 1px;
}
.collab a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.collab a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.timeline .collab { margin-top: 6px; font-size: 13.5px; }

/* ---------- Experience ---------- */
.two-col { display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; }
.col-title { font-size: 13px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 16px; }
.two-col > div > .col-title:not(:first-child) { margin-top: 36px; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline > li { position: relative; padding: 0 0 28px 24px; }
.timeline > li::before {
  content: ""; position: absolute; left: 0; top: 7px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent);
}
.timeline > li::after {
  content: ""; position: absolute; left: 4px; top: 22px; bottom: 2px; width: 1px; background: var(--line);
}
.timeline > li:last-child::after { display: none; }
.timeline time { font-family: var(--mono); font-size: 12.5px; color: var(--faint); }
.timeline h4 { font-size: 16.5px; font-weight: 700; margin-top: 2px; }
.org-link { color: inherit; }
.inline-link { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.inline-link:hover { color: var(--accent); text-decoration-color: var(--accent); }
.org-link span { color: var(--faint); font-weight: 500; font-size: .85em; transition: color .15s; }
.org-link:hover { color: var(--accent); text-decoration: none; }
.org-link:hover span { color: var(--accent); }
.timeline .role { margin: 2px 0 0; color: var(--accent); font-weight: 550; font-size: 14.5px; }
.timeline p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.timeline ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 14.5px; }
.timeline ul li { margin-bottom: 6px; }
.timeline ul b { color: var(--text); font-weight: 600; }

.repo {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  font-family: var(--mono); font-size: 12.5px; color: var(--text);
  border: 1px solid var(--line); background: var(--surface); padding: 4px 10px; border-radius: 8px;
  transition: border-color .15s, color .15s;
}
.repo:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.run-text a { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

.plain { list-style: none; margin: 0; padding: 0; }
.plain li { display: grid; grid-template-columns: 104px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.plain li:last-child { border-bottom: 0; }
.plain span { font-family: var(--mono); font-size: 12.5px; color: var(--faint); padding-top: 2px; }

/* ---------- Awards & skills ---------- */
.awards { list-style: none; margin: 0; padding: 0; }
.awards li { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.awards li:first-child { padding-top: 0; }
.awards time { font-family: var(--mono); font-size: 12.5px; color: var(--faint); padding-top: 3px; }
.awards p { margin: 0; color: var(--muted); font-size: 15px; }
.awards b { color: var(--text); font-weight: 650; }
.skill-group { margin-bottom: 18px; }
.skill-label { font-size: 14px; font-weight: 600; }

/* ---------- Outside the lab ---------- */
.run-panel {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 64px; align-items: end;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 36px 28px;
}
.run-period { margin: 0 0 12px; font-family: var(--mono); font-size: 13px; color: var(--text); }
.run-period span { color: var(--faint); }
.run-num { margin: 0; display: flex; align-items: baseline; gap: 8px; line-height: 1; }
.count { font-size: 76px; font-weight: 800; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.unit { font-size: 24px; font-weight: 750; color: var(--accent); }
.run-stats { display: flex; gap: 32px; margin: 26px 0 0; }
.run-stats div { display: flex; flex-direction: column-reverse; gap: 2px; }
.run-stats dt { font-size: 12.5px; color: var(--faint); }
.run-stats dd { margin: 0; font-size: 24px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.run-stats small { font-size: 13px; font-weight: 600; color: var(--faint); margin-left: 2px; }

.chart { margin: 0; --max: 640; }
.chart-plot {
  position: relative; height: 190px; border-bottom: 1px solid var(--line); padding-right: 72px;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; align-items: end;
}
.bar { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; }
.bar i {
  display: block; width: 100%; max-width: 46px; height: calc(var(--v) / var(--max) * 100%);
  background: color-mix(in srgb, var(--accent) 30%, var(--surface)); border-radius: 8px 8px 2px 2px;
  transform-origin: bottom; transition: background-color .15s;
}
.bar.now i, .bar:hover i, .bar:focus-visible i { background: var(--accent); }
.val {
  position: absolute; left: 50%; bottom: calc(var(--v) / var(--max) * 100% + 6px); transform: translateX(-50%);
  font-family: var(--mono); font-size: 11.5px; color: var(--text); white-space: nowrap;
  opacity: 0; transition: opacity .15s; pointer-events: none;
}
.bar.now .val, .bar:hover .val, .bar:focus-visible .val { opacity: 1; }
.chart-plot:hover .bar.now:not(:hover) .val { opacity: 0; }
.avg-line {
  position: absolute; left: 0; right: 0; bottom: calc(var(--v) / var(--max) * 100%);
  border-top: 1px dashed var(--faint); opacity: .7; pointer-events: none; z-index: 1;
}
.avg-line span {
  position: absolute; right: 0; top: -8px; padding-left: 6px; background: var(--surface);
  font-family: var(--mono); font-size: 11px; line-height: 14px; color: var(--faint);
}
.chart-years { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-top: 8px; padding-right: 72px; text-align: center; font-family: var(--mono); font-size: 12px; color: var(--faint); }
.chart-years .now { color: var(--text); font-weight: 600; }
.chart.anim .bar i { transform: scaleY(0); }
.chart.anim.go .bar i { transform: scaleY(1); transition: transform .7s cubic-bezier(.2, .7, .2, 1), background-color .15s; transition-delay: calc(var(--i) * 70ms), 0s; }

.snap-link {
  border: 0; background: none; padding: 0; font: inherit; font-weight: 650; color: var(--text); cursor: pointer;
  text-decoration: underline dotted; text-decoration-color: var(--accent); text-underline-offset: 4px; text-decoration-thickness: 2px;
}
.snap-link svg { margin-left: 5px; vertical-align: -2px; color: var(--accent); }
.snap-link:hover, .snap-link[aria-expanded="true"] { color: var(--accent); }
.places { margin-top: 24px; }
.places-label span { text-transform: none; letter-spacing: 0; font-weight: 500; }
.place-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.place {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 13.5px; font-weight: 550; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); padding: 5px 12px 5px 10px; border-radius: 999px;
  transition: border-color .15s, background-color .15s, color .15s;
}
.place svg { color: var(--accent); flex: none; transition: color .15s; }
.place:hover { border-color: var(--accent); }
.place[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.place[aria-expanded="true"] svg { color: var(--accent-ink); }
.snap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s cubic-bezier(.2, .7, .2, 1); }
.snap.open { grid-template-rows: 1fr; }
.snap-inner { overflow: hidden; min-height: 0; }
.snap-photo {
  display: block; width: 100%; margin-top: 14px; border-radius: 14px; overflow: hidden;
  background: var(--surface-2);
}
.snap-photo img { display: block; width: 100%; height: 400px; object-fit: cover; transition: opacity .25s ease; }
.snap-photo img.loading { opacity: 0; }
.snap-cap { margin: 8px 0 0; font-size: 13.5px; color: var(--muted); }

.run { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; margin-top: 36px; }
.run-lead { margin: 0 0 22px; font-size: 17px; color: var(--muted); max-width: 58ch; }
.run-lead:has(+ .run-lead) { margin-bottom: 10px; }
.run-lead.secondary { font-size: 15.5px; color: var(--faint); }
.places-label { margin: 0 0 10px; font-size: 12px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }
.run-lead b { color: var(--text); font-weight: 650; }
.apps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.apps li { border-bottom: 1px solid var(--line); }
.app {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 16px; align-items: center;
  padding: 16px 10px; margin: 0 -10px; border-radius: 12px; color: var(--text);
  transition: background-color .15s;
}
.app:hover { text-decoration: none; background: var(--surface); }
.app-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 19px;
}
.app-icon.alt { background: var(--text); color: var(--bg); }
.app-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.app-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.app-top b { font-size: 16.5px; font-weight: 750; }
.app-year { font-family: var(--mono); font-size: 12.5px; color: var(--faint); }
.app-desc { color: var(--muted); font-size: 14.5px; }
.stack { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.app-arrow { color: var(--faint); font-size: 18px; transition: transform .15s, color .15s; }
.app:hover .app-arrow { color: var(--accent); transform: translate(2px, -2px); }
.awards a { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* ---------- Footer ---------- */
.footer {
  width: calc(100% - 48px); max-width: calc(var(--maxw) - 48px); margin: 80px auto 0; padding: 28px 0 40px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--line); color: var(--faint); font-size: 13.5px;
}
.footer p { margin: 0; }
.to-top { color: var(--muted); }

/* ---------- Lightbox ---------- */
.lightbox {
  width: min(1200px, 94vw); max-height: 92vh; padding: 0; border: 0; border-radius: 16px;
  background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.35);
  overflow: auto;
}
.lightbox::backdrop { background: rgba(8, 10, 14, .72); backdrop-filter: blur(4px); }
.lightbox img { width: 100%; height: auto; background: #fff; }
.lb-caption { margin: 0; padding: 14px 20px 18px; font-size: 14.5px; color: var(--muted); border-top: 1px solid var(--line); }
.lb-close {
  position: sticky; top: 10px; float: right; margin: 10px 10px -46px 0; z-index: 2;
  width: 36px; height: 36px; border-radius: 999px; border: 0;
  background: rgba(20, 22, 28, .75); color: #fff; font-size: 15px;
}
.lightbox[open] { animation: pop .22s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .pub-fig img, .btn { transition: none; }
  .chart.anim .bar i { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .pub { grid-template-columns: 280px 1fr; gap: 22px; }
  .two-col { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 760px) {
  .nav-links { display: none; }
  .theme-toggle { margin-left: auto; }
  .nav-inner, main { padding-left: 16px; padding-right: 16px; }
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 40px; }
  .hero-photo { order: -1; width: 150px; }
  .hero-photo::before { inset: 8px -8px -8px 8px; border-radius: 18px; }
  .hero-photo img { border-radius: 18px; }
  .lead { font-size: 16.5px; }
  .section { padding-top: 56px; }
  h2 { font-size: 24px; }
  .pub { grid-template-columns: 1fr; padding: 14px; gap: 16px; }
  .pub-fig { aspect-ratio: 16 / 9; }
  .news li { grid-template-columns: 1fr; gap: 2px; }
  .plain li { grid-template-columns: 1fr; gap: 0; }
  .awards li { grid-template-columns: 1fr; gap: 2px; }
  .mini-pubs li { flex-direction: column; gap: 8px; padding: 14px; }
  .footer { width: calc(100% - 32px); }
  .run-panel { grid-template-columns: 1fr; gap: 28px; padding: 24px 20px 20px; }
  .run { grid-template-columns: 1fr; gap: 32px; margin-top: 28px; }
  .count { font-size: 60px; }
  .run-stats { gap: 24px; }
  .run-stats dd { font-size: 21px; }
  .chart-plot { height: 150px; gap: 8px; padding-right: 50px; }
  .chart-years { gap: 8px; padding-right: 50px; }
  .snap-photo img { height: 360px; }
  .avg-line span { font-size: 10px; }
  .bar.now .val { opacity: 0; }
  .bar.now:hover .val, .bar.now:focus .val, .bar:focus .val { opacity: 1; }
  .app { grid-template-columns: 40px 1fr; gap: 14px; align-items: start; }
  .app-icon { width: 40px; height: 40px; font-size: 17px; }
  .app-arrow { display: none; }
}
