/* ---------- Tokens ---------- */
:root {
  --bg: #ffffff;
  --side: #e9f2fa;          /* sidebar: light sky */
  --side-rule: #cfe0ee;
  --tint: #f3f8fc;          /* faint sky wash for figure and button hover surfaces */
  --ink: #15202b;
  --ink-2: #44515f;
  --ink-3: #63707e;
  --rule: #dbe4ec;
  --rule-strong: #b7c7d6;
  --accent: #1b6ca8;        /* sky-blue link, 5.3:1 on white */
  --accent-ink: #14547f;
  --accent-soft: #d6e8f6;

  --font: "Libre Franklin", "Franklin Gothic Medium", "Helvetica Neue", Arial, sans-serif;

  --measure: 66ch;
  --wrap: 860px;
  --side-w: 250px;
  --gutter: clamp(20px, 4vw, 44px);

  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2.5rem;
  --s-5: 3.5rem;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 160ms;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  font-feature-settings: "kern", "liga", "tnum";
  -webkit-font-smoothing: antialiased;
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
}

::selection { background: var(--accent); color: #fff; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  transition: color var(--t-fast) var(--ease), text-decoration-color var(--t-fast) var(--ease);
}
a:hover { color: var(--accent-ink); text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

img { max-width: 100%; height: auto; display: block; }

p { margin: 0 0 var(--s-2); }
p:last-child { margin-bottom: 0; }

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

.wrap {
  width: min(var(--wrap), 100% - 2 * var(--gutter));
  margin-inline: var(--gutter) auto;
}

.muted { color: var(--ink-3); }
.small { font-size: 0.9375rem; }

.skip {
  position: absolute; left: var(--gutter); top: -3rem;
  background: var(--ink); color: #fff; padding: 0.5rem 0.75rem;
  border-radius: 4px; text-decoration: none; z-index: 20;
}
.skip:focus { top: 0.5rem; }

/* ---------- Sidebar ---------- */
.site-header {
  grid-row: 1 / span 2;
  position: sticky; top: 0;
  height: 100vh;
  background: var(--side);
  border-right: 1px solid var(--side-rule);
}
.header-row {
  width: auto; margin: 0;
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 2rem;
  padding: 2.5rem 1.75rem;
}
.brand {
  font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em;
  color: var(--ink); text-decoration: none;
}
.brand:hover { color: var(--accent-ink); }
.site-nav { display: flex; flex-direction: column; gap: 0.6rem; }
.site-nav a {
  color: var(--ink-2); text-decoration: none; font-size: 1rem; font-weight: 500;
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease);
}
.site-nav a:hover { color: var(--accent-ink); }

main { grid-column: 2; }
.site-footer { grid-column: 2; }

/* ---------- Hero / About ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 3rem;
  align-items: start;
  padding-block: var(--s-5);
}
.name {
  font-size: clamp(2rem, 3.5vw, 2.375rem);
  margin-bottom: 1.5rem;
}
.lede {
  font-size: 1.25rem;
  line-height: 1.45;
  color: var(--ink-2);
  max-width: var(--measure);
  margin-bottom: var(--s-3);
}
.bio { max-width: var(--measure); color: var(--ink-2); font-size: 1.0625rem; }
.bio strong { font-weight: 600; color: var(--ink); }
.bio p { margin-bottom: var(--s-2); }

.contact {
  list-style: none; padding: 0;
  margin: var(--s-4) 0 var(--s-2);
  display: flex; flex-wrap: wrap; gap: 0.5rem 0;
}
.contact li { display: flex; align-items: center; }
.contact li + li::before {
  content: ""; display: inline-block; width: 1px; height: 1em;
  background: var(--rule-strong); margin-inline: 0.9rem;
}
.contact a { font-weight: 500; }

.interests { font-size: 0.9375rem; color: var(--ink-2); }
.interests .muted { margin-right: 0.6rem; font-weight: 600; color: var(--ink); }

.portrait { margin: 0; padding-top: 0.5rem; }
.portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 4px;
}

/* ---------- Sections ---------- */
.section {
  padding-block: 3rem;
  border-top: 1px solid var(--rule);
}
.section h2 {
  font-size: 1.625rem;
  margin-bottom: 1.75rem;
}
.section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
h3.group {
  font-size: 0.8125rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
  margin: var(--s-4) 0 var(--s-2);
}
.section h2 + h3.group { margin-top: 0; }
.section-intro { max-width: var(--measure); font-size: 1.0625rem; margin-bottom: var(--s-4); }
.prose { max-width: var(--measure); }

/* Research */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 3rem;
  align-items: start;
}
.theme + .theme { margin-top: var(--s-4); }
.theme p { color: var(--ink-2); }
.with { display: block; margin-top: 0.4rem; color: var(--ink-3); font-size: 0.9375rem; }

.netfig {
  margin: 0;
  position: sticky; top: 2rem;
  color: var(--ink-2);
  background: var(--tint);
  border-radius: 6px;
  padding: 1rem 1rem 1.1rem;
}
.net { width: 100%; height: auto; display: block; }
.net .edges path {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  transition: stroke-dashoffset 1.3s var(--ease);
}
.net.drawn .edges path { stroke-dashoffset: 0; }
.net .edges path:nth-child(2)  { transition-delay: 0.08s; }
.net .edges path:nth-child(3)  { transition-delay: 0.14s; }
.net .edges path:nth-child(4)  { transition-delay: 0.20s; }
.net .edges path:nth-child(5)  { transition-delay: 0.10s; }
.net .edges path:nth-child(6)  { transition-delay: 0.26s; }
.net .edges path:nth-child(7)  { transition-delay: 0.30s; }
.net .edges path:nth-child(8)  { transition-delay: 0.42s; }
.net .edges path:nth-child(9)  { transition-delay: 0.38s; }
.net .edges path:nth-child(10) { transition-delay: 0.44s; }
.net .edges path:nth-child(11) { transition-delay: 0.56s; }
.net .edges path:nth-child(12) { transition-delay: 0.62s; }
.net .edges path:nth-child(13) { transition-delay: 0.60s; }
.net .edges path:nth-child(14) { transition-delay: 0.22s; }
.net .edges path:nth-child(15) { transition-delay: 0.36s; }
.net .nodes { opacity: 0; transition: opacity 0.6s var(--ease) 0.5s; }
.net.drawn .nodes { opacity: 1; }
.net .depot { fill: var(--accent); }
.net .station { fill: var(--tint); stroke: var(--accent); stroke-width: 1.75; }
.net .demand { fill: var(--ink-2); }

.netfig figcaption {
  margin-top: var(--s-2);
  font-size: 0.875rem; color: var(--ink-3);
  display: flex; flex-wrap: wrap; gap: 0.35rem 1rem;
}
.key { display: inline-flex; align-items: center; gap: 0.4rem; }
.swatch { display: inline-block; width: 10px; height: 10px; }
.swatch.depot { background: var(--accent); }
.swatch.station { border: 1.75px solid var(--accent); border-radius: 50%; }
.swatch.demand { background: var(--ink-2); border-radius: 50%; width: 8px; height: 8px; }
.caption-note { flex-basis: 100%; }

/* Publications */
.pubs { margin: 0; padding-left: 1.75rem; max-width: 72ch; }
.pubs li { margin-bottom: var(--s-3); padding-left: 0.25rem; }
.pubs li::marker { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pub-title { display: block; font-weight: 600; font-size: 1.0625rem; line-height: 1.35; margin-bottom: 0.2rem; }
.authors { display: block; color: var(--ink-2); }
.authors strong { font-weight: 600; color: var(--ink); }
.venue { display: block; color: var(--ink-3); font-size: 0.9375rem; }

/* Talks, honors, timeline: date column + content */
.talks, .honors, .timeline, .roles { list-style: none; margin: 0; padding: 0; }
.talks li, .honors li, .timeline li {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: var(--s-2);
  padding-block: var(--s-2);
  border-top: 1px solid var(--rule);
  max-width: 80ch;
}
.when {
  color: var(--ink-3); font-variant-numeric: tabular-nums; font-weight: 500;
  padding-top: 0.15rem; white-space: nowrap;
}
.talks .pub-title { font-size: 1rem; }
.role { display: block; font-weight: 600; }
.org { display: block; color: var(--ink-2); }
.meta { display: block; color: var(--accent-ink); font-weight: 500; font-variant-numeric: tabular-nums; margin-top: 0.15rem; }
.roles li { margin-bottom: var(--s-3); }
.roles p { color: var(--ink-2); margin-top: 0.35rem; }

.two-col {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem;
}
.two-col h3.group { margin-top: 0; }

/* CV */
.cv p { max-width: var(--measure); }
.button {
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin: var(--s-2) 0 var(--s-2);
  padding: 0.75rem 1.25rem;
  background: var(--accent); color: #fff;
  font-weight: 600; text-decoration: none; border-radius: 4px;
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.button:hover { background: var(--accent-ink); color: #fff; }
.button:active { transform: translateY(1px); }
.button svg { flex: none; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: var(--s-4);
  font-size: 0.9375rem; color: var(--ink-2);
}
.footer-row { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  body { display: block; }
  html { scroll-padding-top: 4.5rem; }
  .site-header {
    position: sticky; top: 0; z-index: 10; height: auto;
    border-right: 0; border-bottom: 1px solid var(--side-rule);
  }
  .header-row {
    flex-direction: row; align-items: center; flex-wrap: wrap;
    gap: 0.35rem 1.5rem; padding: 0.7rem var(--gutter);
  }
  .brand { font-size: 1.125rem; }
  .site-nav { flex-direction: row; flex-wrap: wrap; gap: 0.25rem 1rem; }
  .site-nav a { font-size: 0.9375rem; }
  .wrap { margin-inline: auto; }
  .split { grid-template-columns: 1fr; }
  .netfig { position: static; max-width: 320px; }
}

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; gap: var(--s-4); padding-block: var(--s-4); }
  .portrait { order: -1; max-width: 60%; padding-top: 0; }
  .section { padding-block: var(--s-4); }
  .section h2 { margin-bottom: var(--s-3); }
  .two-col { grid-template-columns: 1fr; gap: var(--s-4); }
  .talks li, .honors li, .timeline li { grid-template-columns: 1fr; gap: 0.25rem; }
  .when { padding-top: 0; font-size: 0.9375rem; }
  .contact li + li::before { margin-inline: 0.65rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .net .edges path { stroke-dashoffset: 0; }
  .net .nodes { opacity: 1; }
}

@media print {
  body { display: block; background: #fff; color: #000; }
  .site-header, .netfig, .button { display: none; }
  a { color: #000; text-decoration: none; }
}
