/* ==========================================================================
   Components shared by every page.
   1. icons · buttons · links · pills & tags
   2. surfaces: one card surface for every boxed component; photo cards; ruled grids; reticle
   3. immersive heroes (home + inner pages), media frames, marquee, sticky rail
   4. stats · form controls · chips · feature list
   5. shared grids: services, products, directory, stat tiles, split
   6. patterns: tabs (+ crossfading panels), accordion, testimonial, logo row, comparison table, carousel
   7. results kit (data-viz): finding chip, range bar, meter, gauge, chart, results list
   8. pinned scroll scene
   9. layout kits: bento, graded photo + photo tag, dense list, data table
   Every component reads the SURFACE tokens (tokens.css) for text, rules and marks, so it works on paper, tint, a
   field, night and a photo. Page files may EXTEND these in their own CSS.
   ========================================================================== */
:root {
  --icon-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3 8h10M9 4l4 4-4 4' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --icon-external: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3.5 8.5l5-5M4.6 3.5h3.9v3.9' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%23111b1d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.5l3 3 6-7' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --icon-clear: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4.5 4.5l7 7M11.5 4.5l-7 7' stroke='%23000' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ---------- Icons ---------- */
.icon { width: 18px; height: 18px; flex: 0 0 auto; }
.icon-arrow { width: 16px; height: 16px; flex: 0 0 auto; }

/* ---------- Buttons ----------
   <a class="btn btn-primary" href="…">Label <svg class="icon-arrow" …></svg></a>
   Variants: btn-primary · btn-secondary · btn-ghost · btn-dark · btn-light · btn-glass
   Sizes: btn-sm · (default) · btn-lg      Modifiers: btn-block · btn-round
   Hover styles only apply where hover exists, so a tap never leaves a button stuck "lifted". */
.btn {
  --btn-h: 48px;
  --btn-px: 22px;
  --btn-fs: 0.9375rem;
  --btn-bg: var(--ink);
  --btn-fg: var(--surface);
  --btn-bd: transparent;
  --btn-bg-h: var(--teal-900);
  --btn-fg-h: var(--btn-fg);
  --btn-bd-h: var(--btn-bd);
  --btn-sh-h: var(--shadow-btn);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--btn-h);
  padding: 0 var(--btn-px);
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-sans);
  font-size: var(--btn-fs);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.005em;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--dur-2) var(--ease-out),
    color var(--dur-2) var(--ease-out),
    border-color var(--dur-2) var(--ease-out),
    box-shadow var(--dur-3) var(--ease-out),
    transform var(--dur-3) var(--ease-out);
}
@media (hover: hover) {
  .btn:hover {
    background: var(--btn-bg-h);
    color: var(--btn-fg-h);
    border-color: var(--btn-bd-h);
    box-shadow: var(--btn-sh-h);
    transform: translateY(-1px);
  }
  .btn:hover .icon-arrow { transform: translateX(3px); }
}
.btn:active { transform: translateY(0) scale(0.98); box-shadow: none; transition-duration: var(--dur-1); }
.btn:focus-visible { outline: 2px solid var(--ring-color); outline-offset: 3px; }
.btn .icon-arrow { transition: transform var(--dur-3) var(--ease-spring); }
.btn:focus-visible .icon-arrow { transform: translateX(3px); }

.btn-primary {
  --btn-bg: var(--accent); --btn-fg: var(--on-accent);
  --btn-bg-h: var(--accent-hover);
  --btn-sh-h: var(--shadow-btn-accent);
}
.btn-dark { --btn-bg: var(--fg); --btn-fg: var(--fg-inverse); --btn-bg-h: var(--fill-strong-hover); }   /* the surface's
   strongest fill: ink on paper, near-white with ink words on night and photos (an ink pill on night would vanish) */
.btn-secondary {
  --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-bd: var(--line-2);
  --btn-bg-h: var(--surface); --btn-bd-h: var(--ink-3);
  --btn-sh-h: var(--shadow-sm);
}
.btn-ghost {
  --btn-bg: var(--ghost-bg); --btn-fg: var(--fg); --btn-bd: transparent;
  --btn-bg-h: var(--ghost-bg-hover); --btn-sh-h: none;
  --btn-px: 16px;
}   /* no fill on paper and night; on a photo it rests on dark glass, so its white words read over any picture */
@media (hover: hover) { .btn-ghost:hover { transform: none; } }
/* on night sections and photos */
.btn-light { --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-bg-h: var(--surface); --btn-sh-h: var(--shadow-btn-photo); }
/* frosted glass on a photo. It reads the SURFACE tokens, so dropped on paper it is a quiet tinted pill with ink words
   (never white words on cream) and on night a faint glass pill with night words */
.btn-glass {
  --btn-bg: var(--face); --btn-fg: var(--fg); --btn-bd: var(--edge);
  --btn-bg-h: var(--face-hover); --btn-bd-h: var(--edge-strong); --btn-sh-h: none;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.btn-sm { --btn-h: 40px; --btn-px: 16px; --btn-fs: 0.875rem; gap: 8px; }
.btn-lg { --btn-h: 56px; --btn-px: 28px; --btn-fs: 1rem; gap: 12px; }
.btn-block { width: 100%; }
.btn-round { width: var(--btn-h); padding: 0; }
@media (pointer: coarse) { .btn-sm { --btn-h: 44px; } }   /* touch: never under 44px */

/* finished / disabled: no longer looks live. No lift, no pointer, no shadow */
.btn:disabled, .btn[aria-disabled="true"],
.btn:disabled:hover, .btn[aria-disabled="true"]:hover {
  background: var(--teal-50); color: var(--teal-800); border-color: transparent;
  box-shadow: none; transform: none; cursor: default;
}
.btn:disabled .icon-arrow { transform: none; }

/* ---------- Links ----------
   .link        inline text link (teal, hairline underline). External links get a drawn ↗ automatically:
                an SVG mask (same shape on every OS, never a fallback glyph), glued to the last word with a
                word joiner so it can never wrap onto a line alone, and never underlined.
   .link-arrow  standalone "Read more →" link with an arrow that nudges. */
.link {
  color: var(--fg-link);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.24em;
  text-decoration-color: var(--link-underline);
  transition: color var(--dur-2) var(--ease-out), text-decoration-color var(--dur-2) var(--ease-out);
}
.link[target="_blank"]::after {
  content: "\2060";                     /* word joiner: no break between the last word and the arrow */
  padding-left: 0.72em;
  margin-left: 0.16em;
  background-color: currentColor;
  -webkit-mask: var(--icon-external) no-repeat 100% 58% / 0.66em 0.66em;
  mask: var(--icon-external) no-repeat 100% 58% / 0.66em 0.66em;
  transition: -webkit-mask-position var(--dur-2) var(--ease-spring), mask-position var(--dur-2) var(--ease-spring);
}
@media (hover: hover) {
  .link:hover { color: var(--fg); text-decoration-color: currentColor; }
  .link[target="_blank"]:hover::after { -webkit-mask-position: 100% 30%; mask-position: 100% 30%; }
}

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px;
  font-weight: var(--fw-ui);
  color: var(--fg);
}
.link-arrow .icon-arrow { color: var(--fg-mark); transition: transform var(--dur-3) var(--ease-spring); }
@media (hover: hover) { .link-arrow:hover .icon-arrow { transform: translateX(4px); } }
.link-arrow:focus-visible .icon-arrow { transform: translateX(4px); }

/* a row of links inside a card: each one a 44px tap target, text starting on the card's text edge.
   The last row gives back the invisible half-row under its text, so a card's bottom padding looks like its top */
.links { display: flex; flex-wrap: wrap; gap: 0 var(--space-5); margin-top: var(--space-2); }
.links a, .partners a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
.links:last-child { margin-bottom: -10px; }
.partners { display: flex; flex-wrap: wrap; gap: 0 var(--space-5); margin-top: var(--space-2); }

/* ---------- Pills & tags ----------
   .pill  rounded label (neutral) · .pill-teal · .pill-dark · .pill-glass (on photos)
   .tag   a card's category: plain sentence-case text in teal, no pill, no capitals (the eyebrow is the only uppercase label) */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 32px; padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: var(--fs-small); font-weight: 500; line-height: 1.2;
  white-space: nowrap;
}
.pill-teal { background: var(--teal-50); border-color: transparent; color: var(--teal-800); }
.pill-dark { background: var(--fg); border-color: transparent; color: var(--fg-inverse); }   /* inverse on every surface */
.pill-glass {
  background: var(--glass-light); border-color: var(--glass-line-strong); color: var(--ink);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-sm);
}
/* live dot: a small teal dot that breathes (static under reduced motion) */
.dot-live {
  position: relative; width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal-500); flex: 0 0 auto;
}
.dot-live::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: inherit; animation: dot-live 2.4s var(--ease-out) infinite;
}
@keyframes dot-live { from { transform: scale(1); opacity: 0.6; } to { transform: scale(3); opacity: 0; } }

.tag {
  display: inline-flex; align-items: center; align-self: flex-start; justify-self: start;
  min-height: 26px;
  color: var(--fg-link);
  font-size: var(--fs-small); font-weight: var(--fw-ui); line-height: 1.2;
  letter-spacing: 0;
}

/* ==========================================================================
   2. Surfaces
   ========================================================================== */
/* ONE card surface. Every boxed component (card, svc, prod, dir, stat-card, split-copy, panel) uses it;
   change a box with the --card-* variables, never by re-declaring background/border/radius/shadow.
   The default is borderless and shadowless: a tinted surface on the canvas, white on a coloured field (the field
   sets --card-bg). Nothing changes layout: an optional hairline is drawn inside with an inset shadow. */
:where(.card, .svc, .prod, .dir, .stat-card, .split-copy, .panel) {
  position: relative;
  background: var(--card-bg, var(--tint));
  border: 0;
  border-radius: var(--card-r, var(--r-lg));
  box-shadow: inset 0 0 0 1px var(--card-bd, transparent), var(--card-sh, 0 0 0 transparent);
  color: var(--card-fg, inherit);
}
:where(.card, .svc, .prod, .dir) { padding: var(--card-pad); }
/* a big panel: forms, the pain panel, split copy */
:where(.panel, .split-copy) { padding: var(--panel-pad); }
.card-white { --card-bg: var(--surface); }
.card-outline { --card-bd: var(--rule); }     /* the surface's own hairline: ink 10% on paper, white 14% on night, 30% on a photo */
.card-flat { --card-bg: var(--canvas-2); }      /* a sunken paper card; on night or a photo it reads as paper (base.css light scope) */
.card-dark { --card-bg: var(--night-2); --card-fg: var(--on-night); }
.card-title {
  font-family: var(--font-display); font-weight: var(--fw-title);
  font-size: var(--fs-title);
  line-height: 1.15; letter-spacing: -0.012em;
}
/* a card that is a link: on hover / keyboard focus it lifts, takes the surface's --card-bg-hover (white on paper,
   night-3 on night, deeper glass on a photo: never a white face under light text) and casts a soft shadow */
.card-link, a.svc, a.prod {
  transition: transform var(--dur-3) var(--ease-out), box-shadow var(--dur-3) var(--ease-out), background-color var(--dur-3) var(--ease-out);
}
@media (hover: hover) {
  :is(.card-link, a.svc):not(.ruled > *):hover { transform: translateY(-4px); background-color: var(--card-bg-hover); box-shadow: var(--shadow-md); }
}
:is(.card-link, a.svc):not(.ruled > *):focus-visible { transform: translateY(-4px); background-color: var(--card-bg-hover); box-shadow: var(--shadow-md); }
:is(.card-link, a.svc):not(.ruled > *):active { transform: translateY(-1px); transition-duration: var(--dur-1); }

/* arrow badge: the action mark (a round face with an arrow). Inside a link it nudges on hover / focus */
.arrow-badge {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--badge-bg, var(--surface)); color: var(--ink);
  flex: 0 0 auto;
  transition: transform var(--dur-3) var(--ease-spring), background-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
@media (hover: hover) { a:hover .arrow-badge { transform: translateX(3px); background: var(--accent); color: var(--on-accent); } }
a:focus-visible .arrow-badge { transform: translateX(3px); background: var(--accent); color: var(--on-accent); }

/* ---------- Photo card (image-led card: photo, scrim, title on the photo) ----------
   <a class="photo-card" href="…"><img src="…" alt="" …><div><h3>Women</h3><p>…</p></div></a>
   Text sits on --scrim-card (>= 4.5:1 for white text under the copy). Set --photo-pos to aim the crop. */
.photo-card {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: var(--photo-card-h, 420px);
  padding: var(--card-pad);
  border-radius: var(--r-lg);
  background: var(--night-2);
  color: var(--on-photo);
  transition: transform var(--dur-3) var(--ease-out), box-shadow var(--dur-3) var(--ease-out);
}
.photo-card > img {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover; object-position: var(--photo-pos, center);
  transition: scale 0.8s var(--ease-out);
}
.photo-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--scrim-card); }
.photo-card :is(h2, h3) { font-size: var(--fs-h3); line-height: 1.1; letter-spacing: -0.015em; }
.photo-card p:where(:not(.eyebrow)) { margin-top: var(--space-2); font-size: var(--fs-card); line-height: 1.5; color: var(--fg-2); max-width: 34ch; }   /* an eyebrow keeps its own look */
/* a tag on a photo is the one place a tag gets a face: a dark-glass pill, so it reads on any part of any picture */
.photo-card .tag {
  min-height: 28px; padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--glass-dark); color: var(--on-photo); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  margin-bottom: var(--space-3);
}
/* the arrow badge is a solid white disc on every card (photo or field), so no card's badge looks disabled */
a.photo-card::after {
  content: "";
  position: absolute; right: var(--space-5); top: var(--space-5);
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface) var(--icon-arrow) center / 16px no-repeat;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-3) var(--ease-spring), background-color var(--dur-2) var(--ease-out);
}
@media (hover: hover) {
  a.photo-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
  a.photo-card:hover > img { scale: 1.05; }
  a.photo-card:hover::after { transform: translateX(3px); }
}
a.photo-card:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
/* a photo-less sibling in a photo-card row: same frame, a colour field instead of a picture */
.photo-card.is-field { background: var(--wash-night); }
.photo-card.is-field::before { content: none; }

/* ---------- Ruled grid (borderless, hairlines between cells: Function's lab-test grid) ----------
   <div class="services ruled">…cells…</div>. Same column tracks and gap as every card grid, so its columns sit
   exactly on the card grids and the footer columns. Text is flush with each column edge. Every cell draws a rule on
   its own right edge (the column rule) and a rule under itself that runs on across the gutter (the row rule); the grid
   clips whatever passes its right edge. So it works for ANY number of columns with no :nth-child arithmetic, and
   cells have no border, so every rule starts and ends exactly on the grid's top border. */
/* the clip sits 1px inside the right edge: at a fractional grid width (1024, 1100, 1280) the last column's rule would
   otherwise bleed a faint outer hairline through the anti-aliased edge pixel */
.ruled, .services.ruled, .products.ruled { row-gap: 0; border-top: 1px solid var(--rule-2); clip-path: inset(-12px 1px -12px -12px); }
.ruled > * {
  --card-bg: transparent; --card-bd: transparent; --card-r: 0; --card-sh: none;
  position: relative;
  border: 0;
  padding: var(--space-8) var(--space-6) var(--space-8) 0;
}
.ruled > *::before { content: ""; position: absolute; left: 0; right: calc(-1 * var(--grid-gap)); top: auto; bottom: 0; width: auto; height: 1px; background: var(--rule-2); -webkit-mask: none; mask: none; transform: none; }
.ruled > *::after { content: ""; position: absolute; left: auto; right: -1px; top: 0; bottom: 0; width: 1px; height: auto; background: var(--rule-2); border-radius: 0; transform: none; }
/* a landed target: a 2px teal rule under the cell that stops at the cell's own column rule; the hairline carries on
   across the gutter as usual */
.ruled > .is-target::before, html:not(.js) .ruled > :target::before {
  height: 2px;
  background:
    linear-gradient(var(--fg-mark), var(--fg-mark)) 0 0 / calc(100% - var(--grid-gap)) 2px no-repeat,
    linear-gradient(var(--rule-2), var(--rule-2)) 100% 100% / var(--grid-gap) 1px no-repeat;
  transform-origin: left center; animation: rule-in 1.1s var(--ease-out) both;
}
.ruled > .is-target h3, html:not(.js) .ruled > :target h3 { color: var(--fg-link-strong); }   /* teal-800 · teal-300 night · white photo */
@keyframes rule-in { from { scale: 0 1; } to { scale: 1 1; } }

/* ---------- Reticle: the MDC signature. Four corner brackets, like a scanner locking focus ----------
   Add .reticle to any positioned frame (photo, map, number). It draws in when its frame reveals. */
.reticle { position: relative; }
.reticle::after {
  content: "";
  position: absolute; inset: var(--reticle-inset, 16px); z-index: 3;
  pointer-events: none;
  --rc: var(--reticle-color, var(--reticle-light));
  --rl: var(--reticle-len, 22px);
  --rt: 1.5px;
  background:
    linear-gradient(var(--rc), var(--rc)) 0 0 / var(--rl) var(--rt),
    linear-gradient(var(--rc), var(--rc)) 0 0 / var(--rt) var(--rl),
    linear-gradient(var(--rc), var(--rc)) 100% 0 / var(--rl) var(--rt),
    linear-gradient(var(--rc), var(--rc)) 100% 0 / var(--rt) var(--rl),
    linear-gradient(var(--rc), var(--rc)) 0 100% / var(--rl) var(--rt),
    linear-gradient(var(--rc), var(--rc)) 0 100% / var(--rt) var(--rl),
    linear-gradient(var(--rc), var(--rc)) 100% 100% / var(--rl) var(--rt),
    linear-gradient(var(--rc), var(--rc)) 100% 100% / var(--rt) var(--rl);
  background-repeat: no-repeat;
  transition: opacity 0.7s var(--ease-out) 0.55s, scale 1.2s var(--ease-out) 0.55s;
}
.reticle-ink { --reticle-color: var(--teal-500); }

/* ==========================================================================
   3. Immersive tier
   ========================================================================== */
/* ---------- Immersive hero: a full-bleed photo under the glass header ----------
   <section class="hero-bleed on-photo">
     <div class="hero-media"><img data-parallax="0.12" …></div>
     <div class="wrap-wide hero-content">…eyebrow, h1, lede, actions…</div>
   </section>
   The section slides under the sticky header (negative margin = header height); the header turns to glass on it. */
.hero-bleed {
  position: relative; isolation: isolate;
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: var(--page-hero-h);
  margin-top: calc(-1 * var(--nav-h));
  padding: calc(var(--nav-h) + var(--space-10)) var(--gutter) clamp(2.5rem, 1.6rem + 3.6vw, 5.5rem);
  background: var(--night);
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.hero-media > img {
  position: absolute; left: 0; top: -6%;
  width: 100%; height: 112%;
  object-fit: cover; object-position: var(--hero-pos, center);
}
/* film grain at device-pixel scale: keeps an enlarged photo looking crisp at 1:1 on wide screens */
.hero-media::before, .bleed-media::before { content: ""; position: absolute; inset: 0; z-index: 1; background: var(--grain); opacity: 0.16; mix-blend-mode: overlay; pointer-events: none; }
.hero-media::after { content: ""; position: absolute; inset: 0; z-index: 2; background: var(--scrim-top), var(--scrim-left), var(--scrim-bottom); }
.hero-content { position: relative; }
.hero-content .display-1, .hero-content .display-2 { max-width: 15ch; }
.hero-content .lede { margin-top: var(--space-6); max-width: 46ch; }
/* the hero copy is above the fold: a shorter, tighter load-in that starts at once */
.hero-content { --reveal-dur: 480ms; --split-step: 14ms; }   /* motion.js caps the hero stagger at 40ms: all in by ~0.7s */
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-8); }
/* inner pages: the same hero, a little shorter, with a display-2 headline */
.page-hero { min-height: var(--page-hero-h); }
/* an inner page's h1 is one clear step above every section heading below it (display-page, not display-2) */
.page-hero h1, .page-hero h1.display-2 { font-size: var(--fs-display-page); line-height: 1; letter-spacing: var(--tracking-display); max-width: 17ch; }
.page-hero .lede { max-width: 48ch; }
/* a photo whose subject stands in the middle: the frame is widened so the subject sits right of the copy */
@media (min-width: 641px) { .hero-media-shift > img { width: 140%; max-width: none; } }   /* max-width: base img rule would cap it at 100% */
@media (max-width: 980px) {
  .hero-media::after { background: var(--scrim-top), var(--scrim-bottom-tall); }
}
/* small labels on a photo sit in a dark glass pill, so they read on any part of any picture. The pill comes from the
   photo scope's --eyebrow-* tokens (base.css), which a .card-white on the photo resets: there it is a plain eyebrow */
.on-photo .eyebrow {
  width: var(--eyebrow-w, fit-content);
  padding: var(--eyebrow-pad, 7px 14px 7px 11px);
  border-radius: var(--r-pill);
  background: var(--eyebrow-bg, var(--glass-dark));
  border: var(--eyebrow-border, 1px solid var(--glass-line));
  -webkit-backdrop-filter: var(--eyebrow-blur, var(--glass-blur)); backdrop-filter: var(--eyebrow-blur, var(--glass-blur));
}

/* ---------- Media frame ----------
   <div class="media"><img …></div>  rounded, clipped photo. Give the frame a size (aspect-ratio or height).
   Parallax: put data-parallax on the <img>; it gets --parallax-room of extra photo above and below, and
   motion.js never moves it further than that room, so no edge of the frame can ever show through. */
.media { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--canvas-2); isolation: isolate; }
.media > img, .media > video { width: 100%; height: 100%; object-fit: cover; }
.media > [data-parallax] {
  position: absolute; left: 0; width: 100%;
  top: calc(-1 * var(--parallax-room, 10%));
  height: calc(100% + 2 * var(--parallax-room, 10%));
}

/* ---------- Photo band (image-led body section) ----------
   <section class="bleed on-photo">
     <div class="bleed-media"><img src="…" alt="…" data-parallax="0.08"></div>
     <div class="wrap bleed-content">…display-2, lede, actions…</div>
   </section>
   A full-bleed photo between paper sections with its copy bottom-left on the scrims (the hero's language, in the
   body). .bleed-inset keeps it inside the gutters with the card radius (Neko's rounded media blocks). */
.bleed {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: clamp(480px, 82svh, 880px);
  padding: var(--section-y) var(--gutter) clamp(2.5rem, 1.6rem + 3.6vw, 5.5rem);
  background: var(--night);
}
.bleed-media { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.bleed-media > img { position: absolute; left: 0; top: -8%; width: 100%; height: 116%; object-fit: cover; object-position: var(--photo-pos, center); }
.bleed-media::after { content: ""; position: absolute; inset: 0; z-index: 2; background: var(--scrim-left), var(--scrim-bottom); }
.bleed-content { position: relative; }
.bleed-content .lede { margin-top: var(--space-5); max-width: 44ch; }
.bleed-inset { margin-inline: var(--gutter); border-radius: var(--r-lg); padding-inline: var(--card-pad); }
@media (max-width: 980px) { .bleed-media::after { background: var(--scrim-bottom-tall); } }

/* ---------- Thumb list (image-led rows: Neko's scan list) ----------
   <ul class="thumb-list" role="list"><li><a class="thumb-row" href="…"><img class="thumb" src="…" alt="">
     <span class="thumb-text"><b>Imaging</b><span>X-ray, ultrasound…</span></span><span class="arrow-badge">…svg…</span></a></li></ul>
   Rows sit on the card surface (tinted on the canvas, white on a field). Two columns from 641px when given .thumb-list-2. */
.thumb-list { list-style: none; display: grid; gap: var(--space-2); }
.thumb-list-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--grid-gap); }
/* two rows side by side are always the same height (the row fills its grid cell), and their titles start on one
   line: photo, title and copy hang from the top; only the arrow badge is centred */
.thumb-list > li { display: flex; }
.thumb-row {
  flex: 1 1 auto;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: var(--space-4);
  min-height: 88px; padding: var(--space-3) var(--space-4) var(--space-3) var(--space-3);
  border-radius: var(--r-sm);
  background: var(--card-bg, var(--tint));
  --badge-bg: var(--card-badge, var(--surface));
  transition: background-color var(--dur-3) var(--ease-out), box-shadow var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out);
}
.thumb { width: 64px; height: 64px; border-radius: var(--r-sm); object-fit: cover; object-position: var(--thumb-pos, center); background: var(--canvas-2); }
.thumb-row > .arrow-badge { align-self: center; }
.thumb-text { display: grid; gap: 2px; padding-top: 2px; }
.thumb-text b { font-family: var(--font-display); font-weight: var(--fw-title); font-size: var(--fs-row); line-height: 1.15; letter-spacing: -0.01em; }
.thumb-text span { color: var(--fg-2); font-size: var(--fs-small); line-height: 1.45; }
@media (hover: hover) { a.thumb-row:hover { background: var(--card-bg-hover); box-shadow: var(--shadow-md); transform: translateY(-2px); } }
a.thumb-row:focus-visible { background: var(--card-bg-hover); box-shadow: var(--shadow-md); }

/* ---------- Marquee (a slow, continuous line of names) ----------
   <div class="marquee" data-marquee aria-label="…"><div class="marquee-track"><ul class="marquee-group">…</ul></div></div>
   motion.js clones the group (aria-hidden) and starts it; it pauses on hover, focus and off-screen.
   No JS / reduced motion: the group simply wraps, centred. */
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
}
.marquee-track { display: flex; width: max-content; }
.marquee-group {
  display: flex; align-items: center; flex: 0 0 auto;
  gap: var(--marquee-gap, var(--space-9)); padding-right: var(--marquee-gap, var(--space-9));
  list-style: none;
}
.marquee-group > * { flex: 0 0 auto; white-space: nowrap; }
.marquee:not(.is-running) .marquee-track { display: block; width: auto; }
.marquee:not(.is-running) .marquee-group { flex-wrap: wrap; justify-content: center; row-gap: var(--space-3); padding-right: 0; }
.marquee:not(.is-running) { -webkit-mask-image: none; mask-image: none; }
.marquee.is-running .marquee-track { animation: marquee var(--marquee-dur) linear infinite; }
.marquee.is-running.is-paused .marquee-track,
.marquee.is-running:hover .marquee-track,
.marquee.is-running:focus-within .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { translate: -50% 0; } }

/* ---------- Sticky rail: a sticky column beside content that scrolls past ----------
   <div class="rail" data-progress> <div class="rail-sticky">…index with [data-step-label]…</div>
                                     <div class="rail-flow">…blocks with [data-step]…</div> </div>
   motion.js writes --progress (0 -> 1) on the rail and marks the block nearest the reading line .is-current
   (and its label). Stacks, unpinned, at 980 and below. */
.rail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 0.5rem + 4vw, 6rem);
  align-items: start;
}
.rail-sticky { position: sticky; top: calc(var(--nav-h) + var(--space-7)); }
.rail-meter { position: relative; height: 2px; border-radius: var(--r-pill); background: var(--rule-2); overflow: hidden; }
.rail-meter > i { position: absolute; inset: 0; background: var(--fg-mark); transform-origin: left center; scale: var(--progress, 0) 1; }
@media (max-width: 980px) {
  .rail { grid-template-columns: 1fr; }
  .rail-sticky { position: static; }
}

/* ==========================================================================
   4. Stats · forms · chips · lists
   ========================================================================== */
/* ---------- Stats ----------
   <div class="stat"><p class="stat-value" data-count="96.4" data-decimals="1" data-suffix="%">96.4%</p><p class="stat-label">Pathway precision</p></div> */
.stat { display: flex; flex-direction: column; gap: var(--space-2); }
.stat-value {
  font-family: var(--font-display); font-weight: var(--fw-display);
  font-size: var(--fs-stat);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: lining-nums tabular-nums;
}
.stat-value em { font-style: normal; color: var(--fg-em); }
.stat-label { font-size: var(--fs-small); line-height: 1.45; color: var(--fg-2); }
/* stats side by side with hairline dividers (Function-style row) */
.stat-row { display: grid; grid-template-columns: repeat(var(--stat-cols, 3), minmax(0, 1fr)); gap: var(--space-6); }
.stat-row > .stat + .stat { border-left: 1px solid var(--stat-rule, var(--rule-2)); padding-left: var(--space-6); }
/* the same row on a photo: the lighter hairline (white 30%), set as a token so a white card on the photo resets it */
.on-photo .stat-row { --stat-rule: var(--rule); }
.on-photo .stat-label { color: var(--fg-2); }
.on-photo .stat-value { font-size: var(--fs-stat-sm); }

/* ---------- Form controls ----------
   .input / .select / .textarea (or any input/select/textarea inside .form / .search-box).
   Pills, like the buttons beside them: white, a warm 1px border (3.7:1 on white, 3.2:1 on a tinted panel), no shadow.
   Visible labels, not placeholders: wrap a control and its label in .float and the label sits inside the pill,
   then floats to the top edge when the field has focus or a value.
     <div class="float"><input id="reg-name" placeholder=" " …><label for="reg-name">Full name</label></div> */
.form { display: grid; gap: var(--space-3); }
.field { display: grid; gap: 6px; }
.label { font-size: var(--fs-small); font-weight: var(--fw-ui); color: var(--fg-2); }
.input, .select, .textarea,
.form :is(input:not([type="checkbox"], [type="radio"], [type="submit"]), select, textarea),
.search-box input {
  display: block;
  width: 100%;
  border: 1px solid var(--control-border);
  background-color: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;                 /* 16px: iOS never zooms the page on focus */
  font-weight: 400;
  line-height: 1.25;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
/* the pill geometry is for single-line controls only, so a textarea never inherits a 999px radius and 0 padding */
.input, .select,
.form :is(input:not([type="checkbox"], [type="radio"], [type="submit"]), select),
.search-box input { height: 56px; padding: 0 24px; border-radius: var(--r-pill); }
.textarea, .form textarea { height: auto; min-height: 140px; padding: 16px 24px; line-height: 1.5; resize: vertical; border-radius: var(--r-lg); }
.select, .form select {
  padding-right: 52px;
  cursor: pointer;
  background-image: var(--icon-chevron);
  background-repeat: no-repeat;
  background-position: right 22px center;
  background-size: 16px;
}
.select:invalid, .form select:invalid, .form select[data-empty="true"] { color: var(--ink-3); }
.select option, .form select option { color: var(--ink); }
:is(.input, .select, .textarea, .form input, .form select, .form textarea, .search-box input)::placeholder { color: var(--ink-3); opacity: 1; }
@media (hover: hover) { :is(.input, .select, .textarea, .form input, .form select, .form textarea, .search-box input):hover { border-color: var(--ink-3); } }
:is(.input, .select, .textarea, .form input, .form select, .form textarea, .search-box input):focus {
  outline: 0;
  border-color: var(--teal-600);
  box-shadow: var(--ring);
}
:is(.input, .select, .textarea, .form input, .form select, .form textarea):user-invalid { border-color: var(--danger); }
/* an invalid field that has focus keeps its error colour: a red halo, never the teal focus ring around a red border */
:is(.input, .select, .textarea, .form input, .form select, .form textarea):user-invalid:focus { border-color: var(--danger); box-shadow: var(--ring-danger); }
:is(.input, .select, .textarea, .form input, .form select, .form textarea):disabled { background-color: var(--canvas-2); color: var(--ink-3); cursor: not-allowed; }
/* floating label. At rest the label is the field's one grey line, centred in the pill (a select too, while nothing is
   chosen). On focus or with a value it shrinks to 13px and the label + value pair sits centred in the 56px pill:
   label glyphs ~15-24px down, value glyphs ~29-41px, a 5px gap between them. */
.float { position: relative; }
.float > :is(input, select), .form .float > :is(input, select) { padding-top: 14px; padding-bottom: 0; }
.float > label {
  position: absolute; left: 25px; top: 50%;
  translate: 0 -50%;
  font-size: 1rem; line-height: 1.2; color: var(--ink-3);
  pointer-events: none;
  transform-origin: left center;
  transition: translate var(--dur-2) var(--ease-out), scale var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.float > :is(input:focus, input:not(:placeholder-shown), select:focus, select:valid) + label { translate: 0 calc(-50% - 9px); scale: 0.8125; }
.float > :is(input, select):focus + label { color: var(--teal-700); }
.float > :is(input, select):user-invalid + label { color: var(--danger); }
.float > input::placeholder { color: transparent; }
/* an empty required select shows only its label at rest, like the text fields; "Choose one" appears once it opens */
.float > select:invalid:not(:focus), .form .float > select:invalid:not(:focus) { color: transparent; }
/* checkbox and radio: the browser's own control, in the brand teal (never browser blue), on a 44px row */
input:is([type="checkbox"], [type="radio"]) { accent-color: var(--accent); width: 20px; height: 20px; margin: 0; flex: 0 0 auto; cursor: pointer; }
.check { display: flex; align-items: flex-start; gap: var(--space-3); min-height: 44px; padding-block: 12px; font-size: var(--fs-small); line-height: 1.45; color: var(--fg-2); cursor: pointer; }
.check > input { margin-top: -1px; }
/* the search clear button: an ink x on a 44px target (the browser's default is a small blue x) */
.search-box input::-webkit-search-cancel-button {
  -webkit-appearance: none; appearance: none;
  width: 44px; height: 44px; margin: 0 -14px 0 var(--space-2);
  background-color: var(--ink-3);
  -webkit-mask: var(--icon-clear) center / 16px no-repeat;
  mask: var(--icon-clear) center / 16px no-repeat;
  cursor: pointer;
}
@media (hover: hover) { .search-box input::-webkit-search-cancel-button:hover { background-color: var(--ink); } }
.form .btn { justify-self: start; }
/* a button beside or under 56px fields is a 56px pill too (never a 48px button next to a 56px field) */
:is(.form, .search-box) .btn:not(.btn-sm, .btn-round) { --btn-h: 56px; --btn-px: 28px; --btn-fs: 1rem; gap: 12px; }
.form-hint { font-size: var(--fs-small); color: var(--fg-3); }
/* status note under a form: outside the form grid, so an empty note adds no phantom gap */
.form-note { margin: 0; }
.form-note:not(:empty) { margin-top: var(--space-3); }
.search-box { display: flex; gap: var(--space-2); align-items: stretch; }
.search-box > :is(.float, input) { flex: 1 1 auto; min-width: 0; }
.search-box > .btn { flex: 0 0 auto; }

/* ---------- Chips (toggle buttons) ----------
   <button class="chip" aria-pressed="false">Neck</button>  — .on or aria-pressed="true" = selected */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px;
  border-radius: var(--r-pill);
  border: 1px solid var(--chip-bd, var(--chip-edge));
  background: var(--chip-bg, var(--chip-face));
  color: var(--chip-fg, var(--chip-ink));
  font-size: var(--fs-small); font-weight: var(--fw-ui);
  cursor: pointer;
  transition: background-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out),
    border-color var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}
@media (hover: hover) { .chip:hover { border-color: var(--fg-3); } }
/* selected = the surface's ink as a fill: ink on paper, near-white on night or a photo */
.chip.on, .chip[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: var(--fg-inverse); }
/* at rest on night or a photo (any photo scope, photo cards included) a chip is a quiet glass face, not a white slab:
   the scopes set --chip-face / --chip-edge / --chip-ink (base.css); a white card puts the white face back */
.chip:active { transform: scale(0.97); }

/* ---------- Feature list (numbered, ruled) ---------- */
.feature-list { list-style: none; margin: var(--space-7) 0 0; display: grid; border-top: 1px solid var(--rule-2); }
.feature-list li {
  display: grid; grid-template-columns: 40px 1fr; gap: var(--space-3); align-items: baseline;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--rule-2);
  color: var(--fg-2);
}
.dot-ico { color: var(--fg-link); font-size: var(--fs-small); font-weight: var(--fw-ui); font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }

/* ==========================================================================
   5. Shared grids (used on several pages; page CSS extends them)
   ========================================================================== */
/* service cards (index, services, wellness). Each card is a subgrid of four rows (tag, title, copy, links),
   so titles, copy and link rows line up across every card in a row, whatever their lengths. */
.services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--grid-gap); }
.svc { display: flex; flex-direction: column; }
@supports (grid-template-rows: subgrid) {
  .services > .svc { display: grid; grid-template-rows: subgrid; grid-row: span 4; row-gap: 0; align-content: start; }
}
.svc h3 {
  font-size: var(--fs-title); font-weight: var(--fw-title);
  line-height: 1.15; letter-spacing: -0.012em;
  margin: var(--space-4) 0 var(--space-2);
}
.svc > h3:first-child { margin-top: 0; }
.svc p { color: var(--fg-2); font-size: var(--fs-card); line-height: 1.55; max-width: 46ch; }
.svc .links { margin-top: var(--space-1); align-self: start; }
.ruled > .svc h3 { font-size: var(--fs-h3); }
/* a card that is a link wears an arrow badge, top right, centred on the tag row. Only that row needs the room:
   the title and copy below it use the card's full width */
a.svc:not(.ruled > *)::after {
  content: "";
  position: absolute; right: calc(var(--card-pad) - 8px); top: calc(var(--card-pad) - 8px);
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--badge-bg, var(--surface));
  transition: transform var(--dur-3) var(--ease-spring), background-color var(--dur-2) var(--ease-out);
}
a.svc:not(.ruled > *)::before {
  content: "";
  position: absolute; right: calc(var(--card-pad) + 4px); top: calc(var(--card-pad) + 4px); z-index: 1;
  width: 16px; height: 16px;
  background: var(--ink);
  -webkit-mask: var(--icon-arrow) center / 16px no-repeat; mask: var(--icon-arrow) center / 16px no-repeat;
  transition: transform var(--dur-3) var(--ease-spring), background-color var(--dur-2) var(--ease-out);
}
a.svc:not(.ruled > *) > .tag { margin-right: 48px; }
a.svc:not(.ruled > *) > h3:first-child { padding-right: 48px; }
@media (hover: hover) {
  a.svc:not(.ruled > *):hover::after { transform: translateX(3px); background-color: var(--accent); }
  a.svc:not(.ruled > *):hover::before { transform: translateX(3px); background-color: var(--on-accent); }
}
a.svc:not(.ruled > *):focus-visible::after { transform: translateX(3px); background-color: var(--accent); }
a.svc:not(.ruled > *):focus-visible::before { transform: translateX(3px); background-color: var(--on-accent); }

/* without JS, the card a link landed on is ringed by :target (a ruled cell gets its teal rule instead, above);
   with JS, motion.js marks it .is-target and clears the previous one, so two cards are never highlighted at once */
html:not(.js) :is(.svc, .prod, .dir, .split-copy):not(.ruled > *):target { box-shadow: inset 0 0 0 1px var(--teal-500), var(--ring-strong); }

/* product / info cards (products, patients). In the .products grid each card is a subgrid of four rows
   (eyebrow, title, copy, links), so the row can never misalign, whatever the width. */
.products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--grid-gap); }
.prod { display: flex; flex-direction: column; }
.prod h3 { font-size: var(--fs-title); line-height: 1.15; letter-spacing: -0.012em; margin: 0 0 var(--space-2); }
.prod .eyebrow, .prod .tag { margin-bottom: var(--space-3); }
.prod p:not(.eyebrow, .links, .tag) { color: var(--fg-2); font-size: var(--fs-card); line-height: 1.55; max-width: 52ch; }
.prod .links { margin-top: auto; padding-top: var(--space-2); }
@supports (grid-template-rows: subgrid) {
  .products > .prod { display: grid; grid-template-rows: subgrid; grid-row: span 4; row-gap: 0; align-content: start; }
  .products > .prod .links { margin-top: 0; align-self: start; }   /* first links share one line in every card */
}

/* directory cards (wellness) */
.dir-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--grid-gap); align-items: stretch; }
.dir h3 { font-size: var(--fs-h3); line-height: 1.12; letter-spacing: -0.015em; margin-bottom: var(--space-2); }
.dir .eyebrow, .dir .tag { margin-bottom: var(--space-3); }
.dir p:not(.eyebrow, .tag) { color: var(--fg-2); font-size: var(--fs-card); line-height: 1.55; margin-bottom: var(--space-3); max-width: 60ch; }
.dir ul { list-style: none; display: grid; gap: 0; }
/* a directory row: a block link, so a wrapped label keeps its ↗ right after the last word */
.dir li .link {
  display: block;
  min-height: 44px; padding: 11px 0;
  font-size: var(--fs-card);
  line-height: 1.4;
  text-decoration: none;
}
@media (hover: hover) { .dir li .link:hover { text-decoration: underline; text-decoration-color: currentColor; } }
.dir li + li .link { border-top: 1px solid var(--rule); }

/* stat tiles */
.stats-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-7); }
.stat-card { display: flex; flex-direction: column; gap: 6px; padding: var(--space-5) var(--space-6); }
.stat-card b {
  display: block;
  font-family: var(--font-display); font-weight: var(--fw-display);
  font-size: var(--fs-stat-sm);
  line-height: 1; letter-spacing: -0.03em;
  font-variant-numeric: lining-nums tabular-nums;
}
.stat-card span { color: var(--fg-2); font-size: var(--fs-small); line-height: 1.45; }
.stat-card.teal { --card-bg: var(--accent); --card-fg: var(--on-accent); }
.stat-card.teal span { color: var(--on-accent); }

/* split: copy panel beside a photo panel (scan). Equal columns: the same edges as the pain map and panel above */
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--grid-gap); align-items: stretch; }
.split-copy { display: flex; flex-direction: column; justify-content: center; }
.split-copy h2 { font-size: var(--fs-h2); line-height: 1.06; letter-spacing: -0.02em; max-width: 16ch; }
.split-visual { position: relative; min-height: 320px; align-self: stretch; border-radius: var(--r-lg); overflow: hidden; background: var(--canvas-2); }
.split-visual > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--photo-pos, center); }

/* ==========================================================================
   6. Patterns (see DESIGN.md §6 for markup). Every pattern reads the SURFACE tokens (--fg*, --rule*, --face,
      --state-*, --viz-*), so it works on paper, tint, a field, night and a photo with no override.
   ========================================================================== */
/* ---------- Segmented tabs (Neko's Skin / Heart / Blood / Body). motion.js wires [data-tabs]: click, arrow keys,
   aria-selected, and the matching [role=tabpanel] crossfades in (the old one fades out over it) ---------- */
.segmented {
  display: inline-flex; flex-wrap: wrap; gap: 2px;
  padding: 3px;
  border-radius: var(--r-pill);
  background: var(--hover-fill);
}
.segment {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; min-width: 44px; padding: 0 var(--space-5);
  border-radius: var(--r-pill);
  font-size: var(--fs-small); font-weight: var(--fw-ui); color: var(--fg-2);
  transition: background-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
@media (hover: hover) { .segment:hover { color: var(--fg); } }
/* the selected segment is a white face with ink on every surface */
.segment[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.segment:focus-visible { outline-offset: -3px; }
/* line tabs: Neko's quiet text tabs. The selected one is full ink with a 2px rule that draws in under it */
.segmented.is-line { gap: var(--space-6); padding: 0; border-radius: 0; background: none; }
.segmented.is-line .segment { position: relative; padding: 0; min-width: 0; border-radius: 0; font-size: var(--fs-body); color: var(--fg-3); }
.segmented.is-line .segment::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 2px; border-radius: 2px;
  background: var(--fg-mark); scale: 0 1; transform-origin: left center;
  transition: scale var(--dur-3) var(--ease-out);
}
.segmented.is-line .segment[aria-selected="true"] { background: none; box-shadow: none; color: var(--fg); }
.segmented.is-line .segment[aria-selected="true"]::after { scale: 1 1; }
@media (hover: hover) { .segmented.is-line .segment:hover { color: var(--fg); } }
[role="tabpanel"][hidden] { display: none; }
/* the panels' parent (motion.js marks it): the outgoing panel fades out on top while the new one rises in */
.tabs-stage { position: relative; }

/* ---------- Accordion (FAQ): native <details>, a ruled list, a + that turns into an x ---------- */
.accordion { border-top: 1px solid var(--rule-2); }
.accordion > details { border-bottom: 1px solid var(--rule-2); }
.accordion summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  min-height: 64px; padding: var(--space-4) 0;
  font-family: var(--font-display); font-weight: var(--fw-title); font-size: var(--fs-title); line-height: 1.25;
  color: var(--fg);
  list-style: none; cursor: pointer;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: ""; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  background:
    linear-gradient(var(--fg), var(--fg)) center / 14px 1.5px no-repeat,
    linear-gradient(var(--fg), var(--fg)) center / 1.5px 14px no-repeat,
    var(--face);
  transition: rotate var(--dur-3) var(--ease-out), background-color var(--dur-2) var(--ease-out);
}
.accordion details[open] > summary::after { rotate: 45deg; }
@media (hover: hover) { .accordion summary:hover::after { background-color: var(--face-hover); } }
.accordion summary:focus-visible { outline-offset: 4px; }
.accordion-body { padding: 0 56px var(--space-6) 0; color: var(--fg-2); max-width: var(--measure); }
/* the answer eases open where the browser can animate <details> (a user-triggered disclosure, not scroll-linked) */
@media (prefers-reduced-motion: no-preference) {
  .accordion { interpolate-size: allow-keywords; }
  .accordion details::details-content { block-size: 0; overflow: clip; transition: block-size var(--dur-3) var(--ease-out), content-visibility var(--dur-3) allow-discrete; }
  .accordion details[open]::details-content { block-size: auto; }
}

/* ---------- Testimonial (a quote with its attribution) ---------- */
.testimonial {
  display: grid; gap: var(--space-6); align-content: space-between;
  padding: var(--card-pad); border-radius: var(--r-lg);
  background: var(--card-bg, var(--tint)); color: var(--card-fg, var(--fg));
}
.testimonial blockquote { font-family: var(--font-display); font-weight: var(--fw-display); font-size: var(--fs-h3); line-height: 1.2; letter-spacing: -0.015em; text-wrap: pretty; }
.testimonial figcaption { display: flex; align-items: center; gap: var(--space-3); font-size: var(--fs-small); line-height: 1.4; color: var(--fg-3); }
.testimonial figcaption b { display: block; color: var(--fg); font-weight: var(--fw-ui); }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--canvas-2); flex: 0 0 auto; }
.stars { color: var(--fg-link); letter-spacing: 0.12em; font-size: var(--fs-small); }
/* any card on a photo is dark glass (the photo scope sets --card-bg); give it the frost (--card-blur: none on a white card) */
:is(.on-photo, .photo-card, .bleed) :is(.testimonial, .card, .panel, .stat-card, .result, .svc, .prod, .dir, .split-copy, .thumb-row) { -webkit-backdrop-filter: var(--card-blur); backdrop-filter: var(--card-blur); }

/* ---------- Logo / press row: quiet, one tone, wraps (or put it in a .marquee) ---------- */
.logo-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-6) var(--space-10); }
.logo-row > * { color: var(--fg-3); font-family: var(--font-display); font-size: var(--fs-title); letter-spacing: -0.01em; }
.logo-row img { height: 28px; width: auto; filter: var(--logo-filter);   /* white on night / a photo (scope token) */ opacity: 0.72; transition: opacity var(--dur-2) var(--ease-out), filter var(--dur-2) var(--ease-out); }
@media (hover: hover) { .logo-row a:hover img { filter: none; opacity: 1; } }

/* ---------- Comparison table: our column is a saturated accent lane (Function's checkup table) ----------
   16px rows on 56px lines; labels in --fg-2; the lane is --accent with white text and checks on every surface */
.compare-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-top: var(--space-3); }
.compare { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-card); line-height: 1.35; color: var(--fg); }
.compare th, .compare td { height: 56px; padding: var(--space-3) var(--space-4); text-align: center; vertical-align: middle; border-bottom: 1px solid var(--rule); }
.compare th:first-child, .compare td:first-child { text-align: left; padding-left: 0; color: var(--fg-2); font-weight: 400; }
.compare thead th { height: 64px; font-size: var(--fs-small); font-weight: var(--fw-ui); color: var(--fg-2); border-bottom-color: var(--rule-2); vertical-align: bottom; }
.compare tbody td:not(:first-child) { font-variant-numeric: tabular-nums; }
.compare .is-us {
  width: max(96px, 24%);
  background: var(--lane-bg, var(--accent)); color: var(--on-accent);
  font-weight: var(--fw-ui);
  border-bottom-color: rgba(255, 255, 255, 0.2);
}
/* the lane stands a little proud of the table: taller header, rounded ends */
.compare thead th.is-us {
  height: 76px; vertical-align: middle;
  font-family: var(--font-display); font-weight: var(--fw-title); font-size: var(--fs-title); letter-spacing: -0.01em; color: var(--on-accent);
  border-radius: var(--r-lg) var(--r-lg) 0 0; border-bottom-color: rgba(255, 255, 255, 0.2);
}
.compare tbody tr:last-child td { border-bottom: 0; }
.compare tbody tr:last-child .is-us { border-radius: 0 0 var(--r-lg) var(--r-lg); height: 72px; }
.compare .yes, .compare .no { display: inline-block; width: 20px; height: 20px; vertical-align: middle; background-color: currentColor; }
.compare .yes { color: var(--fg-mark); -webkit-mask: var(--icon-check) center / contain no-repeat; mask: var(--icon-check) center / contain no-repeat; }
.compare .no { color: var(--fg-3); -webkit-mask: var(--icon-clear) center / 14px no-repeat; mask: var(--icon-clear) center / 14px no-repeat; }
.compare .is-us .yes { color: var(--on-accent); }
@media (max-width: 640px) {
  .compare th, .compare td { padding-inline: var(--space-3); }
  .compare { font-size: var(--fs-small); }
}

/* ---------- Carousel: a scroll-snapped row of cards with round prev / next buttons. motion.js wires [data-carousel]:
   the buttons page by one card and disable at the ends; touch and trackpads simply scroll ---------- */
.carousel-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: var(--carousel-card, min(78%, 360px)); gap: var(--grid-gap);
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding-bottom: var(--space-2);
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track > * { scroll-snap-align: start; min-width: 0; }
.carousel-controls { display: flex; gap: var(--space-2); justify-content: flex-end; margin-top: var(--space-5); }
/* a white face with an ink arrow on every surface */
.carousel-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--rule-2); background: var(--surface); color: var(--ink);
  transition: background-color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out), opacity var(--dur-2) var(--ease-out), transform var(--dur-3) var(--ease-spring);
}
.carousel-btn .icon-arrow { width: 16px; height: 16px; }
.carousel-btn[data-dir="-1"] .icon-arrow { rotate: 180deg; }
@media (hover: hover) { .carousel-btn:not(:disabled):hover { border-color: var(--fg-3); transform: scale(1.06); } }
.carousel-btn:disabled { opacity: 0.35; cursor: default; }

/* ==========================================================================
   7. Results kit (data-viz): the vocabulary of a diagnostic result. Teal says "in range"; the state tokens say
      borderline (--state-watch) and out of range (--state-out). Everything draws on reveal (motion.js adds .is-drawn
      when it enters the viewport; no JS, reduced motion and print show the final state).
        .finding  a state chip          .range  a value on its reference range      .meter  a fill to a value
        .gauge    a ring to a value     .chart  a line or bars from data-points     .results  a ruled list of results
   Values come from data-* attributes (motion.js turns them into --lo / --hi / --v); never inline styles.
   ========================================================================== */
:is(.finding, .range, .meter, .gauge, .chart, .result, .results) { --st: var(--state-in); --st-ink: var(--state-in-ink); --st-bg: var(--state-in-bg); }
:is(.finding, .range, .meter, .gauge, .chart, .result)[data-state="watch"] { --st: var(--state-watch); --st-ink: var(--state-watch-ink); --st-bg: var(--state-watch-bg); }
:is(.finding, .range, .meter, .gauge, .chart, .result)[data-state="out"] { --st: var(--state-out); --st-ink: var(--state-out-ink); --st-bg: var(--state-out-bg); }

/* ---------- Finding chip: <span class="finding" data-state="out">Above range</span> (in | watch | out) ---------- */
.finding {
  display: inline-flex; align-items: center; gap: 8px; align-self: center; justify-self: start;
  min-height: 30px; padding: 0 12px 0 10px;
  border-radius: var(--r-pill);
  background: var(--st-bg); color: var(--st-ink);
  font-family: var(--font-sans); font-size: var(--fs-small); font-weight: var(--fw-ui); line-height: 1.2; letter-spacing: 0;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.finding::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--st); flex: 0 0 auto; }
/* out of range carries a halo: the one mark on the page that asks to be looked at */
.finding[data-state="out"]::before { box-shadow: 0 0 0 3px color-mix(in srgb, var(--st) 26%, transparent); }
.finding.is-quiet { min-height: 24px; padding: 0; background: none; }
:is(.on-photo, .photo-card, .bleed) .finding:not(.is-quiet) { border: 1px solid var(--edge); -webkit-backdrop-filter: var(--card-blur); backdrop-filter: var(--card-blur); }

/* ---------- Range bar: a value on its reference range ----------
   <div class="range" data-range data-min="3" data-max="8" data-low="4" data-high="5.6" data-value="6.1" data-state="out">
     <div class="range-head"><span class="range-name">HbA1c</span><span class="range-value">6.1<small>%</small></span></div>
     <div class="range-track"><i class="range-band"></i><i class="range-dot"></i></div>
     <div class="range-scale"><span>4.0</span><span>5.6</span></div>
   </div>
   The band is the normal range (teal), the dot is the value in its state colour; the scale numbers sit under the
   band's ends. On reveal the band opens from its centre and the dot travels in from the band. */
.range { --lo: 0.35; --hi: 0.65; --v: 0.5; display: grid; gap: var(--space-2); color: var(--fg); min-width: 0; }
.range-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); }
.range-name { font-size: var(--fs-card); font-weight: var(--fw-ui); line-height: 1.3; color: var(--fg); }
.range-value {
  font-family: var(--font-display); font-weight: var(--fw-display); font-size: var(--fs-h3); line-height: 1;
  letter-spacing: -0.02em; font-variant-numeric: lining-nums tabular-nums; color: var(--fg); white-space: nowrap;
}
.range-value small { margin-left: 4px; font-family: var(--font-sans); font-size: var(--fs-small); font-weight: 400; letter-spacing: 0; color: var(--fg-3); }
.range-track { position: relative; height: 6px; margin-block: 9px 4px; border-radius: var(--r-pill); background: var(--viz-track); container-type: inline-size; }
.range-band {
  position: absolute; top: 0; bottom: 0;
  left: calc(var(--lo) * 100%); width: calc((var(--hi) - var(--lo)) * 100%);
  background: var(--viz-band);
}
/* the reference range's ends: crisp 2px ticks that stand proud of the track, like the marks on a lab report */
.range-band::before, .range-band::after { content: ""; position: absolute; top: -5px; bottom: -5px; width: 2px; border-radius: 1px; background: var(--fg-mark); }
.range-band::before { left: -1px; }
.range-band::after { right: -1px; }
.range-dot {
  position: absolute; top: 50%; left: calc(var(--v) * 100%);
  width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  background: var(--st); box-shadow: 0 0 0 3px var(--viz-dot-ring);
}
.range-scale { position: relative; height: 18px; font-size: var(--fs-eyebrow); line-height: 18px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.range-scale > span { position: absolute; top: 0; translate: -50% 0; white-space: nowrap; }
.range-scale > span:nth-child(1) { left: calc(var(--lo) * 100%); }
.range-scale > span:nth-child(2) { left: calc(var(--hi) * 100%); }
.range-scale > span:nth-child(3) { right: 0; translate: none; }   /* optional unit / "normal range" note at the end */

/* ---------- Meter: a fill to a value (a line that fills on reveal) ----------
   <div class="meter" data-meter data-value="72" data-max="100"><div class="meter-head"><span class="meter-label">Pathway precision</span>
     <b class="meter-value" data-count="72" data-suffix="%">72%</b></div><div class="meter-track"><i></i></div></div> */
.meter { --v: 0.5; display: grid; gap: var(--space-2); min-width: 0; }
.meter-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); }
.meter-label { font-size: var(--fs-small); line-height: 1.4; color: var(--fg-2); }
.meter-value { font-family: var(--font-display); font-weight: var(--fw-title); font-size: var(--fs-row); line-height: 1; letter-spacing: -0.01em; font-variant-numeric: lining-nums tabular-nums; color: var(--fg); }
.meter-track { position: relative; height: var(--meter-h, 4px); border-radius: var(--r-pill); background: var(--viz-track); overflow: hidden; }
.meter-track > i { position: absolute; inset: 0; border-radius: inherit; background: var(--st); transform-origin: left center; scale: var(--v) 1; }
.meter.is-thick { --meter-h: 10px; }

/* ---------- Gauge: a ring to a value (a score). motion.js draws the ring ----------
   <div class="gauge" data-gauge data-value="82" data-max="100"><b class="gauge-value" data-count="82">82</b><span class="gauge-label">Readiness</span></div> */
.gauge {
  --v: 0.5;
  position: relative; display: inline-grid; place-content: center; justify-items: center; gap: 2px;
  width: var(--gauge-size, 152px); aspect-ratio: 1; text-align: center; color: var(--fg);
}
.gauge > svg { position: absolute; inset: 0; width: 100%; height: 100%; rotate: -90deg; overflow: visible; }
.gauge-track, .gauge-arc { fill: none; stroke-width: 6; vector-effect: non-scaling-stroke; }
.gauge-track { stroke: var(--viz-track); }
.gauge-arc { stroke: var(--st); stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: calc(1 - var(--v)); }
.gauge-value { position: relative; font-family: var(--font-display); font-weight: var(--fw-display); font-size: calc(var(--gauge-size, 152px) * 0.3); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: lining-nums tabular-nums; }
.gauge-label { position: relative; max-width: 11ch; font-size: var(--fs-eyebrow); line-height: 1.3; color: var(--fg-3); }

/* ---------- Chart: a small line or bar chart built by motion.js from data-points ----------
   <figure class="chart" data-chart="line" data-points="5.2,5.5,5.9,6.1" data-min="4" data-max="7" data-low="4" data-high="5.7"
           data-ticks="4,5,6,7" data-labels="Jan,Apr,Jul,Oct" data-state="watch"><figcaption>…</figcaption></figure>
   Dashed gridlines with tick labels in small pills, the reference range as a teal band, the line (and a soft area)
   draws left to right, the last point gets a state dot. data-chart="bars": bars grow from the baseline in turn, the
   last bar in the state colour. The figure keeps its own caption text; the drawing is aria-hidden. */
.chart { display: grid; gap: var(--space-3); min-width: 0; color: var(--fg); }
.chart > figcaption, .chart-cap { font-size: var(--fs-small); line-height: 1.45; color: var(--fg-2); }
.chart-plot { position: relative; height: var(--chart-h, 180px); margin-left: var(--chart-gutter, 44px); margin-right: 10px; }
.chart-grid { position: absolute; inset: 0; z-index: 1; }   /* the dashed lines run over the reference band */
.chart-grid > span {
  position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--viz-grid);
}
.chart-grid > span > b {
  position: absolute; right: calc(100% + 8px); top: 0; translate: 0 -50%;
  padding: 1px 6px; border: 1px solid var(--rule-2); border-radius: var(--r-pill);
  font-size: var(--fs-eyebrow); font-weight: 400; line-height: 1.3; color: var(--fg-3); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chart-band {
  position: absolute; left: 0; right: 0;
  background: var(--viz-field); opacity: var(--viz-band-o, 1);
  box-shadow: inset 0 1px 0 var(--fg-mark), inset 0 -1px 0 var(--fg-mark);
}
.chart-plot > svg { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; overflow: visible; clip-path: inset(-12px -12px -12px -12px); }
.chart-line { fill: none; stroke: var(--fg-mark); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart-area { fill: var(--fg-mark); opacity: 0.07; stroke: none; }
.chart-dot { position: absolute; z-index: 3; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--st); box-shadow: 0 0 0 3px var(--viz-dot-ring); }
.chart-bars { position: absolute; inset: 0; z-index: 2; display: flex; align-items: flex-end; gap: var(--chart-bar-gap, 6px); }
.chart-bars > i { flex: 1 1 0; min-width: 0; height: calc(var(--h, 0.5) * 100%); border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--fg-mark) 55%, transparent); transform-origin: 50% 100%; }
.chart-bars > i:last-child { background: var(--st); }
.chart-x { display: flex; justify-content: space-between; margin-left: var(--chart-gutter, 44px); font-size: var(--fs-eyebrow); line-height: 1.3; color: var(--fg-3); font-variant-numeric: tabular-nums; }

/* ---------- Results: a ruled list of results (Function's biomarker table, MDC's findings) ----------
   <ul class="results" role="list"><li class="result" data-state="out"><div class="result-name"><b>Vitamin D</b><span>25-OH, nmol/L</span></div>
     <div class="range" …>…</div><span class="finding" data-state="out">Low</span></li>…</ul> */
.results { list-style: none; display: grid; border-top: 1px solid var(--rule-2); container-type: inline-size; }
.result {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(6.5rem, auto) minmax(0, 1.5fr) minmax(8.5rem, auto);
  align-items: center; gap: var(--space-3) var(--space-7);
  padding: var(--space-5) 0; border-bottom: 1px solid var(--rule-2);
}
.result-name { display: grid; gap: 2px; min-width: 0; }
.result-name b { font-family: var(--font-display); font-weight: var(--fw-title); font-size: var(--fs-row); line-height: 1.2; letter-spacing: -0.01em; color: var(--fg); }
.result-name span { font-size: var(--fs-small); line-height: 1.4; color: var(--fg-3); }
.result-value { font-family: var(--font-display); font-weight: var(--fw-display); font-size: var(--fs-h3); line-height: 1; letter-spacing: -0.02em; font-variant-numeric: lining-nums tabular-nums; color: var(--fg); white-space: nowrap; text-align: right; }
.result-value small { margin-left: 4px; font-family: var(--font-sans); font-size: var(--fs-small); font-weight: 400; letter-spacing: 0; color: var(--fg-3); }
.result > .range { padding-top: 18px; }   /* the scale numbers hang below the track: keep the track on the row's centre line */
.result > .finding { justify-self: end; }
/* laid out by the list's own width (a container query), so a results list in a narrow card stacks like on a phone */
@container (max-width: 760px) {
  .result { grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--space-3) var(--space-5); }
  .result > .range { grid-column: 1 / -1; grid-row: 2; padding-top: 0; }
}
@container (max-width: 440px) {
  .result { grid-template-columns: minmax(0, 1fr) auto; }
  .result > .finding { grid-column: 1 / -1; grid-row: 3; justify-self: start; }
}

/* ==========================================================================
   8. Pinned scroll scene: a deck of frames that pin under the header in turn. Each next frame slides up over the one
      before it, which recedes (scales back a touch, its content fades) and leaves a 14px edge showing above: the
      reader feels the stack build. Pure CSS sticky, so it pins without JS too; motion.js only adds the recede.
   <section class="section scene" data-scene aria-label="…">
     <div class="wrap">
       <div class="section-head">…</div>                                           (optional)
       <ol class="scene-index" role="list"><li data-scene-label="0">Skin</li>…</ol>   (optional: the current one is marked)
       <div class="scene-frames">
         <article class="scene-frame"><div class="scene-copy">…</div><div class="scene-media media"><img …></div></article> …
       </div>
     </div>
   </section>
   Frames are cards (the card surface: tint on the canvas, white on a field, night-2 on night). >= 981px each frame
   is sticky at the header + 24px (+ 14px per frame before it) and is as tall as the screen allows (<= 640px), so keep
   its copy short. motion.js writes --cover (0 -> 1) on a frame while the next one covers it, --scene (0 -> 1) on the
   scene, and marks the frame on top (and its label) .is-current; tabbing into a covered frame scrolls it to the top.
   Phones and tablets: no pin, the frames follow one another (media first). Reduced motion: the deck still pins
   (that is the reader's own scroll), nothing recedes. A full-page capture or print shows every frame in turn.
   ========================================================================== */
.scene-frames { display: grid; gap: var(--grid-gap); }
.scene-frame {
  position: relative; isolation: isolate; overflow: clip;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center;
  border-radius: var(--r-lg);
  background: var(--card-bg, var(--tint)); color: var(--card-fg, inherit);
  min-width: 0;
  transform-origin: 50% 0;
}
/* the copy carries the padding; the photo runs to the card's own edges (Neko's scan cards) */
.scene-copy { min-width: 0; padding: var(--panel-pad) clamp(1.5rem, 0.2rem + 4vw, 5rem) var(--panel-pad) var(--panel-pad); }
.scene-copy > .lede { margin-top: var(--space-5); }
.scene-frame > .scene-media { min-height: 0; aspect-ratio: 4 / 3; align-self: stretch; border-radius: 0; }
/* the photo fills its frame and never sets its height (a portrait photo would stretch the frame past the screen) */
.scene-media > img:not([data-parallax]) { position: absolute; inset: 0; }
.scene-index { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); margin-bottom: var(--space-6); font-size: var(--fs-small); font-weight: var(--fw-ui); color: var(--fg-3); }
.scene-index > li { transition: color var(--dur-3) var(--ease-out); }
.scene-index > li.is-current { color: var(--fg); }
.scene-frame:nth-child(2) { --i: 1; } .scene-frame:nth-child(3) { --i: 2; } .scene-frame:nth-child(4) { --i: 3; }
.scene-frame:nth-child(5) { --i: 4; } .scene-frame:nth-child(6) { --i: 5; }
@media (max-width: 980px) {
  .scene-frame { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .scene-frame > .scene-media { order: -1; aspect-ratio: 16 / 10; }
  .scene-copy { padding: var(--card-pad) var(--card-pad) var(--panel-pad); }
}
@media (min-width: 981px) {
  .scene-frames { gap: var(--space-7); }
  .scene-frame {
    position: sticky;
    top: calc(var(--nav-h) + var(--space-6) + var(--i, 0) * var(--scene-peek, 14px));
    min-height: min(640px, calc(100svh - var(--nav-h) - 96px));
  }
  .scene-frame > .scene-media { aspect-ratio: auto; min-height: 320px; }
}
@media print { .scene-frame { position: relative; top: auto; break-inside: avoid; } }

/* ==========================================================================
   9. Layout kits: bento (a mixed-span media grid) · graded photos + photo tag · dense list · data table.
      Shared versions of what pages kept building on their own (index's who bento and photo tags, products' ICD
      columns, services' specialty rows). All read the SURFACE tokens: paper, a field, night and a photo.
   ========================================================================== */
/* ---------- Bento: photos, photo cards and cards in one grid of mixed spans (Neko's who-we-are, Function's feature
   grid). 4 tracks >= 981px · 2 tracks 641-980 · 1 track on phones. Rows keep one rhythm (--bento-row, 176-288px);
   a cell grows if its copy needs it. Spans: .is-wide (2 tracks) · .is-tall (2 rows) · .is-big (2 x 2) · .is-full.
   Dense flow fills the holes. A .media or .photo-card fills its cell (its photo never sets the row height).
   <div class="bento" data-reveal-stagger="80">
     <figure class="media graded is-big"><img src="…" alt="…"><span class="photo-tag">Care</span></figure>
     <a class="photo-card is-tall" href="…"><img …><div><h3>…</h3><p>…</p></div></a>
     <article class="card">…</article> <article class="card is-wide">…</article>
   </div> ---------- */
.bento {
  --bento-cols: 4;
  display: grid;
  grid-template-columns: repeat(var(--bento-cols), minmax(0, 1fr));
  grid-auto-rows: minmax(var(--bento-row, clamp(11rem, 5.6rem + 9vw, 18rem)), auto);
  grid-auto-flow: row dense;
  gap: var(--grid-gap);
}
.bento > * { min-width: 0; min-height: 0; margin: 0; }
.bento > .is-wide { grid-column: span 2; }
.bento > .is-tall { grid-row: span 2; }
.bento > .is-big { grid-column: span 2; grid-row: span 2; }
.bento > .is-full { grid-column: 1 / -1; }
.bento > .photo-card { --photo-card-h: 0px; }
.bento > .media > img:not([data-parallax]) { position: absolute; inset: 0; }
.bento > :is(.card, .panel) { display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-4); }

/* ---------- Graded photo: one warm grade for people and room photos, so a set reads as one shoot, not as stock.
   A touch of sepia, less saturation, a butter wash multiplied over it, film grain. On a positioned frame (.media):
   <figure class="media graded"><img …></figure> · or on the <img> alone: <img class="graded-img">.
   It uses the frame's ::before / ::after: don't combine it with .reticle or data-reveal="scan" on the same frame ---- */
.graded > img, .graded-img { filter: sepia(0.26) saturate(0.84) contrast(1.05) brightness(1.02); }
.graded::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: var(--grain); opacity: 0.16; mix-blend-mode: overlay;
}
.graded::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: var(--butter); mix-blend-mode: multiply; opacity: 0.2;
}
/* ---------- Photo tag: a small dark-glass label on a photo (Neko's SCIENCE / CARE labels, in sentence case).
   Absolute, top-left of a positioned frame: <span class="photo-tag">Care</span> (>= 4.7:1 on any photo) ---------- */
.photo-tag {
  position: absolute; left: var(--space-4); top: var(--space-4); z-index: 3;
  display: inline-flex; align-items: center;
  min-height: 28px; padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--glass-dark); color: var(--on-photo);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  font-size: var(--fs-eyebrow); font-weight: var(--fw-ui); line-height: 1;
}

/* ---------- Dense list: a ruled index of short rows (codes, specialties, directories): a key, a label, an optional
   meta. .dense-2 / .dense-3 lay it in two / three ruled columns that fill row by row, so the rows of every column
   line up (never ragged columns). Rows can be links (each >= 52px tall).
   <ul class="dense dense-2" role="list">
     <li><a class="dense-row" href="…"><span class="dense-key">M54.5</span><span class="dense-label">Low back pain</span>
       <span class="dense-meta">Musculoskeletal</span></a></li>
     <li><div class="dense-row"><span class="dense-key">G43</span><span class="dense-label">Migraine</span></div></li>
   </ul>
   Without keys: add .is-plain (label + meta only). ---------- */
.dense { list-style: none; display: grid; grid-template-columns: repeat(var(--dense-cols, 1), minmax(0, 1fr)); column-gap: var(--grid-gap); border-top: 1px solid var(--rule-2); }
.dense-2 { --dense-cols: 2; }
.dense-3 { --dense-cols: 3; }
.dense > li { display: flex; min-width: 0; border-bottom: 1px solid var(--rule); }
.dense-row {
  flex: 1 1 auto; min-width: 0;
  display: grid; grid-template-columns: var(--dense-key-w, 4.75rem) minmax(0, 1fr) auto; align-items: baseline; gap: var(--space-4);
  min-height: 52px; padding: 13px 0;
  color: var(--fg);
}
.dense.is-plain .dense-row { grid-template-columns: minmax(0, 1fr) auto; }
.dense-key { font-size: var(--fs-small); font-weight: var(--fw-ui); line-height: 1.4; letter-spacing: 0.02em; color: var(--fg-link); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dense-label { min-width: 0; font-size: var(--fs-card); line-height: 1.4; color: var(--fg); }
.dense-meta { font-size: var(--fs-small); line-height: 1.4; color: var(--fg-3); text-align: right; }
a.dense-row { transition: color var(--dur-2) var(--ease-out); }
a.dense-row .dense-label { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.24em; text-decoration-color: transparent; transition: text-decoration-color var(--dur-2) var(--ease-out); }
@media (hover: hover) { a.dense-row:hover .dense-label { text-decoration-color: currentColor; } }
a.dense-row:focus-visible .dense-label { text-decoration-color: currentColor; }

/* ---------- Data table: a plain ruled table for real tabular data (hours, fees, schedules). The comparison table
   (§6) is for "us vs them"; this is for facts. Numbers in .num cells are right-aligned and tabular. Wrap it in
   .table-wrap so a wide table scrolls inside itself on a phone, never the page ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-card); line-height: 1.4; color: var(--fg); font-variant-numeric: tabular-nums; }
.table :is(th, td) { padding: var(--space-3) var(--space-5) var(--space-3) 0; text-align: left; vertical-align: baseline; border-bottom: 1px solid var(--rule); }
.table :is(th, td):last-child { padding-right: 0; }
.table thead th { padding-block: var(--space-2); font-size: var(--fs-small); font-weight: var(--fw-ui); color: var(--fg-3); border-bottom-color: var(--rule-2); }
.table tbody th { font-weight: var(--fw-ui); color: var(--fg); }
.table td { color: var(--fg-2); }
.table .num { text-align: right; }
.table caption { caption-side: bottom; padding-top: var(--space-3); text-align: left; font-size: var(--fs-small); color: var(--fg-3); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  /* two product cards side by side, the third full width below them, laid out across */
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .products > .prod:last-child:nth-child(odd) {
    grid-column: 1 / -1; grid-row: auto;
    /* laid out across: tag and title on the left; the copy starts on the title's baseline in the right column
       (exactly where the text of the card above-right starts) and its link follows it at the usual step */
    display: grid; grid-template-rows: auto auto auto; grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: calc(var(--grid-gap) + 2 * var(--card-pad)); align-content: start;
  }
  .products > .prod:last-child:nth-child(odd) > :nth-child(1) { grid-column: 1; grid-row: 1; }
  .products > .prod:last-child:nth-child(odd) > :nth-child(2) { grid-column: 1; grid-row: 2; align-self: baseline; }
  .products > .prod:last-child:nth-child(odd) > :nth-child(3) { grid-column: 2; grid-row: 2; align-self: baseline; }
  .products > .prod:last-child:nth-child(odd) > :nth-child(4) { grid-column: 2; grid-row: 3; margin-top: var(--space-2); }
}
@media (max-width: 980px) {
  .services, .dir-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* an odd last card in a two-column grid spans the row instead of sitting beside a hole */
  .services:not(.ruled) > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .split { grid-template-columns: 1fr; }
  .split-visual { min-height: 0; aspect-ratio: 16 / 10; }
  .bento { --bento-cols: 2; }
  .dense-3 { --dense-cols: 2; }
}
@media (max-width: 640px) {
  .services, .products, .dir-grid, .thumb-list-2 { grid-template-columns: 1fr; }
  .ruled > * { padding-right: 0; padding-block: var(--space-7); }
  .services > :last-child:nth-child(odd) { grid-column: auto; }
  .products > .prod:last-child:nth-child(odd) { grid-template-columns: 1fr; }
  .products > .prod:last-child:nth-child(odd) > * { grid-column: 1 !important; grid-row: auto !important; }
  .stats-row { grid-template-columns: 1fr 1fr; gap: var(--space-3); }
  .stat-card { padding: var(--space-4) var(--space-5); }
  .stat-row { --stat-cols: 1; }
  .stat-row > .stat + .stat { border-left: 0; padding-left: 0; border-top: 1px solid var(--stat-rule, var(--rule-2)); padding-top: var(--space-5); }
  /* phones: one track; cards hug their copy, photos keep a 4:3 frame and photo cards a fixed height */
  .bento { --bento-cols: 1; grid-auto-rows: auto; }
  .bento > :is(.is-wide, .is-big, .is-full) { grid-column: 1 / -1; }
  .bento > :is(.is-tall, .is-big) { grid-row: auto; }
  .bento > .media { aspect-ratio: 4 / 3; }
  .bento > .photo-card { min-height: 380px; }
  .photo-tag { left: var(--space-3); top: var(--space-3); }
  .dense { --dense-cols: 1; }
  .dense-row { grid-template-columns: var(--dense-key-w, 4.75rem) minmax(0, 1fr); row-gap: 2px; }
  .dense-meta { grid-column: 2; text-align: left; }
  .dense.is-plain .dense-row { grid-template-columns: minmax(0, 1fr); }
  .dense.is-plain .dense-meta { grid-column: 1; }
}
