/* ===========================================================================
 * KinematiX Physical Therapy — Home v2 (Design #1 "Polished Direction B")
 * Standalone stylesheet for index.new.html. Does NOT touch styles.css.
 * Tokens + base classes ported from the design bundle's vpt-styles.css,
 * plus vanilla nav / mobile-menu / lightbox rules (no React).
 * Font: Inter, self-hosted via /css/typography.css (linked in the HTML).
 * ======================================================================== */

:root {
  --navy: #0A1F44;
  --navy-700: #142C5A;
  --navy-600: #1E3A6E;
  --navy-300: #6478A0;

  --sky: #00A8FF;
  --sky-700: #0076B8;
  /* Hover step below --sky-700, now that sky-700 is the resting button fill. */
  --sky-800: #0072B3;
  --sky-500: #1FB6FF;
  --sky-100: #DCEFFF;
  --sky-50: #F0F8FF;

  /* Accent hues for hero CTA variety (matches the platform's R/Y/G convention
     used for clinical findings elsewhere in KinematiX). */
  --green: #17794C;
  --green-700: #17794C;
  --green-100: #DDF3E6;
  --amber: #A2620F;
  --amber-700: #9C6210;
  --amber-100: #FBE9D0;
  --violet: #6D28D9;
  --violet-700: #5B21B6;

  --paper: #FFFFFF;
  --tint: #F4F8FC;
  --tint-2: #E6EFF8;
  --ink: #0E1626;
  --ink-2: #3A4459;
  --muted: #6B7689;
  --line: #E5EBF2;
  --line-2: #D5DDE8;

  --serif: 'Inter', system-ui, -apple-system, sans-serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --max: 1280px;
  --gutter: 32px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }

/* Anchor targets clear the sticky nav */
[id] { scroll-margin-top: 88px; }

/* Section */
.section { padding: 96px 0; border-top: 1px solid var(--line); }
.section.tight { padding: 64px 0; }
.section.loose { padding: 128px 0; }
.section.tint { background: var(--tint); }
.section.navy { background: var(--navy); color: #E6EAF2; }
.section.sky { background: var(--sky); color: #fff; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* Eyebrow */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--sans);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--sky-700);
}
.section.navy .eyebrow { color: var(--sky); }
.eyebrow::before { content: ""; width: 24px; height: 1px; background: currentColor; opacity: 0.6; }

/* Headlines */
.display-1 {
  font-family: var(--serif);
  font-size: clamp(56px, 7.5vw, 104px);
  line-height: 0.96; letter-spacing: -0.035em; font-weight: 700;
  color: var(--navy); margin: 0;
  text-wrap: balance;
}
.display-2 {
  font-family: var(--serif);
  font-size: clamp(44px, 5.2vw, 72px);
  line-height: 1.0; letter-spacing: -0.03em; font-weight: 700;
  color: var(--navy); margin: 0;
  text-wrap: balance;
}
.display-3 {
  font-family: var(--serif);
  font-size: clamp(34px, 3.6vw, 52px);
  line-height: 1.05; letter-spacing: -0.02em; font-weight: 700;
  color: var(--navy); margin: 0;
  text-wrap: balance;
}
.section.navy .display-1, .section.navy .display-2, .section.navy .display-3 { color: #fff; }
.section.sky .display-1, .section.sky .display-2, .section.sky .display-3 { color: #fff; }

.italic { font-style: normal; color: var(--sky-700); font-weight: 700; }
.section.navy .italic { color: var(--sky); }
.section.sky .italic { color: #fff; opacity: 0.85; }

.lede { font-size: 19px; line-height: 1.55; color: var(--ink-2); max-width: 56ch; margin: 0; }
.section.navy .lede { color: rgba(255,255,255,0.78); }
.section.sky .lede { color: rgba(255,255,255,0.92); }

p { margin: 0 0 1em; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 16px 26px; border-radius: 999px;
  font-family: var(--sans); font-size: 14px; font-weight: 600; letter-spacing: 0.01em;
  border: 1.5px solid var(--navy); background: var(--navy); color: #fff;
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); background: var(--navy-700); }
.btn.ghost { background: transparent; color: var(--navy); }
.btn.ghost:hover { background: var(--navy); color: #fff; }
/* Filled buttons sit on white almost everywhere, where white-on---sky is only
 * 2.61:1. --sky-700 takes the label to 4.02:1 and is still plainly sky blue.
 * On a dark ground the bright fill is what separates the button from the
 * background, so the exception below keeps it there. */
.btn.sky { background: var(--sky-700); border-color: var(--sky-700); color: #fff; }
.btn.sky:hover { background: var(--sky-800); border-color: var(--sky-800); }
.section.navy .btn.sky, .mobile-overlay .btn.sky { background: var(--sky); border-color: var(--sky); }
.section.navy .btn.sky:hover, .mobile-overlay .btn.sky:hover { background: var(--sky-700); border-color: var(--sky-700); }
.btn.light { background: #fff; color: var(--navy); border-color: #fff; }
.btn.light:hover { background: var(--tint); }
.btn.lg { padding: 20px 32px; font-size: 15px; }
.btn .arr { transition: transform .2s ease; }
.btn:hover .arr { transform: translateX(3px); }

/* Cards */
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.card.flat { border-radius: 12px; padding: 24px; }
.card.dark { background: var(--navy); color: #fff; border-color: var(--navy); }
.card.tint-card { background: var(--tint); border-color: var(--line); }

/* Tag */
.tag {
  display: inline-flex; align-items: center;
  padding: 6px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--line-2); background: #fff; color: var(--ink-2);
}
.tag.sky { background: var(--sky-100); border-color: var(--sky-100); color: var(--sky-700); }
.tag.dark { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.18); color: #fff; }

/* Role badge */
.role-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--navy-300);
}
.role-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--navy-300); }
.role-badge.human { color: var(--sky-700); }
.role-badge.human::before { background: var(--sky); }
.section.navy .role-badge { color: rgba(255,255,255,0.65); }
.section.navy .role-badge.human { color: var(--sky); }

/* Misc */
.divider { height: 1px; background: var(--line); }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }

/* Sticky side columns (Thesis, Insurance) — desktop only; on mobile they stack
 * (overridden to static in the max-width:768px media query). */
.sticky-col { position: sticky; top: 100px; }

/* Journey step cells must size by their grid track, not by content. Without
 * min-width:0 the Riley step's wide phone+card mock forces its track wider than
 * the container, squeezing the copy column so the row's overflow:hidden clips
 * the copy text on the right (desktop AND mobile). */
.journey-steps .accordion-panel-inner > div { min-width: 0; }

/* ───────────────────────── Nav (v2) ───────────────────────── */
.nav-v2 {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92);
  -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-v2 .nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; gap: 16px;
}
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.nav-logo img { height: 52px; width: auto; display: block; }
.nav-logo .nav-rule { height: 22px; width: 1px; background: var(--line); }
.nav-logo .nav-kx {
  font-size: 10px; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase;
}
.nav-logo .nav-kx b { color: var(--navy); font-weight: 700; }
.nav-links { display: flex; gap: 14px; align-items: center; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.nav-links a { color: inherit; text-decoration: none; }
.nav-links a:hover { color: var(--navy); }
.nav-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.nav-phone { font-size: 13px; font-weight: 600; color: var(--navy); text-decoration: none; white-space: nowrap; }
.btn.vpt-rx { background: transparent; border: 2px solid var(--sky); color: var(--sky-700); }
.btn.vpt-rx:hover { background: var(--sky); color: #fff; }
.nav-hamburger {
  display: none; background: transparent; border: none; padding: 8px; cursor: pointer; color: var(--navy);
}

/* Below 1220px: collapse to hamburger. Desktop users rarely think to open a
 * hamburger menu, so this threshold is intentionally kept as low as the
 * content allows: all 9 links (Start/Demo/Insurance/Clinician/Accuracy/
 * Providers/Tools/Book/Blog, flat — no merged dropdown) plus logo, kx
 * byline, phone, VPT Rx, and Talk to Kai measured ~1200px of required content
 * width against the 1232px-wide container content box at full size, so
 * 1220px leaves a little headroom without inviting overflow.
 *
 * NOTE: .nav-links has no wrap/shrink/overflow handling, so if a future link
 * is added without raising this breakpoint (or trimming/merging an existing
 * link), the row will silently overflow rather than wrap — re-check this
 * whenever CANONICAL_NAV_LINKS in js/home-v2.js grows. */
@media (max-width: 1219px) {
  .nav-links, .nav-actions { display: none !important; }
  .nav-hamburger { display: flex; }
}

/* ───────────────────────── Mobile menu overlay ───────────────────────── */
.mobile-overlay {
  position: fixed; inset: 0; background: var(--navy); z-index: 9999;
  display: flex; flex-direction: column; animation: slideIn .3s ease-out;
}
.mobile-overlay[hidden] { display: none; }
.mobile-overlay__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.mobile-overlay__head img { height: 40px; }
.mobile-overlay__close { background: transparent; border: none; padding: 8px; cursor: pointer; color: #fff; }
.mobile-overlay__nav {
  flex: 1; display: flex; flex-direction: column; padding: 32px 24px; gap: 4px; overflow: auto;
}
.mobile-overlay__nav a {
  color: #fff; font-size: 20px; font-weight: 600; padding: 16px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08); text-decoration: none; transition: color .2s;
}
.mobile-overlay__nav a:hover { color: var(--sky); }
/* "Areas served" expandable (native <details>, no JS) */
.mobile-overlay__nav details.m-areas { border-bottom: 1px solid rgba(255,255,255,0.08); }
.mobile-overlay__nav details.m-areas > summary {
  color: #fff; font-size: 20px; font-weight: 600; padding: 16px 0; cursor: pointer;
  list-style: none; display: flex; align-items: center; justify-content: space-between;
}
.mobile-overlay__nav details.m-areas > summary::-webkit-details-marker { display: none; }
.mobile-overlay__nav details.m-areas > summary::after { content: '+'; color: var(--sky); font-size: 26px; font-weight: 400; line-height: 1; }
.mobile-overlay__nav details.m-areas[open] > summary::after { content: '\2013'; }
.m-areas__body { padding: 2px 0 18px; }
.m-areas__islands { color: rgba(255,255,255,0.85); font-size: 15px; line-height: 1.7; }
.m-areas__tag { color: var(--sky); font-style: italic; font-size: 14px; margin-top: 8px; }
.mobile-overlay__nav a.m-areas__link { display: inline-block; margin-top: 14px; padding: 0; border-bottom: none; color: var(--sky); font-size: 15px; font-weight: 600; text-decoration: none; }
.mobile-overlay__actions {
  padding: 24px; border-top: 1px solid rgba(255,255,255,0.1);
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.mobile-overlay__actions a {
  display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
  padding: 14px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; text-decoration: none;
}
.mobile-overlay__actions .m-cta-btn { margin-bottom: 0; }
.mobile-overlay__actions .m-cta-btn { grid-column: 1 / -1; padding: 16px 24px; font-size: 15px; }
.m-call { background: transparent; border: 2px solid var(--sky); color: var(--sky); }
.m-pdf { background: transparent; border: 2px solid rgba(255,255,255,0.3); color: #fff; }
.m-cta-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
  padding: 14px 20px; border-radius: 8px; font-weight: 700; font-size: 15px; line-height: 1.25;
  text-decoration: none; border: 1.5px solid transparent; margin-bottom: 4px;
}
/* Solid fill so it stands out against the overlay's own navy background — the old
 * .m-cta-btn--1 used background:var(--navy), the same color as .mobile-overlay itself,
 * which made that button invisible. */
.m-cta-btn--kai { background: var(--sky); border-color: var(--sky); color: #fff; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* ───────────────────────── Avatar lightbox ───────────────────────── */
[data-agent], [data-person] { cursor: zoom-in; transition: transform .15s ease, box-shadow .15s ease; }
[data-agent]:hover, [data-person]:hover { transform: scale(1.06); }
.lb-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10,22,38,0.82); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 40px;
  animation: lbFade 180ms ease-out;
}
.lb-backdrop[hidden] { display: none; }
.lb-modal {
  background: #fff; border-radius: 24px; max-width: 920px; width: 100%; max-height: 88vh;
  overflow: hidden; display: grid; grid-template-columns: 1fr 1fr;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4); position: relative;
  animation: lbScale 220ms cubic-bezier(.16,1,.3,1);
}
.lb-close {
  position: absolute; top: 16px; right: 16px; z-index: 2; width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.92); -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); border: 1px solid var(--line);
  cursor: pointer; font-size: 18px; color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
}
.lb-photo { aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; }
.lb-photo.agent { background: linear-gradient(135deg, var(--tint), var(--tint-2)); padding: 24px; }
.lb-photo.person { background: #0A1F44; padding: 0; }
.lb-photo img { width: 100%; height: 100%; display: block; }
.lb-photo.agent img { object-fit: contain; object-position: center; }
.lb-photo.person img { object-fit: cover; object-position: center top; }
.lb-detail { padding: 40px 36px; display: flex; flex-direction: column; }
.lb-name { font-weight: 700; font-size: 36px; line-height: 1.05; letter-spacing: -0.02em; color: var(--navy); margin-bottom: 6px; }
.lb-role { font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.lb-summary { font-size: 15px; line-height: 1.6; color: var(--ink-2); margin: 0; flex: 1; }
.lb-nav { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.lb-arrow { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.lb-dots { display: flex; gap: 6px; }
.lb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); border: none; cursor: pointer; padding: 0; }
.lb-dot.active { background: var(--navy); }
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lbScale { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }

/* ───────────────────────── Responsive (from design) ───────────────────────── */
@media (max-width: 1024px) {
  :root { --gutter: 24px; }
  .section { padding: 72px 0; }
  .section.loose { padding: 96px 0; }
  [style*="grid-template-columns: repeat(4, 1fr)"] { grid-template-columns: 1fr 1fr !important; }
  [style*="grid-template-columns: repeat(3, 1fr)"] { gap: 14px !important; }
}

@media (max-width: 768px) {
  :root { --gutter: 20px; }
  .section { padding: 56px 0; }
  .section.loose { padding: 64px 0; }
  .section.tight { padding: 40px 0; }
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; gap: 32px !important; }
  /* Override the single-column fallback above for the 6-stat Brian block —
   * one column stacks it into a long scroll; 3 columns (2 rows) is what it
   * was designed for and stays readable at phone width. */
  #brian .brian-stats { grid-template-columns: repeat(3, 1fr) !important; gap: 18px 12px !important; }
  #brian .brian-stats > div > div:first-child { font-size: 30px !important; }
  .display-1 { font-size: clamp(40px, 11vw, 56px) !important; }
  .display-2 { font-size: clamp(34px, 9vw, 44px) !important; }
  .display-3 { font-size: clamp(26px, 7vw, 34px) !important; }
  /* Hero headline stays on ONE line on phones (2026-08-23, per Brian). At the
     generic .display-1 sizes above (and the 38px ≤420px override below) the
     headline measures ~9.79x its font-size wide (Inter 700, -0.03em) — 372px
     at 38px vs 311px available on a 375px phone → wrapped to two lines. Size
     it to what actually fits: hero-grid pads 64px total, so (100vw-64px)/10.5
     is the largest single-line size at any width; nowrap is the guarantee.
     The divisor budgets for a classic 17px scrollbar, which 100vw INCLUDES
     (desktop-narrow windows; phone scrollbars are overlay and cost nothing).
     !important + the .hero-copy qualifier outrank both the inline font-size
     and the .display-1 !important overrides above/below.
     2026-08-25 (per Brian, "Movement" shakes on tap): 100vw is a LIVE metric —
     on mobile Safari/Chrome, tapping the page collapses/expands the address
     bar, which changes 100vw mid-visit and re-runs this calc(), visibly
     resizing (and re-wrapping) the headline. 100svw ("small" viewport width)
     is fixed to the address-bar-visible size and never recomputes on scroll/
     tap, so the headline stops moving. Declared twice: browsers without svw
     support drop the second (invalid-at-parse-time) declaration and keep the
     first, so this is a no-op fallback rather than a break. */
  /* 2026-08-27 (per Brian, "the words on the hero are too big, I want people to
     see the video"): the divisor was 10.5, which is the largest value that still
     fits on one line — so the headline stretched the FULL content width, edge to
     edge, and visually outweighed the video sitting under it. 13 backs it off to
     ~24px at 375px: still the dominant text on the screen, but it no longer eats
     the whole line, and the eye reaches the video sooner. nowrap still guarantees
     one line, and a LARGER divisor can never re-introduce the two-line wrap the
     note above solved — it only ever makes the text smaller than what fits. */
  .hero-copy h1 { font-size: clamp(20px, calc((100vw - 64px) / 13), 56px) !important; white-space: nowrap; }
  .hero-copy h1 { font-size: clamp(20px, calc((100svw - 64px) / 13), 56px) !important; white-space: nowrap; }
  .lede { font-size: 16px; }
  /* No min-height: .hero-stage now holds ONLY the video (the quote moved out), so
     a 380px floor left ~197px of dead space under it — the "huge buffer" between
     the video and the buttons. Let it size to the video. */
  .hero-stage { height: auto !important; min-height: 0; }
  .hero-floating { display: none !important; }

  /* Mobile: lay the insurance payers out as a tidy 3-column grid instead of a
   * messy center-wrap. Desktop keeps the centered flex row (unchanged). */
  .ins-banner { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; padding: 24px 20px !important; }
  .ins-banner > div { text-align: center; }
  .btn.lg { padding: 16px 22px; font-size: 14px; }
  .card { padding: 22px !important; }
  .lb-modal { grid-template-columns: 1fr; max-height: 92vh; overflow: auto; }
  .lb-photo { aspect-ratio: 16/10; }

  /* Mobile: side columns (Thesis, Insurance) must not stay pinned — pinned,
   * they overlap the now-stacked content below. Return them to normal flow. */
  .sticky-col { position: static !important; top: auto !important; }

  /* Mobile: Journey steps always stack the copy (agent intro) BEFORE the
   * screen visual, overriding the desktop zig-zag order so e.g. Nora/Brian/
   * Riley are introduced before their screenshot. (copy is first in source.) */
  .journey-steps .accordion-panel-inner > div { order: 0 !important; }

  /* Mobile: the Riley step's phone + Atlas-card mock is wider than a phone
   * screen — scale it to fit instead of running off the right edge. */
  .riley-mock { transform: scale(0.78); transform-origin: top center; }

  /* Mobile: opaque nav so scrolled content never ghosts through it. */
  .nav-v2 { background: #fff !important; }

  /* Mobile: hide the "powered by KinematiX" tag + divider so the enlarged logo has room. */
  .nav-logo .nav-kx, .nav-logo .nav-rule { display: none !important; }

  /* Mobile: the final CTA heading is a fixed 52px with tight 0.98 line-height,
   * which crowds/overlaps its wrapped lines on a phone — relax it. */
  #start h2 { font-size: 32px !important; line-height: 1.12 !important; }
}

@media (max-width: 420px) {
  .display-1 { font-size: 38px !important; }
  .display-2 { font-size: 30px !important; }
}

/* Hero grid base: shared by both breakpoints. Desktop uses a real CSS Grid
   (see min-width:769px below) with the video/quote row-aligned to specific
   rows on the left (headline, the two button rows, the subtext line) via
   named grid-areas — no wrapper divs, every hero child is a direct grid item.
   Mobile flattens the same children into a simple ordered flex column. */
.hero-grid { padding: 40px 32px 80px; }
/* Base aspect ratio (mobile/tablet) — was previously an inline style on the
   element, which meant the min-width:769px override below could never
   actually clear it (inline beats an external class rule regardless of
   media query), so the frame kept computing its width from height x 16/9
   instead of filling its grid column — 203px wider than the column had
   room for, silently sliced off by the hero section's overflow:hidden
   (2026-08-01 incident: the right edge of the video, including the ROM
   gauge panel, was invisible). Desktop clears it properly now because both
   rules live in the cascade, not fighting an inline attribute. */
.hero-video-frame { aspect-ratio: 16/9; }

/* Mobile: headline -> video -> buttons (a,b,c) -> referring physician (d) ->
   subtext. Explicit margin-top per item (not a uniform flex `gap`)
   because the headline/video/button-cluster gaps (32px) differ from the
   gap between buttons themselves (12px). */
@media (max-width: 768px) {
  .hero-grid { display: flex; flex-direction: column; }
  .hero-copy { order: 1; }
  .hero-copy h1 { margin-bottom: 0 !important; }
  .hero-stage { order: 2; margin-top: 32px; }
  .hero-area-a { order: 3; margin-top: 32px; }
  .hero-area-b { order: 4; margin-top: 12px; }
  .hero-area-c { order: 5; margin-top: 12px; }
  .hero-area-d { order: 7; margin-top: 12px; }
  /* 2026-08-27 (per Brian): the subtext used to sit at order 6, i.e. BETWEEN
     the third button and the Referring Physician button, which split the CTA
     stack in half. It now closes the group. Order values need not be
     contiguous, so only this one line moves -- the buttons keep 3/4/5/7.
     Spacing comes from .hero-cta-subtext's own `margin: 14px 0 0`. */
  .hero-area-subtext { order: 8; }
  /* No quote on mobile — only under the video on desktop. */
  .hero-quote { display: none; }
}

/* Shoulder ROM banner caption (index.html ~L398).

   HISTORY: the caption used to be a child of .rom-banner, absolutely bottom-
   anchored inside an overflow:hidden 16:9 box. On a 375px viewport that box is
   only 211px tall while the caption needs ~270px, so 59px overflowed the TOP
   and was clipped — 44% of the quote invisible. The first fix let the banner
   grow (aspect-ratio:auto + min-height:56.25vw), which stopped the clipping but
   left the copy sitting directly on top of the ROM gauges baked into the video,
   and broke the 16:9 box so object-fit:cover quietly cropped ~23px off each
   side of the frame — the very gauges the banner exists to show.

   NOW: the caption is a SIBLING of .rom-banner (see index.html), so mobile can
   drop it below the video in normal flow instead of over it. The banner keeps a
   true 16:9 and the whole frame stays visible; desktop keeps the overlay look.
   Mirrors .hero-vid-caption, which solved the identical problem on the hero. */
.rom-block { position: relative; }
.rom-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 0 var(--gutter) 48px;
}
.rom-quote {
  max-width: 900px;
  font-family: var(--serif); font-weight: 500; font-style: italic;
  font-size: clamp(28px, 3.6vw, 48px); line-height: 1.2; letter-spacing: -0.015em;
  color: #fff; text-shadow: 0 2px 24px rgba(0,0,0,0.55);
}
.rom-tag {
  margin-top: 28px; font-size: 14px; font-weight: 700; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--sky); text-shadow: 0 2px 12px rgba(0,0,0,0.7);
  padding: 8px 18px; border: 1px solid rgba(0,168,255,0.45); border-radius: 999px;
  background: rgba(10,31,68,0.45);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}

/* Desktop: single grid, no wrapper divs. The video spans the headline row
   through the second button row, so it top-aligns with "Physical Therapy"
   and bottom-aligns with the New Patient / Referring Physician row. The
   quote sits in the same row as the subtext line. Column 2 (12px) and
   column 4 (48px) are spacer tracks, not `gap`, so button-to-button spacing
   (12px) and left-column-to-video spacing (48px) can differ. Row 3 (12px)
   is the spacer between the two button rows. */
@media (min-width: 769px) {
  .hero-grid {
    display: grid;
    /* Columns 1+3 (the button pair) are the left half of the hero; column 5
       (video) is the right half — so video gets 2fr against 1fr apiece for
       columns 1/3 (1fr + 12px + 1fr =~ 2fr, matching video's 2fr). Straight
       1fr/1fr/1fr made the button pair TWICE as wide as the video (wrong —
       2026-08-01 regression). minmax(0, __), not bare __fr: a bare fr
       track's implicit minimum is its content's min-content size, so the
       video column refused to shrink below the video frame's intrinsic
       width and blew the whole grid out past the viewport on narrower
       desktop widths (~769-1000px), which squeezed columns 1/3 far
       narrower than their fair share and drove the quote/subtext wrapping
       + hero clipping bug (also 2026-08-01, fixed the same day). */
    grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr) 48px minmax(0, 2.15fr);
    grid-template-rows: auto auto 12px auto auto;
    grid-template-areas:
      "headline headline headline . video"
      "a . b . video"
      ". . . . video"
      "c . d . video"
      "subtext subtext subtext . video";
  }
  .hero-area-headline { grid-area: headline; }
  .hero-area-a { grid-area: a; }
  .hero-area-b { grid-area: b; }
  .hero-area-c { grid-area: c; }
  .hero-area-d { grid-area: d; }
  .hero-area-subtext { grid-area: subtext; }
  /* 2026-08-09, per Brian: the previous height:100%-stretch-to-row design
     (frame bottom lands exactly on the New Patient / Referring Physician row)
     forced the frame into a squarer box than the video's native 16:9 --
     object-fit:cover then had to crop real width off both sides to fill it,
     worse the taller the row got (e.g. headline length changes, which is
     what surfaced this). Reverted to the video's true aspect ratio (zero
     crop) at the cost of no longer bottom-aligning with the button row --
     top-aligned with the headline instead, the closest available match to
     the original design intent. */
  .hero-area-video { grid-area: video; align-self: start; }
  .hero-area-quote { grid-area: quote; align-self: start; }
  .hero-video-frame { width: 100%; height: auto; aspect-ratio: 16 / 9; }
  /* min-height tracks the current 2-line headline (2 x line-height:1.02).
     The video frame no longer binds its height to this row (aspect-ratio
     instead, see .hero-area-video above), so this is just headline/button
     spacing now -- update the multiplier if the headline gains/loses a line.
     2026-08-21: headline went from two lines to one ("Movement is Medicine"),
     so the reservation dropped from 2.04em to 1.02em. */
  .hero-copy h1 { margin-bottom: 20px !important; min-height: 1.02em; }
}

/* Moved "All islands" rainbow band: desktop keeps the fixed 560px photo band
   (inline height). On mobile the headline wraps to ~4 lines and the longer
   paragraph would overflow a fixed height + get clipped by overflow:hidden —
   so let the band grow to fit content (height auto, min-height floor) and add
   vertical breathing room. background-size:cover still fills the taller band. */
@media (max-width: 768px) {
  .islands-band { height: auto !important; min-height: 440px; }
  .islands-band__inner { height: auto !important; padding: 56px 32px !important; }
  .islands-band__inner .lede { font-size: 16px; }
}

@keyframes reviewFade { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

/* ───────────────────────── Journey steps ─────────────────────────────
 * The six "Your care, step by step" rows render as always-visible static
 * content — each header (step number + title + role tag) followed by its
 * full .accordion-panel. No collapse, no click-to-expand, no JS. */
.journey-steps .accordion {
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  overflow: hidden;
}
.journey-steps .accordion.is-clinician { border-left: 4px solid var(--sky); }

.acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 28px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: var(--navy);
  transition: background .2s ease;
}
.acc-head { cursor: default; }

.acc-step {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--sky-700);
  letter-spacing: 0.04em;
}
.acc-title {
  flex: 1;
  min-width: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--navy);
}
.acc-tag { flex-shrink: 0; }

/* Chevron: a CSS box-corner that points down when closed, up when open. */
.acc-chevron {
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  margin: 0 4px 4px 2px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .3s ease;
}
.acc-head[aria-expanded="true"] .acc-chevron {
  margin: 4px 4px 0 2px;
  transform: rotate(-135deg);
}

/* Panels are always-visible static content — they stay open (no collapse). */
.accordion-panel {
  max-height: none;
  opacity: 1;
  overflow: visible;
}
.accordion-panel-inner { border-top: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) {
  .accordion-panel { transition: none; }
  .acc-chevron { transition: none; }
  .acc-head { transition: none; }
}

/* Mobile: tighter header padding + slightly smaller title so a long step
 * title (e.g. "We schedule + start your onboarding") wraps cleanly next to
 * the tag/chevron without overflowing at 320px. Tap target stays ~60px. */
@media (max-width: 768px) {
  .acc-head { gap: 10px; padding: 18px 18px; }
  .acc-title { font-size: 16px; }
}

/* ───────────────────── Movement-capture demo cards ─────────────────────
 * The four "free movement screen" cards present each scan as a live capture
 * frame. The media element is VIDEO-READY: it shows the poster image today and
 * plays the baked skeleton-overlay clip the moment a <source> is dropped in —
 * no markup change needed beyond one <source> line. The frame chrome (capture
 * chip + angle readout) stays put whether the media is a still or a clip. */
.capture-frame {
  position: relative;
  height: 280px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
  background: #0a1730;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.capture-media {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
}
/* live skeleton-overlay animation layer (atlas-capture.js injects the SVG here).
 * Sits above the poster/video, below the capture chrome. Empty + transparent if
 * the script never runs, so the <video> poster shows through as the fallback. */
.capture-overlay {
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
}
.capture-overlay svg { width: 100%; height: 100%; display: block; }
.cap-badge, .cap-metric { z-index: 3; }
/* legibility vignette so the chrome reads over any footage */
.capture-frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg,
    rgba(8,20,42,0.42) 0%, rgba(8,20,42,0) 24%,
    rgba(8,20,42,0) 66%, rgba(8,20,42,0.48) 100%);
}
.cap-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(10,23,48,0.66); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px);
  color: #eaf6ff; font-family: var(--mono);
  font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
}
.cap-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #ff4d5e; box-shadow: 0 0 0 3px rgba(255,77,94,0.22);
}
.cap-metric {
  position: absolute; bottom: 12px; right: 12px; z-index: 2;
  padding: 6px 10px; border-radius: 8px;
  background: rgba(10,23,48,0.66); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px);
  color: #dfeeff; font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.01em;
}
.cap-metric b { color: var(--sky-500); font-weight: 700; }
@media (prefers-reduced-motion: no-preference) {
  .cap-dot { animation: capBlink 1.5s steps(1, end) infinite; }
}
@keyframes capBlink { 50% { opacity: 0.3; } }

/* ───────────────── Hero: consolidated CTAs + Kai + live-capture card ───────
 * The four stacked hero buttons collapse to one primary (scan) + Talk to Kai,
 * Kai introduced as care coordinator, registration/login as small links, and a
 * small live-capture card tucked onto the hero photo (same engine as the demo
 * cards, data-scan="hero" cycling all four movements). */
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-kai-btn { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }
.hero-kai-btn:hover { background: var(--navy); color: #fff; }
.kai-hint { display: flex; align-items: center; gap: 11px; margin-top: 18px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); max-width: 460px; }
.kai-hint b { color: var(--navy); }
.kai-av { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; object-fit: cover; background: #fff; box-shadow: 0 2px 8px rgba(10,31,68,0.15); }
.cta-mini { display: flex; gap: 12px 30px; align-items: center; flex-wrap: wrap; margin-top: 22px; font-size: 15px; color: var(--ink-2); }
.cta-mini .item { display: inline-flex; align-items: center; gap: 10px; }
.cta-mini b { color: var(--ink); font-weight: 700; }
.cta-mini a { color: var(--sky-700); font-weight: 800; font-size: 16px; text-decoration: none; white-space: nowrap; }
.cta-mini a:hover { color: var(--sky); text-decoration: underline; text-underline-offset: 2px; }
.kai-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sky); flex-shrink: 0; display: inline-block; }

/* Hero CTA — four buttons, each its own color so the row scans as distinct
   choices rather than one repeated button (navy / light-blue / green / white-outline).
   Each button + the subtext are direct grid items of .hero-grid — see the
   min-width:769px / max-width:768px blocks above for placement per breakpoint. */
.hero-cta-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
  width: 100%; box-sizing: border-box;
  padding: 16px 18px; border-radius: 12px; font-weight: 700; font-size: 15px; line-height: 1.25;
  text-decoration: none; border: 1.5px solid var(--navy); transition: transform .2s ease, background .2s ease, color .2s ease;
}
.hero-cta-btn:hover { transform: translateY(-1px); }
.hero-cta-btn .arr { transition: transform .2s ease; }
.hero-cta-btn--1 { background: var(--navy); border-color: var(--navy); color: #fff; }
.hero-cta-btn--1:hover { background: var(--navy-700); border-color: var(--navy-700); }
.hero-cta-btn--1.hero-cta-btn--two-line .line-1 { color: #fff; }
.hero-cta-btn--1.hero-cta-btn--two-line .line-2 { color: #fff; }
.hero-cta-btn--2 { background: var(--sky-700); border-color: var(--sky-700); color: #fff; }
.hero-cta-btn--2:hover { background: var(--sky-800); border-color: var(--sky-800); }
.hero-cta-btn--3 { background: var(--green); border-color: var(--green); color: #fff; }
.hero-cta-btn--3:hover { background: var(--green-700); border-color: var(--green-700); }
.hero-cta-btn--4 { background: #fff; border-color: var(--navy); color: var(--navy); }
.hero-cta-btn--two-line { flex-direction: column; gap: 2px; }
.hero-cta-btn--two-line .line-1 { color: var(--navy-300); font-weight: 700; }
.hero-cta-btn--two-line .line-2 { display: inline-flex; align-items: center; gap: 6px; color: var(--sky-700); font-weight: 800; }
.hero-cta-btn--4 .line-1 { color: var(--navy-300); }
.hero-cta-btn--4 .line-2 { color: var(--sky-700); }
.hero-cta-btn--2.hero-cta-btn--two-line .line-1 { color: #fff; }
.hero-cta-btn--2.hero-cta-btn--two-line .line-2 { color: #fff; }
/* Both lines white on all three colored buttons per Brian's explicit call —
   do not recolor line-2 for "readability" again without asking first. */
.hero-cta-btn--3.hero-cta-btn--two-line .line-1 { color: #fff; }
.hero-cta-btn--3.hero-cta-btn--two-line .line-2 { color: #fff; }
.hero-cta-btn--4:hover { background: var(--tint); }
.hero-cta-subtext { margin: 14px 0 0; font-size: 14px; color: var(--muted, #4a5568); max-width: 560px; text-align: center; }
.hero-cta-subtext__link { color: var(--sky-700); font-weight: 700; text-decoration: none; }
.hero-cta-subtext__link:hover { text-decoration: underline; }

/* Far-left quote under the green Begin Registration button (row 5, col 1 of
   the desktop hero grid — see grid-template-areas below). Hidden on mobile —
   see the max-width:768px hero reorder block. Text and attribution are each
   forced onto their own line (not left to wrap) and sized to fit the single
   button-width column without breaking mid-word — a wider wrap here quietly
   overflowed the hero section's overflow:hidden and clipped into the next
   section (2026-08-01 incident: "Jones, DPT" was getting cut off). */
.hero-quote {
  font-family: var(--serif); font-weight: 500; font-style: italic; font-size: 19px;
  line-height: 1.25; letter-spacing: -0.01em; text-align: center;
  margin: 0; padding: 4px 0 0;
}
.hero-quote__text { display: block; color: var(--sky-700); }
.hero-quote__attr {
  display: block; margin-top: 6px; color: var(--navy); font-weight: 600;
  font-style: normal; font-size: 15px; letter-spacing: 0;
}

/* Smart Eval (#smart-eval) — two big centered tap-to-open tabs (Body areas /
 * Whole-body systems), each a native <details> so no JS is needed. Tapping
 * the tab reveals its box grid, one box per catalog area/system, mirroring
 * patient-web's smart-eval-catalog.ts. */
.se-tabs { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.se-tab {
  border-radius: 18px; background: #fff; border: 1.5px solid var(--line-2);
  overflow: hidden; transition: border-color .15s ease, box-shadow .15s ease;
}
.se-tab[open] { border-color: var(--sky); box-shadow: 0 8px 24px -12px rgba(15,60,110,0.18); }
.se-tab__btn {
  display: flex; align-items: center; gap: 14px; padding: 20px 22px; cursor: pointer;
  list-style: none; user-select: none;
}
.se-tab__btn::-webkit-details-marker { display: none; }
.se-tab__text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.se-tab__title { font-size: 18px; font-weight: 800; color: var(--sky-700); }
.se-tab__sub { font-size: 13px; color: var(--muted); }
.se-tab__chevron { color: var(--sky-700); transition: transform .18s ease; flex-shrink: 0; }
.se-tab[open] .se-tab__chevron { transform: rotate(180deg); }
.se-tab .se-grid--compact { padding: 0 22px 22px; margin-top: 0; }

.se-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 32px; }
.se-grid--compact { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-bottom: 0; }
.se-box {
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 12px 12px; border-radius: 10px; background: #fff; border: 1.5px solid var(--line-2);
  color: var(--navy); font-weight: 700; font-size: 14px; text-decoration: none;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.se-box:hover { transform: translateY(-1px); border-color: var(--sky); background: var(--sky-50); }
.se-box--muted { color: var(--muted); border-style: dashed; }
.se-box--muted:hover { transform: none; border-color: var(--line-2); background: #fff; cursor: default; }

/* Build your movement profile — five tap-to-open scans. 2026-08-26 (Brian:
 * "the buttons are able to scatter, should be more linear and clean") —
 * switched from a 2-column grid to a single stacked column, row-style
 * (badge + title left, Start/Skip actions right) instead of card tiles. */
.mp-tabs { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.mp-tab {
  border-radius: 14px; background: #fff; border: 1.5px solid var(--line-2);
  overflow: hidden;
}
.mp-tab--soon { border-style: dashed; }
.mp-tab__btn {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px;
}
.mp-tab__badge {
  width: 30px; height: 30px; border-radius: 50%; background: var(--sky-100); color: var(--sky-700);
  font-family: var(--serif); font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.mp-tab__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mp-tab__lead {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--sky-700);
}
.mp-tab__title { font-size: 17px; font-weight: 800; color: var(--navy); letter-spacing: -0.01em; }
.mp-tab--soon .mp-tab__title { color: var(--ink-2); }
.mp-tab__meta { font-size: 11px; color: var(--muted); flex-shrink: 0; white-space: nowrap; }
.mp-tab__body { padding: 0 20px 20px; }
.mp-tab__media {
  height: 260px; border-radius: 12px; margin-bottom: 16px; background-color: var(--tint);
  background-size: contain; background-position: center; background-repeat: no-repeat;
}
.mp-tab__media--soon { display: flex; align-items: center; justify-content: center; border: 1.5px dashed var(--line-2); }
.mp-tab__soon-label { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.mp-tab__desc { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); margin-bottom: 16px; }
.mp-tab__actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mp-tab__skip { font-size: 12px; color: var(--muted); text-decoration: none; }
@media (max-width: 640px) {
  .mp-tab__btn { padding: 12px 12px 8px; gap: 8px; }
  .mp-tab__badge { width: 24px; height: 24px; font-size: 12px; }
  .mp-tab__title { font-size: 13px; }
  .mp-tab__lead { font-size: 11px; }
  .mp-tab__meta { display: none; }
  .mp-tab__body { padding: 0 12px 14px; }
  .mp-tab__media { height: 160px; margin-bottom: 12px; }
  .mp-tab__desc { font-size: 12.5px; margin-bottom: 12px; }
  .mp-tab__actions { gap: 8px; }
  .mp-tab__actions .btn { padding: 10px 14px; font-size: 13px; }
}

/* Collapsible "Read more" on the movement-profile intro — the full paragraph
   was pushing the six scan cards too far down the page. */
.lede-more summary {
  cursor: pointer; font-size: 14px; font-weight: 700; color: var(--sky-700);
  list-style: none; margin-bottom: 8px;
}
.lede-more summary::-webkit-details-marker { display: none; }
.lede-more summary::after { content: ' →'; }
.lede-more[open] summary::after { content: ' ↑'; }
.lede-more[open] summary { margin-bottom: 12px; }

/* "We recommend all four" note — collapsible, same native <details> pattern. */
.mp-note {
  margin-top: 32px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; transition: border-color .15s ease;
}
.mp-note[open] { border-color: var(--sky); }
.mp-note__btn {
  display: flex; align-items: center; gap: 16px; padding: 20px 24px; cursor: pointer;
  list-style: none; user-select: none;
}
.mp-note__btn::-webkit-details-marker { display: none; }
.mp-note__icon {
  width: 44px; height: 44px; border-radius: 50%; background: var(--sky-100); color: var(--sky-700);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 22px;
}
.mp-note__title { flex: 1; font-size: 14px; font-weight: 700; color: var(--navy); }
.mp-note__chevron { color: var(--sky-700); transition: transform .18s ease; flex-shrink: 0; }
.mp-note[open] .mp-note__chevron { transform: rotate(180deg); }
.mp-note__body { padding: 0 24px 20px 84px; font-size: 14px; color: var(--ink-2); line-height: 1.55; }
@media (max-width: 640px) {
  .mp-note__btn { padding: 16px 18px; gap: 12px; }
  .mp-note__icon { width: 36px; height: 36px; font-size: 18px; }
  .mp-note__title { font-size: 13px; }
  .mp-note__body { padding: 0 18px 16px 66px; font-size: 13px; }
}

/* "Click where it hurts" body map (#where-it-hurts) — real anatomy photo +
 * absolutely-positioned hotspot overlay, same pattern as demo-frontend's
 * AnatomicalBodyPicker.tsx (percent-of-image-box coordinates). */
.bm-figure { margin: 0; width: 100%; max-width: 340px; margin-left: auto; margin-right: auto; }
.bm-stage { position: relative; width: 100%; line-height: 0; }
.bm-img { width: 100%; height: auto; display: block; user-select: none; }
.bm-hotspot {
  position: absolute; padding: 0; margin: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; border: 2px solid transparent; background: transparent;
  box-shadow: none; transform: scale(1); -webkit-tap-highlight-color: transparent; outline: none;
  transition: background .16s ease, box-shadow .16s ease, border-color .16s ease, transform .16s ease;
}
.bm-hotspot[data-side="mid"] { --bm-color: var(--sky-700); }
.bm-hotspot:not([data-side="mid"]) { --bm-color: #2f6bed; }
.bm-hotspot:hover, .bm-hotspot.is-selected {
  border-color: var(--bm-color);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--bm-color) 30%, transparent), color-mix(in srgb, var(--bm-color) 10%, transparent) 68%, transparent);
  box-shadow: 0 0 26px color-mix(in srgb, var(--bm-color) 44%, transparent);
  transform: scale(1.06);
}
.bm-hotspot.is-maxed:not(.is-selected) { cursor: not-allowed; opacity: 0.4; }
.bm-hotspot-dot {
  width: 30%; aspect-ratio: 1; border-radius: 50%; background: var(--bm-color); opacity: 0.5;
  box-shadow: 0 0 7px color-mix(in srgb, var(--bm-color) 60%, transparent);
  transition: background .16s ease, opacity .16s ease, box-shadow .16s ease; pointer-events: none;
}
.bm-hotspot:hover .bm-hotspot-dot, .bm-hotspot.is-selected .bm-hotspot-dot {
  background: #fff; opacity: 1; box-shadow: 0 0 12px #fff;
}
.bm-hotspot-label {
  position: absolute; white-space: nowrap; color: var(--bm-color); font-size: 11.5px; font-weight: 800;
  letter-spacing: 0.01em; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 5px #fff, 0 1px 1px rgba(255,255,255,0.95);
  pointer-events: none; opacity: 0; transition: opacity .16s ease;
  left: 50%; top: 100%; transform: translateX(-50%);
}
.bm-hotspot:hover .bm-hotspot-label, .bm-hotspot.is-selected .bm-hotspot-label { opacity: 1; }
.bm-selected { display: flex; gap: 8px; flex-wrap: wrap; min-height: 30px; margin-bottom: 12px; }
.bm-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--sky-100); color: var(--sky-700); font-size: 13px; font-weight: 700; padding: 6px 10px 6px 12px; border-radius: 999px; }
.bm-chip button { background: none; border: none; color: var(--sky-700); font-size: 15px; line-height: 1; cursor: pointer; padding: 0; }
.bm-counter { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
/* Mobile CTA reorder: scan (a) -> returning patient (b) -> new patient (c) ->
   subtext (Kai / provider sign-in) -> referring physician (d) last, single column. */
@media (max-width: 640px) { .hero-cta-btn { min-height: 73px; } }

.hero-live {
  position: absolute; bottom: 16px; left: 16px; width: 238px; z-index: 3;
  background: #0a1730; border-radius: 14px; overflow: hidden;
  box-shadow: 0 16px 36px rgba(7,22,52,0.5); border: 1px solid rgba(255,255,255,0.1);
}
.hero-live .capture-frame { height: 148px; margin: 0; border-radius: 0; box-shadow: none; }
.hero-live-cap { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; color: #dfeeff; font-family: var(--mono); font-size: 11px; }
.hero-live-cap .nm { color: #fff; font-weight: 700; }
.hero-live-cap b { color: var(--sky-500); font-weight: 700; }
@media (max-width: 420px) { .hero-live { width: 200px; } .hero-live .capture-frame { height: 126px; } }

/* Journey "step by step" — 6 tappable buttons opening the existing avatar
 * lightbox (data-agent/data-person), replacing the old fully-expanded
 * accordion cards which read as overwhelming on the main page. */
.journey-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.journey-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px 16px;
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.journey-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(10,31,68,0.10); border-color: var(--sky-100); }
.journey-btn img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(10,31,68,0.10); background: #fff; margin-bottom: 6px; }
@media (min-width: 900px) {
  .journey-btn img { width: 104px; height: 104px; }
}
.journey-btn-step { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; color: var(--sky-700); }
.journey-btn-title { font-size: 14px; font-weight: 700; color: var(--navy); line-height: 1.3; }
.journey-btn-name { font-size: 11px; color: var(--muted); }
.journey-btn--clinician { border-color: var(--sky); border-width: 1.5px; }
.journey-btn--clinician .journey-btn-step { color: var(--navy); }
@media (max-width: 640px) { .journey-buttons { grid-template-columns: repeat(2, 1fr); } }

.coco-team {
  margin-top: 56px; display: flex; gap: 28px; align-items: center; flex-wrap: wrap;
  background: var(--tint); border: 1px solid var(--line-2); border-radius: 20px; padding: 28px;
}
.coco-team-photo {
  flex: 0 0 auto; width: 280px; border-radius: 14px; overflow: hidden; aspect-ratio: 9/16;
  box-shadow: 0 20px 40px rgba(10,31,68,0.2); border: 6px solid #fff; background: var(--navy);
}
.coco-team-text { flex: 1 1 320px; }

/* Was max-width:640px, leaving 641-899px (a normal laptop-window width) with NO
   rule at all — .coco-team fell back to the desktop base styles (flex ROW,
   fixed 280px photo) inside a column that's nowhere near 280px wide at that
   size, which is what made Coco read as broken/missing outside a maximized
   window. Matches the min-width:900px desktop breakpoint exactly below, so
   there is no undefined gap between them. */
@media (max-width: 899px) {
  .coco-team { flex-direction: column; text-align: center; padding-bottom: 20px; }
  .coco-team-photo { margin: 0 auto; }
  /* .coco-team-text's base "flex: 1 1 320px" sizes it for the desktop ROW
     layout, where 320px is a width-basis. In column direction (mobile) that
     same 320px becomes a HEIGHT-basis instead, forcing a ~320px-tall box
     around two short lines of text — the "extreme buffer" under Coco. */
  .coco-team-text { text-align: center; flex: 0 0 auto; }
  #journey.section.loose { padding-bottom: 28px; }
}

/* Desktop: narrow the agent grid and put Dr. Coco alongside it, sitting at the
   top of that column. Per Brian, Coco's card should look exactly like it does
   on mobile — plain photo + plain caption below it, no overlay, no gradient —
   just placed beside the cards instead of below them. */
@media (min-width: 900px) {
  .journey-layout { display: flex; align-items: stretch; gap: 24px; }
  /* Cap each card and center the 3-track group inside the flex space Coco leaves,
     so the team block reads as a centered cluster instead of six cards stretched
     to fill (which pushed them visually left of the page). Coco stays alongside. */
  .journey-buttons {
    flex: 1 1 auto;
    grid-template-columns: repeat(3, minmax(0, 236px));
    justify-content: center;
    grid-template-rows: 1fr 1fr;
  }
  /* Same card treatment as mobile (<=899px) — just narrower and in the row.
     coco-team stretches (via .journey-layout's align-items:stretch) to match
     the two-row agent grid's actual height; coco-team-photo then grows to
     fill whatever's left above the caption text instead of using a fixed
     9/16 aspect ratio that left a buffer gap under Coco's card. */
  .coco-team { margin-top: 0; flex: 0 0 300px; flex-direction: column; text-align: center; }
  .coco-team-photo { flex: 1 1 auto; width: 100%; aspect-ratio: auto; min-height: 0; margin: 0 auto; }
  .coco-team-text { text-align: center; flex: 0 0 auto; }
}

/* No-wearables section: live-capture stage (moved here from the hero) */
.sensor-stage .capture-frame { height: auto; aspect-ratio: 4 / 3; margin: 0; border-radius: 16px; box-shadow: 0 20px 44px rgba(10,31,68,0.16); }
.cap-scan {
  position: absolute; bottom: 12px; left: 12px; z-index: 3;
  padding: 6px 11px; border-radius: 8px; background: rgba(10,23,48,0.66); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px);
  color: #fff; font-weight: 700; font-size: 12px; letter-spacing: -0.01em;
}

/* ════════════════ AMBIENT MOTION ════════════════
   Very slow drift on the lifestyle/island photography so the page reads as
   alive without competing with the overlaid headlines. Two variants:

   .amb   — for blocks that carry a background-image AND overlaid text. The
            image moves to a ::before layer so the drift transform never
            touches the caption sitting on top of it.
   .amb-i — for bare <img> (the island grid), where transform is safe direct.

   Durations are deliberately long (50-80s) and offset per element: if two
   photos in view drift in lockstep the effect reads as a glitch, not weather.
   Motion is opt-in via prefers-reduced-motion: no-preference. */

.amb { position: relative; overflow: hidden; }
.amb > * { position: relative; z-index: 1; }
.amb::before {
  content: ""; position: absolute; z-index: 0;
  /* bleed past every edge so the scaled layer never exposes a gap mid-drift */
  inset: -8%;
  background-image: var(--amb-img);
  background-size: cover;
  background-position: var(--amb-pos, center);
  transform: scale(1.02);
}
.amb-i { transform: scale(1.02); }

/* will-change lives inside the media query, not outside it: promoting 16 layers
   to the compositor permanently costs real memory on low-end phones, and there
   is nothing to promote for a reduced-motion visitor whose layers never move. */
@media (prefers-reduced-motion: no-preference) {
  .amb::before,
  .amb-i { will-change: transform; }
  .amb::before { animation: amb-drift var(--amb-dur, 64s) var(--amb-delay, 0s) ease-in-out infinite alternate; }
  .amb-i       { animation: amb-drift var(--amb-dur, 64s) var(--amb-delay, 0s) ease-in-out infinite alternate; }
}

@keyframes amb-drift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to   { transform: scale(1.09) translate3d(-1.2%, -0.8%, 0); }
}

/* Island grid: six photos on screen at once. Same duration everywhere would
   have them swell and settle in unison, which reads as a rendering glitch.
   Prime-ish offsets keep any two neighbours visibly out of phase. */
.amb-i { --amb-dur: 68s; }
[data-reveal] > div:nth-child(2) .amb-i { --amb-dur: 59s; --amb-delay: -11s; }
[data-reveal] > div:nth-child(3) .amb-i { --amb-dur: 73s; --amb-delay: -26s; }
[data-reveal] > div:nth-child(4) .amb-i { --amb-dur: 61s; --amb-delay: -37s; }
[data-reveal] > div:nth-child(5) .amb-i { --amb-dur: 79s; --amb-delay: -5s; }
[data-reveal] > div:nth-child(6) .amb-i { --amb-dur: 64s; --amb-delay: -48s; }
/* ═══════════════ 2026-08-28 (Brian, mobile voice feedback pass) ═══════════════ */

/* 1. Hero headline: center it on phones (was left-aligned, matching the
      desktop grid's left-column layout, which reads off-center once the
      hero collapses to a single centered column on mobile). */
@media (max-width: 768px) {
  /* width:100% is needed alongside text-align: the flex column here doesn't
     reliably stretch this item to the full cross-axis width in every engine,
     and text-align:center on a shrink-to-fit box has no slack to center within. */
  .hero-copy { text-align: center; width: 100%; }
}

/* 2. Hero image (hiker video): too tall on phones. aspect-ratio:16/9 is
      shared with desktop (see base rule above) — give mobile a shorter,
      more panoramic box instead so the photo takes less vertical space
      without needing a max-height that would fight aspect-ratio sizing. */
@media (max-width: 768px) {
  .hero-video-frame { aspect-ratio: 16 / 7; }
}

/* 3. Hero body copy ("The body is meant to move..."): used to be absolutely
      bottom-anchored INSIDE the (now shorter) video frame, which pushed it
      over the hiker's face on phones. Markup moved it to a sibling of
      .hero-video-frame (still inside .hero-stage) so this rule can drop it
      below the photo in normal flow on mobile, while desktop keeps the
      original overlay position via the default (non-media-query) rule. */
.hero-vid-caption {
  position: absolute;
  left: 20px; right: 20px; bottom: 20px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.hero-vid-quote {
  font-family: var(--serif); font-weight: 500; font-style: italic;
  font-size: clamp(15px, 2.2vw, 22px); line-height: 1.2; letter-spacing: -0.015em;
  color: #fff; text-shadow: 0 2px 24px rgba(0,0,0,0.55);
}
.hero-vid-tag {
  margin-top: 16px; font-size: 12px; font-weight: 700; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--sky); text-shadow: 0 2px 12px rgba(0,0,0,0.7);
  padding: 7px 16px; border: 1px solid rgba(0,168,255,0.45); border-radius: 999px;
  background: rgba(10,31,68,0.45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
/* 2026-08-28 (Brian, voice note): mobile-only duplicates of the location/ROM tags
   that sit ON their photo/video (smaller, light blue). Hidden on desktop, where the
   originals in the caption blocks still render. */
.hero-vid-tag--onphoto, .rom-tag--onvideo { display: none; }

/* 2026-08-29 (Brian, voice note): every Step-3 test button the SAME size. The labels
   differ in length ("Smart Eval" vs "Vestibular/Eye Tracking"), so without a fixed
   box the long ones wrap to two lines and the short ones don't — which is exactly
   the mismatch he saw. Fixed height + centered text makes all six identical, and
   the long labels shrink to fit rather than changing the button's size. */
.six-ways-grid > a.card > span > span {
  display: flex !important;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 46px;
  padding: 10px 14px !important;
  line-height: 1.2;
}

/* 2026-08-28 (Brian, voice note): the tests grid is Step 3 now, and "more compact" —
   two columns on phones instead of three squeezed ones, tighter cards and pills. */
@media (max-width: 768px) {
  .six-ways-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .six-ways-grid > a.card { padding: 14px 12px !important; }
  /* Same fixed box on phones, one notch smaller; 12px keeps even the longest
     label ("Vestibular/Eye Tracking") on a single line in a half-width card. */
  .six-ways-grid > a.card > span > span {
    padding: 8px 10px !important; font-size: 12px !important; min-height: 42px; letter-spacing: -0.01em;
  }
}
@media (max-width: 768px) {
  .hero-vid-caption { position: static; margin-top: 16px; padding: 0 8px; }
  .hero-vid-quote { font-size: 15px; color: var(--navy); text-shadow: none; }
  /* Tag moved back ONTO the photo (below), so the caption copy is quote-only. */
  .hero-vid-tag { display: none; }
  .hero-vid-tag--onphoto {
    display: block; position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
    white-space: nowrap; font-size: 10px; font-weight: 700; letter-spacing: 0.22em;
    text-transform: uppercase; color: var(--sky); text-shadow: 0 2px 12px rgba(0,0,0,0.7);
    padding: 5px 12px; border: 1px solid rgba(0,168,255,0.45); border-radius: 999px;
    background: rgba(10,31,68,0.45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  }
}

/* 7/8. Real-time ROM banner: smaller footprint + reordered lower on mobile.
      .rom-mobile-reorder is display:contents on desktop (a pure structural
      wrapper — zero layout effect, original document order intact). On
      mobile it becomes a flex column so its three children (the "Why this
      instead of" cards, the ROM banner, and the research-stats section) can
      be given an explicit order — moving the ROM banner from the middle to
      last without touching desktop at all. */
.rom-mobile-reorder { display: contents; }
@media (max-width: 768px) {
  .rom-mobile-reorder { display: flex; flex-direction: column; }
  .rom-mobile-reorder > .rom-order-1 { order: 1; }
  .rom-mobile-reorder > .rom-order-2 { order: 2; }
  .rom-mobile-reorder > .rom-order-3 { order: 3; }

  /* FULL-BLEED on mobile, deliberately (Brian, 2026-08-28). A dead
     `.rom-banner { width: 88% }` rule sat here from 8/27 — it never applied,
     because the element carries an inline `width:100%` that outranks it, so the
     banner has always rendered edge-to-edge. Moving the caption out of the
     banner would have let that rule finally bite and silently inset the video;
     it is not reinstated. Do not add a width here: the banner is meant to span
     the viewport. The 14px radius DID apply before and still does. Never shrink
     this via aspect-ratio either — that makes object-fit:cover crop the
     gauge/shoulder-diagram graphics baked into the video itself. */
  .rom-banner { border-radius: 14px; }

  /* The caption drops out of the overlay and below the video, in normal flow:
     the gauges are never covered, the quote reads directly underneath them, and
     the pill lands last. Off the video it needs no shadow/scrim to be legible,
     so it takes the same on-paper treatment as .hero-vid-caption on mobile.
     Keeps the page gutter now that the banner behind it is full-bleed. */
  .rom-caption { position: static; padding: 16px var(--gutter) 0; }
  .rom-quote { font-size: 17px; color: var(--navy); text-shadow: none; }
  /* 2026-08-28 (Brian, voice note): the pill goes back ON the video; the caption's
     copy of the pill is hidden here so it doesn't render twice.
     2026-08-29 (Brian, voice note): centered in the photo, not bottom-left. */
  .rom-tag { display: none; }
  .rom-tag--onvideo {
    display: block; position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); white-space: nowrap;
    font-size: 10px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--sky); text-shadow: 0 2px 12px rgba(0,0,0,0.7);
    padding: 5px 12px; border: 1px solid rgba(0,168,255,0.45); border-radius: 999px;
    background: rgba(10,31,68,0.45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  }
}
