/* ==========================================================================
   Saleeb Lab — pathology theme
   Light = "Brightfield" (H&E: hematoxylin purple, eosin pink)
   Dark  = "Fluorescence" (DAPI blue, FITC green on black)
   ========================================================================== */

:root {
  --bg: #fbf7f6;
  --bg-alt: #f6edf0;
  --surface: #ffffff;
  --glass: rgba(255, 255, 255, 0.72);
  --ink: #241a35;
  --ink-soft: #4a3e5c;
  --muted: #76697f;
  --line: #eadde3;
  --line-strong: #dac6d0;

  --hema: #4a2e86;        /* hematoxylin */
  --hema-deep: #2f1d5e;
  --eosin: #c9427a;       /* eosin */
  --eosin-soft: #f6d3e1;
  --eosin-tint: #fcecf2;
  --accent: var(--hema);
  --accent-ink: #ffffff;
  --highlight: var(--eosin);

  --scope-metal: linear-gradient(145deg, #3a3346, #17131f);
  --scope-rim: #0f0c15;
  --shadow: 0 1px 2px rgba(36, 26, 53, 0.06), 0 10px 30px -12px rgba(74, 46, 134, 0.22);
  --shadow-lg: 0 30px 80px -30px rgba(74, 46, 134, 0.45);

  --radius: 14px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0a12;
    --bg-alt: #111019;
    --surface: #16141f;
    --glass: rgba(22, 20, 31, 0.72);
    --ink: #eeeaf6;
    --ink-soft: #c9c2d8;
    --muted: #958ca6;
    --line: #24212f;
    --line-strong: #34303f;
    --hema: #8fb3ff;      /* DAPI */
    --hema-deep: #c4d6ff;
    --eosin: #5ee3a1;     /* FITC */
    --eosin-soft: #163428;
    --eosin-tint: #10221b;
    --accent: #8fb3ff;
    --accent-ink: #0b0a12;
    --highlight: #5ee3a1;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 30px 80px -30px rgba(80, 130, 255, 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0a12;
  --bg-alt: #111019;
  --surface: #16141f;
  --glass: rgba(22, 20, 31, 0.72);
  --ink: #eeeaf6;
  --ink-soft: #c9c2d8;
  --muted: #958ca6;
  --line: #24212f;
  --line-strong: #34303f;
  --hema: #8fb3ff;
  --hema-deep: #c4d6ff;
  --eosin: #5ee3a1;
  --eosin-soft: #163428;
  --eosin-tint: #10221b;
  --accent: #8fb3ff;
  --accent-ink: #0b0a12;
  --highlight: #5ee3a1;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 80px -30px rgba(80, 130, 255, 0.35);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .4s ease, color .4s ease;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--eosin); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.12; letter-spacing: -0.015em; margin: 0; color: var(--ink); }
h2 { font-size: clamp(30px, 4vw, 44px); }
h3 { font-size: 21px; }
p { margin: 0 0 1em; }
.mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 16px; }
:focus-visible { outline: 2px solid var(--eosin); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

.label {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--eosin); margin: 0 0 14px;
}
.label::before { content: ""; width: 22px; height: 1.5px; background: currentColor; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font: 500 15px/1 var(--sans);
  text-decoration: none; border: 1.5px solid transparent; cursor: pointer;
  transition: transform .15s ease, background-color .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--eosin); color: #fff; }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--eosin); color: var(--eosin); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 600 20px/1 var(--serif); }
.brand-mark { width: 30px; height: 30px; }
.bm-ring { fill: var(--eosin-soft); stroke: var(--hema); stroke-width: 1.2; }
.bm-nuc { fill: var(--hema); }
.bm-tick { stroke: var(--hema); stroke-width: 1.2; }
nav { margin-left: auto; }
.nav-links { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.nav-links a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink-soft); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav-links a:hover { color: var(--eosin); background: var(--eosin-tint); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.mode-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 9px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft);
  font: 500 12.5px/1 var(--mono); letter-spacing: .04em; cursor: pointer;
}
.mode-toggle:hover { border-color: var(--eosin); }
.mode-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0 18%, #f3c9d9 19% 55%, #4a2e86 56%);
  box-shadow: 0 0 0 1px var(--line-strong);
}
[data-mode="dark"] .mode-dot {
  background: radial-gradient(circle at 35% 35%, #c4d6ff 0 20%, #5a86ff 21% 55%, #0b0a12 56%);
  box-shadow: 0 0 8px #5a86ff;
}
.menu-btn { display: none; width: 40px; height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.menu-btn span { width: 16px; height: 1.6px; background: var(--ink); transition: transform .2s; }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.3px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.3px) rotate(-45deg); }

@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  nav { margin-left: auto; }
  .nav-links {
    position: absolute; left: 0; right: 0; top: 64px;
    flex-direction: column; gap: 0; padding: 8px 16px 16px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 8px; font-size: 17px; }
  .mode-label { display: none; }
  .mode-toggle { padding: 9px; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(40px, 7vw, 96px) 0 clamp(56px, 8vw, 110px);
  background:
    radial-gradient(900px 500px at 85% 30%, color-mix(in srgb, var(--eosin) 14%, transparent), transparent 70%),
    radial-gradient(700px 500px at 0% 100%, color-mix(in srgb, var(--hema) 10%, transparent), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.eyebrow { font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 22px; }
.hero h1 { font-size: clamp(42px, 6.4vw, 80px); line-height: 1.02; letter-spacing: -0.03em; margin-bottom: 24px; }
.hero h1 em { font-style: italic; font-weight: 400; color: var(--eosin); }
.lead { font-size: clamp(17px, 1.6vw, 19.5px); color: var(--ink-soft); max-width: 34em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 40px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0; border-top: 1px solid var(--line); }
.stats > div { padding: 16px 16px 0 0; }
.stats > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.stats dt { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.stats dd { margin: 0; font: 600 clamp(18px, 2vw, 24px)/1.15 var(--serif); }

/* microscope eyepiece */
.scope { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.scope-ring {
  width: min(100%, 500px); aspect-ratio: 1; border-radius: 50%; padding: 18px;
  background: var(--scope-metal);
  box-shadow: var(--shadow-lg), inset 0 2px 1px rgba(255,255,255,.12), inset 0 -3px 6px rgba(0,0,0,.5);
  position: relative;
}
.scope-ring::before { /* knurled rim */
  content: ""; position: absolute; inset: 6px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.06) 0 2deg, transparent 2deg 5deg);
  pointer-events: none;
}
.eyepiece {
  position: relative; width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  background: #f3c9d9; cursor: grab; touch-action: none;
  box-shadow: 0 0 0 3px var(--scope-rim), inset 0 0 50px rgba(0,0,0,.35);
  isolation: isolate;
}
.eyepiece.dragging { cursor: grabbing; }
.eyepiece canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.eyepiece::after { /* vignette */
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, transparent 58%, rgba(20, 8, 30, .28) 82%, rgba(10, 4, 16, .7) 100%);
}
.reticle { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.ret-edge { fill: none; stroke: rgba(0,0,0,.25); stroke-width: .5; }
.ret-line { stroke: rgba(30, 14, 50, .55); stroke-width: .35; fill: none; }
.ret-center { stroke-width: .5; }
.ret-ticks line { stroke: rgba(30, 14, 50, .5); stroke-width: .3; }
[data-mode="dark"] .ret-line, [data-mode="dark"] .ret-ticks line { stroke: rgba(210, 225, 255, .55); }
.scalebar {
  position: absolute; z-index: 3; left: 66%; bottom: 17%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10.5px; color: #1d1030; text-shadow: 0 0 4px rgba(255,255,255,.8); pointer-events: none;
}
.scalebar .bar { height: 3px; background: #1d1030; border-radius: 1px; width: 60px; transition: width .5s ease; }
[data-mode="dark"] .scalebar { color: #e4ecff; text-shadow: 0 0 4px #000; }
[data-mode="dark"] .scalebar .bar { background: #e4ecff; }
.focus-veil { position: absolute; inset: 0; z-index: 1; pointer-events: none; backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); transition: backdrop-filter .35s ease, -webkit-backdrop-filter .35s ease; }
.focus-veil.blur { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

.turret { display: inline-flex; gap: 6px; padding: 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.obj {
  position: relative; min-width: 62px; padding: 9px 14px; border-radius: 999px; border: 0;
  background: transparent; color: var(--ink-soft); font: 500 14px/1 var(--mono); cursor: pointer;
}
.obj::after { /* objective colour band, like real objectives */
  content: ""; position: absolute; left: 50%; bottom: 4px; width: 16px; height: 2px; border-radius: 2px; transform: translateX(-50%);
}
.obj[data-mag="4"]::after { background: #e0463c; }
.obj[data-mag="10"]::after { background: #e8b730; }
.obj[data-mag="40"]::after { background: #3a8de0; }
.obj:hover { color: var(--ink); }
.obj[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }
.scope-cap { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; font-size: 12px; color: var(--muted); }
.scope-cap .hint::before { content: "↔ "; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .scope { margin-top: 8px; }
  .scope-ring { width: min(84vw, 420px); padding: 14px; }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stats > div:nth-child(3) { grid-column: span 2; border-left: 0; padding-left: 0; border-top: 1px solid var(--line); margin-top: 14px; }
}

/* ---------- sections ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section-head { max-width: 720px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-sub { color: var(--muted); font-size: 17.5px; margin-top: 14px; }

/* mission */
.mission { background: var(--bg-alt); border-block: 1px solid var(--line); }
.mission-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.mission-copy h2 { margin-bottom: 22px; }
.mission-copy > p { color: var(--ink-soft); font-size: 18px; max-width: 38em; }
.microscope-art { position: relative; max-width: 360px; margin: 0 auto; width: 100%; }
.microscope { width: 100%; height: auto; overflow: visible; }
.ms-body { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.ms-arm { fill: none; stroke: var(--ink); stroke-width: 20; stroke-linecap: round; }
.ms-dark { fill: var(--ink); }
.ms-obj { fill: var(--ink-soft); }
.ms-obj-active { fill: var(--eosin); }
.ms-knob { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.ms-slide { fill: rgba(200, 230, 255, .55); stroke: var(--ink); stroke-width: 1; }
.ms-slide-label { fill: #fff; stroke: var(--ink); stroke-width: .6; }
.ms-tissue { fill: var(--eosin); }
.ms-bulb { fill: #ffe07a; }
.ms-shadow { fill: color-mix(in srgb, var(--hema) 14%, transparent); }
.ms-lamp { animation: lamp 4s ease-in-out infinite; transform-origin: 96px 216px; }
@keyframes lamp { 50% { opacity: .55; } }
.slide-tag {
  position: absolute; right: 0; top: 12%;
  padding: 6px 10px; border-radius: 6px; font-size: 11px; letter-spacing: .06em;
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink-soft);
  transform: rotate(4deg); box-shadow: var(--shadow);
}

.pi-card {
  margin-top: 34px; display: grid; grid-template-columns: 108px 1fr; gap: 22px; align-items: center;
  padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.pi-card .fov { width: 108px; }
.pi-card h3 { font-size: 22px; margin-bottom: 2px; }
.pi-card .creds { font: 500 12.5px/1.4 var(--mono); color: var(--eosin); margin-bottom: 10px; }
.pi-card ul { margin: 0; padding: 0; list-style: none; font-size: 14.5px; color: var(--ink-soft); line-height: 1.5; }
.pi-card li { padding-left: 14px; position: relative; }
.pi-card li + li { margin-top: 4px; }
.pi-card li::before { content: ""; position: absolute; left: 0; top: .6em; width: 5px; height: 5px; border-radius: 50%; background: var(--hema); }
@media (max-width: 900px) { .mission-grid { grid-template-columns: 1fr; } .microscope-art { max-width: 260px; } }
@media (max-width: 520px) { .pi-card { grid-template-columns: 1fr; } }

/* research themes */
.themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.theme {
  position: relative; padding: 26px 24px 24px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s;
  overflow: hidden;
}
.theme::before { /* stain gradient strip */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--hema), var(--eosin));
}
.theme:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.theme-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--eosin-tint); margin-bottom: 20px; }
.theme-icon svg { width: 32px; height: 32px; }
.ti-fill { fill: var(--eosin-soft); stroke: var(--eosin); stroke-width: 1.6; }
.ti-line { fill: none; stroke: var(--hema); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ti-thin { stroke-width: 1.3; }
.ti-nuc { fill: var(--hema); }
.ti-hl { fill: var(--hema); opacity: .3; }
.theme-mag { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.theme h3 { margin-bottom: 12px; }
.theme p:last-child { color: var(--ink-soft); font-size: 15.5px; margin: 0; }
@media (max-width: 900px) { .themes { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .themes { grid-template-columns: 1fr; } }

/* team */
.team { background: var(--bg-alt); border-block: 1px solid var(--line); }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.member {
  position: relative; padding: 26px 20px 20px; border-radius: var(--radius); text-align: center;
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .25s, box-shadow .25s;
}
.member:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.member .acc { position: absolute; top: 10px; right: 12px; font: 500 10px/1 var(--mono); letter-spacing: .06em; color: var(--muted); }
.fov { position: relative; width: 136px; aspect-ratio: 1; margin: 0 auto 16px; border-radius: 50%; }
.fov img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; filter: saturate(.95); }
.fov::before { /* eyepiece tick ring */
  content: ""; position: absolute; inset: -9px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(var(--line-strong) 0 1.2deg, transparent 1.2deg 10deg);
  -webkit-mask: radial-gradient(circle, transparent 66%, #000 67%);
  mask: radial-gradient(circle, transparent 66%, #000 67%);
}
.fov::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: inset 0 0 0 3px var(--surface), 0 0 0 1.5px var(--line-strong);
  background: radial-gradient(circle, transparent 66%, rgba(20, 8, 30, .22) 100%);
}
.fov .initials { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; background: var(--eosin-soft); color: var(--hema); font: 600 36px/1 var(--serif); }
.member h3 { font-size: 18.5px; margin-bottom: 4px; }
.member .creds { font: 500 11.5px/1.3 var(--mono); color: var(--eosin); margin-bottom: 6px; min-height: 1em; }
.member .role { font-size: 14.5px; color: var(--muted); margin: 0; }

.alumni { margin-top: 48px; padding-top: 28px; border-top: 1px dashed var(--line-strong); }
.alumni h3 { font-size: 12.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.alumni-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.alumni-list li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14.5px; }
.alumni-list li span { font: 500 11.5px/1 var(--mono); color: var(--muted); }

/* publications */
.lead-key { display: inline-block; padding: 1px 8px; border-radius: 4px; background: var(--eosin-tint); color: var(--eosin); font: 500 13px/1.6 var(--mono); }
.pub-controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 14px; }
.search { flex: 1 1 300px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-strong); }
.search:focus-within { border-color: var(--eosin); box-shadow: 0 0 0 3px color-mix(in srgb, var(--eosin) 18%, transparent); }
.search svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 400 16px/1 var(--sans); padding: 13px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft); font: 500 14px/1 var(--sans); cursor: pointer; }
.chip:hover { border-color: var(--eosin); color: var(--eosin); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pub-count { font-size: 12.5px; color: var(--muted); margin: 0 0 18px; }
.pub-year { display: grid; grid-template-columns: 110px 1fr; gap: 24px; padding: 26px 0; border-top: 1px solid var(--line); }
.pub-year > h3 { font: 600 34px/1 var(--serif); color: var(--line-strong); position: sticky; top: 90px; align-self: start; }
[data-mode="dark"] .pub-year > h3 { color: var(--muted); }
.pub-items { display: flex; flex-direction: column; gap: 22px; }
.pub { position: relative; padding-left: 18px; border-left: 2px solid var(--line); }
.pub-title { font: 600 17.5px/1.35 var(--serif); color: var(--ink); text-decoration: none; letter-spacing: -0.005em; }
.pub-title:hover { color: var(--eosin); }
.pub-authors { margin: 6px 0 6px; font-size: 14.5px; color: var(--muted); line-height: 1.55; }
.pub-authors b { color: var(--ink); font-weight: 600; }
.pub-authors b.pi { color: var(--eosin); }
.pub-authors .more { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.pub-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 13.5px; }
.pub-meta .journal { font-style: italic; color: var(--ink-soft); }
.pub-meta a { font: 500 12px/1 var(--mono); text-decoration: none; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--line-strong); color: var(--ink-soft); }
.pub-meta a:hover { border-color: var(--eosin); color: var(--eosin); }
.badge { font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 5px 8px; border-radius: 6px; background: var(--eosin-tint); color: var(--eosin); }
.badge.alt { background: color-mix(in srgb, var(--hema) 12%, transparent); color: var(--hema); }
.pub-empty { padding: 40px 0; color: var(--muted); text-align: center; border-top: 1px solid var(--line); }
.pub-more { margin-top: 32px; color: var(--muted); font-size: 15px; }
@media (max-width: 700px) {
  .pub-year { grid-template-columns: 1fr; gap: 14px; }
  .pub-year > h3 { position: static; font-size: 28px; color: var(--eosin); }
}

/* news */
.news { background: var(--bg-alt); border-block: 1px solid var(--line); }
.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.news-card {
  display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
a.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-strong); color: var(--ink); }
.news-card .tag { font: 500 11.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--eosin); }
.news-card h3 { font-size: 19.5px; line-height: 1.25; }
.news-card p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.news-card .date { margin-top: auto; padding-top: 6px; font: 400 12.5px/1 var(--mono); color: var(--muted); }
.news-card .go { color: var(--accent); font-size: 14px; font-weight: 500; }
.news-card.featured {
  grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center;
  padding: clamp(24px, 4vw, 40px);
  background:
    radial-gradient(500px 300px at 100% 0%, color-mix(in srgb, var(--eosin) 16%, transparent), transparent 70%),
    var(--surface);
  border-color: color-mix(in srgb, var(--eosin) 35%, var(--line));
}
.news-card.featured h3 { font-size: clamp(22px, 2.8vw, 30px); }
.news-card.featured p { font-size: 16.5px; max-width: 46em; }
.news-card.featured .body { display: flex; flex-direction: column; gap: 12px; }
.trophy { width: clamp(80px, 11vw, 120px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: var(--eosin-tint); border: 1px solid color-mix(in srgb, var(--eosin) 30%, transparent); }
.trophy svg { width: 56%; height: 56%; }
.trophy .tr-cup { fill: var(--eosin-soft); stroke: var(--eosin); stroke-width: 1.8; stroke-linejoin: round; }
.trophy .tr-line { fill: none; stroke: var(--eosin); stroke-width: 1.8; stroke-linecap: round; }
@media (max-width: 960px) { .news-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
  .news-grid { grid-template-columns: 1fr; }
  .news-card.featured { grid-template-columns: 1fr; gap: 18px; }
}

/* funding */
.funders { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.funders li { background: var(--surface); padding: 26px 24px; display: flex; align-items: center; gap: 14px; font: 600 17px/1.3 var(--serif); }
.funders li::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--hema); box-shadow: 14px 0 0 -2px var(--eosin); margin-right: 14px; }
@media (max-width: 860px) { .funders { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .funders { grid-template-columns: 1fr; } }

/* contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.slide-glass { /* the contact card looks like a glass slide */
  position: relative; display: grid; grid-template-columns: 74px 1fr; grid-template-rows: auto auto; gap: 0 26px;
  padding: 28px 28px 28px 0; border-radius: 10px;
  background:
    linear-gradient(115deg, rgba(255,255,255,.55), rgba(255,255,255,0) 40%),
    color-mix(in srgb, #cfe6f5 22%, var(--surface));
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
  overflow: hidden;
}
[data-mode="dark"] .slide-glass { background: linear-gradient(115deg, rgba(255,255,255,.05), transparent 40%), var(--surface); }
.slide-frost {
  grid-row: 1 / span 2; align-self: stretch; margin: -28px 0; padding: 18px 0;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px;
  writing-mode: vertical-rl; transform: rotate(180deg);
  background: repeating-linear-gradient(45deg, var(--bg-alt) 0 3px, var(--surface) 3px 6px);
  border-left: 1px solid var(--line-strong);
  font-size: 12px; letter-spacing: .18em; color: var(--ink-soft);
}
.slide-frost span:first-child { font-weight: 500; color: var(--eosin); }
.contact-list { margin: 0 0 22px; display: grid; gap: 18px; }
.contact-list dt { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.contact-list dd { margin: 0; font-size: 16.5px; line-height: 1.55; }
.contact-list a { color: var(--ink); }
.slide-glass .btn { justify-self: start; grid-column: 2; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .slide-glass { grid-template-columns: 48px 1fr; gap: 0 18px; padding-right: 18px; } }

/* footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 14px; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer p { margin: 0; }
.footer a { color: var(--muted); text-decoration: none; font-size: 13px; }
.footer a:hover { color: var(--eosin); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

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

/* ---------- mobile: hero fits one screen ---------- */
@media (max-width: 900px) {
  .hero { min-height: calc(100vh - 64px); display: flex; align-items: center; padding: 20px 0 24px; }
  .hero-grid { gap: 18px; }
  .stats { display: none; }
  .eyebrow { margin-bottom: 10px; font-size: 11px; }
  .hero h1 { font-size: clamp(34px, 10vw, 52px); margin-bottom: 12px; }
  .lead { font-size: 16px; margin-bottom: 0; }
  .hero-cta { margin: 16px 0 0; }
  .hero-cta .btn { padding: 11px 18px; }
  .scope { gap: 10px; margin-top: 0; }
  .scope-ring { width: min(78vw, 34svh, 420px); padding: 10px; }
  .scope-cap { display: none; }
  .obj { min-width: 54px; padding: 8px 12px; }
}

/* resources (under publications) */
.resources { margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--line); }
.resources h3, .trainee-awards h3 { font-size: 12.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.resources ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.resources li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 15.5px; }
.resources li a, .resources .res-t { font-family: var(--serif); font-weight: 600; color: var(--ink); text-decoration: none; }
.resources li a:hover { color: var(--eosin); }
.resources li > span:last-child { color: var(--muted); font-size: 14px; }

/* awards */
.awards-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.award-list { list-style: none; margin: 0; padding: 0; }
.award-list li { display: grid; grid-template-columns: 70px 1fr; gap: 18px; padding: 18px 0; border-top: 1px solid var(--line); }
.award-list li:first-child { border-top: 0; padding-top: 0; }
.aw-year { font-size: 14px; color: var(--eosin); padding-top: 3px; }
.award-list h3 { font-size: 19px; margin-bottom: 4px; }
.award-list p { margin: 0; color: var(--muted); font-size: 15px; }
.trainee-awards { padding: 24px; border-radius: var(--radius); background: var(--bg-alt); border: 1px solid var(--line); }
.trainee-awards ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.trainee-awards li { display: grid; grid-template-columns: 46px 1fr; gap: 2px 12px; font-size: 14.5px; }
.trainee-awards li .mono { grid-row: span 2; color: var(--muted); font-size: 12.5px; padding-top: 2px; }
.trainee-awards li b { font-weight: 600; }
.trainee-awards li span:last-child { color: var(--ink-soft); }
@media (max-width: 860px) { .awards-grid { grid-template-columns: 1fr; } }

/* alumni cards: same as team, a little smaller */
.alumni-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 220px)); }
.member.alum .fov { width: 104px; }
.member.alum h3 { font-size: 17px; }

/* lab group photo */
.group-photo { margin: 0 0 clamp(28px, 4vw, 44px); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.group-photo img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 30%; }
@media (max-width: 600px) { .group-photo img { aspect-ratio: 4 / 3; } }

/* funder logo wall (overrides the earlier text tiles) */
.funders { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.funders li { padding: 0; background: #fff; display: block; }
.funders li::before { content: none; }
.funders a { display: flex; align-items: center; justify-content: center; height: 132px; padding: 22px 26px; transition: background-color .2s; }
.funders a:hover { background: #fbf4f7; }
.funders img { max-width: 100%; max-height: 74px; width: auto; height: auto; object-fit: contain; filter: saturate(.92); transition: filter .2s, transform .2s; }
.funders a:hover img { filter: none; transform: scale(1.03); }
[data-mode="dark"] .funders { background: var(--line); }
[data-mode="dark"] .funders li { background: #f4f2f7; }
@media (max-width: 860px) { .funders { grid-template-columns: repeat(2, minmax(0, 1fr)); } .funders a { height: 112px; padding: 18px; } }
.funders img[src$=".svg"] { height: 62px; }
.funders img[src*="kfoc"] { max-height: 92px; }

/* two group photos side by side, equal heights (columns sized by aspect ratio) */
.group-photos { display: grid; grid-template-columns: 0.75fr 1.323fr; gap: 14px; margin: 0 0 clamp(28px, 4vw, 44px); }
.group-photos .group-photo { margin: 0; }
.group-photos .group-photo img { aspect-ratio: auto; height: 100%; object-fit: cover; }
@media (max-width: 700px) { .group-photos { grid-template-columns: 1fr; } }

/* keep the eyepiece perfectly round on every browser:
   explicit equal width/height, no reliance on aspect-ratio or % heights, never shrink */
.scope-ring { --scope: min(100%, 500px); flex-shrink: 0; }
.eyepiece { position: absolute; inset: 18px; width: auto; height: auto; }
@media (max-width: 900px) {
  .scope-ring {
    --scope: min(78vw, 34vh, 420px);
    width: var(--scope); height: var(--scope); aspect-ratio: auto; padding: 0;
  }
  @supports (height: 1svh) { .scope-ring { --scope: min(78vw, 34svh, 420px); } }
  .eyepiece { inset: 10px; }
}

/* three group photos: equal heights on desktop, swipeable row on phones */
.group-photos { grid-template-columns: 0.75fr 0.885fr 1.323fr; }
@media (max-width: 700px) {
  .group-photos {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px;
    margin-inline: -16px; padding: 0 16px 6px; scrollbar-width: none;
  }
  .group-photos::-webkit-scrollbar { display: none; }
  .group-photos .group-photo { flex: 0 0 auto; height: 300px; scroll-snap-align: center; }
  .group-photos .group-photo img { height: 300px; width: auto; aspect-ratio: auto; }
}

/* mobile: microscope drawing goes below the PI card */
@media (max-width: 900px) { .microscope-art { order: 2; } }

/* mobile: no sideways scrolling for group photos.
   Wide event photo on top, the two tall photos side by side underneath. */
@media (max-width: 700px) {
  .group-photos {
    display: grid; overflow: visible; margin-inline: 0; padding: 0; gap: 8px;
    grid-template-columns: 0.75fr 0.885fr;
  }
  .group-photos .group-photo { height: auto; }
  .group-photos .group-photo img { height: 100%; width: 100%; }
  .group-photos .group-photo:last-child { grid-column: 1 / -1; order: -1; }
}

/* desktop hero: fill exactly one screen and centre the content vertically */
@media (min-width: 901px) {
  .hero {
    min-height: calc(100vh - 65px);
    display: flex; align-items: center;
    padding: 32px 0;
  }
  @supports (height: 1svh) { .hero { min-height: calc(100svh - 65px); } }
  /* shrink the microscope on short laptop screens so everything fits */
  .scope-ring { width: min(100%, 500px, calc(100vh - 300px)); }
  .hero h1 { font-size: clamp(42px, min(6.4vw, 9.5vh), 80px); }
}

/* alumni cards match team cards on mobile (full width) */
@media (max-width: 600px) { .alumni-grid { grid-template-columns: 1fr; } }

/* trainee awards: full width under the main list, in columns */
.awards-grid { grid-template-columns: 1fr; gap: 36px; }
.trainee-awards ul { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px 28px; }

/* scroll-in animations removed: everything is visible immediately */
.reveal { opacity: 1 !important; transform: none !important; transition: none !important; }

/* microscope drawing lamp: switched off in light mode, glowing in dark mode */
.ms-lamp { display: none; }
.ms-bulb { fill: var(--line-strong); }
[data-mode="dark"] .ms-lamp { display: inline; }
[data-mode="dark"] .ms-bulb { fill: #ffe07a; }

/* two group photos, side by side at equal height on every screen size */
.group-photos {
  display: grid; grid-template-columns: 0.75fr 0.885fr; gap: 14px;
  max-width: 860px; margin: 0 auto clamp(28px, 4vw, 44px); padding: 0; overflow: visible;
}
.group-photos .group-photo { height: auto; }
.group-photos .group-photo img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; }
.group-photos .group-photo:last-child { grid-column: auto; order: 0; }
@media (max-width: 700px) { .group-photos { gap: 8px; max-width: none; } }
.group-photos { grid-template-columns: 0.75fr 1.162fr; max-width: 980px; }

/* three group photos: one row at equal height on desktop;
   on phones the dinner photo goes full width on top, the two tall ones side by side below */
.group-photos { grid-template-columns: 0.75fr 0.884fr 1.162fr; max-width: none; }
@media (max-width: 700px) {
  .group-photos { grid-template-columns: 0.75fr 0.884fr; }
  .group-photos .group-photo:last-child { grid-column: 1 / -1; order: -1; }
}
.trainee-awards .ta-sub { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line-strong); }
