:root {
  --ink: #172033;
  --muted: #627087;
  --paper: #f7f9fc;
  --surface: #ffffff;
  --surface-soft: #eef3f9;
  --line: #dce4ef;
  --brand: #1b4fd8;
  --brand-dark: #123ca6;
  --accent: #28d6b4;
  --hero: #101a2b;
  --hero-ink: #f5f8ff;
  --serif: "Newsreader", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shadow: 0 20px 50px rgba(26, 44, 77, .09);
}

[data-theme="dark"] {
  --ink: #edf3ff;
  --muted: #a7b4c8;
  --paper: #0d1420;
  --surface: #141e2e;
  --surface-soft: #192638;
  --line: #2a3950;
  --brand: #7aa2ff;
  --brand-dark: #a9c1ff;
  --accent: #36dfbd;
  --hero: #080d16;
  --hero-ink: #f5f8ff;
  --shadow: 0 20px 50px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6rem; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 400 1rem/1.72 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration-thickness: .08em; text-underline-offset: .2em; }
a:hover { color: var(--brand-dark); }

.skip-link {
  position: fixed; z-index: 100; left: 1rem; top: -5rem;
  padding: .7rem 1rem; color: white; background: var(--brand); border-radius: .5rem;
}
.skip-link:focus { top: 1rem; }
.reading-progress { position: fixed; z-index: 50; inset: 0 0 auto; height: 3px; }
.reading-progress span { display: block; width: 0; height: 100%; background: var(--accent); }

.site-header {
  position: absolute; z-index: 10; top: 0; left: 50%; transform: translateX(-50%);
  display: flex; width: min(100% - 2rem, 1200px); align-items: center; justify-content: space-between;
  padding: 1.35rem 0; color: var(--hero-ink);
}
.wordmark { color: inherit; font-weight: 700; font-size: 1.15rem; text-decoration: none; letter-spacing: -.03em; }
.wordmark span { color: var(--accent); }
.header-links { display: flex; align-items: center; gap: 1.25rem; }
.header-links a { color: inherit; font-size: .9rem; text-decoration: none; opacity: .85; }
.header-links a:hover { opacity: 1; }
.theme-toggle { display: grid; width: 2.35rem; height: 2.35rem; place-items: center; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; color: inherit; background: rgba(255,255,255,.08); cursor: pointer; }
.theme-toggle:hover { background: rgba(255,255,255,.16); }
.theme-toggle svg { width: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle .moon, [data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 480px; padding: 9.5rem max(1rem, calc((100vw - 1200px) / 2)) 8rem;
  color: var(--hero-ink); background: var(--hero);
}
.hero::after { content: ""; position: absolute; z-index: -1; right: -10%; bottom: -70%; width: 55vw; height: 55vw; border: 1px solid rgba(40,214,180,.2); border-radius: 50%; box-shadow: 0 0 0 5vw rgba(40,214,180,.035), 0 0 0 10vw rgba(40,214,180,.025); }
.hero-pattern { position: absolute; z-index: -2; inset: 0; opacity: .18; background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(90deg, #000, transparent 75%); }
.eyebrow { margin: 0 0 1rem; color: var(--accent); font-size: .82rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.hero h1 { max-width: 850px; margin: 0; font: 600 clamp(3.8rem, 9vw, 7.4rem)/.86 var(--serif); letter-spacing: -.055em; }
.subtitle { max-width: 780px; margin: 1.8rem 0 0; color: #d5deed; font-size: clamp(1.15rem, 2vw, 1.45rem); }
.hero-note { margin: 3.5rem 0 0; color: #98a8c0; font-size: .88rem; }

.page-shell { display: grid; grid-template-columns: 210px minmax(0, 800px); gap: clamp(3rem, 7vw, 7rem); width: min(100% - 2rem, 1120px); margin: 0 auto; padding: 5.5rem 0 7rem; }
.sidebar { position: relative; }
.toc-wrap { position: sticky; top: 2rem; }
.toc-label { margin: 0 0 .85rem; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
#TOC ul { margin: 0; padding: 0; list-style: none; }
#TOC li { margin: .2rem 0; }
#TOC ul ul { display: none; }
#TOC a { display: block; padding: .42rem .75rem; border-left: 2px solid var(--line); color: var(--muted); font-size: .88rem; text-decoration: none; transition: .18s ease; }
#TOC a:hover, #TOC a.active { border-color: var(--brand); color: var(--ink); background: var(--surface-soft); }
.content { min-width: 0; }
.content > :first-child { margin-top: 0; }
.content h1 { margin: 6.5rem 0 1.75rem; font: 600 clamp(2.5rem, 5vw, 4rem)/1 var(--serif); letter-spacing: -.035em; }
.content h1::before { content: ""; display: block; width: 2.5rem; height: .24rem; margin-bottom: 1.2rem; background: var(--accent); }
.content h2 { margin: 3.5rem 0 1.4rem; font: 600 1.65rem/1.15 var(--serif); letter-spacing: -.015em; }
.content h3 { margin: 0 0 .7rem; font-size: 1.02rem; line-height: 1.4; }
.content p, .content li { color: var(--muted); }

.intro { margin: -8.5rem 0 3rem; padding: clamp(1.5rem, 4vw, 3rem); border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); box-shadow: var(--shadow); }
.intro p:first-child { margin-top: 0; color: var(--ink); font-size: clamp(1.15rem, 2.2vw, 1.4rem); line-height: 1.6; }
.intro p:last-child { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.8rem 0 0; }
.button { display: inline-flex; min-height: 2.8rem; align-items: center; padding: .65rem 1rem; border: 1px solid var(--line); border-radius: .55rem; color: var(--ink); background: var(--surface); font-size: .88rem; font-weight: 600; text-decoration: none; }
.button:hover { transform: translateY(-1px); border-color: var(--brand); color: var(--brand); }
.button-primary { border-color: var(--brand); color: white; background: var(--brand); }
.button-primary:hover { color: white; background: var(--brand-dark); }
.quick-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: .85rem; background: var(--line); }
.fact { padding: 1.25rem; background: var(--surface); }
.fact p { margin: 0; font-size: .88rem; }
.fact p:first-child { margin-bottom: .4rem; color: var(--ink); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }

.publication-list { display: grid; gap: .75rem; }
.publication { position: relative; padding: 1.35rem 4.7rem 1.35rem 1.4rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.publication:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: 0 10px 30px rgba(26,44,77,.07); }
.publication::after { content: attr(data-year); position: absolute; top: 1.35rem; right: 1.25rem; color: var(--muted); font-size: .74rem; font-weight: 700; letter-spacing: .08em; }
.publication p { margin: .35rem 0 0; font-size: .86rem; }
.publication-title { color: var(--ink); font: 600 1.1rem/1.4 var(--sans); text-decoration: none; }
.publication-title::after { content: " ↗"; color: var(--brand); }
.publication-title:hover { color: var(--brand); }

.talk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.talk { padding: 1.35rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); }
.talk p { margin: 0; font-size: .88rem; }
.content > ul { padding-left: 1.2rem; }
.content > ul > li { margin: 1rem 0; padding-left: .35rem; }
.content li::marker { color: var(--brand); }
.text-link { font-weight: 600; text-decoration: none; }

footer { display: flex; width: min(100% - 2rem, 1120px); margin: 0 auto; align-items: center; justify-content: space-between; padding: 2rem 0 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
footer p { margin: 0; }
footer a { font-weight: 600; text-decoration: none; }

@media (max-width: 800px) {
  .hero { min-height: 420px; padding-top: 8.5rem; }
  .page-shell { display: block; padding-top: 3.5rem; }
  .sidebar { display: none; }
  .intro { margin-top: -6.5rem; }
  .quick-facts, .talk-grid { grid-template-columns: 1fr; }
  .content h1 { margin-top: 5rem; }
}

@media (max-width: 520px) {
  .header-links a { display: none; }
  .hero h1 { font-size: 3.7rem; }
  .hero-note { margin-top: 2.5rem; }
  .intro { padding: 1.25rem; }
  .intro p:last-child { display: grid; }
  .button { justify-content: center; }
  .publication { padding-right: 1.35rem; padding-top: 3.1rem; }
  .publication::after { left: 1.4rem; right: auto; top: 1.2rem; }
  footer { display: block; }
  footer a { display: inline-block; margin-top: .6rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

