/* CriterionMD — global tokens & base */
:root {
  --bg: #FAFAF7;
  --paper: #FFFFFF;
  --paper-2: #F4F4EF;
  --ink: #0A0F0F;
  --ink-2: #2A3331;
  --ink-3: #5A6360;
  --ink-4: #6E7773;
  --line: #E8E8E2;
  --line-2: #F1F1EC;
  --accent: #1F5C3D;
  --accent-ink: #143C28;
  --accent-tint: #EEF3EE;
  --accent-tint-2: #DDE7DE;
  --warn: #B45A1A;
  --warn-tint: #FBEFE3;
  --danger: #8C2F2F;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 18px;
  /* Surface elevation. Per Apple's material guidance, bigger surfaces read as
     thicker: --shadow-card for small/medium cards, --shadow-card-lg for the
     large containers. A near-invisible hairline (--line-2) stays for definition
     on the cream ground; the shadow, not the outline, does the separating. */
  --shadow-card: 0 1px 1px rgba(15,20,20,.035), 0 4px 10px -4px rgba(15,20,20,.06), 0 14px 32px -18px rgba(15,20,20,.10);
  --shadow-card-lg: 0 1px 1px rgba(15,20,20,.035), 0 8px 18px -8px rgba(15,20,20,.07), 0 30px 60px -30px rgba(15,20,20,.14);
  --shadow-sm: 0 1px 0 rgba(15,20,20,.04), 0 1px 2px rgba(15,20,20,.04);
  --shadow-md: 0 2px 4px rgba(15,20,20,.04), 0 12px 32px rgba(15,20,20,.06);
  --shadow-lg: 0 4px 8px rgba(15,20,20,.04), 0 24px 60px rgba(15,20,20,.10);
  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --maxw: 1440px;
  --pad-x: 1.25in;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--accent-tint-2); color: var(--accent-ink); }

/* Layout */
.cmd-shell { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.cmd-container { max-width: var(--maxw); margin: 0 auto; padding-left: var(--pad-x); padding-right: var(--pad-x); width: 100%; }
.cmd-main { flex: 1; }

/* Header */
.cmd-header {
  position: sticky; top: 0; z-index: 50;
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  transition: transform .2s ease-out;
  background:
    radial-gradient(1100px 620px at 50% -140px, rgba(32,118,79,0.82) 0%, rgba(32,118,79,0) 58%),
    radial-gradient(820px 520px at 86% 60px, rgba(21,88,60,0.82) 0%, rgba(21,88,60,0) 60%),
    linear-gradient(170deg, rgba(12,65,49,0.85) 0%, rgba(6,35,26,0.85) 100%);
  background-attachment: fixed, fixed, fixed;
  background-repeat: no-repeat;
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  box-shadow: 0 10px 30px -18px rgba(0,0,0,0.35);
}
.cmd-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
  position: relative;
}
/* True page-centering: the nav is positioned independently of the (unequal)
   wordmark and CTA widths flanking it */
.cmd-nav {
  display: flex; gap: 28px; align-items: center;
  position: absolute; left: 50%; transform: translateX(-50%);
  margin: 0;
}
.cmd-nav a {
  font-size: 15px; color: rgba(255,255,255,0.80); font-weight: 500;
  letter-spacing: normal;
  padding: 6px 0; position: relative;
  white-space: nowrap;
}
.cmd-nav a:hover { color: #fff; }
.cmd-nav a.active { color: #fff; }
.cmd-nav a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -22px;
  height: 1px; background: #5FD39A;
}
.cmd-header-cta { display: flex; gap: 10px; align-items: center; }
.cmd-header .btn-primary { background: #fff; color: var(--accent-ink); }
.cmd-header .btn-primary:hover { background: rgba(255,255,255,0.9); }
.cmd-header .btn-ghost {
  color: #fff;
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.28);
}
.cmd-header .btn-ghost:hover { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.5); }
.cmd-header .btn-ghost { letter-spacing: normal; }

/* Wordmark */
.cmd-wordmark {
  display: inline-flex; align-items: center; gap: 0;
  flex-shrink: 0;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px;
  border: 1px solid transparent; font-size: 15px; font-weight: 500;
  letter-spacing: -0.005em;
  transition: background var(--spring-snap), border-color var(--spring-snap),
              color var(--spring-snap), transform var(--spring-snap);
  white-space: nowrap;
}
.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn-lg { height: 52px; padding: 0 24px; font-size: 16px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: rgba(15, 20, 20, 0.05); }
.btn-outline { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--ink-3); }
.btn-arrow svg { transition: transform .15s ease; }
.btn-arrow:hover svg { transform: translateX(2px); }

/* Type */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 16px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-3); font-weight: 400;
}
.eyebrow-dot::before {
  content: ""; display: inline-block; width: 6px; height: 6px;
  background: var(--accent); border-radius: 999px;
  margin-right: 8px; vertical-align: middle;
}
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.028em; color: var(--ink); }
.h-display {
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1.05; font-weight: 500; letter-spacing: -0.03em;
}
.h-1 {
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1.06; font-weight: 500; letter-spacing: -0.03em;
}
.h-2 {
  font-size: clamp(24px, 2.2vw, 34px);
  line-height: 1.12; font-weight: 500; letter-spacing: -0.025em;
}
.h-3 {
  font-size: 20px; line-height: 1.3; font-weight: 500; letter-spacing: -0.015em;
}
.lede {
  font-size: 18px; line-height: 1.55; color: var(--ink-2); max-width: 64ch;
  font-weight: 400;
}
.muted { color: var(--ink-3); }
.mono { font-family: var(--font-mono); }

/* Cards */
.card {
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
/* Cards nested inside another card sit FLAT — never stack two elevated
   surfaces, or the hierarchy stops meaning anything. */
.card .card, .card-flat { box-shadow: none; border-color: var(--line); }
.card-pad { padding: 24px; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* Section padding */
.section { padding: 44px 0; }
.section-tight { padding: 26px 0; }
.section-divider { border-top: 1px solid var(--line); }

/* Full-bleed background bands — create vertical rhythm between cream sections.
   Use sparingly and alternate: warm (off-white) is the workhorse, tint (soft
   green) for emphasis moments. Banded sections drop the hairline divider since
   the color change is the separator. */
.band-warm { background: var(--paper-2); }
.band-tint { background: var(--accent-tint); }
.band-warm.section-divider, .band-tint.section-divider { border-top-color: transparent; }
/* Soft seam where a band meets cream, so edges don't look like hard steps */
.band-warm, .band-tint { box-shadow: inset 0 1px 0 rgba(255,255,255,0.5); }

/* Deep emerald band — matches the hero. Light text; subtle grid texture. */
.emerald-field {
  background:
    radial-gradient(1100px 620px at 50% -140px, #20764f 0%, rgba(32,118,79,0) 58%),
    radial-gradient(820px 520px at 86% 60px, #15583c 0%, rgba(21,88,60,0) 60%),
    linear-gradient(170deg, #0c4131 0%, #06231a 100%);
  background-attachment: fixed, fixed, fixed;
  background-repeat: no-repeat;
}
.band-emerald {
  position: relative;
  background:
    radial-gradient(120% 78% at 50% -12%, #1f7350 0%, rgba(31,115,80,0) 56%),
    radial-gradient(86% 70% at 87% 12%, #165a3d 0%, rgba(22,90,61,0) 60%),
    radial-gradient(70% 60% at 8% 30%, #0f4a34 0%, rgba(15,74,52,0) 62%),
    linear-gradient(168deg, #0c4131 0%, #06231a 100%);
  color: #fff;
}
.band-emerald.section-divider { border-top-color: transparent; }
.band-emerald::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.05;
  background-image:
    linear-gradient(rgba(255,255,255,.7) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.7) 1px, transparent 1px);
  background-size: 42px 42px;
}
.band-emerald > .cmd-container { position: relative; z-index: 1; }

/* Footer */
.cmd-footer {
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  padding: 18px 0;
  margin-top: 48px;
}

/* Mobile nav (hamburger) — full-height sheet */
.cmd-burger {
  display: none; width: 44px; height: 44px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.28); background: rgba(255,255,255,0.06);
  align-items: center; justify-content: center; flex-direction: column; gap: 4px;
  cursor: pointer; flex-shrink: 0;
}
.cmd-burger span { display: block; width: 16px; height: 1.6px; background: #fff; border-radius: 2px; }
@media (max-width: 965px) { .cmd-burger { display: inline-flex; } }
/* Motion tokens. `--spring-snap` is a critically-damped spring (no overshoot,
   response ~0.3s) for controls the user touches directly; `--spring-settle`
   carries a little overshoot and is reserved for motion that FOLLOWED a
   gesture with momentum. Anything purely decorative keeps plain easing. */
:root {
  --spring-snap: 280ms cubic-bezier(.2,.72,.24,1);
  --spring-settle: 420ms cubic-bezier(.22,1.02,.3,1);
}
@media (prefers-reduced-motion: reduce) {
  :root { --spring-snap: 1ms linear; --spring-settle: 1ms linear; }
}

.cmd-mobile-menu {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 80;
  background: linear-gradient(170deg, rgba(12,65,49,0.99) 0%, rgba(6,35,26,0.99) 100%);
  padding: calc(8px + env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  display: flex; flex-direction: column;
  overflow-y: auto; overscroll-behavior: contain;
  touch-action: pan-y;
}
/* No entry keyframe here on purpose. In contexts where the document animation
   timeline never advances (rAF frozen), an animation sits at its 0% keyframe
   forever regardless of fill mode — so ANY css entry that starts off-screen or
   at opacity 0 renders the menu permanently invisible. The CSS resting state is
   therefore transform:none (visible), and the entry is driven by springSafe(),
   whose 140ms no-frame watchdog degrades to "the menu is simply there". */
.cmd-mobile-menu a {
  color: rgba(255,255,255,0.92); font-size: 16px; font-weight: 500;
  padding: 14px 4px; border-bottom: 1px solid rgba(255,255,255,0.08);
  text-decoration: none;
}
.cmd-mobile-menu a:hover { color: #fff; }
.cmd-mobile-menu .btn { margin-top: 14px; justify-content: center; }

/* Mobile menu accordion groups — same links/look as the desktop dropdowns */
.cmd-mm-toplink {
  display: flex !important; align-items: center; justify-content: space-between;
  width: 100%; box-sizing: border-box; cursor: pointer;
}
.cmd-mm-toplink svg { transition: transform var(--spring-snap); opacity: 0.7; flex-shrink: 0; }
.cmd-mm-toplink.is-open svg { transform: rotate(180deg); }
.cmd-mm-panel {
  background: var(--paper);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-card);
  border-radius: 14px;
  padding: 6px;
  margin: 8px 0 12px;
  box-shadow: 0 1px 0 rgba(15,20,20,.04), 0 24px 60px -16px rgba(15,20,20,.22);
  animation: cmdNavFadeIn .14s ease both;
}
/* Transform-only 0% states throughout: a frozen animation timeline holds an
   animation at its 0% values indefinitely (fill mode is irrelevant), so an
   `opacity: 0` start would leave these panels permanently invisible rather
   than merely un-animated. */
@keyframes cmdNavFadeIn {
  0%   { transform: translateY(-4px); }
  100% { transform: translateY(0); }
}
/* Sub-panel reveal: transform + opacity only. `max-height` was animated here,
   which forces layout every frame and clipped taller submenus at the magic
   320px. The panel is mounted on expand, so natural height is correct. */
@keyframes cmdNavSubIn {
  0%   { transform: translateY(-2px); }
  100% { transform: translateY(0); }
}
.cmd-nav-audience {
  all: unset;
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; box-sizing: border-box;
  padding: 12px 14px; border-radius: 10px;
  cursor: pointer; gap: 12px;
  transition: background .15s ease;
}
.cmd-nav-audience:hover { background: var(--paper-2); }
.cmd-nav-audience.is-open { background: var(--paper-2); }
.cmd-nav-audience-label {
  font-size: 14px; font-weight: 500; color: var(--ink);
  letter-spacing: -0.005em;
}
.cmd-nav-audience-sub {
  font-size: 12px; color: var(--ink-3); margin-top: 2px;
  line-height: 1.35;
}
.cmd-nav-product {
  all: unset; box-sizing: border-box;
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: 8px 12px 8px 14px;
  border-radius: 8px;
  cursor: pointer; gap: 12px;
  transition: background .15s ease;
  position: relative;
}
.cmd-nav-product::before {
  content: ""; position: absolute;
  left: 0; top: 12px; bottom: 12px; width: 2px;
  background: var(--line); border-radius: 2px;
}
.cmd-nav-product:hover { background: var(--paper-2); }
.cmd-nav-product:hover::before { background: var(--accent); }
.cmd-nav-product.is-static { cursor: default; }
.cmd-nav-product.is-static:hover { background: transparent; }
.cmd-nav-product.is-static:hover::before { background: var(--line); }
.cmd-nav-product.is-static .cmd-nav-product-name { color: var(--ink-3); }
.cmd-nav-product-name {
  font-size: 13.5px; font-weight: 450; color: var(--ink);
  letter-spacing: -0.005em;
}
.cmd-nav-status {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: .14em; font-weight: 500;
  padding: 3px 7px; border-radius: 4px; white-space: nowrap;
  text-transform: uppercase;
}
.cmd-nav-status.beta {
  background: var(--accent-tint); color: var(--accent-ink);
  border: 1px solid var(--accent-tint-2);
}
.cmd-nav-status.soon {
  background: var(--paper-2); color: var(--ink-3);
  border: 1px solid var(--line);
}
.cmd-nav-sublist {
  padding: 4px 10px 8px 28px;
  overflow: hidden;
  animation: cmdNavSubIn .22s cubic-bezier(.2,.7,.2,1) both;
}
.cmd-nav-footer {
  border-top: 1px solid var(--line);
  margin-top: 4px; padding: 10px 14px 8px;
  display: flex; justify-content: space-between; align-items: center;
}
.cmd-nav-footer a {
  font-size: 13px; font-weight: 500; color: var(--accent);
  display: inline-flex; align-items: center; gap: 6px;
}
/* Inside the paper panels, desktop row styles win over the sheet's white links */
.cmd-mm-panel .cmd-nav-footer a {
  color: var(--accent); font-size: 13px; padding: 0; border-bottom: 0;
}
.cmd-footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px;
}
.cmd-footer h5 {
  font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-3); margin: 0 0 18px; font-weight: 400;
  font-family: var(--font-mono);
}
.cmd-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.cmd-footer a { font-size: 15px; color: var(--ink-2); }
.cmd-footer a:hover { color: var(--ink); }
.cmd-footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 14px; color: var(--ink-2);
}
.cmd-footer-bottom a { font-size: 14px; }

/* Pills, tags */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 14px; border-radius: 999px;
  font-size: 14px; font-weight: 500;
  background: var(--accent-tint); color: var(--accent-ink);
  border: 1px solid var(--accent-tint-2);
}
.pill-neutral { background: var(--paper-2); color: var(--ink-2); border-color: var(--line); }
.pill-warn { background: var(--warn-tint); color: var(--warn); border-color: #F1D9BB; }
.pill-dot::before {
  content: ""; width: 6px; height: 6px; border-radius: 999px;
  background: currentColor; opacity: 0.8;
}

/* Mock UI primitives */
.mock {
  background: var(--paper); border: 1px solid var(--line-2);
  border-radius: 14px; box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.mock-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--ink-3);
}
.mock-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--line); }

.im-live-dot { box-shadow: 0 0 0 0 rgba(31,92,61,0.45); }
@media (prefers-reduced-motion: no-preference) {
  .im-live-dot { animation: imLiveDot 1.8s ease-out infinite; }
}
@keyframes imLiveDot {
  0% { box-shadow: 0 0 0 0 rgba(31,92,61,0.45); }
  70% { box-shadow: 0 0 0 6px rgba(31,92,61,0); }
  100% { box-shadow: 0 0 0 0 rgba(31,92,61,0); }
}
.crit-row {
  opacity: 0; transform: translateX(-6px);
}
@media (prefers-reduced-motion: no-preference) {
  .crit-row { animation: critRowIn .5s cubic-bezier(.2,.7,.2,1) forwards; }
}
@media (prefers-reduced-motion: reduce) {
  .crit-row { opacity: 1; transform: none; }
}
@keyframes critRowIn { to { opacity: 1; transform: translateX(0); } }

/* Typing caret used by hero visual + product mocks */
.ip-caret {
  display: inline-block; width: 1.5px; height: 11px; background: var(--accent);
  vertical-align: -1px; margin-left: 1px;
}
@media (prefers-reduced-motion: no-preference) {
  .ip-caret { animation: ipCaretBlink 1s steps(2) infinite; }
}
@keyframes ipCaretBlink { 50% { opacity: 0; } }

/* Subtle grid background for diagrams */
.grid-bg {
  background-image:
    linear-gradient(var(--line-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-2) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
}

/* Form */
.input, .textarea, .select {
  width: 100%; height: 44px; padding: 0 14px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 8px; font: inherit; font-size: 16px; color: var(--ink);
  outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { height: auto; padding: 12px 14px; min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}
.label {
  display: block; font-size: 14px; color: var(--ink-2);
  margin-bottom: 6px; font-weight: 450;
}

/* Misc */
.row { display: flex; gap: 16px; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* Header/page responsive plan — bands derived from measured natural widths
   (full nav 717, mid nav 568, tight nav ~502, wordmark 219/172, ghost 84,
   CTA 168, side pads 4.5vw capped at 1.25in):
   ≥1440      full 1.25in margins + full header        (1198 + 240 = 1438 ✓)
   1320–1439  fluid 4.5vw margins + full header        (1198 + .09w ≤ w ✓)
   1241–1319  fluid margins + mid-compressed nav       (1049 + .09w ≤ w ✓)
   926–1240   small wordmark + tight nav, ghost hidden ( 842 + .09w ≤ w ✓)
   ≤925       nav hidden                               ( 423 max ✓) */
@media (max-width: 1449px) {
  :root { --pad-x: clamp(24px, 4.5vw, 1.25in); }
}

@media (max-width: 1330px) {
  .cmd-nav { gap: 18px; }
  .cmd-nav a { font-size: 13px; }
}

@media (max-width: 1240px) {
  .cmd-header .cmd-wordmark img { height: 40px !important; }
  .cmd-nav { gap: 12px; }
  .cmd-nav a { font-size: 12.5px; }
  .cmd-header-cta .btn:not(.btn-primary) { display: none; }
}

@media (max-width: 965px) {
  .cmd-nav { display: none; }
}

@media (max-width: 720px) {
  :root { --pad-x: 24px; }
  .grid-2, .grid-3, .grid-4, .cmd-footer-grid { grid-template-columns: minmax(0, 1fr); }
  .section { padding: 40px 0; }
}

/* Mobile hero: the desktop app mock (illegible at phone widths) is hidden so
   the message + CTAs own the first screen. The script artwork needs no mobile
   overrides — it is sized in em and flows inline with the headline. */
/* Mobile hero: the animated product demo renders in a compact stacked variant
   below 760px (see hero-demo.jsx) — no display:none. */
@media (max-width: 760px) {
  .hero-cta-row .btn { flex: 1 1 100%; justify-content: center; }
  .hero-mock-stage { padding-left: 0 !important; padding-right: 0 !important; }
}

/* Product spotlight cards (Solutions page): stack below 1000px, where the
   two-column layout starts clipping the embedded product mock. */
@media (max-width: 1000px) {
  .spotlight-card { grid-template-columns: 1fr !important; }
  .spotlight-card .spotlight-mock { padding: 0 32px 32px !important; justify-content: center; }
}
@media (max-width: 720px) {
  .spotlight-card .spotlight-mock { display: none; }
}

/* Pilot quote: mid-size desktop viewports — widen the quote column and pin the
   font so the full 212-char quote holds ≤4 lines (column is narrowest here) */
@media (min-width: 761px) and (max-width: 1100px) {
  .pilot-cols { --cols: 2fr 1fr !important; }
  .pilot-cols > div:first-child { padding: 32px 30px !important; }
  .pilot-cols blockquote { font-size: 14px !important; }
}

/* Visible keyboard focus (WCAG 2.4.7) */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible,
.input:focus-visible, .select:focus-visible, .textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.band-emerald a:focus-visible, .band-emerald button:focus-visible,
.emerald-field a:focus-visible, .emerald-field button:focus-visible,
.cmd-header a:focus-visible, .cmd-header button:focus-visible {
  outline-color: #5FD39A;
}

/* Legal pages: single column + tighter gutters on small screens */
@media (max-width: 900px) {
  .legal { column-count: 1; }
}

/* ── Mobile excellence pass ─────────────────────────────────────────── */

/* Designed pressed states instead of the UA tap flash. The press is instant
   (feedback on pointer-DOWN, per Apple); the release springs back. */
html { -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(0.98); transition-duration: 60ms; }
@media (pointer: coarse) {
  a:active { opacity: .75; }
  /* Extend small-link hit areas invisibly (footer, dropdown footers) */
  .cmd-footer a { padding: 12px 8px; margin: -12px -8px; }
}

@media (prefers-reduced-motion: reduce) {
  .cmd-header { transition: none; }
}

/* Sticky bottom CTA bar (Home + Insurify, mobile only) */
.cmd-sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  padding: 6px max(16px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(6,35,26,0.94);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.14);
  transform: translateY(110%); transition: transform .2s ease-out;
}
.cmd-sticky-cta.is-visible { transform: translateY(0); }
.cmd-sticky-cta .btn { width: 100%; height: 44px; background: #fff; color: var(--accent-ink); }
@media (min-width: 761px) { .cmd-sticky-cta { display: none; } }
@media (prefers-reduced-motion: reduce) { .cmd-sticky-cta { transition: none; } }

/* Translucent chrome degrades for the two accessibility signals that ask for
   it: frostier/solid when transparency is reduced, near-solid with a defined
   border when more contrast is requested. */
@media (prefers-reduced-transparency: reduce) {
  .cmd-header {
    backdrop-filter: none; -webkit-backdrop-filter: none;
    background: #0B3B29;
  }
  .cmd-sticky-cta {
    backdrop-filter: none; -webkit-backdrop-filter: none;
    background: #06231A;
  }
  .cmd-mobile-menu, .cmd-nav-panel { backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .cmd-header {
    backdrop-filter: none; -webkit-backdrop-filter: none;
    background: #06231A;
    border-bottom: 1px solid rgba(255,255,255,0.55);
  }
  .cmd-header .cmd-nav a { color: #fff; }
  .cmd-sticky-cta {
    backdrop-filter: none; -webkit-backdrop-filter: none;
    background: #06231A;
    border-top: 1px solid rgba(255,255,255,0.55);
  }
}

/* Access page split layout stacks on small screens */
.access-split { display: grid; grid-template-columns: 1fr 1.05fr; }
@media (max-width: 900px) {
  .access-split { grid-template-columns: minmax(0, 1fr); gap: 28px !important; }
}

/* Responsive column grids: column ratio set inline via --cols; stacks on mobile */
.cols { display: grid; grid-template-columns: var(--cols, 1fr 1fr); }
@media (max-width: 900px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
}
/* Big padded feature cards tighten up on phones */
@media (max-width: 720px) {
  .pad-card { padding: 28px 20px !important; }
}

/* ── Entrance-animation safety net ───────────────────────────────────────────
   One-shot entrance reveals legitimately start invisible, which means their
   visibility depends on the document animation timeline advancing. In contexts
   where it never does (rAF frozen — every animation pinned at currentTime 0)
   the element would stay hidden forever. `motion-settled` is added by a
   setTimeout in App after the longest entrance would have finished: it kills
   the animation and forces the settled state, so the timeline is an
   enhancement and never a dependency. Timers keep running when rAF does not. */
html.motion-settled .hero-rise,
html.motion-settled .hero-mock-rise,
html.motion-settled .crit-row {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

/* Inline field validation */
.field-error { font-size: 13px; color: var(--danger); margin-top: 6px; line-height: 1.4; }
.input.is-invalid, .select.is-invalid { border-color: var(--danger); }
.input.is-invalid:focus, .select.is-invalid:focus { box-shadow: 0 0 0 3px rgba(140,47,47,0.12); }

/* In-flight button spinner */
.btn-spinner {
  width: 14px; height: 14px; border-radius: 999px; flex-shrink: 0;
  border: 2px solid currentColor; border-top-color: transparent; display: inline-block;
}
@media (prefers-reduced-motion: no-preference) {
  .btn-spinner { animation: btnSpin .7s linear infinite; }
}
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* Success checkmark draws itself */
.cmd-check-draw path { stroke-dasharray: 20; stroke-dashoffset: 0; }
@media (prefers-reduced-motion: no-preference) {
  .cmd-check-draw path { stroke-dashoffset: 20; animation: cmdCheckDraw .25s ease-out .12s forwards; }
}
@keyframes cmdCheckDraw { to { stroke-dashoffset: 0; } }

/* The scrawl grazes the comma at small headline sizes — give it more air */
@media (max-width: 900px) {
  .hero-script-glow, .hero-script-box { margin-left: 0.28em !important; }
}

/* Hero promo video stage: 16:9, sized by available viewport height so the
   whole video is visible without scrolling (video h = width / 1.7778) */
.hero-video-stage {
  max-width: clamp(450px, calc((100vh - 445px) * 2.6667), 2100px);
  max-width: clamp(450px, calc((100svh - 445px) * 2.6667), 2100px);
}

/* ── Mobile hero fold budget (≤760px only; desktop hero unchanged) ──────────
   Target: at 393×660 the header, full headline (2 lines), subhead (3 lines),
   both CTAs, AND ≥120px of the mock card are visible on first paint. */
@media (min-width: 761px) {
  .hero-br-m { display: none; }
  .hero-sub-m { display: none; }
}
@media (max-width: 760px) {
  section.emerald-field { padding-top: 20px !important; }
  .hero-h1 {
    font-size: clamp(26px, 7.4vw, 31px) !important;
    line-height: 1.12 !important;
    letter-spacing: -0.02em !important;
    white-space: nowrap;
  }
  .hero-sub-d { display: none; }
  .hero-sub-m { font-size: clamp(13.5px, 3.8vw, 15px) !important; margin-top: 8px !important; }
  /* scrawl centered on its own line under the headline text; the doctor's
     writing scene anchors to it automatically */
  .hero-script-glow, .hero-script-box {
    display: block !important;
    width: fit-content;
    height: 1.875em !important;
    margin: 8px auto 0 !important;
    top: 0 !important;
    left: 0 !important;
  }
  /* CTAs stacked, primary on top, full width */
  .hero-cta-row { flex-direction: column; align-items: stretch; gap: 10px !important; margin-top: 20px !important; flex-wrap: nowrap !important; }
  .hero-cta-row .btn {
    flex: 0 0 auto; width: 100%; height: 48px !important;
    padding: 0 16px;
    font-size: 15px;
    white-space: nowrap;
  }
  .hero-cta-secondary { margin-top: 10px; }
  .hero-mock-stage { margin-top: 14px !important; padding-bottom: 10px !important; }
  /* divider line (catch-light): tracks the +8px shift (and +4 tilt offset) */
  .hero-mock-tilt::after { top: -30px !important; }
  /* laptop mock at 1.5× — the scene's empty side margins crop away; the hero
     section's overflow:hidden clips it so no horizontal scroll appears */
  .hero-promo-embed { width: 150% !important; margin-left: -25%; }

  /* ── Full-screen hero: fills the first screen exactly (minus the 56px
     header). Text block holds the top; the laptop CENTERS in all remaining
     space, so leftover height splits evenly around it instead of pooling
     into one dead gap. ── */
  section.emerald-field:has(.hero-dolly) {
    display: flex; flex-direction: column;
    min-height: calc(100vh - 56px);
    min-height: calc(100svh - 56px);
  }
  section.emerald-field:has(.hero-dolly) .hero-dolly {
    flex: 1; display: flex; flex-direction: column; min-height: 0;
  }
  section.emerald-field:has(.hero-dolly) .hero-dolly > .cmd-container {
    flex: 1; display: flex; flex-direction: column; min-height: 0;
    /* everything (text, CTAs, laptop — and the doctor, who measures these
       rects) rides 15px lower; the section's own height is untouched */
    transform: translateY(15px);
  }
  section.emerald-field:has(.hero-dolly) .hero-dolly > .cmd-container > div:last-child {
    flex: 1; display: flex; flex-direction: column; min-height: 0;
  }
  section.emerald-field:has(.hero-dolly) .hero-mock-stage {
    flex: 1; min-height: 0;
    display: flex; flex-direction: column; justify-content: center;
  }
  /* text block sits 8px lower; the laptop's flex-center would drift +4px from
     the shrunken gap, so the tilt wrapper compensates — net laptop shift: 0 */
  section.emerald-field:has(.hero-dolly) .hero-dolly > .cmd-container > div:first-child {
    margin-top: 8px;
  }
  section.emerald-field:has(.hero-dolly) .hero-mock-tilt {
    transform: translateY(-19px); /* -4 base, -15 user nudge */
  }
}

/* Tall phones: the laptop grows to near full-bleed and the text block
   breathes a little more, so the centered gaps stay proportionate */
@media (max-width: 760px) and (min-height: 760px) {
  .hero-promo-embed { width: 178% !important; margin-left: -39%; }
  .hero-sub-m { margin-top: 22px !important; }
  .hero-cta-row { margin-top: 26px !important; }
  /* Tall phones pool ~98px of dead green under the laptop — cut HALF of it:
     section 49px shorter; the tilt wrapper shifts the laptop back down so
     the space above it is unchanged and the whole 49px comes off the bottom.
     (Short viewports keep the exact-first-screen height — the laptop already
     sits flush there and a cut would overflow it.) */
  section.emerald-field:has(.hero-dolly) {
    min-height: calc(100vh - 129px);
    min-height: calc(100svh - 129px);
  }
  section.emerald-field:has(.hero-dolly) .hero-mock-tilt {
    transform: translateY(-17px); /* tuned so ~24px (25%) of the original gap remains below the laptop */
  }
}

/* Compact mobile header + first-screenful compression */
@media (max-width: 760px) {  .cmd-header-inner { height: 56px; }
  .cmd-header .cmd-wordmark img { height: 32px !important; }
  body { font-size: 16px; }
  .lede { font-size: 16px; }
  .eyebrow { font-size: 13px; }
  .section { padding: 32px 0; }
  .cmd-footer-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
  /* ── Card carousels: one original-size card per view; swipe to advance ── */
  .snap-cards {
    display: flex !important;
    grid-template-columns: none !important;
    overflow-x: auto !important;
    /* Peek rails intentionally leave the next card hanging off-screen, so snap
       is `proximity`: `mandatory` fights short flicks and forces a full page
       move the user didn't ask for. */
    scroll-snap-type: x proximity;
    gap: 12px !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .snap-cards::-webkit-scrollbar { display: none; }
  /* Every card carousel: next card peeks in from the right to invite the
     swipe; continuous scrolling snaps to card starts (no forced paging) */
  .snap-cards > * { flex: 0 0 82%; scroll-snap-align: start; min-width: 0; }

  /* ── Solutions page (mobile) ── */
  /* Hero: 2-line reworded title at the same clamp size; single 2-line subtitle
     at the home-hero mobile size; free-signup CTA hidden (demo stays) */
  .sol-h1-d { display: none !important; }
  .sol-h1-m { display: inline !important; }
  .sol-sub-d { display: none !important; }
  .sol-sub-m {
    display: block !important;
    font-size: clamp(13.5px, 3.8vw, 15px); color: var(--ink-2);
    line-height: 1.5; max-width: 36ch; margin: 10px auto 0; font-weight: 400;
  }
  .sol-cta-free { display: none !important; }
  /* Divider below the hero (above the first "In public beta"): give the
     hairline breathing room so it reads as a real section break */
  [data-screen-label="02 Solutions"] > section:first-child { padding-bottom: 28px !important; }
  [data-screen-label="02 Solutions"] > section:nth-child(2) {
    border-top: 1px solid var(--line) !important;
    padding-top: 24px !important;
  }

  /* Public-beta spotlight cards: single column, mock shown below the copy */
  .spotlight-card { grid-template-columns: 1fr !important; }
  .spotlight-card > * { min-width: 0 !important; }
  .spotlight-card > div:first-child { padding: 24px 20px !important; }
  .spotlight-card .spotlight-mock {
    display: flex !important;
    padding: 0 20px 24px !important;
    justify-content: center !important;
  }
  .spotlight-card .spotlight-mock > * { width: 100% !important; max-width: 420px; }
  .spot-copy-d { display: none !important; }
  .spot-copy-m { display: block !important; }
  .spot-cta-row { flex-direction: column; }
  .spot-cta-row .btn { width: 100%; justify-content: center; }
  /* Code QuickRef card: no pills, no Add-to-Chrome CTA on mobile */
  .cqr-pills { display: none !important; }
  .cqr-cta { display: none !important; }
  /* ── Contact pages (mobile): same hero type scale as board/solutions ── */
  [data-screen-label^="06 Contact"] h1.h-display {
    font-size: clamp(19px, 6vw, 28px) !important;
  }
  [data-screen-label^="06 Contact"] > section:first-child p {
    font-size: clamp(13.5px, 3.8vw, 15px) !important;
    line-height: 1.5 !important; max-width: 40ch !important;
    margin: 10px auto 0 !important;
  }
  .ct-sub-d { display: none !important; }
  .ct-sub-m { display: block !important; color: var(--ink-2); font-weight: 400; }
  /* ── Advisory board pages (mobile): match the sitewide mobile type scale ── */
  .pab-sub-d { display: none !important; }
  .pab-sub-m { display: block !important; }
  .gab-sub-d { display: none !important; }
  .gab-sub-m { display: block !important; }
  [data-screen-label="05 Physician Advisory Board"] h1.h-display,
  [data-screen-label="05 Advisory Board"] h1.h-display {
    font-size: clamp(20px, 6.6vw, 30px) !important;
  }
  [data-screen-label="05 Physician Advisory Board"] > section:first-child p,
  [data-screen-label="05 Advisory Board"] > section:first-child p {
    font-size: clamp(13.5px, 3.8vw, 15px) !important;
    line-height: 1.5 !important; max-width: 40ch !important;
    margin: 10px auto 0 !important;
  }
  [data-screen-label="05 Physician Advisory Board"] .band-warm,
  [data-screen-label="05 Advisory Board"] .band-warm { padding: 28px 0 !important; }
  /* Person cards: founder-card mobile scale */
  .person-card { padding: 28px 20px !important; }
  .person-card img { width: 160px !important; height: 160px !important; margin-bottom: 18px !important; }
  .person-card .pc-name { font-size: 21px !important; }
  .person-card .pc-role { font-size: 14.5px !important; }
  .person-card .pc-bio { font-size: 14.5px !important; line-height: 1.55 !important; }
  /* Board cross-link CTA: stacked full-width buttons like other pages */
  [data-screen-label="05 Physician Advisory Board"] .section .btn,
  [data-screen-label="05 Advisory Board"] .section .btn { width: 100%; justify-content: center; }
  /* ── Executive Leadership page (mobile) ── */
  .about-h1-br { display: inline !important; }
  /* sized so "A physician-led company," always fits one line */
  .about-h1 { font-size: clamp(20px, 6.6vw, 30px) !important; }
  .about-sub-d { display: none !important; }
  .about-sub-m {
    display: block !important;
    font-size: clamp(13.5px, 3.8vw, 15px); color: var(--ink-2);
    line-height: 1.5; max-width: 40ch; margin: 10px auto 0; font-weight: 400;
  }
  .founder-card { padding: 28px 20px !important; }
  .founder-card img { width: 160px !important; height: 160px !important; margin-bottom: 18px !important; }
  .founder-card .fc-name { font-size: 21px !important; }
  .founder-card .fc-role { font-size: 14.5px !important; margin-bottom: 12px !important; }
  .founder-card .fc-bio { font-size: 14.5px !important; line-height: 1.55 !important; }
  /* Physician-led green band */
  .plb-card { padding: 28px 22px !important; text-align: center; }
  .plb-card .mono { text-align: center; }
  .plb-br { display: none !important; }
  .plb-title { font-size: 20px !important; line-height: 1.25 !important; }
  .plb-sub { font-size: 14.5px !important; line-height: 1.55 !important; margin-top: 12px !important; }
  .plb-ctas { flex-direction: column; }
  .plb-ctas .btn { width: 100%; justify-content: center; white-space: nowrap; }
  /* ── Careers page (mobile) ── */
  .careers-sub-d { display: none !important; }
  .careers-sub-m {
    display: block !important;
    font-size: clamp(13.5px, 3.8vw, 15px); color: var(--ink-2);
    line-height: 1.5; max-width: 40ch; margin: 10px auto 0; font-weight: 400;
  }
  /* Job cards: compact single-column header; metadata as a plain dot-separated
     line instead of pills */
  .job-head { grid-template-columns: 1fr auto !important; gap: 12px !important; padding: 14px 16px !important; }
  .job-head > div > div:first-child { font-size: 17px !important; }
  .job-meta { gap: 0 !important; margin-top: 4px !important; }
  .job-meta-pill {
    background: transparent !important; border: 0 !important; padding: 0 !important;
    border-radius: 0 !important; font-size: 12px !important; color: var(--ink-3) !important;
  }
  .job-meta-pill + .job-meta-pill::before { content: "\00b7"; margin: 0 6px; color: var(--ink-4); }
  /* chevron-only expand affordance — hide the "View role" label text */
  .job-view { font-size: 0 !important; gap: 0 !important; }
  .job-view svg { width: 14px; height: 14px; }
  .job-body { padding: 0 18px 18px !important; }
  .job-apply { flex-direction: column; align-items: stretch !important; }
  .job-apply .btn { width: 100%; justify-content: center; }
  /* Contact form card: tighter padding */
  .contact-form-card { padding: 22px 18px !important; }
  /* Active beta note in the hero: one-card, ≤2 lines; demo CTA hidden */
  .ins-hero-demo { display: none !important; }
  .ins-beta-note {
    display: block !important;
    padding: 10px 14px !important; font-size: 12.5px !important;
    line-height: 1.45; text-align: center !important;
    white-space: normal !important;
  }
  .ins-beta-note > span:first-child::after { content: " "; }
  .ins-beta-long { display: none !important; }
  .ins-beta-short { display: inline !important; }
  /* ── Insurify page (mobile) ── */
  .ins-hero-pills { display: none !important; }
  .ins-h1-d { display: none !important; }
  .ins-h1-m { display: inline !important; }
  /* sized so "Know what payers require" always fits line 1; break forced */
  [data-screen-label="03 Insurify"] h1 { font-size: clamp(20px, 7vw, 28px) !important; }
  .ins-sub-d { display: none !important; }
  .ins-sub-m {
    display: block !important;
    font-size: clamp(13.5px, 3.8vw, 15px); color: var(--ink-2);
    line-height: 1.5; max-width: 40ch; margin: 10px auto 0; font-weight: 400;
  }
  /* Show the product mock (scaled) — .hero-mock-stage is otherwise hidden */
  .ins-page-mock { display: block !important; padding: 20px 0 4px !important; }
  /* Solutions hero demo CTA reads in brand green */
  .sol-cta-demo { color: var(--accent) !important; }
  /* Insurify spotlight: pills hidden on mobile */
  .ins-pills { display: none !important; }
  /* Insurify beta card title: forced 2-line break after "medical",
     sized so line 1 always fits one line */
  .ins-card-br { display: inline !important; }
  .spotlight-card h2.h-2 { font-size: clamp(19px, 5.6vw, 24px) !important; text-wrap: initial !important; }
  /* "In development" carousel: next card peeks in to invite the swipe,
     continuous scrolling (snap to card starts, no forced paging) */
  .peek-cards { scroll-padding-left: 0; }
  .peek-cards > * { flex: 0 0 82% !important; scroll-snap-align: start !important; }

  /* Specialty rollout: 3-line subtitle, no email link, swipeable 4-per-card
     carousel instead of the desktop panel */
  .sr-copy-d { display: none !important; }
  .sr-copy-m {
    display: block !important;
    margin: 12px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-2);
  }
  .sr-email { display: none !important; }
  .sr-panel-d { display: none !important; }
  .sr-carousel { display: flex !important; margin-top: 4px; }
  /* Coming next: mobile card variant */
  .cn-desktop { display: none !important; }
  .cn-mobile { display: block !important; }
  /* Pilot-partner spotlight: quote and stats become two separate swipe cards */
  .ps-eyebrow-d { display: none !important; }
  .ps-eyebrow-m { display: block !important; }
  .pilot-cols {
    border: 0 !important; background: transparent !important;
    box-shadow: none !important; border-radius: 0 !important;
    min-height: 0 !important; overflow-x: auto !important;
  }
  .pilot-cols > div {
    border: 1px solid var(--line-2) !important; border-radius: 16px;
    box-shadow: var(--shadow-card);
    padding: 26px 22px !important;
  }
  .pilot-cols > div:first-child { background: var(--paper); }
  .pilot-cols > div:first-child span.mono { display: none !important; } /* setting pill */
  /* Pilot quote: complete-sentence excerpt so it holds to \u22644 lines */
  .pq-full { display: none !important; }
  .pq-short { display: inline !important; }
  .pilot-cols blockquote { font-size: 17px !important; }
  /* footer, mobile: logo + Terms/Privacy on the row; disclaimer alone below;
     no copyright, no city */
  .footer-copyright, .footer-city, .footer-disc-inline { display: none !important; }
  .footer-disc-below {
    display: block !important;
    margin-top: 12px; font-size: 10px; color: var(--ink); white-space: nowrap;
  }
  /* trust-logo carousel: 10px shorter, contents scaled to match */
  .clinician-marquee img { height: 46px !important; }
  .clinician-track { gap: 10px; }
  /* carousel section exactly 100px tall: 14 + 26 (eyebrow) + 0 + 46 (logos) + 14 */
  section:has(.clinician-marquee) { padding: 14px 0 !important; }
  section:has(.clinician-marquee) .cmd-container > div:first-child { margin-top: -8px !important; margin-bottom: 8px !important; }
}

/* Form pills & chips: direct manipulation, so they get the snap spring and an
   instant pressed state (feedback on pointer-down, spring on release). */
.pick-pill {
  transition: background var(--spring-snap), border-color var(--spring-snap),
              color var(--spring-snap), transform var(--spring-snap);
}
.pick-pill:active { transform: scale(0.94); transition-duration: 60ms; }
