/* ==========================================================================
   Editorial research dossier — design system  (navy + azure)
   ========================================================================== */

/* ----- Theme tokens ------------------------------------------------------ */
:root {
  --paper:        #faf6f4;
  --surface:      #ffffff;
  --surface-2:    #f2eae7;
  --ink:          #261a1a;
  --ink-2:        #6e5d5c;
  --ink-3:        #9a8a88;
  --line:         rgba(38, 26, 26, 0.12);
  --line-2:       rgba(38, 26, 26, 0.22);
  --accent:       #c0392b;
  --accent-2:     #a32d22;
  --accent-soft:  rgba(192, 57, 43, 0.10);
  --accent-glow:  rgba(192, 57, 43, 0.7);   /* plain rgba (not color-mix) for max browser support */
  --page:         #fbf7ef;        /* lightbox "book page" paper */
  --wood-1:       #5c4030;        /* shelf back panel */
  --wood-2:       #46301f;
  --wood-ledge-1: #7a5440;        /* shelf ledge */
  --wood-ledge-2: #533a2a;
  --book-cloth:   #c0392b;        /* book spine color (independent of --accent) */
  --book-text:    #f7efe0;

  /* highlight families */
  --hl-gold:      #b7791f;        /* Spotlight (amber) */
  --hl-gold-soft: rgba(183, 121, 31, 0.16);
  --hl-violet:    #3a5a9c;        /* Oral (indigo) */
  --hl-violet-soft: rgba(58, 90, 156, 0.16);

  --font-display: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --font-sans:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono:    ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --maxw: 1120px;
  --nav-h: 64px;
  --shadow: 0 1px 2px rgba(15, 27, 51, 0.05), 0 8px 28px rgba(15, 27, 51, 0.07);
  --shadow-lift: 0 22px 56px rgba(15, 27, 51, 0.18);
  --shadow-lg: 0 18px 60px rgba(15, 27, 51, 0.24);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme="dark"] {
  --paper:        #170f0e;
  --surface:      #231715;
  --surface-2:    #1d1311;
  --ink:          #f0e5e3;
  --ink-2:        #b59b98;
  --ink-3:        #8a726f;
  --line:         rgba(240, 229, 227, 0.13);
  --line-2:       rgba(240, 229, 227, 0.24);
  --accent:       #e5635a;
  --accent-2:     #ef7d75;
  --accent-soft:  rgba(229, 99, 90, 0.15);
  --accent-glow:  rgba(229, 99, 90, 0.75);
  --page:         #221813;        /* lightbox "book page" paper (dark) */
  /* darker than the light-mode wood so the shelf doesn't read brighter
     against the surrounding dark page */
  --wood-1:       #382716;
  --wood-2:       #241710;
  --wood-ledge-1: #4a3424;
  --wood-ledge-2: #2c1e13;
  /* muted on purpose — using the brighter dark-mode --accent directly here
     made the books glow against the dark shelf */
  --book-cloth:   #7a352e;
  --book-text:    #ddd0c4;

  --hl-gold:      #e3a94a;        /* Spotlight (amber) */
  --hl-gold-soft: rgba(227, 169, 74, 0.18);
  --hl-violet:    #8aa6e8;        /* Oral (indigo) */
  --hl-violet-soft: rgba(138, 166, 232, 0.20);

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-lift: 0 22px 56px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 18px 60px rgba(0, 0, 0, 0.6);
}

/* ----- Base ------------------------------------------------------------- */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.18; letter-spacing: normal; margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -0.15em; flex-shrink: 0; }
.is-hidden { display: none !important; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 0; }

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

/* ----- Paper-grain texture (subtle full-page overlay) ------------------- */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 40; pointer-events: none;
  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='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
  opacity: 0.045; mix-blend-mode: multiply;
}
[data-theme="dark"] body::after { opacity: 0.05; mix-blend-mode: screen; }

/* ----- Layout helpers --------------------------------------------------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 52px 28px;
}
.section--alt { max-width: none; background: var(--surface-2); }
.section--alt > .section__wrap { max-width: var(--maxw); margin: 0 auto; }
.section:empty { display: none; padding: 0; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}
.section__head { margin-bottom: 28px; }
.section__head h2 { font-size: clamp(28px, 4vw, 42px); }
.section__head p { color: var(--ink-2); max-width: 60ch; margin: 12px 0 0; }

/* ----- Navigation (flat, no blur for snappy scroll) --------------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.nav.is-scrolled { background: var(--paper); border-bottom-color: var(--line); }
.nav__inner {
  max-width: var(--maxw); height: 100%; margin: 0 auto;
  padding: 0 28px; display: flex; align-items: center; gap: 20px;
}
.nav__links { display: flex; gap: 4px; margin-right: auto; }
.nav__links a {
  position: relative; font-size: 18px; color: var(--ink-2); font-weight: 500;
  padding: 8px 14px; border-radius: var(--r-sm); transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav__links a:hover { color: var(--ink); background: var(--accent-soft); }
.nav__links a.is-active { color: var(--accent); }
.nav__links a.is-active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px;
  background: var(--accent); border-radius: 2px;
}
.nav__actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; font-size: 18px; transition: background 0.2s var(--ease), transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.icon-btn:hover { background: var(--accent-soft); border-color: var(--line-2); }
.icon-btn:active { transform: scale(0.92); }
.nav__burger { display: none; }

/* ----- Hero ------------------------------------------------------------- */
.section--hero { padding-top: calc(var(--nav-h) + 36px); padding-bottom: 40px; }
.hero {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 52px; align-items: start;
}
.hero__intro { min-width: 0; }
.hero__name {
  font-size: clamp(28px, 4vw, 46px); line-height: 1.14; letter-spacing: normal; margin: 0 0 14px; white-space: nowrap;
}
.hero__name-em { color: var(--accent); white-space: nowrap; }
.hero__role { color: var(--ink-2); font-weight: 500; font-size: 17px; margin: 0 0 20px; white-space: nowrap; }
.hero__role .dot { color: var(--accent); margin: 0 4px; }
.hero__bio { color: var(--ink-2); font-size: 18px; margin: 0 0 18px; }
.hero__interests-text { color: var(--ink-2); font-size: 18px; margin: 0 0 16px; }
.hero__interests { display: flex; flex-wrap: nowrap; gap: 9px; margin: 0; overflow-x: auto; }
.interest {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-2);
  font-family: var(--font-sans); font-size: 14px; font-weight: 500; cursor: pointer; border: 1px solid transparent;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease);
}
[data-theme="dark"] .interest { color: var(--accent); }
.interest .ic { width: 16px; height: 16px; }
.interest:hover { transform: translateY(-2px); border-color: var(--accent); }
.interest--static { cursor: default; }
.interest--static:hover { transform: none; border-color: transparent; }

/* labeled chips on one line; scroll horizontally on narrow screens (no wrap) */
.hero__links {
  display: flex; flex-wrap: nowrap; gap: 8px; margin-top: 28px;
  overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.hero__links::-webkit-scrollbar { display: none; }
/* Edge fade = "there's more to scroll" indicator, only on whichever side has
   more content; both vendor + standard mask properties for Safari support. */
.hero__links.can-scroll-right {
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 28px), transparent 100%);
          mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 28px), transparent 100%);
}
.hero__links.can-scroll-left {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 100%);
}
.hero__links.can-scroll-left.can-scroll-right {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
}
.chip {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease);
}
.chip .ic { width: 16px; height: 16px; color: var(--accent); transition: color 0.18s var(--ease); }
.chip:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--accent); color: #fff; }
.chip:hover .ic { color: #fff; }

/* portrait — clean matted frame; cycles images with a "denoise" reveal */
.hero__portrait {
  position: relative; width: 100%; padding: 10px; align-self: start;
  background: var(--accent-soft); border-radius: var(--r-lg);
}
.hero__portrait img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; max-height: 460px;
  object-fit: cover; border-radius: calc(var(--r-lg) - 6px);
  background: var(--surface-2); border: 1px solid var(--line);
  transition: transform 0.45s var(--ease);
}
.hero__portrait:hover img { transform: scale(1.02); }

/* ----- News — timeline -------------------------------------------------- */
.news-timeline { max-width: var(--maxw); }
.news-track {
  position: relative; margin-left: 8px; padding: 4px 0 4px 28px; border-left: 2px solid var(--line);
}
.news-item {
  position: relative; padding: 9px 14px; margin-bottom: 2px; border-radius: var(--r-sm);
  transition: background 0.18s var(--ease);
}
.news-item::before {
  content: ""; position: absolute; left: -35px; top: 14px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--accent);
  transition: background 0.18s var(--ease), transform 0.18s var(--ease);
}
.news-item:hover { background: var(--accent-soft); }
.news-item:hover::before { background: var(--accent); transform: scale(1.18); }
.news-item__date { font-family: var(--font-mono); font-size: 12.5px; color: var(--accent); display: block; margin-bottom: 3px; }
.news-item__text { color: var(--ink); margin: 0; font-size: 16px; line-height: 1.55; }
.news-item__text strong { color: var(--accent); font-weight: 600; }
.news-new {
  display: inline-block; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase; color: #fff; background: var(--accent);
  border-radius: 5px; padding: 2px 7px; margin-right: 6px; vertical-align: 1px;
  animation: newPulse 1.5s ease-in-out infinite;
}
[data-theme="dark"] .news-new { color: var(--paper); }
@keyframes newPulse {
  0%   { box-shadow: 0 0 7px 0 var(--accent-glow), 0 0 0 0 var(--accent-glow); }
  70%  { box-shadow: 0 0 9px 1px var(--accent-glow), 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 7px 0 var(--accent-glow), 0 0 0 0 transparent; }
}
.news-item__text a { color: var(--accent); }
.hero__bio a { color: var(--accent); text-decoration: none; }
.hero__bio a:hover { text-decoration: underline; }

/* ----- Publications ----------------------------------------------------- */
.pub-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 30px; }
.pub-filters__label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-right: 4px; }
.filter {
  font-size: 13.5px; font-weight: 500; padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink-2); cursor: pointer;
  transition: all 0.18s var(--ease);
}
.filter:hover { border-color: var(--accent); color: var(--accent-2); }
[data-theme="dark"] .filter:hover { color: var(--accent); }
.filter.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); }
[data-theme="dark"] .filter.is-active { color: var(--accent); }

.pub-list { display: flex; flex-direction: column; gap: 18px; transition: opacity 0.2s var(--ease); }
.pub-list.is-filtering { opacity: 0; }

.pub {
  display: grid; grid-template-columns: 264px 1fr; align-items: stretch;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  cursor: pointer; min-height: 210px; position: relative;
  transition: transform 0.26s var(--ease), border-color 0.26s var(--ease);
}
/* pop-out: lift + scale + accent ring, all on a composited pseudo (no repaint) */
.pub::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: var(--shadow-lift), 0 0 0 2px var(--accent);
  opacity: 0; pointer-events: none;
  transition: opacity 0.26s var(--ease);
}
.pub:hover { transform: translateY(-8px) scale(1.025); z-index: 3; }
.pub:hover::after { opacity: 1; }
/* while hovering, before the lightbox opens: blink the ring as an affordance */
@keyframes pubPending { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
/* steady lift (no card-scale animation = no jitter); only the ring pulses */
.pub.is-pending { z-index: 3; }
.pub.is-pending::after {
  opacity: 1;
  box-shadow: var(--shadow-lift), 0 0 0 3px var(--accent), 0 0 44px var(--accent-soft);
  animation: pubPending 0.5s ease-in-out infinite;
}
.pub__media { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--r-md) 0 0 var(--r-md); }
.pub__body { border-radius: 0 var(--r-md) var(--r-md) 0; }

/* expand affordance, fades in on hover (signals the card opens) */
.pub__expand {
  position: absolute; top: 12px; right: 12px; z-index: 4;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--accent); border: 1px solid var(--line-2);
  opacity: 0; transform: scale(0.8); pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}
.pub__expand .ic { width: 15px; height: 15px; }
.pub:hover .pub__expand { opacity: 1; transform: scale(1); }
.pub__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.45s var(--ease); }
.pub:hover .pub__media img { transform: scale(1.07); }
.pub__body { display: flex; flex-direction: column; min-width: 0; padding: 24px 26px; }
.pub__badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 9px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.02em;
  padding: 3px 9px; border-radius: 6px;
}
.badge .ic { width: 12px; height: 12px; }
.badge--venue { background: var(--accent-soft); color: var(--accent-2); }
[data-theme="dark"] .badge--venue { color: var(--accent); }
.badge--gold   { background: var(--hl-gold-soft);   color: var(--hl-gold); }
.badge--violet { background: var(--hl-violet-soft); color: var(--hl-violet); }
.badge--accent { background: var(--accent-soft); color: var(--accent-2); }
[data-theme="dark"] .badge--accent { color: var(--accent); }
.pub__title { font-size: 23px; line-height: 1.18; margin: 2px 0 7px; }
.pub__authors { color: var(--ink-2); font-size: 14.5px; margin: 0 0 4px; }
.pub__eq-note { color: var(--ink-3); font-size: 12.5px; margin: -8px 0 14px; }
.author { color: var(--ink-2); }
a.author { border-bottom: 1px solid var(--line-2); transition: color 0.15s var(--ease), border-color 0.15s var(--ease); }
a.author:hover { color: var(--accent); border-color: var(--accent); }
.author--me { color: var(--ink); font-weight: 600; }
a.author--me { border-bottom-color: var(--accent); }
.pub__actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.action {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: transparent; color: var(--ink); cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), border-color 0.16s var(--ease);
}
.action .ic { width: 15px; height: 15px; }
.action:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.action.is-copied { background: var(--accent); border-color: var(--accent); color: #fff; }

/* highlight panels: distinct color + glow */
.pub[data-hl="spotlight"] {
  border-color: color-mix(in srgb, var(--hl-gold) 55%, var(--line));
  background: color-mix(in srgb, var(--hl-gold-soft) 35%, var(--surface));
  box-shadow: 0 0 22px var(--hl-gold-soft);
}
.pub[data-hl="spotlight"]::after { box-shadow: var(--shadow-lift), 0 0 0 2px var(--hl-gold), 0 0 34px var(--hl-gold-soft); }
.pub[data-hl="oral"] {
  border-color: color-mix(in srgb, var(--hl-violet) 55%, var(--line));
  background: color-mix(in srgb, var(--hl-violet-soft) 35%, var(--surface));
  box-shadow: 0 0 22px var(--hl-violet-soft);
}
.pub[data-hl="oral"]::after { box-shadow: var(--shadow-lift), 0 0 0 2px var(--hl-violet), 0 0 34px var(--hl-violet-soft); }
.pub[data-hl="accent"] {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  box-shadow: 0 0 22px var(--accent-soft);
}
.pub[data-hl="accent"]::after { box-shadow: var(--shadow-lift), 0 0 0 2px var(--accent), 0 0 34px var(--accent-soft); }

.pub-empty { color: var(--ink-3); font-size: 15px; padding: 30px 0; }

/* ----- Publication view switcher --------------------------------------- */
.pubviews {
  display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
}
.pubview {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-sans); font-size: 13.5px; font-weight: 500;
  color: var(--ink-2); background: transparent; border: 0;
  padding: 7px 15px; border-radius: 999px; cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.pubview .ic { width: 15px; height: 15px; }
.pubview:hover { color: var(--ink); }
.pubview.is-active { background: var(--accent); color: #fff; }
[data-theme="dark"] .pubview.is-active { color: var(--paper); }
.pub-view[hidden] { display: none; }

/* ----- Shelf view (wooden shelf + real-looking book spines) ------------- */
.shelf { padding: 6px 0 0; }
.shelf__back {
  padding: 24px 20px 0; border-radius: var(--r-md) var(--r-md) 0 0;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,0.05) 0 1px, transparent 1px 46px),
    linear-gradient(180deg, var(--wood-1), var(--wood-2));
  box-shadow: inset 0 24px 30px -24px rgba(0, 0, 0, 0.75), inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.shelf__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px; min-height: 312px; }
/* All books share one size + the crimson accent color, so the shelf reads as
   a uniform row of books rather than mismatched stripes. */
.book {
  position: relative; flex: 0 0 auto;
  width: 80px; height: 296px;
  color: var(--book-text); border: 0; cursor: pointer; padding: 0; overflow: hidden;
  border-radius: 3px 6px 6px 3px;
  /* horizontal sheen = cylindrical spine roundness (not a flat stripe) */
  background:
    linear-gradient(90deg, rgba(0,0,0,0.35), rgba(255,255,255,0.14) 14%, rgba(255,255,255,0.03) 50%, rgba(0,0,0,0.12) 78%, rgba(0,0,0,0.32)),
    var(--book-cloth);
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.32);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.book:hover { transform: translateY(-22px); box-shadow: 0 26px 36px -12px rgba(0, 0, 0, 0.55); }
.book:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.book__label {
  flex: 1 1 auto; width: calc(100% - 18px); margin: 18px 0 0;
  display: flex; align-items: center; justify-content: center;
  border-top: 1px solid rgba(255, 255, 255, 0.3); border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}
.book__title {
  writing-mode: vertical-rl; font-family: var(--font-display); font-size: 15px; line-height: 1.12;
  max-height: 210px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 10px 0;
}
.book__base { font-family: var(--font-mono); font-size: 9px; opacity: 0.85; padding: 8px 2px 14px; text-align: center; }
.book__foil { position: absolute; top: 0; left: 0; right: 0; height: 6px; }
.book__foil--spotlight { background: var(--hl-gold); }
.book__foil--oral { background: var(--hl-violet); }
/* highlight ring — a composited overlay so it never distorts the book's own
   rounded corners or hover shadow */
.book::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
}
.book--spotlight::after { box-shadow: inset 0 0 0 3px var(--hl-gold); }
.book--oral::after { box-shadow: inset 0 0 0 3px var(--hl-violet); }
.shelf__ledge {
  height: 22px; border-radius: 0 0 6px 6px;
  background: linear-gradient(180deg, var(--wood-ledge-1) 0 38%, var(--wood-ledge-2));
  box-shadow: 0 18px 26px -10px rgba(0, 0, 0, 0.5), inset 0 3px 0 rgba(255, 255, 255, 0.12), inset 0 -4px 7px rgba(0, 0, 0, 0.45);
}
.shelf__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.shelf__hint { font-size: 12.5px; color: var(--ink-3); margin: 0; }

/* ----- Highlight legend (shelf + graph) -------------------------------- */
.hl-legend { display: flex; flex-wrap: wrap; gap: 16px; }
.hl-legend__item { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); }
.hl-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.hl-dot--topic { background: var(--accent); }
.hl-dot--paper { background: var(--surface); border: 2px solid var(--ink-2); }
.hl-dot--spotlight { background: transparent; border: 2px solid var(--hl-gold); }
.hl-dot--oral { background: transparent; border: 2px solid var(--hl-violet); }

/* ----- Graph view ------------------------------------------------------- */
.graph { position: relative; }
/* sub-switcher: Topics / Collaborators */
.graphviews {
  display: inline-flex; gap: 4px; padding: 3px; margin-bottom: 16px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
}
.graphview {
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 500;
  color: var(--ink-2); background: transparent; border: 0;
  padding: 6px 13px; border-radius: 999px; cursor: pointer; transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.graphview:hover { color: var(--ink); }
.graphview.is-active { background: var(--accent); color: #fff; }
[data-theme="dark"] .graphview.is-active { color: var(--paper); }
.graph__pane[hidden] { display: none; }
.graph__svg { width: 100%; height: auto; max-height: 470px; display: block; }
.gedge { stroke: var(--line-2); stroke-width: var(--w, 1.5); transition: opacity 0.2s var(--ease), stroke 0.2s var(--ease), stroke-width 0.2s var(--ease); }
.gedge.is-lit { stroke: var(--accent); stroke-width: calc(var(--w, 1.5) + 0.8); }
.gnode { cursor: pointer; }
.gnode circle { transition: opacity 0.2s var(--ease), fill 0.2s var(--ease), stroke 0.2s var(--ease); }
.gnode--topic circle { fill: var(--accent); }
.gnode--paper circle { fill: var(--surface); stroke: var(--ink-2); stroke-width: 2; }
.gnode--paper.gnode--spotlight circle { stroke: var(--hl-gold); }
.gnode--paper.gnode--oral circle { stroke: var(--hl-violet); }
.gnode:hover circle { stroke: var(--accent); }
.gnode--topic.is-sel circle { stroke: var(--accent); stroke-width: 4; }
.glabel { fill: var(--ink); font-family: var(--font-sans); font-size: 11.5px; }
.glabel__venue { fill: var(--accent); font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; }
.glabel__title { fill: var(--ink); font-family: var(--font-sans); font-size: 11px; }
.glabel--topic { fill: var(--accent); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; text-anchor: middle; font-weight: 500; }
.graph__pane.is-focus .gnode.is-dim { opacity: 0.22; }
.graph__pane.is-focus .gedge.is-dim { opacity: 0.12; }
.graph .hl-legend { justify-content: center; margin-top: 12px; }
.graph__hint { font-size: 12.5px; color: var(--ink-3); margin: 8px 0 0; text-align: center; }

/* ----- Collaborator graph nodes + reveal panel -------------------------- */
/* "Me" is the filled hub; collaborators are outlined, sized by papers shared.
   A selected collaborator's name turns orange/underlined — a visual cue that
   clicking it again (now that it's "active") follows their social link. */
.gnode--person:not(.gnode--me) circle { fill: var(--surface); stroke: var(--ink-2); stroke-width: 2; }
.gnode--me circle { fill: var(--accent); stroke: none; }
.glabel--person { fill: var(--ink); font-family: var(--font-sans); font-size: 11.5px; text-anchor: middle; }
.glabel--me { fill: var(--accent); font-weight: 500; }
.gnode--person.is-sel .glabel--person {
  fill: var(--hl-gold); text-decoration: underline; font-weight: 500;
}
.collab-reveal { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.collab-reveal[hidden] { display: none; }
.collab-paper {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--font-sans); font-size: 14px; text-align: left; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 10px 12px; cursor: pointer; transition: border-color 0.16s var(--ease), transform 0.16s var(--ease);
}
.collab-paper:hover { border-color: var(--accent); transform: translateX(2px); }
.collab-paper__title { flex: 1 1 auto; }

/* ----- Talks ------------------------------------------------------------ */
.talk-list { display: flex; flex-direction: column; gap: 0; }
.talk {
  display: grid; grid-template-columns: 120px 1fr auto; gap: 20px; align-items: center;
  padding: 18px 0; border-top: 1px solid var(--line);
}
.talk:last-child { border-bottom: 1px solid var(--line); }
.talk__date { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); }
.talk__title { font-weight: 500; }
.talk__venue { color: var(--ink-2); font-size: 14.5px; }
.talk__links { display: flex; gap: 7px; }

/* ----- Awards ----------------------------------------------------------- */
.award-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.award {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 24px; display: flex; gap: 16px; align-items: flex-start;
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease);
}
.award:hover { transform: translateY(-3px); border-color: var(--line-2); }
.award__year { font-family: var(--font-mono); font-size: 14px; color: var(--accent); font-weight: 500; padding-top: 2px; }
.award h3 { font-size: 18px; margin-bottom: 4px; }
.award p { color: var(--ink-2); font-size: 14.5px; margin: 0; }

/* ----- Teaching --------------------------------------------------------- */
.teach-list { display: flex; flex-direction: column; gap: 0; }
.teach {
  display: grid; grid-template-columns: 150px 1fr; gap: 20px; align-items: baseline;
  padding: 16px 0; border-top: 1px solid var(--line);
}
.teach:last-child { border-bottom: 1px solid var(--line); }
.teach__term { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); }
.teach__role { font-weight: 500; }
.teach__course { color: var(--ink-2); }

/* ----- Footer (now also holds contact) ---------------------------------- */
.footer {
  border-top: 1px solid var(--line); padding: 40px 28px;
  text-align: center; color: var(--ink-3); font-size: 13.5px;
}
.footer__links { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; margin-bottom: 20px; }
.footer__copy { margin: 0; }

/* ----- Reading-progress rail ------------------------------------------- */
.rail {
  position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 80;
  display: flex; flex-direction: column; align-items: flex-end; gap: 16px;
}
.rail__dot {
  position: relative; width: 9px; height: 9px; border-radius: 50%;
  background: var(--line-2);
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.rail__dot:hover { background: var(--accent); }
.rail__dot.is-active { background: var(--accent); transform: scale(1.5); }
.rail__label {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  white-space: nowrap; font-size: 12px; font-weight: 500; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 3px 9px; border-radius: var(--r-sm);
  opacity: 0; pointer-events: none; transition: opacity 0.2s var(--ease);
}
.rail__dot:hover .rail__label { opacity: 1; }
@media (max-width: 1100px) { .rail { display: none; } }

/* ----- Back to top ------------------------------------------------------ */
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  cursor: pointer; font-size: 20px; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s, background 0.2s var(--ease);
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ----- Modal ------------------------------------------------------------ */
.modal {
  position: fixed; inset: 0; z-index: 150;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  visibility: hidden; perspective: 2200px;
}
.modal.is-open { visibility: visible; }
.modal__overlay {
  position: absolute; inset: 0; background: rgba(8, 14, 28, 0.6);
  opacity: 0; transition: opacity 0.28s var(--ease);
}
.modal.is-open .modal__overlay { opacity: 1; }
/* modal__panel is a FIXED FRAME (not itself scrollable) so that decorative
   elements like the book binding always cover its full height. The inner
   .modal__scroll wrapper is what actually scrolls. */
.modal__panel {
  position: relative; z-index: 1;
  width: min(720px, 100%); max-height: 88vh; overflow: hidden;
  display: flex; flex-direction: column;   /* lets modal__scroll claim the remaining height */
  background: var(--surface); color: var(--ink);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(16px) scale(0.97);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.modal.is-open .modal__panel { opacity: 1; transform: translateY(0) scale(1); }
/* flex (not max-height:100%, which can't resolve against an auto-height
   parent) + min-height:0 (so the flex item is actually allowed to shrink and
   scroll instead of pushing the panel taller) */
.modal__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 36px; }

/* Shelf-only "book page" lightbox: swings open like a cover + paper page. */
.modal--book .modal__panel {
  background: var(--page);
  border-radius: 2px var(--r-lg) var(--r-lg) 2px;
  transform: rotateY(-92deg); transform-origin: left center;
  transition: opacity 0.35s var(--ease), transform 0.55s var(--ease);
}
.modal--book.is-open .modal__panel { transform: rotateY(0deg); }
.modal--book .modal__scroll { padding: 40px 40px 40px 52px; }   /* clears the binding */
/* the book binding — a sibling of the scroll wrapper, so it always spans the
   full panel height regardless of scroll position */
.modal--book .modal__panel::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 22px; pointer-events: none; z-index: 1;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.26), rgba(0, 0, 0, 0.08) 55%, transparent);
  border-radius: 2px 0 0 2px;
}
.modal__close {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center; transition: background 0.2s var(--ease);
}
.modal__close:hover { background: var(--accent-soft); }
.modal__badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.modal__title { font-size: 27px; line-height: 1.18; margin-bottom: 10px; padding-right: 30px; }
.modal__authors { color: var(--ink-2); margin: 0 0 6px; }
.modal__authors strong { color: var(--ink); font-weight: 600; }
.modal__video { position: relative; aspect-ratio: 16 / 9; margin: 22px 0; border-radius: var(--r-md); overflow: hidden; background: #000; }
.modal__media { margin: 22px 0; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.modal__media img { display: block; width: 100%; max-height: 320px; object-fit: cover; }
.modal__video iframe, .modal__video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.modal__abstract-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin: 22px 0 8px; }
.modal__abstract { color: var(--ink-2); font-size: 16px; line-height: 1.75; margin: 0; }
.modal__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.modal__nav { display: flex; justify-content: center; gap: 10px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.modal__navbtn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink); cursor: pointer;
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), border-color 0.16s var(--ease);
}
.modal__navbtn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
[data-theme="dark"] .modal__navbtn:hover { color: var(--paper); }
.modal__navbtn .ic { width: 16px; height: 16px; }
.bibtex { margin-top: 22px; }
.bibtex pre {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 16px; overflow-x: auto; font-family: var(--font-mono); font-size: 13px;
  color: var(--ink-2); line-height: 1.6; margin: 10px 0 0;
}

/* ----- Scroll reveal ---------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.55s var(--ease), transform 0.55s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ----- Responsive ------------------------------------------------------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .hero__portrait { order: -1; width: min(260px, 62vw); margin: 0 auto; }
  .hero__portrait img { max-height: none; }
  .hero__links { margin-top: 20px; }
  .section { padding: 40px 22px; }
  .section--hero { padding-top: calc(var(--nav-h) + 28px); }
}

@media (max-width: 720px) {
  .nav__links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 2px; padding: 12px;
    background: var(--paper); border-bottom: 1px solid var(--line);
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
  }
  .nav__links.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav__links a { padding: 12px 14px; font-size: 16px; }
  .nav__links a.is-active::after { display: none; }
  .nav__burger { display: inline-flex; }

  .pub { grid-template-columns: 1fr; min-height: 0; }
  .pub__media { height: 200px; border-radius: var(--r-md) var(--r-md) 0 0; }
  .pub__body { border-radius: 0 0 var(--r-md) var(--r-md); }
  .talk { grid-template-columns: 1fr; gap: 4px; }
  .talk__links { margin-top: 8px; }
  .teach { grid-template-columns: 1fr; gap: 2px; }
  .modal__scroll { padding: 26px 20px; }
  .modal--book .modal__scroll { padding: 26px 20px 26px 32px; }
}

/* ----- Reduced motion --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
