/* ==========================================================================
   Academic site — style.css
   --------------------------------------------------------------------------
   1. Design tokens (colors, fonts, spacing)   <- change the look here
   2. Base / typography
   3. Layout helpers
   4. Header & navigation
   5. Page headers & sections
   6. Components (cards, news, publications, people, projects, timeline …)
   7. Footer
   8. Responsive & print
   ========================================================================== */

/* 1. DESIGN TOKENS ======================================================= */
:root {
  /* Colors — light (cream paper, sand borders, orange buttons, blue links) */
  --bg:          #fefbf2;
  --surface:     #fffdf8;
  --surface-2:   #f6efdc;
  --ink:         #130b03;
  --ink-2:       #3d3329;
  --muted:       #7a6e5f;
  --line:        #ebe1c4;   /* hairlines */
  --line-strong: #decb95;   /* card borders */
  --accent:      #1145c9;   /* links & highlights (blue) #1f4e92 (electric blue)*/
  --accent-ink:  #0b3291;   
  --accent-soft: #e3efff;
  --brand:       #e6dc00;   /* #ff7b42 (original orange) #e6dc00 (green/ chartreuse) buttons & fills (orange) - too light for text */
  --brand-hover: #f2642a;   
  --brand-on:    #130b03;   /* text on orange */
  --gold:        #b4471a;   /* awards / highlights */
  --gold-soft:   #ffe8dc;

  /* Typography - Geist for everything, Geist Mono for labels */
  --font-display: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body:    "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono:    "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* Shape & spacing */
  --radius:    28px;
  --radius-sm: 12px;
  --max:       1120px;
  --gutter:    24px;
  --shadow:    none;

  color-scheme: light;
}

/* Dark theme: follows the OS unless the visitor picked light with the toggle */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #150c04;
    --surface:     #1e1409;
    --surface-2:   #2a1d10;
    --ink:         #fbf8ed;
    --ink-2:       #dcd2c1;
    --muted:       #a3947f;
    --line:        #3b2b19;
    --line-strong: #5a4426;
    --accent:      #8db8ff; /* #8db8ff (original) #e6dc00 */
    --accent-ink:  #b6d2ff; /* #b6d2ff (original) */
    --accent-soft: #19243d;
    --brand:       #ff7b42;
    --brand-hover: #ff9466;
    --brand-on:    #130b03;
    --gold:        #ff9c6e;
    --gold-soft:   #3a1e10;
    --shadow:      none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg:          #150c04;
  --surface:     #1e1409;
  --surface-2:   #2a1d10;
  --ink:         #fbf8ed;
  --ink-2:       #dcd2c1;
  --muted:       #a3947f;
  --line:        #3b2b19;
  --line-strong: #5a4426;
  --accent:      #8db8ff;
  --accent-ink:  #b6d2ff;
  --accent-soft: #19243d;
  --brand:       #ff7b42; 
  --brand-hover: #ff9466;
  --brand-on:    #130b03;
  --gold:        #ff9c6e;
  --gold-soft:   #3a1e10;
  --shadow:      none;
  color-scheme: dark;
}

/* 2. BASE / TYPOGRAPHY =================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 .5em;
  color: var(--ink);
}
h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); font-weight: 400; letter-spacing: -0.04em; line-height: 1.08; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 400; letter-spacing: -0.035em; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.08rem; }

p { margin: 0 0 1em; }
em, i { font-style: italic; }

a { color: var(--accent); text-decoration: none; text-underline-offset: .2em; }
a:hover { color: var(--accent-ink); text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

::selection { background: var(--accent-soft); color: var(--ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: var(--radius-sm);
}
.skip-link:focus { left: 16px; }

/* Text read aloud by screen readers but not shown, e.g. "(opens in a new tab)" */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Small uppercase label, e.g. above page titles */
.eyebrow {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .9rem;
}

.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.serif { font-family: var(--font-display); }

/* 3. LAYOUT HELPERS ====================================================== */
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: 68ch; }
.prose p, .prose li { color: var(--ink-2); }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }

main { display: block; padding-bottom: 4rem; }

/* Page with a sticky "On this page" side menu */
.with-toc { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 56px; align-items: start; }
.toc {
  position: sticky; top: 100px;
  font-size: .875rem;
  border-left: 1px solid var(--line);
  padding-left: 16px;
}
.toc p { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .6rem; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: .35rem 0; }
.toc a { color: var(--ink-2); }
.toc a:hover, .toc a.is-active { color: var(--accent); text-decoration: none; }

/* 4. HEADER & NAVIGATION ================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 68px; }

.brand { display: flex; flex-direction: column; line-height: 1.15; color: var(--ink); margin-right: auto; }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 500; letter-spacing: -0.03em; }
.brand-sub { font-size: .75rem; color: var(--muted); letter-spacing: .02em; }

.site-nav { display: flex; align-items: center; gap: 2px; }
.site-nav a {
  color: var(--ink-2);
  font-size: .875rem;
  padding: 6px 10px;
  border-radius: 999px;
  transition: background .15s, color .15s;
}
.site-nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink-2);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }

.nav-toggle { display: none; }

/* 5. PAGE HEADERS & SECTIONS ============================================= */
.page-head { padding: 4.5rem 0 2.5rem; }
.page-head h1 { margin-bottom: .35em; }

.section { padding: 3rem 0; }
.section + .section { border-top: 1px solid var(--line); }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin-bottom: 1.6rem;
}
.section-head h2 { margin: 0; }
.more-link { font-size: .9rem; white-space: nowrap; }
.more-link::after { content: " \2192"; }

/* Block that groups content inside a page (used with .with-toc) */
.block { padding: 0 0 3rem; }
.block > h2 { padding-bottom: .5rem; border-bottom: 1px solid var(--line); margin-bottom: 1.4rem; }

/* ---- Home hero ---- */
.hero { padding: 4.5rem 0 3.5rem; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 64px; align-items: center; }
.hero h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); margin-bottom: .3em; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero .role { font-size: 1.05rem; color: var(--ink-2); margin-bottom: 1.6rem; line-height: 1.5; }
.hero .role strong { color: var(--ink); font-weight: 600; }
.hero .bio { color: var(--ink-2); max-width: 60ch; }

.portrait { position: relative; justify-self: end; width: 100%; max-width: 300px; }
.portrait img {
  position: relative; z-index: 1;
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: var(--radius) 0 var(--radius) var(--radius);
  background: var(--surface-2);
}
.portrait::before {           /* offset frame behind the photo */
  content: ""; position: absolute; inset: 14px -14px -14px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius) 0 var(--radius) var(--radius);
}

.link-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.6rem; padding: 0; list-style: none; }
.link-row a {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .85rem; color: var(--ink-2);
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface);
  transition: border-color .15s, color .15s;
}
.link-row a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.link-row a.primary { background: var(--brand); color: var(--brand-on); border-color: var(--brand); }
.link-row a.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--brand-on); }

/* 6. COMPONENTS ========================================================== */

/* ---- Card ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius) 0 var(--radius) var(--radius);   /* signature clipped corner */
  padding: 28px;
  box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .4em; }
.card p:last-child { margin-bottom: 0; }
.card .num { font-family: var(--font-mono); letter-spacing: .08em; color: var(--accent); font-size: .8rem; display: block; margin-bottom: .6rem; }

/* ---- Callout / announcement ---- */
.callout {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: var(--radius) 0 var(--radius) var(--radius);
  padding: 20px 26px;
  color: var(--ink);
}
.callout p { margin: 0; color: var(--ink-2); }
.callout strong { color: var(--ink); }
.callout .dot { flex: none; width: 10px; height: 10px; margin-top: .5em; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 30%, transparent); }

/* ---- Tags & badges ---- */
.tag, .badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .7rem; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
  vertical-align: middle;
  white-space: nowrap;
}
.tag.paper  { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.tag.award, .badge.award { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 40%, transparent); background: var(--gold-soft); }
.tag.grant  { color: var(--ink); background: var(--surface-2); }
.tag.talk, .tag.event, .tag.people { color: var(--ink-2); }
.badge.ongoing   { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.badge.completed { color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.chips li { font-size: .875rem; padding: 5px 12px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }

/* ---- Stats strip ---- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.stat { padding: 22px 24px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat b { display: block; font-family: var(--font-display); font-weight: 400; letter-spacing: -0.04em; font-size: 2.6rem; line-height: 1; color: var(--ink); }
.stat span { font-size: .85rem; color: var(--muted); }

/* ---- News list ---- */
.news { list-style: none; margin: 0; padding: 0; }
.news li {
  display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 20px;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.news li:first-child { padding-top: 0; }
.news time { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); padding-top: .2em; }
.news p { margin: 0; color: var(--ink-2); }
.news .tag { margin-right: 6px; }

.year-label { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.03em; font-size: 1.6rem; color: var(--muted); margin: 2.5rem 0 1rem; }
.year-label:first-child { margin-top: 0; }

/* ---- "New" badge: orange pill with a soft pulsing glow ----
   Usage: <span class="new-badge">New</span> in front of any item. Delete it when no longer new. */
.new-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: .7rem; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 10px 3px 8px; border-radius: 999px;
  background: var(--brand); color: var(--brand-on);
  vertical-align: middle;
  animation: new-glow 2.4s ease-out infinite;
}
.new-badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand-on);
  animation: new-dot 2.4s ease-in-out infinite;
}
@keyframes new-glow {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 55%, transparent); }
  70%  { box-shadow: 0 0 0 8px color-mix(in srgb, var(--brand) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes new-dot { 50% { opacity: .35; } }
.news .new-badge { margin-right: 6px; }

/* ---- Featured news card (home page, above the news list) ---- */
.news-feature {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px 40px; align-items: end;
  padding: 30px 32px; margin-bottom: 1.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius) 0 var(--radius) var(--radius);
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--surface) 65%);
}
.news-feature .meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: .78rem; color: var(--muted);
  margin-bottom: .9rem;
}
.news-feature h3 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); font-weight: 400; letter-spacing: -0.025em; line-height: 1.25; margin: 0 0 .6rem; }
.news-feature h3 a { color: var(--ink); }
.news-feature h3 a:hover { color: var(--accent); }
.news-feature p { color: var(--ink-2); margin: 0; max-width: 62ch; }
.news-feature .link-row { margin: 0; flex-wrap: nowrap; }

/* ---- Publications ---- */
.pub-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 2rem; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn {
  font: inherit; font-size: .85rem;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  cursor: pointer;
}
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }
.chip-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.search {
  margin-left: auto;
  font: inherit; font-size: .9rem;
  padding: 7px 14px; min-width: 240px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink);
}
.search::placeholder { color: var(--muted); }
.pub-count { font-size: .85rem; color: var(--muted); width: 100%; margin: 0; }

.year-group { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 24px; padding-top: 1.5rem; }
.year-group > h3 {
  position: sticky; top: 92px; align-self: start;
  font-size: 1.6rem; color: var(--muted); font-weight: 400; margin: 0;
}
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub { padding: 0 0 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.pub:last-child { border-bottom: 0; }
.pub-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 500; letter-spacing: -0.015em; line-height: 1.35; color: var(--ink); margin: 0 0 .3rem; }
.pub-title a { color: inherit; }
.pub-title a:hover { color: var(--accent); }
.pub-authors { color: var(--ink-2); font-size: .93rem; margin: 0 0 .2rem; }
.pub-authors .me { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .2em; }
.pub-venue { font-size: .93rem; color: var(--muted); margin: 0 0 .55rem; }
.pub-venue em { color: var(--ink-2); }
.pub-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pub-meta a {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .03em;
  padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-2);
}
.pub-meta a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pub-meta details[open] { width: 100%; }
.pub-meta summary {
  display: inline-block; cursor: pointer; list-style: none;
  font-family: var(--font-mono); font-size: .72rem;
  padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2);
}
.pub-meta summary::-webkit-details-marker { display: none; }
.pub-meta details[open] summary { border-color: var(--accent); color: var(--accent); }
pre.bibtex {
  margin: .6rem 0 0; padding: 14px 16px; overflow-x: auto;
  font-family: var(--font-mono); font-size: .78rem; line-height: 1.5;
  background: var(--surface-2); border-radius: var(--radius-sm); color: var(--ink-2);
}
.pub[hidden], .year-group[hidden] { display: none; }

/* Featured publication (home) with thumbnail */
.feature { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
.feature img { border-radius: var(--radius-sm); aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); }

/* ---- Projects / grants ---- */
.project { display: flex; flex-direction: column; gap: 10px; }
.project h3 { font-size: 1.15rem; margin: 0; }
.project dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: .88rem; }
.project dt { color: var(--muted); }
.project dd { margin: 0; color: var(--ink-2); }

/* ---- People ---- */
.people-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.person { text-align: left; }
.person .avatar {
  width: 84px; height: 84px; border-radius: 50%;
  object-fit: cover; margin-bottom: 14px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 1.6rem;
}
.person h3 { font-size: 1.1rem; margin: 0 0 .15rem; }
.person .role { font-size: .85rem; color: var(--accent); margin: 0 0 .5rem; }
.person p { font-size: .9rem; color: var(--ink-2); margin: 0 0 .4rem; }
.person .links { display: flex; gap: 12px; font-size: .85rem; margin-top: .5rem; }

/* Simple two-column table-like list (alumni, courses …) */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.rows li:first-child { border-top: 1px solid var(--line); }
.rows .title { color: var(--ink); font-weight: 500; }
.rows .sub { display: block; font-size: .88rem; color: var(--muted); font-weight: 400; }
.rows .side { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); text-align: right; white-space: nowrap; }

/* ---- Timeline (experience, education) ---- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 1px solid var(--line); }
.timeline li { position: relative; padding: 0 0 26px; }
.timeline li::before {
  content: ""; position: absolute; left: -27px; top: .45em;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.timeline .when { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); display: block; }
.timeline .what { font-weight: 500; color: var(--ink); }
.timeline .where { display: block; color: var(--ink-2); font-size: .93rem; }

/* ---- Gallery ---- */
.gallery { columns: 3 280px; column-gap: 20px; }
.gallery figure { break-inside: avoid; margin: 0 0 20px; }
.gallery img { width: 100%; border-radius: var(--radius-sm); background: var(--surface-2); }
.gallery figcaption { font-size: .85rem; color: var(--muted); padding-top: 8px; }
.gallery figcaption b { color: var(--ink-2); font-weight: 500; }

/* ---- Contact ---- */
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.contact-list dt, .contact-list .k { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: block; }
.contact-list .v { color: var(--ink); }
.map-frame { width: 100%; aspect-ratio: 4 / 3; border: 1px solid var(--line-strong); border-radius: var(--radius) 0 var(--radius) var(--radius); background: var(--surface-2); }

/* 7. FOOTER ============================================================== */
.site-footer { border-top: 1px solid var(--line); padding: 2.5rem 0 3rem; font-size: .875rem; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: baseline; }
.footer-inner .name { font-family: var(--font-display); font-size: 1.1rem; color: var(--ink); }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; list-style: none; padding: 0; margin: 0; }
.footer-links a { color: var(--ink-2); }

/* 8. RESPONSIVE & PRINT ================================================== */
@media (max-width: 1080px) {
  .nav-toggle { display: inline-grid; }
  .nav-toggle span { display: block; width: 16px; height: 1.5px; background: currentColor; margin: 2px 0; transition: transform .2s, opacity .2s; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
  .site-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 16px;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 10px 12px; font-size: 1rem; border-radius: var(--radius-sm); }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 3rem; }
  .portrait { justify-self: start; max-width: 220px; order: -1; }
  .with-toc { grid-template-columns: 1fr; gap: 0; }
  .news-feature { grid-template-columns: 1fr; align-items: start; }
  .toc { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .brand-sub { display: none; }
  .page-head { padding: 3rem 0 1.5rem; }
  .news li { grid-template-columns: 1fr; gap: 4px; }
  .news-feature { padding: 24px 22px; }
  .news-feature .link-row { flex-wrap: wrap; }
  .year-group { grid-template-columns: 1fr; gap: 8px; }
  .year-group > h3 { position: static; }
  .feature { grid-template-columns: 1fr; }
  .search { margin-left: 0; min-width: 0; width: 100%; }
  .rows li { grid-template-columns: 1fr; gap: 2px; }
  .rows .side { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .new-badge, .new-badge::before { animation: none; }
}

@media print {
  .site-header, .site-footer, .toc, .pub-tools, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .with-toc { display: block; }
  .card { box-shadow: none; }
  a { color: #000; }
}
