/* ===================================================================
 * 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 */
  --signal:    #5C94C2;             /* ACCENT — use sparingly (≤3% of viewport) */
  --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; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  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 ======================================================= */
/* 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: 14px 24px; } }
.nav-brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}
.nav-links { display: flex; gap: 32px; list-style: none; }
@media (max-width: 768px) { .nav-links { gap: 20px; } }
.nav-links a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
  padding-bottom: 3px;
}
.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; }
.figure-caption.under-banner { margin-top: -48px; margin-bottom: 64px; }

/* 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. */
/* §04→§05 junction: the banner caption already carries 64px bottom margin,
 * so drop §04's bottom pad and trim Contact's top pad — otherwise the two
 * full section pads stack into a ~300px void (more obvious now the divider
 * rule is gone). */
#for-everyone { padding-bottom: 0; }
#contact { padding-top: 56px; }
/* Hero fills the first screen below the sticky nav so the headline plus
 * the whole 2×2 pipeline sequence is visible without scrolling. */
section#hero {
  min-height: calc(100vh - 57px);
  padding: 40px 0;
  display: flex;
  align-items: flex-start;
}
section#hero > .container { width: 100%; }
/* §00 hero headline block: a single display line that names the payoff
 * (cell type + disease state) plus one tagline carrying the "zero sample
 * preparation" hook. Sits above the 4-step sequence. */
.hero-head { margin-bottom: clamp(16px, 2vh, 28px); max-width: 64ch; }
.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; } }
/* §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;
}
.stat-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 12px;
}

/* === 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: top-align so the "Cellular fluid analysis" heading
 * and the "Remoscope" title sit on the same line; the eyebrow now lives
 * above the row so neither column is offset by it. */
.two-col.problem-row {
  align-items: start;
  grid-template-columns: 1fr minmax(0, 400px);
}
.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:hover .hero-media-hover { opacity: 1; }
@media (hover: none) {
  .hero-media-swap .hero-media-hover { display: none; }
}
.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; }
}

/* === 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: 1fr 1fr;
  gap: 24px 48px;
  margin-bottom: 0;
  list-style: none;
}
/* On wide screens, open up the row gap so the bottom-row videos sit
 * below the fold on load — the first row (flow cell + hardware, with the
 * enlarged device) reads cleanly without the gifs poking up as noise. */
@media (min-width: 901px) {
  .flow-grid-2x2 { row-gap: 190px; }
}
/* 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 {
  aspect-ratio: 4 / 3;
  height: auto;
  max-height: 30vh;
}
/* The two videos and the square device render fill their (now taller)
 * tiles via cover, so they scale 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,
.flow-grid-2x2 .fig-device img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.flow-grid-2x2 .fig-flowcell img { transform: scale(0.78); }

/* §00 hero: on wide screens, blow up the Hardware device render so it
 * fills the empty space to the right of the "Deep analysis" title. The
 * caption sits in its own (auto) grid row and stays put; the figure
 * scales from its bottom edge so the image grows UP into the whitespace
 * rather than pushing the caption down. */
@media (min-width: 901px) {
  .flow-grid-2x2 .fig-device {
    transform: scale(1.4) translateY(6%);
    transform-origin: bottom center;
  }
}
@media (min-width: 1100px) {
  .flow-grid-2x2 .fig-device { transform: scale(1.75) translateY(6%); }
}
@media (min-width: 1300px) {
  .flow-grid-2x2 .fig-device { transform: scale(2.2) translateY(6%); }
}

/* 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) {
  .flow-grid-2x2 { grid-template-columns: 1fr; gap: 32px; }
  .flow-grid-2x2 .figure { height: clamp(220px, 42vh, 420px); }
}
/* 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;
}
.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);
}
.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; }
}

/* 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 rotating gallery (§02) — center slide is sharp; the
 * neighbors peek in blurred as if they were the next slides on a
 * turntable. 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;
}
.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);
}

/* 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); }
}

/* 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: 360px; }
  .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;
}

/* === 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; } }

/* === 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;
}

/* === 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; }
}
