/* ============ Tokens ============ */
:root {
  --bg: #faf8f3;
  --paper: #ffffff;
  --paper-2: #fdfcf8;
  --ink: #1c2230;
  --muted: #5b6475;
  --line: #e6e0d2;
  --navy: #14284b;
  --navy-2: #2a4a7f;
  --gold: #c9a227;
  --gold-ink: #8a6c12;
  --gold-soft: #f4ecd2;
  --on-navy: #f3e6bf;
  --shadow: 0 1px 2px rgba(20, 40, 75, .05), 0 10px 30px -12px rgba(20, 40, 75, .15);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1626; --paper: #13203a; --paper-2: #172643; --ink: #e8ebf2; --muted: #a3adc2;
    --line: #26375a; --navy: #e9dcb4; --navy-2: #c9b98a; --gold: #d8b440; --gold-ink: #e3c35c;
    --gold-soft: #2a2a20; --on-navy: #14284b;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 14px 34px -14px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1626; --paper: #13203a; --paper-2: #172643; --ink: #e8ebf2; --muted: #a3adc2;
  --line: #26375a; --navy: #e9dcb4; --navy-2: #c9b98a; --gold: #d8b440; --gold-ink: #e3c35c;
  --gold-soft: #2a2a20; --on-navy: #14284b;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 14px 34px -14px rgba(0,0,0,.6);
  color-scheme: dark;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; color: var(--navy); margin: 0; line-height: 1.15; }
p { margin: 0; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.kicker { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; color: var(--gold-ink); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--navy); color: var(--bg); padding: 8px 14px; z-index: 100; border-radius: 6px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px;
  background: var(--navy); color: var(--bg); text-decoration: none; font-weight: 600; font-size: 15px;
  border: 1px solid var(--navy); cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-small { padding: 7px 16px; font-size: 13px; }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--gold); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #1a1405; font-size: 17px; padding: 14px 28px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--navy); cursor: pointer;
}
.icon-btn:hover { border-color: var(--gold); }

/* ============ Nav ============ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 68px; }
.brand { font-family: var(--serif); font-size: 21px; color: var(--navy); text-decoration: none; font-weight: 500; }
.brand span { color: var(--gold-ink); }
.nav-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  text-decoration: none; font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; position: relative; padding: 6px 0;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--gold);
  transform: scaleX(0); transform-origin: left; transition: transform .25s;
}
.nav-links a:hover, .nav-links a.active { color: var(--navy); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}

/* ============ Hero ============ */
.hero { padding: 72px 0 40px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--gold) 16%, transparent), transparent);
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 280px 1fr; gap: 64px; align-items: center; position: relative; }
.portrait {
  margin: 0; width: 280px; aspect-ratio: 5 / 6; border-radius: 6px; position: relative;
  background: linear-gradient(160deg, #14284b, #2a4a7f); box-shadow: 16px 16px 0 var(--gold);
  overflow: hidden;
}
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.monogram { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 64px; color: #f3e6bf; letter-spacing: .04em; }
.hero h1 { font-size: clamp(40px, 6vw, 68px); margin: 12px 0 20px; letter-spacing: -.01em; }
.lead { font-size: 18px; color: var(--ink); max-width: 680px; }
.lead + .lead { margin-top: 12px; }
.lead em { font-style: normal; color: var(--navy); background: linear-gradient(transparent 62%, var(--gold-soft) 62%); }
.lead.muted { color: var(--muted); font-size: 16px; }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; font-size: 14px;
  text-decoration: none; border: 1px solid var(--line); background: var(--paper); color: var(--navy); font-weight: 500;
  transition: border-color .2s, transform .2s;
}
.pill:hover { border-color: var(--gold); transform: translateY(-1px); }
.pill-solid { background: var(--navy); color: var(--bg); border-color: var(--navy); }
.stats {
  display: grid; grid-template-columns: repeat(5, 1fr); margin: 64px 0 0; padding: 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stats div { padding: 22px 8px; text-align: center; }
.stats div + div { border-left: 1px solid var(--line); }
.stats dt { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); order: 2; }
.stats dd { margin: 0 0 2px; font-family: var(--serif); font-size: 38px; color: var(--navy); font-variant-numeric: tabular-nums; }
.stats div { display: flex; flex-direction: column-reverse; }

/* ============ Sections ============ */
.section { padding: 96px 0; }
.section.alt { background: var(--paper); border-block: 1px solid var(--line); }
.section-head { margin-bottom: 40px; }
.section-head h2 { font-size: clamp(30px, 4vw, 42px); margin-top: 8px; }
.sub-head { margin-top: 80px; display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 24px; }
.sub-head h2 { font-size: 30px; margin: 0; }

/* Research cards */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px;
  position: relative; transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card::before { content: ""; position: absolute; left: 24px; top: 0; width: 36px; height: 3px; background: var(--gold); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--gold) 50%, var(--line)); }
.num { font-family: var(--serif); font-size: 34px; color: var(--gold); line-height: 1; }
.card h3 { font-size: 21px; margin: 14px 0 10px; }
.card { display: flex; flex-direction: column; }
.card p { color: var(--muted); font-size: 15px; }
.tags { list-style: none; padding: 0; margin: auto 0 0; padding-top: 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-ink); }
.vision {
  margin: 0 0 36px; padding: 6px 0 6px 28px; border-left: 3px solid var(--gold); max-width: 860px;
}
.vision p { font-family: var(--serif); font-size: clamp(20px, 2.4vw, 26px); line-height: 1.45; color: var(--navy); }
.vision em { font-style: italic; color: var(--gold-ink); }

.duo { display: grid; grid-template-columns: 1fr 1.3fr; gap: 20px; margin-top: 20px; }
.feature { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; }
.feature:first-child { background: var(--navy); border-color: var(--navy); color: var(--bg); }
.feature:first-child h3 { color: var(--bg); font-size: 26px; margin: 10px 0 12px; }
.feature:first-child .kicker { color: var(--gold); }
.feature:first-child p { opacity: .86; }
:root[data-theme="dark"] .feature:first-child { background: #1b2d52; border-color: #2e4573; color: #f1f3f8; }
:root[data-theme="dark"] .feature:first-child h3 { color: #f3e6bf; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .feature:first-child { background: #1b2d52; border-color: #2e4573; color: #f1f3f8; }
  :root:not([data-theme="light"]) .feature:first-child h3 { color: #f3e6bf; }
}
.meta-list { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.meta-list li { display: flex; justify-content: space-between; border-top: 1px solid rgba(255,255,255,.16); padding-top: 10px; font-weight: 600; }
.meta-list span { font-weight: 400; opacity: .7; }

.chart { display: flex; align-items: flex-end; gap: 6px; height: 190px; margin-top: 22px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.bar i {
  display: block; width: 100%; background: color-mix(in srgb, var(--navy-2) 35%, transparent); border-radius: 3px 3px 0 0;
  height: 0; transition: height 1s cubic-bezier(.2,.8,.2,1), background .2s; position: relative;
}
.bar:last-child i { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--gold) 70%, transparent) 0 4px, color-mix(in srgb, var(--gold) 40%, transparent) 4px 8px); }
.bar:nth-last-child(2) i { background: var(--gold); }
.bar:hover i { background: var(--navy); }
.bar i::after {
  content: attr(data-v); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  font-size: 11px; font-weight: 600; color: var(--navy); opacity: 0; transition: opacity .2s; white-space: nowrap;
}
.bar:hover i::after { opacity: 1; }
.bar small { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-note { font-size: 12px; color: var(--muted); margin-top: 12px; }

.service {
  display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center; margin-top: 20px;
  padding: 22px 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2);
}
.service strong { display: block; color: var(--navy); font-weight: 600; }
.service small { color: var(--muted); }

/* Experience + education */
.two-col { display: grid; grid-template-columns: 1.15fr 1fr; gap: 72px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 26px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 28px; }
.timeline li::before {
  content: ""; position: absolute; left: -33px; top: 5px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--gold);
}
.timeline li:first-child::before { background: var(--gold); box-shadow: 0 0 0 5px color-mix(in srgb, var(--gold) 25%, transparent); }
.timeline time, .edu time { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-ink); font-weight: 600; }
.timeline h3 { font-size: 20px; margin: 4px 0 4px; }
.timeline p { color: var(--muted); font-size: 15px; }
.edu { display: grid; gap: 18px; }
.edu article { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; background: var(--paper-2); }
.edu h3 { font-size: 21px; margin: 6px 0 4px; }
.edu .org { color: var(--navy-2); font-weight: 500; margin-bottom: 8px; }
.edu p { font-size: 15px; color: var(--muted); }
.edu .thesis { margin-top: 8px; font-style: italic; border-left: 2px solid var(--gold); padding-left: 12px; }

/* Publications */
.selected { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.sel {
  display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; text-decoration: none; transition: transform .25s, box-shadow .25s, border-color .25s;
}
.sel:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--gold); }
.sel .cites { font-family: var(--serif); font-size: 34px; color: var(--gold-ink); line-height: 1; }
.sel .cites small { font-family: var(--sans); font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-left: 6px; }
.sel h3 { font-size: 18px; margin: 14px 0 10px; line-height: 1.3; }
.sel p { font-size: 13px; color: var(--muted); margin-top: auto; }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.search {
  flex: 1 1 280px; display: flex; align-items: center; gap: 10px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 16px; color: var(--muted);
}
.search:focus-within { border-color: var(--gold); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; padding: 12px 0; font: inherit; color: var(--ink); min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: var(--paper); color: var(--muted); border-radius: 999px; padding: 7px 13px;
  font: 500 13px var(--sans); cursor: pointer; transition: all .2s;
}
.chip b { font-weight: 600; opacity: .6; margin-left: 4px; }
.chip:hover { border-color: var(--gold); color: var(--navy); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--bg); }
select {
  border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 10px 14px; font: 500 14px var(--sans); cursor: pointer;
}

.year-group { display: grid; grid-template-columns: 90px 1fr; gap: 24px; padding: 18px 0; border-top: 1px solid var(--line); }
.year-label { font-family: var(--serif); font-size: 28px; color: var(--navy); position: sticky; top: 84px; align-self: start; }
.year-label small { display: block; font-family: var(--sans); font-size: 12px; color: var(--muted); }
.pub { padding: 12px 0 12px 16px; border-left: 2px solid transparent; transition: border-color .2s, background .2s; border-radius: 0 6px 6px 0; }
.pub:hover { border-left-color: var(--gold); background: var(--paper-2); }
.pub + .pub { margin-top: 2px; }
.pub-title { font-weight: 600; color: var(--navy); text-decoration: none; font-size: 16px; line-height: 1.45; }
.pub-title:hover { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.pub-authors { font-size: 14px; color: var(--muted); margin-top: 3px; }
.pub-authors mark { background: none; color: var(--ink); font-weight: 600; }
.pub-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 4px; }
.pub-meta em { font-style: italic; }
.tag { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: var(--gold-soft); color: var(--gold-ink); }
.cite-badge { font-weight: 600; color: var(--navy-2); }
.list-flat .pub { border-top: 1px solid var(--line); border-radius: 0; }
.list-flat .pub .yr { font-family: var(--serif); color: var(--gold-ink); margin-right: 6px; }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.more-wrap { text-align: center; margin-top: 28px; }

/* Contact */
.contact { background: var(--navy); color: #e8ebf2; text-align: center; }
:root[data-theme="dark"] .contact { background: #0a1220; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .contact { background: #0a1220; } }
.contact h2 { color: #fff; font-size: clamp(32px, 5vw, 50px); margin: 10px 0 16px; }
.contact .kicker { color: var(--gold); }
.contact .lead { color: #c7cfdf; margin: 0 auto 30px; }
.contact-inner { max-width: 720px; }
.address { margin-top: 22px; font-size: 14px; color: #9aa6bf; }

.footer { padding: 26px 0; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--navy); }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .bar i { transition: none; }
}

/* ============ Responsive ============ */
@media (max-width: 1000px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .selected { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; gap: 64px; }
}
@media (max-width: 820px) {
  .menu-btn { display: inline-grid; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; gap: 0; padding: 8px 16px 16px;
    background: var(--bg); border-bottom: 1px solid var(--line); display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav-links a::after { display: none; }
  .hero { padding-top: 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .portrait { width: 200px; box-shadow: 12px 12px 0 var(--gold); }
  .monogram { font-size: 48px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stats div:nth-child(4) { border-left: 0; }
  .stats div:nth-child(n+4) { border-top: 1px solid var(--line); }
  .duo { grid-template-columns: 1fr; }
  .service { grid-template-columns: 1fr; gap: 14px; }
  .section { padding: 72px 0; }
}
@media (max-width: 560px) {
  .cards, .selected { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats div:nth-child(n) { border-left: 0; border-top: 1px solid var(--line); }
  .stats div:nth-child(even) { border-left: 1px solid var(--line); }
  .stats div:nth-child(-n+2) { border-top: 0; }
  .stats div:last-child { grid-column: span 2; border-left: 0; }
  .stats dd { font-size: 32px; }
  .year-group { grid-template-columns: 1fr; gap: 6px; }
  .year-label { position: static; }
  .year-label small { display: inline; margin-left: 8px; }
  .lead { font-size: 17px; }
  .chart { gap: 3px; }
  .bar small { writing-mode: vertical-rl; transform: rotate(180deg); }
  .brand span { display: none; }
}
