/* ============================================================
   Modern / editorial theme  —  SITE_THEME = "modern"

   Design notes, so future edits stay coherent:
   • One typeface. Inter carries prose at 400; labels, years and tags are the
     same face at 600 with wide letter-spacing and uppercase. Hierarchy comes
     from weight and spacing, not from a second font.
   • Strictly black and white: the accent is just the foreground color.
   • Depth comes from hairlines and a single soft glow, never from shadows.
   • Motion is slow and one-directional: things rise 18px and settle.
     Everything uses --ease; nothing bounces.
   • Dark is the default here (see base.html); light is a full second palette.
   ============================================================ */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/inter-var.woff2") format("woff2");
}

/* ── Tokens ───────────────────────────────────────────────── */

:root {
  --accent:      #f3f4f5;   /* monochrome: white on dark */
  --accent-ink:  #b0b6bc;   /* accent on small text */
  --accent-soft: rgba(255, 255, 255, 0.10);
  --accent-faint: rgba(255, 255, 255, 0.05);   /* highlighted talk rows */
  --glow-1:      rgba(255, 255, 255, 0.07);
  --glow-2:      rgba(255, 255, 255, 0.04);

  --bg:     #08090a;
  --bg-2:   #0f1113;        /* raised panels */
  --fg:     #f3f4f5;
  --muted:  #d3d7db;
  --dim:    #a4aab1;

  --line:    rgba(255, 255, 255, 0.09);
  --line-mid: rgba(255, 255, 255, 0.16);

  --nav-bg:  rgba(8, 9, 10, 0.72);
  --grain:   0.05;

  --globe-land: #767e86;
  --globe-grid: rgba(255, 255, 255, 0.07);
  --globe-disc: rgba(255, 255, 255, 0.022);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;

  --maxw:  1180px;
  --pad:   clamp(20px, 5vw, 64px);
  --rail:  190px;           /* sticky section-label column */
  --gap-s: clamp(96px, 13vh, 168px);   /* space between sections */

  --r:     18px;
  --ease:  cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme="light"] {
  /* Deepened so 12px labels still clear AA against the off-white ground. */
  --accent:      #0d0f11;
  --accent-ink:  #4e545a;
  --accent-soft: rgba(13, 15, 17, 0.07);
  --accent-faint: rgba(13, 15, 17, 0.04);
  --glow-1:      rgba(13, 15, 17, 0.05);
  --glow-2:      rgba(13, 15, 17, 0.03);

  --bg:     #fbfbfa;
  --bg-2:   #ffffff;
  --fg:     #0d0f11;
  --muted:  #22262a;
  --dim:    #50565c;

  --line:    rgba(13, 15, 17, 0.10);
  --line-mid: rgba(13, 15, 17, 0.18);

  --nav-bg:  rgba(251, 251, 250, 0.72);
  --grain:   0.035;

  --globe-land: #9aa1a8;
  --globe-grid: rgba(13, 15, 17, 0.07);
  --globe-disc: rgba(13, 15, 17, 0.022);
}

/* Pink: the just-for-fun theme behind the little flower button in the nav. */
:root[data-theme="pink"] {
  --accent:      #d6336c;
  --accent-ink:  #b02458;
  --accent-soft: rgba(214, 51, 108, 0.10);
  --accent-faint: rgba(214, 51, 108, 0.06);
  --glow-1:      rgba(255, 138, 180, 0.30);
  --glow-2:      rgba(255, 190, 150, 0.20);

  --bg:     #fff5f8;
  --bg-2:   #ffffff;
  --fg:     #2b1320;
  --muted:  #3d2230;
  --dim:    #6b4a5b;

  --line:    rgba(150, 40, 90, 0.13);
  --line-mid: rgba(150, 40, 90, 0.22);

  --nav-bg:  rgba(255, 245, 248, 0.72);
  --grain:   0.03;

  --globe-land: #d99ab5;
  --globe-grid: rgba(150, 40, 90, 0.09);
  --globe-disc: rgba(214, 51, 108, 0.035);
}

/* ── Base ─────────────────────────────────────────────────── */

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv05" 1, "ss01" 1;
  overflow-x: hidden;
}

a { color: inherit; }

/* Exponents and subscripts (10^5, M_sun) otherwise grow their own line box and
   open a visible gap above that one line. Zero line-height takes them out of
   the height calculation; the offset is done with position instead. */
sup, sub {
  font-size: 0.72em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
sup { top: -0.46em; }
sub { bottom: -0.22em; }

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

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

/* The old themes' starfield layer has no place here. */
.bg-mesh { display: none !important; }

/* ── Atmosphere: one slow glow + a film grain ─────────────── */

/* A single wide soft wash behind the hero. Very low opacity on purpose —
   it should read as light in a room, not as a "gradient blob". */
.atmos {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}
.atmos::before {
  content: "";
  position: absolute;
  top: -34vh;
  left: 50%;
  width: 130vw;
  height: 110vh;
  transform: translateX(-52%);
  background:
    radial-gradient(48% 46% at 62% 40%, var(--glow-1), transparent 68%),
    radial-gradient(44% 44% at 26% 24%, var(--glow-2), transparent 70%);
  filter: blur(30px);
  animation: drift 34s var(--ease) infinite alternate;
}
@keyframes drift {
  from { transform: translateX(-52%) translateY(0) scale(1); }
  to   { transform: translateX(-46%) translateY(28px) scale(1.07); }
}

/* Grain kills the flat, plasticky look that vector gradients have on their own. */
.grain {
  position: fixed;
  inset: -50%;
  z-index: -1;
  pointer-events: none;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Scroll progress ──────────────────────────────────────── */

.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: var(--accent);
  z-index: 90;
  will-change: transform;
}

/* ── Nav ──────────────────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px var(--pad);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
}
.nav.scrolled {
  background: var(--nav-bg);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom-color: var(--line);
}

.nav-brand {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  margin-right: auto;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav-links a {
  position: relative;
  font-size: 13px;
  font-weight: 450;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 999px;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.nav-links a:hover { color: var(--fg); background: var(--accent-soft); }
.nav-links a.active { color: var(--fg); }
/* A single dot marks the section you're in — quieter than an underline. */
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 1px;
  width: 4px; height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--accent);
}

.theme-toggle {
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  font-size: 13px;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.theme-toggle:hover { color: var(--fg); border-color: var(--line-mid); }
.theme-icon { line-height: 1; display: inline-block; transition: transform 0.25s var(--ease); }
.theme-toggle:hover .theme-icon { transform: rotate(18deg); }
/* Notch in the ring where the flower badge sits, so the badge can stay transparent. */
.theme-wrap .theme-toggle {
  -webkit-mask-image: radial-gradient(circle 9.5px at 31px 31px, transparent 98%, #000 100%);
  mask-image: radial-gradient(circle 9.5px at 31px 31px, transparent 98%, #000 100%);
}
.theme-wrap { position: relative; display: flex; }
/* The just-for-fun pink-theme switch: a tiny badge on the lower right of the
   theme button, drawn in the same quiet line style as the sun. */
.flower-toggle {
  position: absolute;
  right: -5px; bottom: -5px;
  width: 16px; height: 16px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.flower-toggle:hover { color: var(--muted); border-color: var(--line-mid); transform: rotate(36deg); }
:root[data-theme="pink"] .flower-toggle { border-color: var(--accent); color: var(--accent); }
:root[data-theme="dark"] .sun,
:root:not([data-theme="dark"]) .moon { display: none; }

/* ── Shared layout ────────────────────────────────────────── */

main { position: relative; }

/* Labels, years and other metadata. These were set in a monospace, which read
   too light and too faint at small sizes — so they're Inter now, carried by
   weight and letter-spacing instead of by a contrasting typeface. Numeric
   gutters keep tabular figures so columns of years still line up. */
.eyebrow, .section-num, .stat-label, .mini-key, .pub-year, .talk-year,
.talk-title, .tl-period, .facility, .card-index, .card-period,
.pub-group-label, .panel-sub, .skill-group h4, .badge, .cites {
  font-weight: 600;
}
.pub-year, .talk-year, .tl-period, .mini-key, .card-period {
  font-variant-numeric: tabular-nums;
}

/* ── Hero ─────────────────────────────────────────────────── */

.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(120px, 21vh, 190px) var(--pad) 0;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.eyebrow {
  margin: 0 0 22px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.hero-name {
  margin: 0;
  font-size: clamp(52px, 8.4vw, 116px);
  line-height: 0.94;
  font-weight: 560;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.hero-tagline {
  margin: 26px 0 0;
  max-width: 30em;
  font-size: clamp(17px, 1.55vw, 21px);
  line-height: 1.55;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: -0.014em;
}
.hero-tagline em {
  font-style: normal;
  color: var(--fg);
  font-weight: 500;
}

.hero-meta {
  margin: 26px 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--dim);
}
.hero-meta .dot { color: var(--line-mid); }
.plain-link {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.plain-link:hover { color: var(--fg); border-bottom-color: var(--line-mid); }

.hero-links {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 450;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease),
              background 0.3s var(--ease), transform 0.3s var(--ease);
}
.pill:hover {
  color: var(--fg);
  border-color: var(--line-mid);
  background: var(--bg-2);
  transform: translateY(-2px);
}
.pill-arrow {
  font-size: 11px;
  color: var(--dim);
  transition: transform 0.3s var(--ease), color 0.3s var(--ease);
}
.pill:hover .pill-arrow { transform: translate(2px, -2px); color: var(--accent); }

/* Portrait: a tall panel with a soft coral halo behind it. */
.hero-photo {
  margin: 0;
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 348px;
  aspect-ratio: 4 / 5;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.hero-photo::after {
  content: "";
  position: absolute;
  inset: -18%;
  z-index: -1;
  background: radial-gradient(50% 50% at 50% 50%, var(--glow-1), transparent 72%);
  filter: blur(38px);
}
.hero-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1.1s var(--ease);
}
.hero-photo:hover img { transform: scale(1.035); }

/* Caption slides up over the foot of the photo on hover. White on a dark
   scrim in both themes — it sits on the photograph, not on the page. */
.hero-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 13px 16px;
  background: rgba(0, 0, 0, 0.62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  color: #fff;
  font-size: 13.5px;
  font-weight: 450;
  line-height: 1.4;
  letter-spacing: -0.008em;
  transform: translateY(101%);
  transition: transform 0.5s var(--ease);
}
.hero-photo:hover .hero-caption,
.hero-photo:focus-within .hero-caption { transform: none; }
/* Nothing hovers on a touchscreen, so just show it. */
@media (hover: none) {
  .hero-caption { transform: none; }
}

/* Stats: a ruled band, numerals set large and light. */
/* Deliberately modest. These are a footnote to the work, not the headline —
   at hero scale the whole page reads as being about the score. */
.stats {
  margin-top: clamp(52px, 8vh, 88px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}
.stat {
  /* Symmetric side padding, so the numerals never crowd the divider lines. */
  padding: 22px 32px 2px;
  border-right: 1px solid var(--line);
}
.stat:first-child { padding-left: 0; }
.stat:last-child { border-right: 0; padding-right: 0; }
.stat-value {
  font-size: clamp(26px, 2.7vw, 34px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  margin-top: 8px;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat-note {
  margin-top: 5px;
  font-size: 12px;
  color: var(--dim);
}

/* ── Sections ─────────────────────────────────────────────── */

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--gap-s) var(--pad) 0;
}

/* On wide screens the label becomes a sticky rail that tracks alongside
   the content, so you always know where you are without a heading shouting. */
@media (min-width: 1040px) {
  .section:not(.contact) {
    display: grid;
    grid-template-columns: var(--rail) minmax(0, 1fr);
    column-gap: clamp(40px, 4vw, 64px);
    align-items: start;
  }
  .section:not(.contact) > *:not(.section-head) { grid-column: 2; }
  .section-head {
    grid-column: 1;
    grid-row: 1 / span 99;
    position: sticky;
    top: 96px;
  }
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 40px;
}
.section-num {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent-ink);
}
.section-head h2 {
  margin: 0;
  font-size: clamp(21px, 2.1vw, 25px);
  font-weight: 550;
  letter-spacing: -0.028em;
  line-height: 1.15;
}
.source-note, .section-note {
  font-size: 12px;
  color: var(--dim);
  letter-spacing: 0;
}

/* Topic subtitle under the Research rail label — tracks the card in view. */
.research-topic {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent-ink);
  transition: opacity 0.2s var(--ease);
}

/* Below the rail breakpoint the sticky label collapses into normal flow and
   only ever shows the first card's topic, so each card repeats its own —
   right under the separator, before the title — for fast skimming. */
.card-topic {
  display: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent-ink);
  margin: 2px 0 10px;
}
@media (max-width: 1039px) {
  .card-topic { display: block; }
}
.source-note::before {
  content: "";
  display: inline-block;
  width: 5px; height: 5px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
}

/* ── About ────────────────────────────────────────────────── */

.prose p {
  margin: 0 0 1.15em;
  max-width: 62ch;
  font-size: clamp(17px, 1.35vw, 19px);
  line-height: 1.68;
  color: var(--muted);
}
.prose p:first-child { color: var(--fg); }
.prose p:last-child { margin-bottom: 0; }

/* ── Research ─────────────────────────────────────────────── */

.research-grid {
  display: flex;
  flex-direction: column;
}
.card {
  position: relative;
  padding: 34px 0;
  border-top: 1px solid var(--line);
}
.card:first-child { border-top: 0; padding-top: 0; }
.card-index {
  font-size: 12px;
  color: var(--dim);
  letter-spacing: 0.14em;
  margin-bottom: 14px;
}
.card h3 {
  margin: 0 0 16px;
  font-size: clamp(22px, 2.3vw, 25px);
  font-weight: 560;
  letter-spacing: -0.033em;
  line-height: 1.18;
}
.card-blurb p {
  margin: 0 0 1em;
  max-width: 64ch;
  color: var(--muted);
  line-height: 1.68;
}
.card-blurb p:last-child { margin-bottom: 0; }
.card-blurb a,
.prose a,
.mini-list a,
.tl-body a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  transition: background 0.25s var(--ease);
}
.card-blurb a:hover,
.prose a:hover,
.mini-list a:hover,
.tl-body a:hover { background: var(--accent-soft); }

.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 22px; }
.tag {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.tag:hover { border-color: var(--line-mid); color: var(--fg); }

.card-period {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--dim);
  letter-spacing: 0.06em;
}

/* ── Publications ─────────────────────────────────────────── */

/* The score lives here now, right above the list it's a footnote to —
   not up in the hero, which read as leading with the numbers. */
.pub-stats-item { list-style: none; margin: 0; padding: 40px 0 8px; }
#publications .stats { margin: 0; }

.pub-list { list-style: none; margin: 0; padding: 0; }

.pub-group-label {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 34px 0 14px;
}
.pub-group-label:first-child { padding-top: 0; }

.pub {
  scroll-margin-top: 124px;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 18px;
  padding: 20px 14px 20px 0;
  border-top: 1px solid var(--line);
  border-radius: 10px;
  margin: 0 -14px;
  padding-left: 14px;
  transition: background 0.35s var(--ease);
}
.pub:hover { background: var(--bg-2); }
.pub-year {
  font-size: 13px;
  color: var(--dim);
  padding-top: 3px;
  font-variant-numeric: tabular-nums;
}
.pub-title {
  display: inline-block;
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.017em;
  text-decoration: none;
  color: var(--fg);
  transition: color 0.25s var(--ease);
}
.pub:hover .pub-title { color: var(--accent-ink); }
.pub-authors {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--dim);
  line-height: 1.5;
}
.pub-venue {
  margin-top: 7px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--muted);
}
.pub-venue em { font-style: normal; }
.badge, .cites {
  font-size: 11.5px;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--line);
  color: var(--dim);
}
.cites { border-color: transparent; background: var(--accent-soft); color: var(--accent-ink); }
.pub-highlight .pub-title { color: var(--fg); }

.pub-link {
  font-size: 12.5px;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}
.pub-link:hover { background: var(--accent-soft); }

/* First-author papers: summary always visible, with the main figure. A single
   plot sits to the right of the text; a multi-panel one goes above it. */
.pub-abstract { margin-top: 14px; max-width: none; }
.pub-abstract-text {
  margin: 0;
  max-width: 86ch;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--muted);
}
.pub-abstract-text b { color: var(--fg); font-weight: 600; }
.pub-abstract-rows { display: flex; flex-direction: column; gap: 9px; }
.pub-abstract--side {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 28px;
  align-items: start;
}
.pub-abstract--side .pub-figure { order: 2; margin: 0; }
.pub-abstract--side .pub-abstract-rows { order: 1; }
.pub-abstract--side .pub-abstract-text { max-width: none; }
.pub-abstract--left { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
.pub-abstract--left .pub-figure { order: 0; }
.pub-abstract--left .pub-abstract-rows { order: 1; }
@media (max-width: 760px) {
  .pub-abstract--side { grid-template-columns: 1fr; }
  .pub-abstract--side .pub-figure { order: 0; margin-bottom: 4px; }
}
.pub-figure { margin: 0 0 16px; }
.pub-figure-row { display: flex; gap: 10px; }
.pub-figure-row img { flex: 1 1 0; min-width: 0; width: 0; padding: 8px; }
.pub-abstract--side .pub-figure-row img { width: 100%; padding: 14px; }
@media (max-width: 560px) { .pub-figure-row { flex-direction: column; } .pub-figure-row img { width: 100%; } }
.pub-figure img {
  display: block;
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  box-sizing: border-box;
  padding: 14px;
}
.pub-figure figcaption { margin-top: 8px; font-size: 12.5px; color: var(--dim); line-height: 1.5; }
.pub-abstract--side .pub-figure figcaption { margin-top: 6px; font-size: 11.5px; line-height: 1.38; letter-spacing: -0.005em; }

/* ── Background: timeline ─────────────────────────────────── */

.timeline { margin-bottom: 56px; }
.tl-item {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 20px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
}
.tl-item:first-child { border-top: 0; padding-top: 0; }
.tl-marker { display: none; }
.tl-period {
  font-size: 13px;
  color: var(--dim);
  padding-top: 4px;
  letter-spacing: 0.02em;
}
.tl-body h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 530;
  letter-spacing: -0.024em;
  line-height: 1.3;
}
.tl-org {
  margin-top: 5px;
  font-size: 14px;
  color: var(--accent-ink);
}
.tl-body p {
  margin: 11px 0 0;
  font-size: 15.5px;
  line-height: 1.62;
  color: var(--muted);
  max-width: 62ch;
}

/* ── Panels ───────────────────────────────────────────────── */

.two-col {
  display: grid;
  /* min() keeps the track from forcing 310px on a screen narrower than that,
     which pushed the panels past the right edge at 320px. */
  grid-template-columns: repeat(auto-fit, minmax(min(310px, 100%), 1fr));
  gap: 18px;
  margin-bottom: 18px;
}
.panel {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-2);
}
.panel-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 550;
  letter-spacing: -0.022em;
}
.panel-sub {
  font-size: 11.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 22px 0 10px;
}
.panel-note {
  margin: 18px 0 0;
  font-size: 13px;
  color: var(--dim);
  line-height: 1.55;
}

.prop-list, .mini-list { list-style: none; margin: 0; padding: 0; }
.prop-list li, .mini-list li {
  display: flex;
  gap: 12px;
  padding: 9px 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.prop-list li:last-child, .mini-list li:last-child { border-bottom: 0; }
.facility, .mini-key {
  flex: 0 0 auto;
  min-width: 74px;
  font-size: 12.5px;
  color: var(--dim);
  padding-top: 3px;
  letter-spacing: 0.02em;
}
/* Fixed width, so every entry's text starts on the same line regardless of
   how long its date is. Only on .mini-key — .facility sits in a column flex
   below, where a flex-basis would pin its height instead of its width. */
.mini-key { flex: 0 0 76px; }

/* Facility names ("XMM-Newton AO-24") are long enough to strangle the text
   beside them in a narrow panel, so they take their own line. */
.prop-list li { flex-direction: column; gap: 5px; }
.facility { color: var(--accent-ink); padding-top: 0; }

/* ── Skills ───────────────────────────────────────────────── */

.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 30px;
  margin-top: 46px;
  padding-top: 38px;
  border-top: 1px solid var(--line);
}
.skill-group h4 {
  margin: 0 0 14px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--dim);
}
.skills .tags { margin-top: 0; }

/* ── Talks ────────────────────────────────────────────────── */

.talk-list { list-style: none; margin: 0; padding: 0; }
/* Year | kind | venue. The venue is the substance here — "Seminar talk" is a
   category, "Lagrange Seminar, Observatoire de la Côte d'Azur, Nice" is the
   thing worth reading — so the venue gets the weight and the kind stays quiet. */
.talk {
  display: grid;
  grid-template-columns: 60px 116px minmax(0, 1fr);
  gap: 20px;
  align-items: baseline;
  padding: 15px 14px;
  margin: 0 -14px;
  border-top: 1px solid var(--line);
  border-radius: 10px;
  transition: background 0.35s var(--ease);
}
.talk:hover { background: var(--bg-2); }
.talk-year {
  font-size: 13px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.talk-title {
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--dim);
  line-height: 1.5;
}
.talk-venue {
  font-size: 15px;
  font-weight: 450;
  letter-spacing: -0.016em;
  line-height: 1.45;
  color: var(--fg);
}
/* The 40-minute talks. A dot alone was too easy to miss in a list of twenty,
   so they get a solid accent bar plus a tint — readable at a glance while
   scrolling, without turning into a button. The bar eats 3px of the padding
   so the year column stays aligned with every other row. */
.talk-long {
  background: var(--accent-faint);
  border-left: 3px solid var(--accent);
  padding-left: 11px;
}
.talk-long:hover { background: var(--accent-soft); }
.talk-long .talk-venue { font-weight: 600; }
.talk-long .talk-year { color: var(--accent-ink); }

/* ── Talks: globe inset ───────────────────────────────────── */

/* A cropped hemisphere: as wide as the talk list above, and short, with the
   sphere's centre on the bottom edge (see globe.js). No caption — the cities
   are already named in the list. */
.globe-inset {
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
#globe {
  display: block;
  width: 100%;
  aspect-ratio: 2.5 / 1;
  min-height: 150px;
  cursor: grab;
  /* Horizontal drag spins it; vertical stays with the page so the canvas
     never traps scrolling on a phone. */
  touch-action: pan-y;
}

/* ── Contact ──────────────────────────────────────────────── */

.contact { padding-bottom: clamp(96px, 14vh, 150px); }
.contact-card {
  border-top: 1px solid var(--line);
  padding-top: clamp(48px, 7vh, 76px);
  text-align: center;
}
.contact-card .section-num { display: block; margin-bottom: 16px; }
.contact-card h2 {
  margin: 0;
  font-size: clamp(34px, 5.6vw, 66px);
  font-weight: 550;
  letter-spacing: -0.042em;
  line-height: 1.02;
}
.contact-card > p {
  margin: 20px auto 0;
  max-width: 44ch;
  font-size: 17px;
  color: var(--muted);
  line-height: 1.6;
}
.mail {
  display: inline-block;
  margin-top: 34px;
  font-size: clamp(17px, 2.1vw, 24px);
  font-weight: 450;
  letter-spacing: -0.028em;
  text-decoration: none;
  color: var(--fg);
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line-mid);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.mail:hover { color: var(--accent-ink); border-bottom-color: var(--accent); }
.contact-card .hero-links { justify-content: center; margin-top: 34px; }

/* ── Footer ───────────────────────────────────────────────── */

.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px var(--pad) 40px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--dim);
}
.footer-credit { color: var(--dim); opacity: 0.75; }

/* ── Reveal ───────────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
  transition-delay: calc(var(--i, 0) * 40ms);
}
.reveal.in { opacity: 1; transform: none; }

/* Hero words rise one after another. JS wraps each word in .w > span.
   Deliberately not a clipping mask: the name runs at line-height 0.94, so an
   overflow:hidden box would slice the tops and tails off the letters. */
.w { display: inline-block; }
.w > span {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.3em);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: calc(var(--wi, 0) * 90ms);
}
.reveal.in .w > span { opacity: 1; transform: none; }

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 44px; }
  /* The tall 4:5 crop belongs to the two-column layout. The moment the photo
     drops below the text it becomes a wide band instead — same breakpoint, so
     it never sits stacked and portrait at the same time. */
  .hero-photo {
    justify-self: start;
    max-width: 420px;
    aspect-ratio: 4 / 3;   /* square source, bottom quarter cropped away */
  }
  .hero-photo img { object-position: center top; }
  .talk { grid-template-columns: 54px minmax(0, 1fr); }
  .talk-venue { grid-column: 2; text-align: left; }
  .tl-item { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding-top: 104px; }

  /* The brand goes — her name is right below in the hero anyway — so the
     section links keep their place instead of disappearing on phones. */
  .nav { gap: 0; padding-left: 10px; padding-right: 10px; }
  .nav-brand { display: none; }
  .nav-links {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links { gap: 2px; }
  .nav-links a { padding: 6px 4px; font-size: 11.5px; white-space: nowrap; }
  .theme-wrap { flex: none; margin-left: 8px; margin-right: 4px; }

  /* All four links on one row. */
  .hero-links { flex-wrap: nowrap; gap: 5px; }
  .pill { padding: 8px 9px; font-size: 11.5px; gap: 4px; }
  .pill-arrow { font-size: 10px; }

  /* Each card already carries its own topic line here. */
  .research-topic { display: none; }

  /* Keep the three across one line — stacked, they read as three separate
     announcements. Everything shrinks to fit a 390px screen. */
  .stat { padding: 18px 12px 2px; }
  .stat-value { font-size: 23px; }
  .stat-label { font-size: 9.5px; letter-spacing: 0.09em; }
  .stat-note { font-size: 10.5px; margin-top: 4px; }
  .pub { grid-template-columns: 1fr; gap: 6px; }
  .panel { padding: 22px; }
  .footer { flex-direction: column; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .w > span { transition: none; }
  .reveal { opacity: 1; transform: none; }
  .w > span { transform: none; }
  .atmos::before { animation: none; }
  .hero-photo img { transition: none; }
}

@media print {
  .nav, .theme-toggle, .progress, .atmos, .grain { display: none; }
  .reveal { opacity: 1; transform: none; }
  body { background: #fff; color: #000; }
}


/* "Back to Research" pill, shown after jumping from the Research text to a paper. */
.back-pill {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: 70px;
  z-index: 90;
  padding: 9px 16px;
  border: 1px solid var(--line-mid);
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.10);
  animation: back-pill-in 0.35s var(--ease);
}
.back-pill:hover { border-color: var(--fg); }
.back-pill[hidden] { display: none; }
@keyframes back-pill-in { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translateX(-50%); } }
@media print { .back-pill { display: none; } }

@media (max-width: 360px) {
  .nav-links a { padding: 6px 4px; font-size: 11px; }
  .pill { padding: 7px 7px; font-size: 11px; }
}
