/* ===================================================================
 * RTIS — Remoscope site stylesheet (single source of truth)
 * -------------------------------------------------------------------
 * Loaded by index.html and publications.html.
 * Mirrored (snapshot, not live) by style-demo.html — keep in sync
 * manually if demo accuracy matters.
 *
 * Design system reference: ../../STYLE.md
 * Page outline reference:   ../../OUTLINE.md
 *
 * AGENT GUIDE — how this file is organized
 * ----------------------------------------
 * 1. DESIGN TOKENS  (:root)            — colors, fonts, the only place
 *                                         hex values should live.
 * 2. RESET / BASE                       — *,html,body,img,a defaults.
 * 3. LAYOUT          .container         — page width + horizontal gutters.
 * 4. NAV             .nav, .nav-*       — sticky top bar.
 * 5. SECTIONS        section, .eyebrow  — vertical rhythm + section labels.
 * 6. TYPE PRIMITIVES .display .h1 ... .mono  — the type scale.
 *                    Default bottom margins live here. Modifier classes
 *                    (.lead, .intro, .beat, .measure-*) tune rhythm.
 * 7. INTERACTIVE     .cta .pull-stat .text-link — accent-underline pattern.
 * 8. STAT BLOCK      .stat-grid .stat-num .stat-label
 * 9. FIGURE          .figure .figure-caption .status-line
 * 10. HERO           .hero-right .instrument — wireframe + spec strip
 *                    (now in §01); §00 hero uses the FLOW ROW below.
 * 11. TWO-COLUMN     .two-col + variants — generic 2-col layout.
 * 12. FLOW ROW       .flow-row .flow-step .flow-arrow — §02's 3-step grid.
 * 13. DEPLOYMENT     .deployment-banner — full-bleed image strip in §04.
 * 14. EMBEDDING      .embedding-figure — UMAP container in §03.
 * 15. GALLERY        .gallery .gallery-item — §03 demo clips.
 * 16. CONTACT        .contact .contact-actions — §05 layout.
 * 17. REVEAL         .reveal — IntersectionObserver fade-up class.
 *                    Activated by ../js/reveal.js. Respects
 *                    prefers-reduced-motion.
 * 18. FOOTER         footer .footer-*
 * 19. PUBLICATIONS   .pubs-page, .pub-row, .filter-chips — pubs page only.
 *
 * COMMON EDIT POINTS
 * ------------------
 * • Change accent color           → --signal in :root
 * • Change page bg / ink          → --bg / --ink in :root
 * • Swap a typeface               → --serif / --sans / --mono in :root
 *                                   AND update the Google Fonts <link>
 *                                   in index.html and publications.html
 *                                   to load the new family.
 * • Change section vertical pad   → `section { padding: ... }`
 * • Change container max-width    → `.container { max-width: ... }`
 * • Change beat-to-beat spacing   → `.beat { margin-bottom: ... }`
 * • Tune hero composition         → `.hero` and `.hero-right` block
 *
 * RULES OF USE
 * ------------
 * • Never put hex colors anywhere except :root.
 * • Never inline `style="..."` in HTML for design choices — add a
 *   class or modifier here. (One-off margins are tolerable but rare.)
 * • Accent (--signal) is scarce: nav active, hover/focus, key data,
 *   one CTA per section. ≤3% of any viewport.
 * • All transitions/animations must be disabled by
 *   `prefers-reduced-motion: reduce` (see § REVEAL block).
 * =================================================================== */


/* === 1. DESIGN TOKENS ============================================= */
/* The only place hex colors and font-family declarations live. Change
 * here to retheme the site. See STYLE.md for design rationale. */

:root {
  /* Colors */
  --bg:        #FAF9F6;             /* page background, warm off-white */
  --surface:   #F1EFEA;             /* cards, code blocks, quiet plates */
  --ink:       #0F1419;             /* primary text, near-black w/ slate undertone */
  --ink-muted: #5A6470;             /* captions, mono labels, secondary text */
  --rule:      rgba(15, 20, 25, 0.10); /* hairlines = 10% --ink */
  --ink-rgb:   15, 20, 25;          /* --ink as raw channels, for rgba() scrims */
  --white:     #ffffff;             /* on-image text (hero banner, mini-doc) */
  --signal:    #5C94C2;             /* ACCENT — use sparingly (≤3% of viewport) */
  --signal-deep: #356F9F;           /* blue surface with sufficient contrast for white text */
  --ok:        #14532D;             /* status: positive, data viz only */
  --warn:      #92400E;             /* status: warning, data viz only */

  /* Typography */
  --serif: 'Newsreader',     Georgia,        serif;       /* display + headlines */
  --sans:  'Inter',          system-ui,      sans-serif;  /* body + UI */
  --mono:  'JetBrains Mono', ui-monospace,   monospace;   /* numerals, labels, captions */
}

/* === 2. RESET / BASE ============================================== */
/* Hard reset on margins/padding so vertical rhythm is fully owned by
 * type primitives + modifier classes below. `box-sizing: border-box`
 * for predictable width math. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (max-width: 768px) { html { scroll-padding-top: 96px; } }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  /* The §00 hero banner breaks out to 100vw; clip (not hidden, so the
   * sticky nav still works) any sub-pixel horizontal overflow it creates
   * when a vertical scrollbar is present. */
  overflow-x: clip;
  font-size: 16px;
  line-height: 1.55;
  /* tnum = tabular numerals (so stats line up); ss01 = Inter alt-glyph set */
  font-feature-settings: 'tnum' 1, 'ss01' 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }


/* === 3. LAYOUT ==================================================== */
/* The single horizontal container. Every section uses .container to
 * lock content to the readable column width. Edit max-width to widen
 * or narrow the whole site at once. */

.container { max-width: 1200px; margin: 0 auto; padding: 0 64px; }
@media (max-width: 768px) { .container { padding: 0 24px; } }


/* === 4. NAV ======================================================= */
/* The award announcement scrolls away; the translucent nav beneath it
 * becomes sticky at the top of the viewport. */

.award-banner {
  background: #E0FF4F;
  color: var(--ink);
}
.award-banner-link {
  min-height: 56px;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 24px;
  color: inherit;
  text-align: center;
  text-decoration: none;
  font-size: 1rem;
  line-height: 1.35;
}
.award-banner-label {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.award-banner-copy { font-weight: 500; }
.award-banner-cta {
  position: relative;
  padding-bottom: 2px;
  white-space: nowrap;
}
.award-banner-cta::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1.5px;
  background: var(--ink);
  transition: width 150ms ease-out;
}
.award-banner-link:hover .award-banner-cta::after { width: 100%; }
.award-banner-link:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}
@media (max-width: 640px) {
  .award-banner-link { gap: 10px; padding-inline: 24px; font-size: 0.9375rem; }
  .award-banner-label { display: none; }
}

/* Sticky top bar. Translucent + backdrop-filter so content shows
 * through during scroll. Active link gets accent underline. */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(250, 249, 246, 0.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 64px;
  max-width: 1200px;
  margin: 0 auto;
}
@media (max-width: 768px) {
  .nav-inner {
    padding: 12px 24px;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
  }
}
.nav-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  line-height: 1;
  text-decoration: none;
  color: var(--ink);
}
.brand-acronym {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.brand-full {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted, #6b7280);
}
@media (max-width: 768px) {
  .nav-brand { align-items: center; text-align: center; }
}
.nav-links { display: flex; gap: 32px; list-style: none; }
@media (max-width: 768px) { .nav-links { gap: 20px; flex-wrap: wrap; justify-content: center; } }
.nav-links a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
  padding-bottom: 3px;
  white-space: nowrap;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1.5px;
  background: var(--signal);
  transition: width 150ms ease-out;
}
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

/* === 5. SECTIONS ================================================== */
/* Top-level page rhythm. Each <section> has 120px vertical pad and a
 * hairline rule below; .no-rule kills the rule for hero / contact.
 * .eyebrow is the small mono label above each section ("§ 02 / ..."). */

section { padding: 120px 0; border-bottom: 1px solid var(--rule); position: relative; }
section.no-rule { border-bottom: none; }
@media (max-width: 768px) { section { padding: 80px 0; } }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 0.5em;
}
/* Blood-drop icon in place of the OUTLINE's `§` placeholder. Sized
 * relative to the eyebrow's cap height so it scales with the text. */
.eyebrow::before {
  content: '';
  display: inline-block;
  width: 0.85em;
  height: 1.05em;
  background: url('blood-drop.svg') no-repeat center;
  background-size: contain;
  flex-shrink: 0;
}

/* === 6. TYPE PRIMITIVES =========================================== */
/* The type scale — apply as classes on any element. Default bottom
 * margins (.h1, .h2, .mono) own the standard rhythm; modifier classes
 * below tune special cases.
 *
 * Hierarchy rules (per STYLE.md):
 *   • One .display / .h1 per page.
 *   • Mono only for: data values, figure captions, eyebrows,
 *     inline technical fragments (e.g. `5 µL`, `>3.2B cells`).
 *   • <em class="serif"> for italic emphasis in body. */

.display { font-family: var(--serif); font-size: 3.75rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; }
.h1 { font-family: var(--serif); font-size: 2.75rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.1; margin-bottom: 24px; }
.h2 { font-family: var(--serif); font-size: 2rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; margin-bottom: 32px; }
.h3 { font-family: var(--sans); font-size: 1.375rem; font-weight: 600; line-height: 1.25; }
p.h3 { line-height: 1.4; }
.body-lg { font-size: 1.125rem; line-height: 1.55; max-width: 60ch; color: var(--ink-muted); }
.body { font-size: 1rem; line-height: 1.55; max-width: 68ch; }
.small { font-size: 0.875rem; line-height: 1.5; color: var(--ink-muted); }
.mono { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 16px; }
em.serif { font-family: var(--serif); font-style: italic; }

/* Vertical-rhythm modifiers — apply alongside a type primitive
 * (e.g. <h2 class="h1 lead">) to tune the gap that follows. */
.lead { margin-bottom: 96px; }
.intro { margin-bottom: 80px; }
.beat { margin-bottom: 120px; }
.beat:last-child { margin-bottom: 0; }

/* Measure (line-length) utilities — cap text width in `ch` units for
 * readable line lengths. Use these instead of inline `max-width`. */
.measure-22 { max-width: 22ch; }
.measure-24 { max-width: 24ch; }
.measure-30 { max-width: 30ch; }
.measure-60 { max-width: 60ch; }

/* Section-specific overrides — the few rules tied to a single section. */
#contact { padding-top: 56px; }
/* §00 hero is a single full-bleed banner with the headline overlaid; it
 * breaks out of .container and sits flush under the nav. */
section#hero { padding: 0; }
.hero-title { margin-bottom: 16px; }
.hero-tagline {
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--ink-muted);
  max-width: 56ch;
}
.hero-tagline strong { color: var(--ink); font-weight: 600; }
@media (max-width: 900px) { .hero-title { font-size: 2.75rem; } }

/* === §00 HERO BANNER — full-bleed image with overlaid headline ===== */
.hero-banner {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);   /* break out of any container to full-bleed */
  height: clamp(420px, 70vh, 720px);
  overflow: hidden;
  background: var(--ink);          /* fallback while the image loads */
}
.hero-banner-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Pan left-of-centre so the Remoscope clears the left-aligned headline. */
  object-position: 25% 88%;
}
/* Left-weighted scrim so the headline stays readable over a busy image. */
.hero-banner-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(var(--ink-rgb), 0.58) 0%,
    rgba(var(--ink-rgb), 0.34) 42%,
    rgba(var(--ink-rgb), 0.04) 100%);
}
.hero-banner-inner {
  position: relative;              /* above the scrim */
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;     /* sit the headline high so it clears
                                      the instrument lower in the frame */
  padding-top: clamp(40px, 9vh, 88px);
  gap: 12px;
}
/* Lighter scrim → lean on a soft text-shadow to keep the white headline
 * legible over brighter parts of the image. */
.hero-banner-title { color: var(--white); margin-bottom: 8px; max-width: none; text-shadow: 0 1px 16px rgba(var(--ink-rgb), 0.55); }
/* Forced line break after "…deep analysis" so "of cell type and disease
 * state" stays on one line; on narrow screens let it wrap naturally. */
.hero-title-break { display: inline; }
@media (max-width: 640px) { .hero-title-break { display: none; } }
.hero-banner-tagline { color: rgba(255, 255, 255, 0.92); max-width: 52ch; text-shadow: 0 1px 10px rgba(var(--ink-rgb), 0.5); }
.hero-banner-tagline strong,
.hero-banner-tagline em.serif { color: var(--white); }
@media (max-width: 768px) {
  /* Shorter box → wider aspect → less of the image's width is cropped
   * by object-fit:cover on narrow screens. */
  .hero-banner { height: clamp(300px, 46vh, 380px); }
  .hero-banner-inner { padding-top: clamp(24px, 5vh, 48px); }
  /* Wrapped headline can drift over brighter areas on narrow screens —
   * switch to a top→bottom darkening so it stays legible. */
  .hero-banner-scrim {
    background: linear-gradient(
      180deg,
      rgba(var(--ink-rgb), 0.30) 0%,
      rgba(var(--ink-rgb), 0.55) 100%);
  }
  /* Drop the 18ch cap so the headline wraps to the gutter instead of
   * overflowing the narrow viewport, and ease the size down. */
  .hero-banner-title { font-size: 2rem; max-width: 100%; }
  .hero-banner-tagline { font-size: 1.0625rem; max-width: 100%; }
}
@media (max-width: 480px) {
  .hero-banner { height: clamp(240px, 40vh, 320px); }
  .hero-banner-title { font-size: 1.75rem; }
}
/* §04 research/field columns — top-align so the .mono labels (and the
 * h3 lines beneath them) sit on the same baseline regardless of how
 * many lines each column's body wraps to. */
.two-col.tight { gap: 64px; margin-bottom: 48px; align-items: start; }
@media (max-width: 768px) {
  .display { font-size: 2.5rem; }
  .h1 { font-size: 2rem; }
  .h2 { font-size: 1.625rem; }
}

/* === 7. INTERACTIVE — links / CTAs / pull stat =================== */
/* Shared hover pattern: an accent-colored underline grows from 0→100%
 * width over 150ms. No filled buttons in v1. .pull-stat is for inline
 * standout numerals in body text (e.g. <span class="pull-stat">). */

.cta, .pull-stat, .text-link {
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  position: relative;
  padding-bottom: 3px;
  display: inline-block;
}
.cta { white-space: nowrap; }
.pull-stat { font-family: var(--serif); font-weight: 600; }
.cta::after, .pull-stat::after, .text-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1.5px;
  background: var(--signal);
  transition: width 150ms ease-out;
}
.cta:hover::after, .pull-stat:hover::after, .text-link:hover::after { width: 100%; }

/* === 8. STAT BLOCK =============================================== */
/* Big serif numeral + small mono caption. Used in the hero spec strip
 * and inline §02/§03. .cols-2 modifier for two-up grids. */

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 64px; }
.stat-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 768px) { .stat-grid, .stat-grid.cols-2 { grid-template-columns: 1fr; gap: 32px; } }
.stat-num {
  font-family: var(--serif);
  font-size: 3.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 768px) { .stat-num { font-size: 2.25rem; } }
.stat-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 12px;
}
/* §02 foundation-model count: the big serif numeral and its label read
 * as one continuous phrase ("> 3,000,000,000 cells imaged — and
 * counting"), so the label drops mono/uppercase and picks up the serif
 * face at a larger size to flow straight out of the number. */
#ai .stat-grid .stat-label {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ink);
  margin-top: 6px;
}

/* === 9. FIGURE / CAPTION / STATUS LINE =========================== */
/* Generic image-or-video container. .figure-caption is mono and lives
 * directly below. .status-line is a mono line with an accent dot
 * prefix — used for the hero "Now imaging..." line and §04 footer. */

.figure { background: var(--surface); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.figure img, .figure video { width: 100%; height: auto; display: block; }
.figure-caption { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 12px; }

/* Status line: mono caption preceded by an accent dot. */

.status-line {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.status-line::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--signal);
  border-radius: 50%;
  flex-shrink: 0;
}

/* === 10. HERO =================================================== */
/* §00 hero is now a 4-step pipeline row (see FLOW ROW below). The
 * instrument wireframe + spec strip (.hero-right) moved into §01, where
 * .instrument stacks the "Remoscope" title above the wireframe | stats.
 *
 * .hero-right is the image + spec strip pair: stacked by default
 * (image on top, 2-col stats below), side-by-side with a hairline
 * divider at ≥1100px. */

.hero-status { margin-top: 64px; }
.instrument { display: flex; flex-direction: column; gap: 28px; }
.instrument-title { margin-bottom: 0; }
/* §01 problem row: prose on the left, the Remoscope wireframe + specs on
 * the right; top-aligned so the prose heading and the "Remoscope" title
 * start on the same line. The 2×2 pipeline grid follows below. */
.two-col.problem-row {
  align-items: start;
  grid-template-columns: 1fr minmax(0, 400px);
  margin-bottom: 64px;
}
.problem-row .body-lg + .body-lg { margin-top: 20px; }
.hero-right { display: flex; flex-direction: column; gap: 32px; }
.hero-media { background: transparent; aspect-ratio: 4/5; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.hero-media img, .hero-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.hero-media-swap { position: relative; }
.hero-media-swap .hero-media-hover {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 220ms ease;
  pointer-events: none;
}
.hero-media-swap.is-revealed .hero-media-hover { opacity: 1; }
/* Hover reveal only where hover actually exists — on touch the sticky
 * :hover state would keep the wireframe stuck after release. */
@media (hover: hover) {
  .hero-media-swap:hover .hero-media-hover { opacity: 1; }
}
/* Touch devices can't hover — tap the image to toggle the wireframe. */
@media (hover: none) {
  .hero-media-swap { cursor: pointer; }
}
.hero-specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.hero-specs .stat-num {
  font-size: 1.5rem;
  line-height: 1.05;
}
.hero-specs .stat-label { margin-top: 8px; }
@media (max-width: 900px) {
  .hero-status { margin-top: 32px; }
}
/* Wide monitors: give the instrument column room and set the specs
 * beside the wireframe (single column, hairline divider) instead of
 * stacked beneath it. The whole instrument stretches to the prose
 * height so the enlarged wireframe fills the column's bottom whitespace. */
@media (min-width: 1200px) {
  .two-col.problem-row {
    grid-template-columns: 1fr minmax(0, 520px);
    gap: 64px;
    align-items: stretch;
  }
  /* Let the wireframe+specs row absorb the height left below the title. */
  .instrument { height: 100%; }
  .hero-right {
    flex: 1;
    flex-direction: row;
    align-items: stretch;
    gap: 32px;
  }
  /* Drop the 4/5 cap so the render scales up to fill the taller column. */
  .hero-media { flex: 0 0 54%; aspect-ratio: auto; }
  .hero-specs {
    flex: 1 1 auto;
    grid-template-columns: 1fr;
    gap: 18px;
    align-content: center;
    padding-top: 0;
    border-top: none;
    padding-left: 32px;
    border-left: 1px solid var(--rule);
  }
}

/* === 11. TWO-COLUMN ============================================= */
/* Generic 2-up layout. Variants tweak the column ratio:
 *   .text-stats  → 1.3 / 1     (text left, stats right)
 *   .image-right → 1   / 1.1   (image emphasized on the right)
 *   .image-left  → 1.1 / 1     (image emphasized on the left)
 * Stacks below 900px. */

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 96px;
  align-items: center;
}
.two-col.text-stats { grid-template-columns: 1.3fr 1fr; }
.two-col.image-right { grid-template-columns: 1fr 1.1fr; }
.two-col.image-left { grid-template-columns: 1.1fr 1fr; }
@media (max-width: 900px) {
  .two-col, .two-col.text-stats, .two-col.image-right, .two-col.image-left,
  .two-col.problem-row {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

/* === 12. FLOW ROW (§02) ======================================== */
/* Three figures in a horizontal grid with mono → arrows between them.
 * Tells the story: flow cell → machine → cells. Each .flow-step has
 * a square figure on top, mono label, and short serif title.
 * Stacks vertically below 900px and rotates the arrows 90°. */

.flow-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 24px;
  margin-bottom: 24px;
}
/* §00 hero 2×2: live imaging + morphology map (top row, the outputs),
 * flow cell + hardware (bottom row, the enablers). Outputs-first — the
 * top row leads with what comes out (cells imaged + classified live),
 * the bottom row shows what makes it possible. Four pillars, not a staged
 * pipeline (no step numbers). Each tile carries a mono category label
 * (Data · Analysis · Flow cell · Hardware) + short caption so the story
 * lands at a glance. It is a <ul> — strip the default list chrome. */
.flow-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px 32px;
  margin-bottom: 0;
  list-style: none;
}
/* The pipeline now reads as a four-beat sequence in §01: collection →
 * consumable → Remoscope (live imaging on-screen) → AI analysis, with
 * the cumulative workflow timeline below. */
/* All four pipeline figures are equal-height squares, so the captions are
 * top-aligned directly beneath them — every eyebrow label lands on the same
 * line regardless of caption length. (The default .flow-step bottom-aligns
 * captions, which staggers tiles with shorter captions lower.) */
.flow-grid-2x2 .flow-step { grid-template-rows: auto 1fr; }
.flow-grid-2x2 .flow-step > .figure { align-self: start; }
.flow-grid-2x2 .flow-step > .flow-cap { align-self: start; }
@media (min-width: 901px) {
  .flow-grid-2x2 { row-gap: 56px; }
}
/* Size each tile by aspect ratio so its height tracks the column width —
 * the figure fills the full width of the caption/text box beneath it
 * instead of being capped short. max-height keeps two rows from blowing
 * past the viewport on tall/narrow windows. */
.flow-grid-2x2 .figure {
  height: auto;
}
/* The AI-analysis video fills its (taller) tile via cover, so it scales
 * up with the box instead of leaving surface whitespace. The flow-cell
 * render stays contained + scaled down (below) — enlarging it just
 * exposes its built-in margins. */
.flow-grid-2x2 .figure > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* DEVICE COMPOSITE ─ the Remoscope render (1080×1080 native) with the
 * live cell video warped onto its on-screen liveviewer panel.
 * The figure is square to match the render. .device-stage is a fixed
 * 1080px coordinate space scaled to the tile width by device-screen.js
 * (sets --device-scale = tileWidth / 1080); both the render and the
 * matrix3d-warped video live in that space so they stay locked together
 * at any size. */
.flow-grid-2x2 .fig-device {
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.flow-grid-2x2 .fig-device .device-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 1080px;
  height: 1080px;
  transform-origin: top left;
  /* device-screen.js sets --device-scale = tileWidth / 1080. The tiny
   * fallback keeps the un-scaled 1080px stage from flashing full-size
   * before the script runs. */
  transform: scale(var(--device-scale, 0.001));
}
.flow-grid-2x2 .fig-device .device-stage > img {
  width: 1080px;
  height: 1080px;
  object-fit: none;
  filter: none;
  mix-blend-mode: normal;
}
/* The video box is the full screen's un-projected rectangle (341×212 in
 * the 1080 space); matrix3d maps its four corners onto the screen-plane
 * quad (corners TL 279,428 · TR 614,457 · BR 596,668 · BL 252,639 —
 * bottom edge dropped ~10px to fully fill the screen glass). */
.flow-grid-2x2 .fig-device .device-screen-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 341px;
  height: 212px;
  object-fit: cover;
  border-radius: 12px;
  filter: none;
  mix-blend-mode: normal;
  transform-origin: 0 0;
  transform: matrix3d(0.988833, 0.089829, 0, 0.000010, -0.158236, 0.916987, 0, -0.000123, 0, 0, 1, 0, 279, 428, 0, 1);
}
/* The consumable tile shows the flow cell with a drop of blood, scaled
 * down + dimmed slightly to match the other renders' visual weight. */
.flow-grid-2x2 .fig-flowcell { position: relative; }
.flow-grid-2x2 .fig-flowcell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(0.78);
  filter: brightness(0.88);
}
/* Sample-volume label overlaid near the blood droplet on the render. */
.flow-grid-2x2 .fig-flowcell .flowcell-vol {
  position: absolute;
  top: 26%;
  right: 22%;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
  white-space: nowrap;
}

/* COLLECTION ─ a small line-art dropper (matching the wireframe instrument
 * line drawing) above the sample sources, so the tile carries visual weight
 * like the render tiles. Transparent (page) background; the whole block is
 * centred vertically and horizontally to share the row's midline and sit
 * under the timeline node above. */
.fig-collection.fig-sources {
  background: transparent;
  align-items: stretch;
}
.sample-sources {
  display: flex;
  flex-direction: column;
  justify-content: center;     /* share the row midline with the renders */
  align-items: center;         /* centred under the timeline node above */
  text-align: center;
  width: 100%;
  height: 100%;
  padding: clamp(12px, 5%, 24px);
}
/* Sample sources shown as four outline icons in a 2×2 grid, no labels.
 * Icons inherit --ink via currentColor. */
.src-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, auto);
  justify-content: center;
  justify-items: center;
  align-items: center;
  row-gap: clamp(20px, 9%, 40px);
  column-gap: clamp(12px, 4%, 20px);
}
.src { display: flex; }
.src-ico { width: clamp(44px, 22%, 60px); height: auto; color: var(--ink); }

/* The device render sits in its tile at native scale — the old hero
 * blow-up (which filled whitespace beside the headline) is no longer
 * needed now the grid is a balanced 2×2 within §01. */

/* Per-tile caption: a mono step label, a short serif title, and one
 * mono sub-line. The live-cell counter reuses .flow-cap-sub on tile 03. */
.flow-cap { display: flex; flex-direction: column; gap: 4px; }
.flow-cap-step {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--signal);
}
.flow-cap-title {
  font-family: var(--serif);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.2;
  color: var(--ink);
}
.flow-cap-sub {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}
.flow-step-foot { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 900px) {
  /* Four-across is too tight on tablets — wrap to a 2×2. */
  .flow-grid-2x2 { grid-template-columns: 1fr 1fr; gap: 32px; }
  .flow-grid-2x2 .figure { height: clamp(220px, 42vh, 420px); }
  /* The device composite must stay square so the warped screen video
   * keeps registration — let it size by aspect ratio, not the clamp. */
  .flow-grid-2x2 .fig-device { height: auto; }
}
@media (max-width: 560px) {
  .flow-grid-2x2 { grid-template-columns: 1fr; }
}
/* Stretch each step to the row's full height (the sample-gallery
 * column is the tallest). Use a 1fr / auto row pair so the figure
 * (or gallery) is vertically centered in the leftover space while
 * all three titles sit on the same baseline at the bottom. */
.flow-step { display: grid; grid-template-rows: 1fr auto; gap: 16px; }
.flow-step > .figure,
.flow-step > .sample-gallery { align-self: center; }
.flow-step .figure {
  background: transparent;
  aspect-ratio: 1 / 1;
  width: 100%;
  position: relative;
}
.figure-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  z-index: 2;
  pointer-events: none;
}
.figure-overlay .spec {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
}
.flow-step .figure img,
.flow-step .figure video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* The clips render on a flat near-white (#F8F8F8 = 248) that reads as a
 * cool rectangle against the warm page bg. `multiply` blends a light
 * background into the page — but only maps to the page colour exactly
 * when the source is pure white (255). So we first nudge brightness so
 * 248 → 255, then multiply lands the background precisely on the page
 * colour and the edge disappears, while the dark cells stay dark. */
.flow-step .figure video {
  filter: brightness(1.03);   /* 248 × 1.03 ≈ 255 */
  mix-blend-mode: multiply;
}
.flow-step .figure.placeholder {
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* --- VIDEO CALLOUT OVERLAY -----------------------------------------
 * A transparent PNG (arrows + cell-type labels) laid over the video.
 * Make the PNG the same square aspect as the video so the two line up,
 * and it scales together with the video automatically. */
.video-callout-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;    /* matches the video's contain-fit box */
  z-index: 3;
  pointer-events: none;   /* clicks/hover pass through to the video */
}
.flow-step-title {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.3;
}
.flow-arrow {
  font-family: var(--mono);
  font-size: 1.5rem;
  color: var(--ink-muted);
  line-height: 1;
  user-select: none;
  align-self: center;
}
@media (max-width: 900px) {
  .flow-row { grid-template-columns: 1fr; gap: 32px; }
  .flow-arrow { transform: rotate(90deg); justify-self: center; }
}

/* === WORKFLOW COMPARISON — straight timelines (§01) ============ */
/* Conventional manual workflow (7 nodes) above the Remoscope run, both as
 * straight horizontal timelines. .htl is a generic N-node track: its connecting
 * line spans the first/last node centers via --cols (= 100/cols/2 in from each
 * edge). Filled dot = hands-on, hollow = unattended wait; .htl-sub flags the
 * step's nature. */
.flow-compare {
  margin: 8px 0 0;
}
.flow-compare + .flow-compare {
  margin-top: 30px;
}
.flow-compare-cap {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 16px;
}
/* Remoscope caption carries the speed stat — a touch larger, the number bold. */
.flow-compare.is-remo .flow-compare-cap {
  color: var(--signal);
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.3;
  margin-bottom: 20px;
}
.flow-compare.is-remo .fc-x {
  font-weight: 600;
}
.htl {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), 1fr);
  margin: 0;
  position: relative;
}
.htl::before {
  content: "";
  position: absolute;
  left: calc(100% / var(--cols, 4) / 2);
  right: calc(100% / var(--cols, 4) / 2);
  top: 31px;             /* dot-row center, matches .pipeline-timeline */
  height: 2px;
  background: var(--rule);
}
.htl-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 0 6px;
}
.htl-dur {
  height: 1rem;
  line-height: 1rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.htl-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--ink-muted);
  position: relative;
  z-index: 1;
}
/* All nodes are uniform hollow grey dots. */
.htl-step.is-wait .htl-dot,
.htl-step.is-hand .htl-dot { background: var(--bg); border-color: var(--ink-muted); }
.htl-label {
  font-family: var(--serif);
  font-size: 0.98rem;
  line-height: 1.2;
  color: var(--ink);
}
.htl-sub {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: -4px;
}
.htl-sub.is-reagent { color: var(--signal); }
@media (max-width: 640px) {
  /* Vertical rail, mirroring the simple timeline's narrow layout. */
  .htl { grid-template-columns: 1fr; gap: 22px; }
  .htl::before {
    left: 7px; right: auto;
    top: 24px; bottom: 24px;
    width: 2px; height: auto;
  }
  .htl-step {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    text-align: left;
    column-gap: 12px;
    row-gap: 2px;
    padding: 0;
    grid-column: auto !important;   /* reset the desktop 1·3·5·7 placement */
  }
  .htl-dot { order: 1; align-self: center; }
  .htl-label { order: 2; }
  .htl-dur { order: 3; height: auto; margin-left: auto; }
  .htl-sub { order: 4; flex-basis: 100%; margin: 0; padding-left: 26px; }
}

/* Plain figure variant — no surface bg, lets transparent renders sit
 * directly on the page. (Source PNGs already have alpha — see
 * assets/_remove_bg.py for the script that stripped white plates.) */
.figure.plain { background: transparent; padding: 0; }
.figure.plain img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Sample-type grid (§02, §03) — every sample shown at once as an equal
 * tile (a specimen/contact-sheet read), captioned in mono below.
 * Static, no JS: replaced the click-through carousel so the breadth
 * of sample types is visible immediately. 3-up on desktop, 2-up on
 * narrow screens. (The carousel rules below are still used by §03.) */
/* This §02 headline runs long ("Same hardware. Many samples. Unlimited
 * applications.") and must stay on one line on wide screens. 2.25rem is
 * the largest size that holds one line within the container down to
 * ~1130px viewport (all real desktop/laptop widths). Phrases are wrapped
 * in `.nowrap` spans so each stays intact; when the window gets too
 * small the heading breaks at phrase boundaries (dropping "Unlimited
 * applications." to a new line) instead of overflowing the gutter.
 * Scoped to #hardware. */
#hardware .h1 { font-size: 2.25rem; }
.nowrap { white-space: nowrap; }

.sample-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 24px;
}
.sample-tile {
  position: relative;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sample-tile img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--rule);
  background: var(--surface);
}
/* In-image label pinned to the tile's top-left (e.g. the §03 UMAP's
 * "Sepsis probability" colormap legend). Non-interactive overlay. */
.sample-tile .slide-overlay {
  position: absolute;
  top: 6px;
  left: 6px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  pointer-events: none;
  z-index: 1;
}
/* Parasite-stage colour key pinned inside the cell-classification tile.
 * Swatch colours mirror the YOGO box colours in the image exactly. Sits
 * on a translucent plate so it stays legible over the cells. */
.cell-id-legend {
  position: absolute;
  top: 6px;
  left: 6px;
  margin: 0;
  padding: 4px 6px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(248, 248, 248, 0.82);
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.58rem;
  line-height: 1.2;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink);
  pointer-events: none;
  z-index: 1;
}
.cell-id-legend-title {
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1px;
}
.cell-id-legend .legend-row { display: flex; align-items: center; gap: 5px; }
.cell-id-legend .swatch {
  width: 8px;
  height: 8px;
  flex: none;
  border: 1px solid rgba(0, 0, 0, 0.2);
}
.cell-id-legend .swatch-ring { background: #f02020; }
.cell-id-legend .swatch-troph { background: #f08000; }
.cell-id-legend .swatch-schizont { background: #f0d000; }

/* Mirror the carousel caption styling so the two §02/§03 registers
 * read identically; the linked tiles (malaria → paper, sepsis →
 * case study) keep the discoverable accent + underline treatment. */
.sample-tile figcaption {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}
.sample-tile figcaption a {
  color: var(--signal);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sample-tile figcaption a:hover { text-decoration-thickness: 2px; }
@media (max-width: 900px) {
  .sample-grid { grid-template-columns: repeat(2, 1fr); gap: 20px 16px; }
}

/* §03 applications: hovering a tile fades a 1–2 sentence blurb over the
 * image, reusing the hero wireframe's opacity-swap mechanism. The plate
 * covers only the image (matching its 4/3 box), leaving the mono
 * caption below untouched. On touch, .is-revealed is toggled by tap. */
/* Wraps only the image, so the blurb overlay (inset: 0) matches the
 * image box exactly and never grows past it, whatever the text length. */
.sample-media { position: relative; display: block; }
.sample-blurb {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 10px;
  background: rgba(var(--ink-rgb), 0.86);
  border: 1px solid var(--rule);
  opacity: 0;
  transition: opacity 220ms ease;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}
.sample-blurb p {
  font-family: var(--sans);
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: left;
  color: var(--white);
  margin: 0;
}
.sample-tile.is-revealed .sample-blurb { opacity: 1; }
@media (hover: hover) {
  .sample-tile:hover .sample-blurb { opacity: 1; }
}
@media (hover: none) {
  .sample-tile { cursor: pointer; }
}

/* Sample-type gallery (§03 inline) — center slide is sharp; the
 * neighbors peek in blurred as if they were the next slides on a
 * turntable. (§02 now uses the static .sample-grid above.)
 * Manual-only: stepped via the injected prev/next arrows or by
 * clicking a neighbor. Driven by assets/home/gallery.js, which sets
 * .is-active / .is-prev / .is-next on the slides.
 *
 * Default layout is horizontal (prev|active|next). On wide screens
 * (≥1100px) the carousel switches to vertical (prev stacked above
 * active, next below). Use .sample-gallery-inline when embedded in a
 * narrow column (e.g. a flow-step) to scale slide widths up. */
.sample-gallery {
  position: relative;
  margin-top: 48px;
  height: 380px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* §02 gallery caption — centered under the standalone carousel. */
.hardware-caption { text-align: center; max-width: 52ch; margin: 32px auto 0; }
.sample-slide {
  position: absolute;
  margin: 0;
  width: 60%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
  filter: blur(10px);
  transform: translate(0, 0) scale(0.6);
  transition: transform 1100ms cubic-bezier(0.4, 0, 0.2, 1),
              opacity 1100ms ease,
              filter 1100ms ease;
  pointer-events: none;
  z-index: 1;
}
.sample-slide.is-prev,
.sample-slide.is-next { cursor: pointer; pointer-events: auto; }
.sample-slide.is-active {
  opacity: 1;
  filter: none;
  transform: translate(0, 0) scale(1);
  z-index: 3;
  pointer-events: auto;
}
.sample-slide.is-prev {
  opacity: 0.45;
  filter: blur(6px);
  transform: translate(-72%, 0) scale(0.85);
  z-index: 2;
}
.sample-slide.is-next {
  opacity: 0.45;
  filter: blur(6px);
  transform: translate(72%, 0) scale(0.85);
  z-index: 2;
}
.sample-slide img {
  width: 100%;
  height: 280px;
  object-fit: contain;
}
.sample-slide figcaption {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}
/* A caption can link out (e.g. Sepsis → case study, Malaria → paper).
 * Show it's clickable: accent color + underline, with a cursor. */
.sample-slide figcaption a {
  color: var(--signal);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.sample-slide figcaption a:hover { text-decoration-thickness: 2px; }

/* In-image label, pinned to the top-left of a slide (e.g. the
 * "Sepsis probability" colormap legend on the UMAP). Sits over the
 * transparent PNG; non-interactive so neighbor-clicks still advance. */
.sample-slide .slide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  z-index: 1;
  pointer-events: none;
}

/* Prev/next arrow controls — injected by gallery.js. Hairline disc,
 * muted chevron; accent (--signal) only on hover/focus, matching the
 * site's restrained "no filled buttons" interaction style. Default
 * layout is horizontal (prev left / next right). The inline gallery
 * goes vertical at ≥901px, so its arrows move to top/bottom and the
 * chevrons rotate a quarter-turn (see the inline media query below). */
.sample-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease;
}
.sample-nav:hover { color: var(--signal); border-color: var(--signal); }
.sample-nav:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.sample-nav svg { width: 16px; height: 16px; display: block; }
.sample-nav-prev { left: 6px; }
.sample-nav-next { right: 6px; }

/* Inline variant — used inside a flow-step column. Whenever the
 * flow-row is in its 3-column layout (>900px) the column is too
 * narrow for a horizontal peek-neighbor carousel, so the inline
 * gallery goes vertical there. Below 900px the flow-row stacks and
 * the inline gallery has the full container width, so it falls back
 * to the same horizontal layout as the standalone gallery. */
.sample-gallery-inline { margin-top: 0; }
@media (min-width: 901px) {
  .sample-gallery-inline { height: 460px; }
  .sample-gallery-inline .sample-slide { width: 92%; max-width: none; }
  .sample-gallery-inline .sample-slide img { height: 260px; }
  .sample-gallery-inline .sample-slide.is-active { transform: translate(0, 0) scale(1); }
  .sample-gallery-inline .sample-slide.is-prev { transform: translate(0, -60%) scale(0.7); }
  .sample-gallery-inline .sample-slide.is-next { transform: translate(0, 60%) scale(0.7); }

  /* Vertical layout → arrows move to top/bottom, chevrons rotate a
   * quarter-turn so prev points up and next points down. */
  .sample-gallery-inline .sample-nav-prev {
    top: 6px; bottom: auto; left: 50%; right: auto; transform: translateX(-50%);
  }
  .sample-gallery-inline .sample-nav-next {
    top: auto; bottom: 6px; left: 50%; right: auto; transform: translateX(-50%);
  }
  .sample-gallery-inline .sample-nav svg { transform: rotate(90deg); }
}

/* Larger-active variant for inline galleries that live in a wider
 * container (e.g. a two-col cell rather than a flow-step). Bigger
 * active image, smaller and tighter neighbors so peek matches the
 * horizontal-mode aesthetic. */
@media (min-width: 901px) {
  .sample-gallery-inline.sample-gallery-large { height: 480px; }
  .sample-gallery-inline.sample-gallery-large .sample-slide img { height: 360px; }
  .sample-gallery-inline.sample-gallery-large .sample-slide.is-prev { transform: translate(0, -82%) scale(0.62); }
  .sample-gallery-inline.sample-gallery-large .sample-slide.is-next { transform: translate(0, 82%) scale(0.62); }
}

@media (max-width: 900px) {
  .sample-gallery { height: 440px; }
  .sample-slide { width: 80%; }
  .sample-slide img { height: auto; max-height: 300px; }
  .sample-slide.is-prev { transform: translate(-90%, 0) scale(0.7); }
  .sample-slide.is-next { transform: translate(90%, 0) scale(0.7); }
  .sample-slide figcaption { font-size: 0.75rem; }
}

/* Cells → UMAP composition (§03)
 * Live-cell gif on top, an animated UMAP fill gif beside it. Earlier
 * a streaming-canvas variant lived here (see archive/assets/js/
 * umap-stream.js + archive/assets/data/), kept commented in index.html
 * for easy revert. */
.cells-umap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 16px 0;
}
.cells-umap-live {
  margin: 0;
  background: transparent;
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 560px;
}
.cells-umap-live img,
.cells-umap-live video {
  width: 100%;
  height: auto;
  display: block;
}
.cells-umap-arrow {
  font-family: var(--mono);
  font-size: 1.5rem;
  color: var(--ink-muted);
  line-height: 1;
  user-select: none;
}
.umap-stream {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: transparent;
}
.umap-stream canvas,
.umap-stream img,
.umap-stream video {
  display: block;
  width: 100%;
  height: 100%;
}
.umap-stream.cells-umap-anim { margin: 0; }
.umap-stream.cells-umap-anim img,
.umap-stream.cells-umap-anim video { object-fit: contain; }
.umap-counter {
  font-family: var(--mono);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
}
.umap-counter-num {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.umap-counter-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.umap-counter-note {
  font-size: 0.82em;
  opacity: 0.65;
}
@media (max-width: 768px) {
  .umap-stream { aspect-ratio: 4 / 3; }
}

.cells-umap-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  width: 100%;
  max-width: 560px;
}
.cells-umap-side .cells-umap-live { width: 100%; max-width: none; }

/* Wide layout — gif (with counter beneath) and stream side by side,
 * equal width, equal aspect (matched to the gif's native 560×419). */
@media (min-width: 900px) {
  .cells-umap { flex-direction: row; align-items: center; justify-content: center; gap: 24px; }
  .cells-umap-side { flex: 1 1 0; min-width: 0; max-width: 560px; }
  .cells-umap-live img,
  .cells-umap-live video { width: 100%; height: 100%; object-fit: contain; }
  .umap-stream { flex: 1 1 0; min-width: 0; max-width: 560px; aspect-ratio: 560 / 419; }
}

/* === 13. DEPLOYMENT BANNER (§04) =============================== */
/* Full-width image strip showing the device deployed in a real
 * clinic. Capped at 480px tall, object-fit cover anchored 20% above
 * the source's bottom edge so the deployed scene (device + surface)
 * stays in view without bumping right against the frame edge. */

.deployment-banner {
  width: 100%;
  margin: 48px 0 64px;
  overflow: hidden;
  background: var(--surface);
}
.deployment-banner img {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
  object-position: center 80%;
  display: block;
}

/* === MINI-DOC FEATURE (§04) — full-bleed click-to-play banner === */
/* Reuses the old deployment-banner footprint: a full-width strip that
 * links out to the mini documentary, with a centered play affordance. A
 * facade (no third-party embed on load) — a real link, so it works
 * without JS and loads nothing from YouTube until clicked. */
.minidoc-banner {
  position: relative;
  display: block;
  width: 100%;
  margin: 48px 0 0;
  overflow: hidden;
  background: var(--surface);
}
.minidoc-banner img {
  width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: cover;
  object-position: center 90%;
  display: block;
  transition: transform 300ms ease, filter 300ms ease;
}
.minidoc-banner:hover img { transform: scale(1.02); filter: brightness(0.9); }
.minidoc-banner:focus-visible { outline: 2px solid var(--signal); outline-offset: -4px; }
.minidoc-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 84px;
  height: 84px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(var(--ink-rgb), 0.55);
  border: 2px solid rgba(255, 255, 255, 0.9);
  transition: background 150ms ease, transform 150ms ease;
}
.minidoc-banner:hover .minidoc-play {
  background: var(--signal);
  transform: translate(-50%, -50%) scale(1.05);
}
.minidoc-play::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 14px 0 14px 22px;       /* right-pointing play triangle */
  border-color: transparent transparent transparent var(--white);
}
.minidoc-cap { text-align: center; margin-top: 16px; }
@media (max-width: 900px) {
  .minidoc-play { width: 64px; height: 64px; }
  .minidoc-play::after { border-width: 11px 0 11px 17px; }
}

/* === 14. EMBEDDING FIGURE (§03) ================================ */
/* Container for the UMAP image. Pure breathing-room padding around
 * the alpha-cut PNG — no border, no surface fill. */

.embedding-figure { background: var(--bg); padding: 32px; }
.embedding-figure img { width: 100%; height: auto; display: block; }

/* Mono link beneath the streaming UMAP gif — clicks through to the
 * summary crop wall (assets/home/crop_5k_43_xl_summary.png).
 * Centered under the cells-umap layout, modest top spacing so it
 * sits clearly under the figure without crowding it. */
.crop-summary-link {
  margin: 24px 0 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}
.crop-summary-link a {
  color: var(--ink-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.crop-summary-link a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* === 15. DEMO GALLERY (§03) ==================================== */
/* 3-up grid of short clips/figures with caption strips. Stacks to
 * single column below 768px. Currently placeholder content — replace
 * the `[ … ]` divs with <video> or <img> when assets land.
 *
 * .figure.cell-figure: variant for cell_line.png (transparent line
 * drawing traced from the raw microscopy crop). Smooth scaling so
 * the stepped raster outlines anti-alias cleanly at smaller sizes.
 * Source pipeline: cell_crop.png → assets/_cell_to_line.py →
 * cell_line.png + cell_line.svg. */

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 768px) { .gallery { grid-template-columns: 1fr; } }
.gallery-item {
  background: var(--surface);
  aspect-ratio: 4/3;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
}
.gallery-item .figure { flex: 1; }
.gallery-item .figure-caption { padding: 12px 16px; margin-top: 0; background: var(--bg); border-top: 1px solid var(--rule); }

/* Cell figure — used for cell_line.png (transparent line trace).
 * Default smooth scaling lets the stepped raster outlines anti-alias
 * cleanly when shown smaller than native resolution. */
.figure.cell-figure { background: var(--bg); overflow: hidden; padding: 16px; }
.figure.cell-figure img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* === 16. CONTACT (§05) ========================================= */
/* Headline + body on the left, secondary CTAs on the right, both
 * baseline-aligned. Stacks below 768px. */

.contact {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 64px;
  align-items: end;
}
.contact-actions { display: flex; gap: 32px; flex-wrap: wrap; }
@media (max-width: 768px) { .contact { grid-template-columns: 1fr; gap: 32px; } }

/* Team — headshots + names linking to LinkedIn. */
.team { margin-top: 80px; text-align: center; }
.team-title { margin-bottom: 40px; }
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  list-style: none;
  max-width: 720px;
  margin: 0 auto;
}
.team-member a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
}
.team-member img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 16px;
  filter: grayscale(1);
}
.team-member a:hover img { filter: grayscale(0); }
.team-name {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.team-member a:hover .team-name { color: var(--signal); }
@media (max-width: 768px) {
  .team-grid { gap: 24px; }
  .team-member img { width: 100%; max-width: 140px; height: auto; aspect-ratio: 1; }
}

/* === 17. REVEAL — fade-up on viewport entry ==================== */
/* Add `class="reveal"` to any element. assets/shared/reveal.js uses an
 * IntersectionObserver to add `.is-in` once it crosses 30% in view,
 * then unobserves it (one-shot per element).
 *
 * Reduced-motion: the @media block disables the transition entirely
 * AND reveal.js short-circuits to immediately add .is-in. So content
 * is always visible even if JS hasn't run or motion is suppressed. */

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 320ms ease-out, transform 320ms ease-out;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* === 17.5 COLLABORATION LINE ==================================== */
/* Single greyed cdot-separated line of partner institutions,
 * placed at the bottom of the §05 contact block. */

.collab-line {
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--ink-muted);
  opacity: 0.8;
  text-align: center;
  margin-top: 64px;
}
.collab-label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.collab-orgs {
  display: block;
}

/* === 18. FOOTER ================================================ */
/* Single hairline above; mono meta-line on the left, mono links on
 * the right. Stacks below 768px. */

footer { padding: 32px 0 48px; border-top: 1px solid var(--rule); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; }
@media (max-width: 768px) { .footer-inner { flex-direction: column; gap: 16px; align-items: flex-start; } }
.footer-meta { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.footer-links a {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  margin-left: 24px;
  position: relative;
  padding-bottom: 3px;
}
@media (max-width: 768px) { .footer-links a { margin-left: 0; margin-right: 24px; } }
.footer-links a:hover { color: var(--ink); }

/* === 19. PUBLICATIONS PAGE ===================================== */
/* Scoped under <body class="pubs-page">. Archive layout: serif
 * page title, mono filter chips, then a list of .pub-row items.
 * Filtering is done by the inline script in publications.html
 * (toggles row display via the data-filter / data-type pair). */

.pubs-page header { padding: 120px 0 64px; border-bottom: 1px solid var(--rule); }
.pubs-page header h1 { font-family: var(--serif); font-size: 2.75rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.1; }
.filter-chips { display: flex; gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.filter-chips a {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-decoration: none;
  position: relative;
  padding-bottom: 3px;
}
.filter-chips a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1.5px;
  background: var(--signal);
  transition: width 150ms ease-out;
}
.filter-chips a.active::after,
.filter-chips a:hover::after { width: 100%; }
.filter-chips a.active { color: var(--ink); }

.pub-row {
  display: grid;
  grid-template-columns: 80px 100px 1fr auto;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.pub-row .year, .pub-row .type { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-muted); }
.pub-row .title { font-family: var(--serif); font-style: italic; font-size: 1.125rem; line-height: 1.4; }
.pub-row .meta { font-size: 0.875rem; color: var(--ink-muted); margin-top: 6px; font-style: normal; font-family: var(--sans); }
.pub-row .links { display: flex; gap: 16px; }
.pub-row .links a {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
  position: relative;
  padding-bottom: 3px;
  white-space: nowrap;
}
.pub-row .links a::after {
  content: '';
  position: absolute; left: 0; bottom: 0; width: 0; height: 1.5px;
  background: var(--signal);
  transition: width 150ms ease-out;
}
.pub-row .links a:hover::after { width: 100%; }
@media (max-width: 768px) {
  .pub-row { grid-template-columns: 1fr; gap: 8px; padding: 24px 0; }
  .pub-row .links { margin-top: 8px; }
}
