/* ==========================================================================
   Dongyu Gong · personal site
   Palette: --bio (coral, the brain) and --ai (cyan, the machine); --mind is
   the neutral ink where they meet.
   ========================================================================== */

:root {
  --bg: #f8f7f3;
  --bg-tint: #f1efe9;
  --surface: #ffffff;
  --text: #15171c;
  --muted: #5b6270;
  --faint: #8a909c;
  --line: rgba(20, 22, 28, 0.1);
  --line-strong: rgba(20, 22, 28, 0.18);
  --bio: #e0533a;
  --ai: #0a8fbf;
  --mind: #15171c;
  --accent: var(--ai);
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgba(20, 22, 28, .04), 0 8px 24px rgba(20, 22, 28, .06);
  --net-edge: 20, 22, 28;
  --hero-fade: 248, 247, 243;

  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --mono: var(--sans);
  --radius: 14px;
  --wrap: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d12;
    --bg-tint: #0f1218;
    --surface: #141821;
    --text: #e8eaf0;
    --muted: #9ba3b3;
    --faint: #6c7484;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);
    --bio: #ff7a5c;
    --ai: #4cc9f0;
    --mind: #e8eaf0;
    --on-accent: #0b0d12;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
    --net-edge: 232, 234, 240;
    --hero-fade: 11, 13, 18;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0d12;
  --bg-tint: #0f1218;
  --surface: #141821;
  --text: #e8eaf0;
  --muted: #9ba3b3;
  --faint: #6c7484;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --bio: #ff7a5c;
  --ai: #4cc9f0;
  --mind: #e8eaf0;
  --on-accent: #0b0d12;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
  --net-edge: 232, 234, 240;
  --hero-fade: 11, 13, 18;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; transition: color .2s, text-decoration-color .2s; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
p a, dd a, .timeline a { color: var(--text); text-decoration-line: underline; }
p a:hover, dd a:hover, .timeline a:hover { color: var(--accent); }
strong, b { font-weight: 600; }
em { font-style: italic; }
kbd {
  font: 500 .78em var(--mono);
  padding: .1em .45em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface);
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--ai) 30%, transparent); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

.eyebrow {
  font: 600 13px/1 var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.dot--bio { background: var(--bio); }
.dot--ai { background: var(--ai); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 20px;
  border-radius: 999px; border: 1px solid transparent;
  font: 500 15px/1 var(--sans);
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background .2s, border-color .2s, color .2s, box-shadow .2s;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--text); color: var(--bg); }
.btn--primary:hover { color: var(--bg); opacity: .85; }
.btn--ghost { border-color: var(--line-strong); background: color-mix(in srgb, var(--surface) 60%, transparent); backdrop-filter: blur(6px); }
.btn--ghost:hover { border-color: var(--text); color: var(--text); }
.btn--sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn--lg { height: 52px; padding: 0 26px; font-size: 16px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.icon-btn {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.icon-btn:hover { border-color: var(--line-strong); background: var(--surface); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled, .nav.is-open {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-color: var(--line);
}
.nav__inner { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 24px; }
.nav__brand { font: 600 19px/1 var(--serif); text-decoration: none; }
.nav__brand:hover { color: var(--text); }
.nav__links { display: flex; gap: 4px; margin-left: auto; }
.nav__links a {
  font-size: 14px; color: var(--muted); text-decoration: none;
  padding: 8px 12px; border-radius: 999px; transition: color .2s, background .2s;
}
.nav__links a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.nav__links a.is-active { color: var(--text); }
.nav__links .nav__cv { color: var(--text); border: 1px solid var(--line-strong); margin-left: 6px; }
.nav__actions { display: flex; gap: 8px; }
.nav__menu { display: none; }
.nav__menu { position: relative; }
.nav__menu span { position: absolute; left: 50%; top: 50%; width: 16px; height: 1.6px; margin: -.8px 0 0 -8px; background: currentColor; border-radius: 2px; transition: transform .25s; }
.nav__menu span:first-child { transform: translateY(-3px); }
.nav__menu span:last-child { transform: translateY(3px); }
.nav__menu[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
.nav__menu[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }

.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; }
}

@media (max-width: 880px) {
  .nav__inner { padding: 0 16px; }
  .nav__menu { display: grid; }
  .nav__links {
    position: fixed; inset: 64px 0 auto 0;
    flex-direction: column; gap: 0; margin: 0;
    padding: 8px 16px 20px;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .2s, transform .2s;
  }
  .nav__links.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .nav__links a { font-size: 17px; padding: 12px 4px; border-radius: 0; border-bottom: 1px solid var(--line); }
  .nav__links .nav__cv { border: 0; margin: 0; }
  .nav__actions { margin-left: auto; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: 112px 0 96px; overflow: hidden; isolation: isolate;
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; cursor: crosshair; }
.hero__fade {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(var(--hero-fade), .92) 0%, rgba(var(--hero-fade), .6) 45%, rgba(var(--hero-fade), 0) 75%),
    linear-gradient(0deg, rgba(var(--hero-fade), 1) 0%, rgba(var(--hero-fade), 0) 22%),
    linear-gradient(180deg, rgba(var(--hero-fade), .9) 0, rgba(var(--hero-fade), 0) 110px);
}
.hero__content { position: relative; pointer-events: none; }
.hero__content a, .hero__content button { pointer-events: auto; }
.hero__content > * { max-width: 680px; }
.pill {
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%;
  padding: 7px 14px; margin-bottom: 36px;
  font-size: 13.5px; line-height: 1.35; color: var(--muted); text-decoration: none;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.pill b { color: var(--text); font-weight: 600; }
.pill:hover { color: var(--text); border-color: var(--text); }
.pill__arrow { width: 14px; height: 14px; flex: none; }

.hero__title {
  font: 600 clamp(48px, 7.2vw, 88px)/1 var(--serif);
  letter-spacing: -.02em; margin: 0 0 22px;
}
.hero__lead { font: 400 clamp(22px, 2.6vw, 28px)/1.35 var(--serif); margin: 0 0 18px; }
.hero__sub { color: var(--muted); font-size: 18px; margin: 0 0 28px; max-width: 580px; }
.socials { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 0 -10px; }
.socials a {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  color: var(--muted); transition: color .2s, background .2s;
}
.socials a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 7%, transparent); }
.socials svg { width: 19px; height: 19px; }
.hero__hint {
  position: absolute; left: 0; right: 0; bottom: 28px; margin: 0; text-align: center;
  font: 400 13px/1.4 var(--sans); color: var(--faint); padding: 0 16px;
  pointer-events: none;
}
.hint-touch { display: none; }
@media (hover: none) { .hint-desktop { display: none; } .hint-touch { display: inline; } }
@media (max-width: 760px) {
  .hero { padding-top: 96px; align-items: flex-end; }
  .hero__fade { background: linear-gradient(0deg, rgba(var(--hero-fade), 1) 0%, rgba(var(--hero-fade), .85) 55%, rgba(var(--hero-fade), .3) 85%, rgba(var(--hero-fade), .9) 100%); }
  .pill { margin-bottom: 28px; font-size: 13px; }
  .hero__sub { font-size: 16px; }
}

/* ---------- Sections ---------- */
.section { padding: 112px 0; position: relative; }
.section--tint { background: var(--bg-tint); border-block: 1px solid var(--line); }
.section__head { margin-bottom: 48px; max-width: 760px; }
.section__head--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; max-width: none; }
.section__title { font: 600 clamp(30px, 3.8vw, 42px)/1.15 var(--serif); letter-spacing: -.012em; margin: 0; }
.section__title em { font-weight: 400; }
.section__intro { color: var(--muted); font-size: 18px; margin: 20px 0 0; }
@media (max-width: 600px) { .section { padding: 80px 0; } .section__head { margin-bottom: 36px; } }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 340px 1fr; gap: 72px; align-items: start; }
.about__photo { margin: 0; position: relative; }
.about__photo img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 22px; }
.about__text .section__title { margin-bottom: 24px; }
.about__text p { color: var(--muted); font-size: 17px; margin: 0 0 16px; }
.about__text p strong { color: var(--text); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 32px 0 0; border-top: 1px solid var(--line); }
.facts div { padding: 16px 0; border-bottom: 1px solid var(--line); }
.facts div:nth-child(odd) { padding-right: 16px; }
.facts dt { font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.facts dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; gap: 40px; }
  .about__photo { max-width: 260px; }
}
@media (max-width: 460px) { .facts { grid-template-columns: 1fr; } .facts div:nth-child(odd) { padding-right: 0; } }

/* ---------- Research ---------- */
.converge { margin: 0 auto 56px; max-width: 1000px; }
.converge svg { width: 100%; height: auto; overflow: visible; }
.arc { fill: none; stroke-width: 2; opacity: .35; }
.arc--flow { opacity: .9; stroke-dasharray: 4 14; stroke-linecap: round; animation: flow 1.6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -18; } }
.node circle { stroke-width: 1.5; }
.node--bio circle { stroke: var(--bio); fill: color-mix(in srgb, var(--bio) 9%, var(--bg-tint)); }
.node--ai circle { stroke: var(--ai); fill: color-mix(in srgb, var(--ai) 9%, var(--bg-tint)); }
.node text { font: 600 24px var(--serif); fill: var(--text); }
.svg-core { font: 400 26px var(--serif); font-style: italic; fill: var(--text); }
.svg-label { font: 400 15px var(--sans); fill: var(--muted); letter-spacing: .01em; }
@media (max-width: 640px) {
  .svg-label { display: none; }
  .svg-core { font-size: 34px; }
  .node text { font-size: 30px; }
  .arc { stroke-width: 2.5; }
  .converge { margin: -24px -8px 32px; }
}

.paths { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 72px; }
.path {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px; position: relative; overflow: hidden; box-shadow: var(--shadow);
}
.path::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; }
.path--ai::before { background: var(--ai); }
.path--bio::before { background: var(--bio); }
.path__kicker { display: flex; align-items: center; gap: 8px; font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; margin: 0 0 18px; }
.path--ai .path__kicker { color: var(--ai); }
.path--bio .path__kicker { color: var(--bio); }
.path h3 { font: 600 26px/1.2 var(--serif); margin: 0 0 14px; }
.path > p { color: var(--muted); margin: 0 0 20px; }
.path > p strong { color: var(--text); }
.questions { list-style: none; margin: 0 0 24px; padding: 0; }
.questions li { position: relative; padding: 10px 0 10px 26px; border-top: 1px dashed var(--line-strong); font-size: 15px; }
.questions li::before { content: "?"; position: absolute; left: 2px; top: 10px; font: 400 18px/1.3 var(--serif); font-style: italic; }
.path--ai .questions li::before { color: var(--ai); }
.path--bio .questions li::before { color: var(--bio); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.tags li { font: 400 12px/1 var(--mono); padding: 7px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }
@media (max-width: 860px) { .paths { grid-template-columns: 1fr; } .path { padding: 26px 22px; } }

/* N-back demo */
.demo {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
  border: 1px solid var(--line); border-radius: 20px; padding: 40px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.demo h3 { font: 600 28px/1.2 var(--serif); margin: 0 0 16px; }
.demo__intro p { color: var(--muted); margin: 0 0 14px; }
.demo__intro p b { color: var(--text); }
.demo__note { font-size: 14.5px; }
.lure-word { color: var(--bio); font-weight: 600; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; border: 1px solid var(--line-strong); margin-top: 10px; }
.seg button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; cursor: pointer; font: 500 13px var(--mono); color: var(--muted); }
.seg button[aria-checked="true"] { background: var(--text); color: var(--bg); }
.seg button:disabled { cursor: not-allowed; }

.stage {
  position: relative; aspect-ratio: 16 / 10; border-radius: 16px;
  background: var(--bg); border: 1px solid var(--line);
  display: grid; place-items: center; overflow: hidden;
}
.stage__letter {
  font: 600 clamp(64px, 9vw, 104px)/1 var(--serif);
  transition: transform .12s ease, opacity .12s ease, color .2s;
}
.stage__letter.is-hidden { opacity: 0; transform: scale(.9); }
.stage__letter.is-hit { color: var(--ai); }
.stage__letter.is-miss { color: var(--bio); }
.stage__history { position: absolute; top: 14px; left: 16px; display: flex; gap: 6px; font: 400 13px var(--mono); color: var(--faint); }
.stage__history span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; border: 1px solid var(--line); }
.stage__history span.is-nback { border-color: var(--mind); color: var(--mind); }
.stage__status { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; font-size: 13.5px; color: var(--muted); padding: 0 12px; }
.stage__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--line); }
.stage__progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--bio), var(--ai)); transition: width .3s; }
.stage__controls { display: flex; gap: 10px; margin-top: 14px; }
.stage__controls .btn { flex: 1; justify-content: center; }
.btn--match { background: var(--surface); border-color: var(--line-strong); }
.btn--match:not([disabled]):hover { border-color: var(--mind); color: var(--text); }
.btn--match.is-pressed { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn--match kbd { font-size: 11px; }
@media (hover: none) { .btn--match kbd { display: none; } }
.results { margin-top: 16px; }
.results__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.results__grid > div { padding: 12px 10px; border-radius: 12px; border: 1px solid var(--line); text-align: center; }
.results__num { display: block; font: 400 28px/1.1 var(--serif); }
.results__lbl { display: block; font: 400 11px/1.3 var(--mono); color: var(--faint); margin-top: 4px; }
.results__msg { font-size: 14.5px; color: var(--muted); margin: 14px 0 0; }
@media (max-width: 860px) {
  .demo { grid-template-columns: 1fr; padding: 26px 20px; gap: 28px; }
}
@media (max-width: 460px) { .results__grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Publications ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: transparent; color: var(--muted); font-size: 14px;
  transition: color .2s, background .2s, border-color .2s;
}
.chip:hover { color: var(--text); border-color: var(--text); }
.chip.is-active { background: var(--text); border-color: var(--text); color: var(--bg); }
.pubs { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.pub {
  display: grid; grid-template-columns: 96px 1fr; gap: 24px;
  padding: 28px 0; border-bottom: 1px solid var(--line); position: relative;
}
.pub.is-filtered { display: none; }
.pub__year { font: 500 14px/30px var(--mono); color: var(--faint); }
.pub__title { font: 600 23px/1.3 var(--serif); letter-spacing: -.005em; margin: 0 0 10px; }
.pub__title a { text-decoration: none; }
.pub__authors { margin: 0 0 4px; color: var(--muted); font-size: 15px; }
.pub__authors b { color: var(--text); }
.pub__venue { margin: 0 0 10px; color: var(--muted); font-size: 15px; }
.pub__venue .badge { margin-right: 6px; vertical-align: 1px; }
.pub__tldr { margin: 0 0 14px; font-size: 15px; color: var(--muted); max-width: 760px; }
.pub__links { display: flex; flex-wrap: wrap; gap: 8px; }
.pub__links a {
  font: 500 12px/1 var(--mono); text-decoration: none; letter-spacing: .02em;
  padding: 7px 11px; border-radius: 8px; border: 1px solid var(--line-strong); color: var(--muted);
}
.pub__links a:hover { border-color: var(--text); color: var(--text); }
.badge { font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 5px 8px; border-radius: 6px; background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.badge--new { background: color-mix(in srgb, var(--bio) 16%, transparent); color: var(--bio); }
.pub::before {
  content: ""; position: absolute; left: -20px; top: 39px; width: 8px; height: 8px; border-radius: 50%;
}
.pub[data-tags~="brain"]::before { background: var(--bio); }
.pub[data-tags~="ai"]::before { background: var(--ai); }
.pub[data-tags="brain ai"]::before { background: linear-gradient(90deg, var(--bio) 50%, var(--ai) 50%); }
.pub--featured .pub__year::after { content: "Featured"; display: block; color: var(--bio); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.more-link { margin: 28px 0 0; color: var(--muted); }
.more-link a { display: inline-flex; align-items: center; gap: 4px; }
.more-link svg { width: 14px; height: 14px; }
@media (max-width: 1200px) { .pub::before { left: auto; right: 0; } }
@media (max-width: 640px) {
  .pub { grid-template-columns: 1fr; gap: 6px; padding: 24px 0; }
  .pub__year { line-height: 1.2; }
  .pub--featured .pub__year::after { display: inline; margin-left: 10px; }
  .pub__title { font-size: 20px; padding-right: 16px; }
  .pub::before { top: 28px; }
}

/* ---------- News ---------- */
.timeline { list-style: none; padding: 0; margin: 0 0 28px; position: relative; max-width: 880px; }
.timeline::before { content: ""; position: absolute; left: 111px; top: 10px; bottom: 10px; width: 1px; background: var(--line-strong); }
.timeline li { display: grid; grid-template-columns: 96px 1fr; gap: 32px; padding: 12px 0; position: relative; }
.timeline li::after {
  content: ""; position: absolute; left: 107px; top: 22px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg-tint); border: 1.5px solid var(--mind);
}
.timeline li:first-child::after { background: var(--mind); }
.timeline li.is-old { display: none; }
.timeline.is-expanded li.is-old { display: grid; }
.timeline time { font: 500 13px/1.6 var(--mono); color: var(--faint); padding-top: 2px; }
.timeline p { margin: 0; }
@media (max-width: 600px) {
  .timeline::before { left: 4px; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; padding: 12px 0 12px 26px; }
  .timeline li::after { left: 0; top: 18px; }
}

/* ---------- Talks ---------- */
.talks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.talk {
  display: flex; flex-direction: column; gap: 14px;
  padding: 26px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.talk:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.talk time { font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--mind); }
.talk h3 { font: 600 17px/1.45 var(--serif); margin: 0 0 8px; }
.talk p { margin: 0; color: var(--muted); font-size: 14.5px; }
@media (max-width: 760px) { .talks { grid-template-columns: 1fr; } }

/* ---------- Teaching / service ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { padding: 28px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.card h3, .honors h3 { font: 600 21px/1.25 var(--serif); margin: 0 0 18px; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 12px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; padding-top: 0; }
.list b { display: block; font-weight: 500; font-size: 15px; }
.list b a { text-decoration: none; }
.list span { display: block; font-size: 13.5px; color: var(--muted); margin-top: 2px; }
@media (max-width: 960px) { .cards { grid-template-columns: 1fr 1fr; } .cards .card:last-child { grid-column: 1 / -1; } }
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; } .card { padding: 24px 20px; } }

.honors { margin-top: 56px; }
.honors ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.honors li { padding: 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.honors b { display: block; font-weight: 500; font-size: 15px; }
.honors span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
@media (max-width: 860px) { .honors ul { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .honors ul { grid-template-columns: 1fr; } }

/* ---------- Contact / footer ---------- */
.contact { text-align: center; overflow: hidden; }
.contact__inner { max-width: 720px; }
.contact p { color: var(--muted); font-size: 18px; margin: 20px auto 32px; max-width: 560px; }
.contact .btn { max-width: 100%; }
.footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 13.5px; color: var(--faint); }
.footer__inner { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.footer p { margin: 0; }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .particles { display: none; }
}
