/* ---------- Tokens ---------- */
:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5b616e;
  --faint: #8a909c;
  --line: #e7e7e4;
  --accent: #0f5f6e;
  --accent-soft: #e6f1f2;
  --accent-ink: #0b4a56;
  --radius: 14px;
  --maxw: 1080px;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1114;
    --surface: #16191e;
    --text: #e9eaec;
    --muted: #a3a8b2;
    --faint: #737985;
    --line: #262a31;
    --accent: #6cc4d1;
    --accent-soft: #15303a;
    --accent-ink: #9fdbe4;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
strong { font-weight: 600; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { font-family: var(--serif); font-size: 1.25rem; font-weight: 500; color: var(--text); letter-spacing: -.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--muted); font-size: .9rem; padding: 6px 10px; border-radius: 8px; }
.nav a:hover { color: var(--text); background: var(--line); text-decoration: none; }
.nav a.active { color: var(--text); }
.nav .btn { margin-left: 6px; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: .9rem; cursor: pointer; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .9rem; font-weight: 500; line-height: 1;
  padding: 11px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  transition: border-color .15s, transform .15s, background .15s;
}
.btn:hover { text-decoration: none; border-color: var(--faint); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { border-color: var(--text); opacity: .9; }
.nav .btn { padding: 8px 14px; color: var(--text); }
.nav .btn:hover { background: var(--surface); }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: 1fr 260px; gap: 56px; align-items: center; }
.eyebrow { font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.hero h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 4rem); line-height: 1.04; letter-spacing: -.025em;
  margin: 0 0 18px;
}
.hero .roles { font-size: 1.05rem; color: var(--muted); margin-bottom: 22px; }
.hero .roles a { color: var(--text); border-bottom: 1px solid var(--line); }
.hero .roles a:hover { text-decoration: none; border-color: var(--text); }
.hero .lede { font-size: 1.15rem; line-height: 1.6; max-width: 40em; margin-bottom: 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.portrait { position: relative; justify-self: end; }
.portrait img {
  width: 260px; height: 260px; border-radius: 50%; object-fit: cover;
  transform: scale(1.02);
  box-shadow: 0 0 0 1px var(--line), 0 24px 48px -24px rgba(15, 30, 40, .35);
}
.socials { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 22px; font-size: .9rem; }
.socials a { color: var(--muted); }
.socials a:hover { color: var(--text); }

/* ---------- Highlights strip ---------- */
.stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.stats .wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 22px 20px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat b { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.2rem; line-height: 1.3; letter-spacing: -.01em; }
.stat span { color: var(--muted); font-size: .85rem; }

/* ---------- Sections ---------- */
section.block { padding: 72px 0; border-bottom: 1px solid var(--line); }
section.block:last-of-type { border-bottom: 0; }
.block .wrap { display: grid; grid-template-columns: 220px 1fr; gap: 48px; }
.block h2 {
  font-family: var(--serif); font-weight: 400; font-size: 1.75rem; letter-spacing: -.015em; line-height: 1.2;
  margin: 0; position: sticky; top: 96px; align-self: start;
}
.block h2 small { display: block; font-family: var(--sans); font-size: .82rem; color: var(--faint); letter-spacing: 0; margin-top: 8px; font-weight: 400; }
.block h3 { font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 40px 0 16px; }
.block h3:first-child { margin-top: 0; }
.prose { font-size: 1.05rem; max-width: 44em; }
.prose p:last-child { margin-bottom: 0; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tag { font-size: .82rem; padding: 5px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- Timeline / entries ---------- */
.entries > li { display: grid; grid-template-columns: 1fr auto; gap: 4px 24px; padding: 18px 0; border-top: 1px solid var(--line); }
.entries > li:first-child { border-top: 0; padding-top: 0; }
.entry-title { font-weight: 600; }
.entry-org { color: var(--muted); }
.entry-date { color: var(--faint); font-size: .88rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.entry-desc { grid-column: 1 / -1; color: var(--muted); font-size: .95rem; margin: 2px 0 0; }
.entry-desc a { font-weight: 500; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 10px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
a.card { color: inherit; }
a.card:hover { text-decoration: none; border-color: var(--faint); transform: translateY(-2px); box-shadow: 0 12px 28px -18px rgba(0,0,0,.3); }
.card .kicker { font-size: .75rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }
.card h4 { margin: 0; font-size: 1.08rem; line-height: 1.35; font-weight: 600; letter-spacing: -.005em; }
.card p { margin: 0; color: var(--muted); font-size: .93rem; }
.card ul { color: var(--muted); font-size: .93rem; display: grid; gap: 6px; }
.card ul li { padding-left: 16px; position: relative; }
.card ul li::before { content: ""; position: absolute; left: 2px; top: .68em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: .7; }
.card .more { margin-top: auto; padding-top: 6px; font-size: .88rem; font-weight: 500; color: var(--accent); }
.card.feature { grid-column: 1 / -1; }

/* ---------- Publications ---------- */
.pubs > li { padding: 16px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 56px 1fr; gap: 0 16px; }
.pubs > li:first-child { border-top: 0; padding-top: 0; }
.pub-year { color: var(--faint); font-size: .88rem; font-variant-numeric: tabular-nums; padding-top: 2px; }
.pub-title { font-weight: 600; color: var(--text); line-height: 1.45; }
a.pub-title:hover { color: var(--accent); text-decoration: none; }
.pub-authors { color: var(--muted); font-size: .92rem; margin-top: 3px; }
.pub-authors b { color: var(--text); font-weight: 600; }
.pub-venue { font-size: .9rem; margin-top: 3px; }
.pub-venue em { font-style: italic; color: var(--text); }
.badge { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .03em; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); margin-left: 6px; vertical-align: 1px; }
.note { color: var(--faint); font-size: .9rem; margin-top: 24px; }

/* ---------- Simple lists ---------- */
.list > li { padding: 10px 0 10px 18px; position: relative; border-top: 1px solid var(--line); color: var(--text); }
.list > li:first-child { border-top: 0; padding-top: 0; }
.list > li::before { content: ""; position: absolute; left: 2px; top: 1.3em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .7; }
.list > li:first-child::before { top: .7em; }
.list .sub { color: var(--muted); font-size: .92rem; }
.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }

/* ---------- Contact / footer ---------- */
.contact-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
}
.contact-card p { margin: 0; color: var(--muted); max-width: 34em; }
.contact-card .emails { margin-top: 10px; font-size: .95rem; }
footer { padding: 32px 0 48px; color: var(--faint); font-size: .85rem; }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
footer a { color: var(--muted); }

/* ---------- Reveal ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(12px); transition: opacity .6s ease, transform .6s ease; }
  .js .reveal.in { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .cards.three { grid-template-columns: 1fr 1fr; }
  .block .wrap { grid-template-columns: 1fr; gap: 24px; }
  .block h2 { position: static; }
}
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 8px; font-size: 1rem; }
  .nav .btn { margin: 8px 0 0; justify-content: center; }
}
@media (max-width: 760px) {
  .hero { padding: 40px 0 40px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 28px; }
  .portrait { order: -1; justify-self: start; }
  .portrait img { width: 128px; height: 128px; }
  .stats .wrap { grid-template-columns: 1fr 1fr; }
  .stat { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
  .stat:nth-child(-n+2) { border-top: 0; }
  section.block { padding: 52px 0; }
  .cards, .cards.three, .twocol { grid-template-columns: 1fr; }
  .entries > li { grid-template-columns: 1fr; }
  .entry-date { order: -1; }
  .pubs > li { grid-template-columns: 1fr; }
  .pub-year { padding: 0 0 2px; }
}

@media print {
  .site-header, .actions, .menu-btn { display: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  section.block { padding: 24px 0; }
}
