/* ───────── Tokens ───────── */
:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --ink: #141821;
  --ink-2: #3e4452;
  --muted: #727887;
  --rule: #e3e5ea;
  --accent: #1f4e8c;
  --accent-ink: #183f72;
  --accent-soft: #e6edf7;
  --hl: #e3a21a;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Inter", sans-serif;
  --mono: "Geist Mono", monospace;
  --max: 980px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e131b; --surface: #141a24; --ink: #e8ecf2; --ink-2: #bfc6d2;
    --muted: #8690a0; --rule: #263040; --accent: #82a9de; --accent-ink: #a6c3eb;
    --accent-soft: #1b2a40; --hl: #f2c14e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e131b; --surface: #141a24; --ink: #e8ecf2; --ink-2: #bfc6d2;
    --muted: #8690a0; --rule: #263040; --accent: #82a9de; --accent-ink: #a6c3eb;
    --accent-soft: #1b2a40; --hl: #f2c14e; color-scheme: dark;
}

/* ───────── Base ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration: none; background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .25s ease; }
a:hover { background-size: 100% 1px; }
b { color: var(--ink); font-weight: 600; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

/* ───────── Nav ───────── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.brand { font-family: var(--serif); font-size: 19px; color: var(--ink); background: none; white-space: nowrap; }
.nav ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.nav ul a { font-size: 14px; color: var(--ink-2); }
.nav ul a:hover { color: var(--accent-ink); }
@media (max-width: 600px) {
  .brand { display: none; }
  .nav { justify-content: center; }
  .nav ul { gap: 14px; }
  .nav ul a { font-size: 13px; }
}

/* ───────── Hero ───────── */
.hero {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 52px;
  align-items: center;
  padding-top: 88px;
  padding-bottom: 72px;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 28px;
}
.lede { font-family: var(--serif); font-size: 21px; line-height: 1.5; color: var(--ink); }
.links { display: flex; flex-wrap: wrap; align-items: center; list-style: none; padding: 0; margin: 26px 0 0; font-size: 15px; font-weight: 500; }
.links li + li::before { content: ""; display: inline-block; width: 1px; height: 13px; background: var(--rule); margin: 0 14px; vertical-align: -1px; }
.links a { color: var(--accent-ink); }

.name-row { display: flex; align-items: center; gap: 22px; margin: 0 0 28px; }
.name-row h1 { margin: 0; font-size: clamp(34px, 4.6vw, 50px); white-space: nowrap; }
@media (max-width: 800px) { .name-row h1 { white-space: normal; } }
.hero-art { margin: 0; }
.lattice { width: 100%; height: auto; display: block; overflow: visible; }
.atom { fill: var(--muted); opacity: .45; }
.atom.on { fill: var(--accent); opacity: 1; }
.ring { fill: none; stroke: var(--accent); stroke-width: 1; stroke-dasharray: 3 4; opacity: .55; transform-box: fill-box; transform-origin: center; animation: breathe 5s ease-in-out infinite; }
.halo { transform-box: fill-box; transform-origin: center; animation: breathe 5s ease-in-out infinite; }
@keyframes breathe { 0%,100% { transform: scale(.92); opacity: .35; } 50% { transform: scale(1.04); opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .ring, .halo { animation: none; } html { scroll-behavior: auto; } }

.portrait { display: block; flex: none; width: 76px; height: 76px; object-fit: cover; border-radius: 50%; box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--rule); }

@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 48px; padding-bottom: 48px; }
  .hero-art { order: -1; width: 160px; }
}

/* ───────── Sections ───────── */
.section { padding-top: 56px; padding-bottom: 56px; border-top: 1px solid var(--rule); }
h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 32px;
  color: var(--ink);
  margin: 0 0 12px;
}
.section-intro { max-width: 640px; color: var(--ink-2); margin-bottom: 36px; }
.note { font-size: 13px; color: var(--muted); margin: -24px 0 20px; text-align: right; }
.section-intro.small { font-size: 14px; color: var(--muted); }
.kicker { font-family: var(--mono); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 16px; }
.muted { color: var(--muted); }

/* ───────── Research areas (with papers) ───────── */
.areas { border-top: 1px solid var(--rule); }
.area { padding: 32px 0 20px; border-bottom: 1px solid var(--rule); }
.area-head { display: grid; grid-template-columns: 220px 1fr; gap: 32px; margin-bottom: 18px; }
.area-head h3 { font-family: var(--serif); font-weight: 500; font-size: 21px; line-height: 1.3; color: var(--ink); margin: 0; }
.area-head p { font-size: 15.5px; max-width: 640px; margin: 0; }
.area .pub { grid-template-columns: 220px 1fr; gap: 32px; padding: 14px 0; border-bottom: 1px dotted var(--rule); }
.area .pub:first-child { padding-top: 14px; }
.area .pub:last-child { border-bottom: none; }
.area .pub-meta { flex-direction: row; justify-content: flex-end; gap: 10px; }
.area .pub-meta { flex-wrap: wrap; row-gap: 2px; align-content: flex-start; }
.status { flex-basis: 100%; text-align: right; color: var(--muted); font-style: italic; }
@media (max-width: 760px) { .status { flex-basis: auto; text-align: left; } }
.area .pub-title { font-size: 17.5px; }
@media (max-width: 760px) {
  .area-head, .area .pub { grid-template-columns: 1fr; gap: 6px; }
  .area .pub-meta { justify-content: flex-start; }
}

/* ───────── Publications ───────── */
.star { color: var(--accent); }
.pubs { list-style: none; margin: 0; padding: 0; }
.pub {
  display: grid; grid-template-columns: 110px 1fr; gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}
.pub:first-child { padding-top: 4px; }
.pub:last-child { border-bottom: none; }
.pub-meta { display: flex; flex-direction: column; gap: 2px; font-family: var(--mono); font-size: 12px; padding-top: 4px; }
.venue { color: var(--ink); font-weight: 500; }
.year { color: var(--muted); }
.pub-title { font-family: var(--serif); font-size: 19px; line-height: 1.35; color: var(--ink); }
a.pub-title { background-image: linear-gradient(var(--accent), var(--accent)); }
a.pub-title:hover { color: var(--accent-ink); }
.authors { font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.authors b { color: var(--ink-2); }
.etal { font-style: italic; }
.blurb { font-size: 15px; color: var(--ink-2); margin: 8px 0 0; }
@media (max-width: 600px) {
  .pub { grid-template-columns: 1fr; gap: 6px; }
  .pub-meta { flex-direction: row; gap: 10px; padding-top: 0; }
}

/* ───────── Talks ───────── */
.talks { list-style: none; margin: 8px 0 0; padding: 0; }
.talks li { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.talks li:last-child { border-bottom: none; }
.date { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 4px; }
.talk-title { font-family: var(--serif); font-size: 17px; line-height: 1.35; color: var(--ink); margin: 0; }
.talk-title a { color: inherit; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.talk-title a:hover { color: var(--accent-ink); text-decoration-color: currentColor; }
.talk-venue { font-size: 14px; color: var(--muted); margin: 4px 0 0; }
.tag { color: var(--muted); font-style: italic; }

/* ───────── About ───────── */
.chrono { list-style: none; margin: 28px 0 0; padding: 0; max-width: 760px; }
.chrono li { display: grid; grid-template-columns: 64px 1fr; gap: 0 20px; }
.chrono li.yr-start .ce { padding-top: 22px; }
.chrono li:first-child .ce { padding-top: 0; }
.chrono li.yr-start .cy { padding-top: 22px; }
.cy { font-family: var(--mono); font-size: 12px; color: var(--accent); padding-top: 4px; }
.chrono li.yr-start .cy { padding-top: 26px; }
.ce { position: relative; border-left: 1px solid var(--rule); padding: 8px 0 8px 24px; font-size: 15px; }
.ce::before { content: ""; position: absolute; left: -4px; top: calc(100% - 100% + 13px); width: 7px; height: 7px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--muted); }
.chrono li.yr-start .ce::before { top: 27px; }
.chrono li:first-child .ce::before { top: 5px; }
.chrono li.now .ce::before { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.ce b { font-weight: 500; color: var(--ink); margin-right: 8px; }
.ce b a { color: inherit; text-decoration: none; }
.ce b a:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.ce span { color: var(--ink-2); }
@media (max-width: 600px) { .chrono li { grid-template-columns: 40px 1fr; gap: 0 12px; } .ce b { display: block; } }

/* ───────── Footer ───────── */
.footer { display: flex; justify-content: space-between; gap: 16px; padding-top: 28px; padding-bottom: 40px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--muted); }
.footer a { color: var(--muted); }

.pub-body, .hero-text, .area-head > *, .talks li > div { min-width: 0; }
@media (max-width: 600px) { .name-row { gap: 14px; } .portrait { width: 56px; height: 56px; } }


