/*
 * RevivMD — modern-blue home.
 * Extracted from docs/revivmd-redesign/modern-blue.html.
 * Prototype-only ACF annotation styles removed.
 */

/* ===========================================================================
   1. TOKENS — one blue-dominant system, two themes
   Anchored on RevivMD's packaging navy #0F2438, extended into a full scale.

   Dark is the default (:root). Light overrides via [data-theme="light"] on
   <html>, set by the no-flash script in <head>. Every colour in the file is a
   token — a single hardcoded rgba() would survive the switch and break.

   Every ratio below is measured, not estimated. See section 1b for the light
   scale's numbers.
   =========================================================================== */
:root {
  color-scheme: dark;

  /* Canvas, darkest → lightest */
  --bg:         #050A14;   /* page                      */
  --bg-2:       #080F1C;   /* alternating band          */
  --panel:      #0B1626;   /* cards, panels             */
  --panel-2:    #0F2438;   /* RevivMD packaging navy    */
  --panel-3:    #16314F;   /* hover / raised            */

  /* Action + accent */
  --blue:       #1E6AFF;   /* primary action. 4.60:1 vs white — AA */
  --blue-lift:  #4A8CFF;   /* hover                     */
  --cyan:       #5FD0FF;   /* technical / data marks    */
  --amber:      #FFB547;   /* warnings only             */
  --on-blue:    #fff;      /* label on a --blue fill    */

  /* Type */
  --text:       #E6EEFB;
  --muted:      #8EA6C8;
  /* --dim is the mono micro-label colour and carries real copy, so it has to
     clear 4.5:1 as normal text. #5B739A measured only 4.12 on --bg and 3.28 on
     --panel-2; #7390B8 holds >=4.8 on every panel in the scale. */
  --dim:        #7390B8;

  /* Hairlines — the modular grid is the main visual device */
  --line:       rgba(94,150,255,.20);
  --line-soft:  rgba(94,150,255,.11);
  --line-hot:   rgba(95,208,255,.45);

  /* Translucent chrome. Tokenised because the alpha has to sit over a
     theme-specific canvas to stay legible. */
  --header-bg:    rgba(5,10,20,.92);
  --header-solid: rgba(5,10,20,.98);
  --scrim-bg:     rgba(3,6,12,.72);
  --bar-bg:       rgba(5,10,20,.97);
  --btn-light-hi: #fff;    /* .btn--light hover         */

  /* Ambient glows */
  --glow-blue: rgba(30,106,255,.30);

  /* ---------------------------------------------------------------------
     MEDIA PANELS STAY DARK IN BOTH THEMES — this is deliberate, not laziness.
     The product photos have black backgrounds and are composited with
     mix-blend-mode: screen, which maps black to transparent. Over a light
     surface, screen blows the vial out to white and multiply leaves a black
     box. Keeping the media wells dark navy preserves the composite, and a
     light page with dark instrument panels reads as intentional.
     Anything drawn ON a media well therefore uses an --on-media-* token.
     --------------------------------------------------------------------- */
  --media-a:       #0F2438;
  --media-b:       #050A14;
  --media-glow:    rgba(95,208,255,.30);
  --media-mark:    rgba(95,208,255,.45);
  --on-media:      #E6EEFB;
  --on-media-dim:  #7390B8;
  --on-media-cyan: #5FD0FF;
  --cap-bg:        rgba(5,10,20,.82);
  --img-blend:     screen;
  /* Painted behind card photos. The product shots are white-studio JPEGs, so a
     source that carries transparency (the WebP exports do) lands on the same
     white field instead of punching a hole through to the dark media well. */
  --media-fill:    #FFFFFF;

  --sans: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter:  clamp(16px, 4.5vw, 40px);
  --section: clamp(60px, 11vw, 128px);
  --gap:     clamp(12px, 2.5vw, 20px);
  --max:     1340px;

  --tap: 48px;

  /* Matches .header__inner's min-height. Anything that sticks below the header
     offsets by this. */
  --header-h: 56px;

  --safe-b: env(safe-area-inset-bottom, 0px);
  --bar-h:  calc(66px + var(--safe-b));

  /* Nothing is rounded. Kept as a token so it is a deliberate decision. */
  --radius: 0px;
}

/* ===========================================================================
   1b. LIGHT THEME — still blue-dominant, not a grey sheet of paper
   The canvas is blue-tinted all the way up (#F4F7FD → #DCE7F8) so the brand
   survives the switch. Accents move DOWN in luminance instead of up: the
   electric #1E6AFF becomes #1552D6 and the light cyan becomes a deep teal,
   because the originals only measure 4.29:1 and 1.6:1 on a white page.

   Measured against the light canvas (bg / bg-2 / panel / panel-2):
     --text   #0A1A2F   16.28 / 15.14 / 17.48 / 14.00
     --muted  #3E5068    7.67 /  7.13 /  8.23 /  6.59
     --dim    #566B86    5.09 /  4.73 /  5.46 /  (never hosted on panel-2)
     --cyan   #07607F    6.55 /  6.09 /  7.03 /  5.63
     --blue   #1552D6    6.10 /  5.67 /  6.54 /  5.24   · white on it: 6.54
   =========================================================================== */
[data-theme="light"] {
  color-scheme: light;

  --bg:         #F4F7FD;
  --bg-2:       #E9EFFA;
  --panel:      #FFFFFF;
  --panel-2:    #DCE7F8;
  --panel-3:    #C9D9F3;

  --blue:       #1552D6;
  --blue-lift:  #0B3FAE;
  --cyan:       #07607F;
  --amber:      #8A5200;
  --on-blue:    #fff;

  --text:       #0A1A2F;
  --muted:      #3E5068;
  --dim:        #566B86;

  --line:       rgba(21,82,214,.26);
  --line-soft:  rgba(21,82,214,.13);
  --line-hot:   rgba(7,96,127,.55);

  --header-bg:    rgba(244,247,253,.92);
  --header-solid: rgba(244,247,253,.98);
  --scrim-bg:     rgba(10,26,47,.46);
  --bar-bg:       rgba(244,247,253,.97);
  --btn-light-hi: #000;

  --glow-blue: rgba(21,82,214,.13);

  /* Media wells keep their own dark scale — see the note in :root. Only the
     surrounding page flips. */
  --media-a:    #15314F;
  --media-b:    #0A1A2F;
}

/* ===========================================================================
   2. RESET / BASE  (mobile is the default, not a breakpoint)
   =========================================================================== */
*, *::before, *::after { box-sizing: border-box; border-radius: var(--radius); }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
  background: var(--bg);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: var(--bar-h);   /* room for the sticky thumb bar */
}

h1, h2, h3 { margin: 0 0 .5em; font-weight: 500; line-height: 1.05; color: var(--text); }
h1 { font-size: clamp(2rem, 8vw, 4.4rem); letter-spacing: -.02em; text-wrap: balance; }
h2 { font-size: clamp(1.5rem, 5.4vw, 2.6rem); letter-spacing: -.015em; text-wrap: balance; }
h3 { font-size: clamp(1.05rem, 3.6vw, 1.25rem); letter-spacing: -.01em; }

p { margin: 0 0 1em; text-wrap: pretty; }
a { color: var(--text); text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
/* Form controls don't inherit font-family — without this they fall back to the
   UA default (measured: Arial) the moment one carries visible text. */
button, input, select, textarea { font: inherit; }

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

::selection { background: var(--blue); color: var(--on-blue); }

.vh {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 8px; top: -100px; z-index: 999;
  background: var(--blue); color: var(--on-blue);
  padding: 12px 18px; font-family: var(--mono); font-size: .8rem;
  transition: top .2s;
}
.skip:focus { top: 8px; }

/* ===========================================================================
   3. THE MONO LABEL — the single most characteristic device of the reference
   =========================================================================== */
.lbl {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
  line-height: 1;
}
.lbl--cyan { color: var(--cyan); }
.lbl--text { color: var(--text); }

/* Eyebrow = mono label preceded by a hairline rule. */
.eyebrow {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px; flex: none;
  background: var(--line-hot);
}

/* ===========================================================================
   4. LAYOUT
   =========================================================================== */
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

.section { padding-block: var(--section); }
.section--alt { background: var(--bg-2); }
.section--line { border-top: 1px solid var(--line-soft); }

.head { margin-bottom: clamp(28px, 5vw, 56px); max-width: 60ch; }
.lede { font-size: clamp(.98rem, 3.4vw, 1.1rem); color: var(--muted); max-width: 56ch; }

/* ===========================================================================
   5. BUTTONS — square, mono-labelled, 48px tap floor
   =========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: var(--tap);
  padding: 15px 26px;
  font-family: var(--mono);
  font-size: .78rem; font-weight: 500;
  letter-spacing: .13em; text-transform: uppercase;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--blue); color: var(--on-blue); border-color: var(--blue); }
.btn--primary:hover { background: var(--blue-lift); border-color: var(--blue-lift); }

.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--cyan); color: var(--cyan); }

.btn--light { background: var(--text); color: var(--bg); border-color: var(--text); }
/* --btn-light-hi pushes AWAY from the page: #fff in dark, #000 in light. */
.btn--light:hover { background: var(--btn-light-hi); border-color: var(--btn-light-hi); }

.btn--block { width: 100%; }

/* Arrow affordance borrowed from the reference's "See if you qualify" button */
.btn__arrow { font-size: .7em; }

/* ===========================================================================
   6. HEADER — 56px on phones, drawer nav
   =========================================================================== */
.header {
  position: sticky; top: 0; z-index: 70;   /* must outrank .scrim (65) */
  background: var(--header-bg);
  border-bottom: 1px solid var(--line-soft);
}
.header.is-scrolled { background: var(--header-solid); border-bottom-color: var(--line); }

.header__inner { display: flex; align-items: center; gap: 10px; min-height: 56px; }

/* Lowercase geometric wordmark, as per the reference's "system" mark. */
.logo {
  display: flex; align-items: center; min-height: var(--tap);
  margin-right: auto;
  font-size: 1.3rem; font-weight: 500; letter-spacing: -.035em;
  color: var(--text);
}
.logo b { font-weight: 500; color: var(--cyan); }

.navToggle, .themeToggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--tap); height: var(--tap); flex: none;
  padding: 0; background: none; border: 1px solid var(--line);
  color: var(--text); cursor: pointer;
}
.navToggle:hover, .themeToggle:hover { border-color: var(--cyan); color: var(--cyan); }

/* Show the destination, not the current state: sun while dark, moon while light. */
[data-theme="dark"]  .themeToggle .ico-moon { display: none; }
[data-theme="light"] .themeToggle .ico-sun  { display: none; }
.navToggle .ico-x { display: none; }
.navToggle[aria-expanded="true"] .ico-x { display: block; }
.navToggle[aria-expanded="true"] .ico-bars { display: none; }

/* Drawer. z-index is intentionally LOCAL — .header is the stacking context. */
.nav {
  position: fixed; inset: 0 0 0 auto; z-index: 1;
  width: min(320px, 88vw);
  display: flex; flex-direction: column;
  background: var(--bg-2);
  border-left: 1px solid var(--line);
  padding: 14px 0 calc(22px + var(--safe-b));
  transform: translateX(100%);
  transition: transform .26s cubic-bezier(.4,0,.2,1);
  overflow-y: auto; overscroll-behavior: contain;
  visibility: hidden;
}
.nav.is-open { transform: none; visibility: visible; }

.nav__close {
  align-self: flex-end; flex: none;      /* flex:none — column flex shrinks it otherwise */
  width: var(--tap); height: var(--tap); margin-right: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--line); color: var(--text); cursor: pointer;
}

/* :not(.btn) — a bare `.nav a` rule outranks .btn--primary and would repaint
   the CTA label. Learned the hard way. */
.nav a:not(.btn) {
  display: flex; align-items: center; gap: 14px;
  min-height: 56px; padding: 0 22px;
  font-family: var(--mono); font-size: .8rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--text);
  border-bottom: 1px solid var(--line-soft);
}
.nav a:not(.btn)::before { content: attr(data-n); color: var(--dim); font-size: .72rem; }
.nav a:not(.btn):hover { background: var(--panel); color: var(--cyan); }

.nav__foot { margin-top: auto; padding: 20px 22px 0; display: grid; gap: 10px; }

.scrim {
  position: fixed; inset: 0; z-index: 65;
  background: var(--scrim-bg);
  opacity: 0; visibility: hidden;
  transition: opacity .26s ease, visibility .26s;
}
.scrim.is-open { opacity: 1; visibility: visible; }

/* ===========================================================================
   7. MARQUEE / TICKER — the reference's section divider
   =========================================================================== */
.ticker {
  display: flex; overflow: hidden;
  border-block: 1px solid var(--line-soft);
  background: var(--bg-2);
  padding-block: 11px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker__track {
  display: flex; flex: none; gap: 44px; padding-right: 44px;
  animation: slide 34s linear infinite;
}
.ticker:hover .ticker__track { animation-play-state: paused; }
@keyframes slide { to { transform: translateX(-100%); } }
.ticker li { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.ticker li::after { content: ""; width: 4px; height: 4px; background: var(--cyan); flex: none; }

.ticker--hot { background: var(--panel-2); border-color: var(--line); }

/* ===========================================================================
   8. HERO
   =========================================================================== */
.hero {
  position: relative;
  padding-block: clamp(36px, 9vw, 92px) clamp(40px, 8vw, 80px);
  overflow: hidden;
}
/* Radial glow echoing the reference's lit-vial hero, in blue. */
.hero::before {
  content: "";
  position: absolute; inset: -40% -20% auto; height: 120%;
  background: radial-gradient(60% 50% at 50% 28%, var(--glow-blue), transparent 70%);
  pointer-events: none;
}
.hero > * { position: relative; }

.hero__media {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  background:
    radial-gradient(52% 52% at 50% 46%, var(--media-glow), transparent 72%),
    linear-gradient(180deg, var(--media-a), var(--media-b));
  margin-bottom: 30px;
  overflow: hidden;
}
.hero__media img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: var(--img-blend); opacity: .92; }

/* Corner registration marks — instrument framing from the reference. */
.hero__media::before, .hero__media::after {
  content: ""; position: absolute; width: 18px; height: 18px; pointer-events: none;
}
/* --media-mark, not --line-hot: these sit INSIDE a media well, which is dark in
   both themes, so they must not follow the page theme. */
.hero__media::before { top: 10px; left: 10px; border-top: 1px solid var(--media-mark); border-left: 1px solid var(--media-mark); }
.hero__media::after  { bottom: 10px; right: 10px; border-bottom: 1px solid var(--media-mark); border-right: 1px solid var(--media-mark); }

.hero h1 { margin-bottom: 20px; }
.hero h1 em { font-style: normal; color: var(--cyan); }

.hero__actions { display: grid; gap: 10px; margin-top: 28px; }

/* Spec table — price anchoring, absent from the live homepage entirely. */
.spec {
  margin-top: 30px;
  border-top: 1px solid var(--line);
}
.spec div {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}
.spec dt { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.spec dd { margin: 0; font-size: 1.05rem; font-weight: 500; color: var(--text); }
.spec dd span { color: var(--cyan); }

/* ===========================================================================
   9. RAIL — scroll-snap on phones, grid from 768px. One markup.
   =========================================================================== */
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: 80%;
  gap: var(--gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }

.hint { display: flex; align-items: center; gap: 8px; margin-top: 16px; }

/* ===========================================================================
   10. TREATMENT CARD — full-bleed image + overlay caption bar
   =========================================================================== */
.tcard {
  position: relative; display: flex; flex-direction: column;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: border-color .18s ease, background .18s ease;
}
.tcard:hover { border-color: var(--line-hot); background: var(--panel-2); }

.tcard__media {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden;
  background: linear-gradient(165deg, var(--media-a), var(--media-b));
}
/* Every card declares width="768" height="960", so the BOX is always square and
   identical — the odd one out is the source itself. The WebP exports are
   letterboxed: ~13% of the canvas top and bottom is fully transparent padding,
   so `cover` scales that padding along with the picture and the product lands
   visibly inset while the opaque JPEGs bleed to the edge.

   No stylesheet can measure an alpha channel, so the real repair is the asset
   (a trimmed copy ships in docs/, ready to replace the attachment). What CSS
   can do is stop the failure from compounding: an opaque white field behind
   every photo means a transparent source matches the white-studio JPEGs beside
   it instead of punching through to the dark media gradient. */
.tcard__media img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  background: var(--media-fill);
}

/* Price chip, top-left, mono. Strikethrough + promo, as per the reference. */
.tcard__price {
  position: absolute; top: 0; left: 0; z-index: 2;
  display: flex; align-items: baseline; gap: 8px;
  padding: 9px 12px;
  background: var(--cap-bg);
  border-right: 1px solid var(--media-mark);
  border-bottom: 1px solid var(--media-mark);
  font-family: var(--mono); font-size: .78rem;
  color: var(--on-media);
}
/* The chip overlays the dark media well, so it keeps the dark-theme type scale
   in both themes. */
.tcard__price s { color: var(--on-media-dim); }
.tcard__price b { color: var(--on-media-cyan); font-weight: 500; }

.tcard__cap {
  border-top: 1px solid var(--line);
  padding: 15px 16px;
  display: grid; gap: 4px;
}
.tcard__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tcard__cap h3 { margin: 0; font-family: var(--mono); font-size: .92rem; letter-spacing: .02em; text-transform: uppercase; }
.tcard__cap p { margin: 0; font-size: .88rem; color: var(--muted); }

.tcard__go {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--tap); padding: 0 16px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text);
}
.tcard__go:hover { color: var(--cyan); background: var(--panel-2); }

/* ===========================================================================
   11. STEPS — 01 / 02 / 03
   =========================================================================== */
.steps { display: grid; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); }
.step { background: var(--bg); padding: 26px 20px; }
.step__n {
  display: inline-block; margin-bottom: 18px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; color: var(--cyan);
}
.step h3 { font-family: var(--mono); font-size: .92rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 10px; }
.step p { font-size: .92rem; color: var(--muted); margin: 0; }

/* ===========================================================================
   12. ASSAY PANEL — CSS-only tabs via radios (native arrow-key support, 0 JS)
   =========================================================================== */
.assay { border: 1px solid var(--line); background: var(--panel); }
.assay input { position: absolute; opacity: 0; pointer-events: none; }

.assay__list { display: grid; border-bottom: 1px solid var(--line); }
.assay__list label {
  display: flex; align-items: center; gap: 12px;
  min-height: var(--tap); padding: 0 18px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: .76rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--muted); cursor: pointer;
}
.assay__list label::before { content: "\25B8"; color: transparent; }
.assay__list label:hover { color: var(--text); background: var(--panel-2); }

.assay__panels { padding: 22px 18px; }
.assay__panel { display: none; margin: 0; font-size: .95rem; color: var(--muted); }
.assay__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 18px; border-top: 1px solid var(--line-soft);
}

/* Radio → label highlight + panel switch, all sibling-selector driven. */
#as1:checked ~ .assay__list label[for="as1"],
#as2:checked ~ .assay__list label[for="as2"],
#as3:checked ~ .assay__list label[for="as3"],
#as4:checked ~ .assay__list label[for="as4"] { color: var(--text); background: var(--panel-2); }

#as1:checked ~ .assay__list label[for="as1"]::before,
#as2:checked ~ .assay__list label[for="as2"]::before,
#as3:checked ~ .assay__list label[for="as3"]::before,
#as4:checked ~ .assay__list label[for="as4"]::before { color: var(--cyan); }

#as1:checked ~ .assay__panels .assay__panel:nth-child(1),
#as2:checked ~ .assay__panels .assay__panel:nth-child(2),
#as3:checked ~ .assay__panels .assay__panel:nth-child(3),
#as4:checked ~ .assay__panels .assay__panel:nth-child(4) { display: block; }

/* Keyboard focus must be visible on the LABEL, since the input is offscreen. */
#as1:focus-visible ~ .assay__list label[for="as1"],
#as2:focus-visible ~ .assay__list label[for="as2"],
#as3:focus-visible ~ .assay__list label[for="as3"],
#as4:focus-visible ~ .assay__list label[for="as4"] { outline: 2px solid var(--cyan); outline-offset: -2px; }

/* ===========================================================================
   13. CLINICIAN
   =========================================================================== */
.doc { border: 1px solid var(--line); background: var(--panel); display: grid; }
.doc__photo {
  aspect-ratio: 4 / 3;
  background: linear-gradient(160deg, var(--panel-3), var(--bg));
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 2.4rem; color: var(--cyan);
  border-bottom: 1px solid var(--line);
}
.doc__body { padding: 24px 20px; }
.doc__body h3 { font-family: var(--mono); font-size: 1rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; }
.doc__body p { font-size: .93rem; color: var(--muted); }

/* ===========================================================================
   14. REVIEWS
   =========================================================================== */
.rev { border: 1px solid var(--line); background: var(--panel); padding: 20px; display: flex; flex-direction: column; }
.rev__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.rev p { font-size: .94rem; color: var(--text); }
.rev__foot {
  margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

/* A lone review would otherwise sit in one narrow rail column with the rest of
   the row left empty. Two classes, so it outranks the per-breakpoint .rail grid. */
.rail.reviews--single { grid-auto-flow: row; grid-template-columns: 1fr; max-width: 720px; }

/* --- Patient experiences carousel ----------------------------------------
   Reviews are long-form text, so this is deliberately one review at a time
   rather than a moving row of cards.

   Scroll position is the carousel's only state: the rail keeps its native
   overflow and scroll-snap, and the buttons and dots just set scrollLeft and
   read it back. That means a swipe, a trackpad, the keyboard and the controls
   cannot disagree, and nothing has to animate a transform.

   .is-carousel is added by the script, so without JS this whole block is inert
   and the section stays the plain review grid. */
/* One full-width slide per view at every breakpoint. Two classes plus the
   wrapper, so it outranks both the base .rail and the grids the 600/768/1200
   breakpoints flatten it into — no need to restate this in each of them. */
.revwrap.is-carousel .rail.reviews {
  grid-auto-flow: column; grid-auto-columns: 100%;
  /* Required, not belt-and-braces: the 768px and 1200px breakpoints give .rail
     EXPLICIT tracks, and items fill those before any auto column is created —
     leaving three 260px slides in a row instead of one per view. */
  grid-template-columns: none;
  overflow-x: auto;
  scroll-behavior: smooth;
}
.revwrap.is-carousel .rail.reviews:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
/* The dots replace it, and it would otherwise double up under them on phones. */
.revwrap.is-carousel .hint { display: none; }

.revnav { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 20px; }

.revnav__btn {
  flex: none; width: var(--tap); height: var(--tap);
  display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  font-size: .65rem; line-height: 1; cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.revnav__btn:hover { border-color: var(--cyan); color: var(--cyan); }
.revnav__btn:disabled { cursor: default; border-color: var(--line-soft); color: var(--muted); opacity: .45; }

.revnav__dots { display: flex; align-items: center; }
/* The button is a full tap target; the visible dot is the pseudo element. */
.revnav__dot {
  flex: none; width: var(--tap); height: var(--tap); padding: 0;
  display: grid; place-items: center;
  border: 0; background: none; cursor: pointer;
}
.revnav__dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent;
  transition: background .15s ease, border-color .15s ease;
}
.revnav__dot:hover::before { border-color: var(--cyan); }
.revnav__dot[aria-current="true"]::before { background: var(--cyan); border-color: var(--cyan); }

@media (prefers-reduced-motion: reduce) {
  .revwrap.is-carousel .rail.reviews { scroll-behavior: auto; }
}

/* ===========================================================================
   15. TRUST TRIAD
   =========================================================================== */
.triad { display: grid; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); }
.triad > div { background: var(--bg); padding: 24px 20px; }
.triad h3 { font-family: var(--mono); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); margin-bottom: 10px; }
.triad p { margin: 0; font-size: .9rem; color: var(--muted); }

/* ===========================================================================
   16. FAQ — numbered disclosures
   =========================================================================== */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: center; gap: 16px;
  min-height: 62px; padding: 14px 0;
  cursor: pointer; list-style: none;
  font-family: var(--mono); font-size: .84rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .n { color: var(--dim); flex: none; font-size: .74rem; }
.faq summary .q { flex: 1; }
.faq summary::after {
  content: "+"; flex: none; color: var(--cyan); font-size: 1.3rem; line-height: 1;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0 20px; padding-left: 40px; font-size: .94rem; color: var(--muted); max-width: 72ch; }

/* ===========================================================================
   17. CTA BAND
   =========================================================================== */
.cta {
  border: 1px solid var(--line);
  background:
    radial-gradient(90% 140% at 10% 0%, var(--glow-blue), transparent 60%),
    var(--panel-2);
  padding: clamp(28px, 7vw, 60px);
}
.cta h2 { margin-bottom: 14px; }
.cta p { color: var(--muted); max-width: 48ch; }
.cta .btn { margin-top: 26px; }

/* ===========================================================================
   18. FOOTER
   =========================================================================== */
.footer { border-top: 1px solid var(--line); background: var(--bg-2); padding-block: 48px 28px; }
.footer__grid { display: grid; gap: 0; }

.fcol { border-bottom: 1px solid var(--line-soft); }
.fcol summary {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--tap); cursor: pointer; list-style: none;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--cyan);
}
.fcol summary::-webkit-details-marker { display: none; }
.fcol summary::after { content: "+"; color: var(--dim); }
.fcol[open] summary::after { content: "\2212"; }
.fcol li a { display: flex; align-items: center; min-height: var(--tap); font-size: .9rem; color: var(--muted); }
.fcol li a:hover { color: var(--text); }
.fcol ul { padding-bottom: 10px; }

.footer__legal { margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
/* 55ch, not 92ch: `ch` is the width of "0", which in Space Grotesk is far wider
   than the average lowercase glyph, so 92ch measured out at ~125 real characters
   per line across 4 lines of FDA disclosure. 55ch lands near 75. */
.footer__legal p { font-size: .78rem; color: var(--dim); max-width: 55ch; line-height: 1.6; }

/* ===========================================================================
   19. STICKY THUMB BAR — mobile conversion surface
   =========================================================================== */
.thumbbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  display: flex; align-items: center; gap: 12px;
  padding: 9px var(--gutter) calc(9px + var(--safe-b));
  background: var(--bar-bg);
  border-top: 1px solid var(--line);
  transform: translateY(110%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.thumbbar.is-up { transform: none; }
.thumbbar__p { flex: none; display: grid; gap: 2px; }
.thumbbar__p b { font-family: var(--mono); font-size: .95rem; font-weight: 500; color: var(--cyan); }
.thumbbar .btn { flex: 1; padding-inline: 14px; }

/* ===========================================================================
   20. PROGRESSIVE ENHANCEMENT — only ever ADDS from here down
   =========================================================================== */

/* --- 600px --------------------------------------------------------------- */
@media (min-width: 600px) {
  .rail { grid-auto-columns: 48%; }
  .hero__actions { grid-auto-flow: column; justify-content: start; }
  .hero__actions .btn { width: auto; }
  /* Six tracks, two per card — still a three-up row, but now a short final row
     can re-span to fill the width. It has to FILL rather than centre inside the
     leftover space: .steps paints --line-soft and lets the 1px gaps show
     through, so an empty grid cell is not blank, it is a solid tinted block.
     Five steps therefore read 3 + 2-at-half-width instead of 3 + 2 + a hole. */
  .steps { grid-template-columns: repeat(6, 1fr); }
  .step  { grid-column: span 2; }
  .step:nth-child(3n+1):nth-last-child(2),
  .step:nth-child(3n+1):nth-last-child(2) ~ .step { grid-column: span 3; }
  .step:nth-child(3n+1):last-child { grid-column: span 6; }

  .triad { grid-template-columns: repeat(3, 1fr); }
  .spec { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); }
  .spec div { flex-direction: column; justify-content: flex-start; gap: 7px; background: var(--bg); padding: 16px; border: 0; }
}

/* --- 768px: rails become grids ------------------------------------------- */
@media (min-width: 768px) {
  body { font-size: 17px; }

  .rail { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); overflow: visible; margin-inline: 0; padding-inline: 0; }
  .hint { display: none; }

  /* A single column of body copy across a 1200px section would be unreadable,
     so the carousel keeps a measure and centres instead. The edge bleed goes
     with it — it only exists to let phone slides touch the screen edge. */
  .revwrap.is-carousel { max-width: 820px; margin-inline: auto; }
  .revwrap.is-carousel .rail.reviews { margin-inline: 0; padding-inline: 0; }

  .assay { display: grid; grid-template-columns: 260px 1fr; }
  .assay__list { border-bottom: 0; border-right: 1px solid var(--line); }
  .assay__panels { padding: 28px; display: flex; align-items: center; }
  .assay__foot { grid-column: 1 / -1; }

  .doc { grid-template-columns: 300px 1fr; }
  .doc__photo { aspect-ratio: auto; border-bottom: 0; border-right: 1px solid var(--line); }
  .doc__body { padding: 32px; }

  .footer__grid { grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .fcol { border-bottom: 0; }
  .fcol summary { pointer-events: none; cursor: default; margin-bottom: 8px; }
  .fcol summary::after { display: none; }
  /* Tightened from the 48px mobile rule, but not below 44px: this breakpoint
     starts at 768px, which is still a touch tablet (WCAG 2.5.5). */
  .fcol li a { min-height: 44px; }
}

/* --- 900px: desktop nav, two-column hero, thumb bar retires --------------- */
@media (min-width: 900px) {
  :root { --tap: 44px; --header-h: 72px; }

  body { padding-bottom: 0; }
  .thumbbar { display: none; }

  .header__inner { min-height: 72px; gap: 32px; }
  .logo { font-size: 1.5rem; }
  .navToggle, .nav__close, .scrim { display: none; }

  /* margin-left goes back to 0 and the toggle gets order:9. Two competing auto
     margins (.logo's margin-right and .nav's margin-left) would split the free
     space and strand the toggle mid-header; with one auto, everything collapses
     right and the toggle lands last. */
  .nav {
    position: static; width: auto; visibility: visible;
    flex-direction: row; align-items: center; gap: 30px;
    margin-left: 0; padding: 0;
    background: none; border: 0; transform: none; overflow: visible;
  }
  .themeToggle { order: 9; }
  /* min-height stays at 32px, not 0: WCAG 2.5.8 wants 24x24 CSS px even for a
     mouse. The label itself is only 18px tall, so the box has to do the work. */
  .nav a:not(.btn) {
    min-height: 32px; padding: 0; border: 0;
    font-size: .72rem; letter-spacing: .14em; color: var(--muted);
  }
  .nav a:not(.btn)::before { display: none; }
  .nav a:not(.btn):hover { background: none; color: var(--cyan); }
  .nav__foot { margin: 0; padding: 0; display: flex; gap: 12px; }
  .nav__foot .btn { padding: 12px 20px; min-height: 44px; white-space: nowrap; }

  .hero__grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
  .hero__copy { order: 1; }
  .hero__media { order: 2; aspect-ratio: 1 / 1; margin-bottom: 0; }

  .rail { grid-template-columns: repeat(4, 1fr); }
  .reviews { grid-template-columns: repeat(3, 1fr); }

  .cta { display: grid; grid-template-columns: 1.3fr auto; gap: 40px; align-items: center; }
  .cta .btn { margin-top: 0; }

  .footer__grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 44px; }
}

/* --- 1024px: quality control becomes a scroll-driven sequence -------------
   Everything here is gated on .is-pinned, which only the script adds, and only
   while this media query matches. No JS, or a narrower viewport, and the assay
   block stays exactly what it is below: four clickable radio tabs. */
@media (min-width: 1024px) {
  /* One viewport to read the first panel, then a scroll beat per further tab.
     --assay-steps is written by the script from the actual radio count. */
  .assayScroll.is-pinned {
    height: calc(100vh + (var(--assay-steps, 4) - 1) * var(--assay-beat, 60vh));
  }

  .assayScroll.is-pinned .assayScroll__pin {
    position: sticky; top: var(--header-h);
    min-height: calc(100vh - var(--header-h));
    display: flex; flex-direction: column; justify-content: center;
  }
  .assayScroll.is-pinned .head { margin-bottom: clamp(24px, 3vw, 40px); }
  .assayScroll.is-pinned .assay { width: 100%; }

  /* The panels differ in length, so without a floor the pinned block would
     resize under the reader every time the sequence advances. The script
     measures the tallest panel and writes it here. */
  .assayScroll.is-pinned .assay__panels { min-height: var(--assay-panel-h, 9rem); }

  /* Progress rail down the tab list: how far through the sequence we are. */
  .assayScroll.is-pinned .assay__list { position: relative; }
  .assayScroll.is-pinned .assay__list::after {
    content: ""; position: absolute; top: 0; right: -1px; width: 2px;
    height: calc(var(--assay-progress, 0) * 100%);
    background: var(--cyan);
    transition: height .2s ease;
  }
}

/* --- 1200px: instrument tick-rails in the outer margins ------------------- */
@media (min-width: 1200px) {
  .ruled { position: relative; }
  .ruled::before, .ruled::after {
    content: ""; position: absolute; top: 0; bottom: 0; width: 10px;
    background: repeating-linear-gradient(180deg, var(--line) 0 1px, transparent 1px 22px);
    pointer-events: none;
  }
  .ruled::before { left: 8px; }
  .ruled::after  { right: 8px; }
}

/* ===========================================================================
   21. ACF OVERLAY — prototype only, delete on theme conversion
   =========================================================================== */
}
body.show-acf [data-acf-loop] { outline-color: rgba(30,106,255,.9); }
body.show-acf [data-acf-loop]::after { background: var(--blue); color: var(--on-blue); }
