/* ==========================================================================
   Normacore — Precision Light  ·  N3 trucks / UN R48
   v3: hero leads with an auto-playing truck analysis; calmer scroll below
   ========================================================================== */

:root {
  --canvas: #FBFBFA;
  --surface: #FFFFFF;
  --surface-sunken: #F4F4F2;
  --ink: #0B0E14;
  --ink-secondary: #4A515E;
  --ink-muted: #5C636E;
  --border: #E4E5E1;
  --border-strong: #CFD1CC;

  --accent: #1F5EFF;
  --accent-hover: #1340C2;
  --accent-wash: #EEF3FF;

  --success: #3F6212;
  --success-wash: rgba(63, 98, 18, 0.10);
  --warning: #B45309;
  --warning-text: #92400E;
  --warning-wash: rgba(180, 83, 9, 0.10);
  --danger: #C2410C;
  --danger-text: #9A3412;
  --danger-wash: rgba(194, 65, 12, 0.10);

  --shadow-card: 0 1px 2px rgba(11,14,20,0.05), 0 8px 24px -8px rgba(11,14,20,0.07);
  --shadow-lift: 0 2px 4px rgba(11,14,20,0.06), 0 24px 48px -16px rgba(11,14,20,0.10);

  --r-md: 10px;
  --r-sm: 6px;

  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;

  --maxw: 1240px;
  --gutter: clamp(1.25rem, 5vw, 2rem);
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }

/* Belt-and-suspenders against any stray horizontal scroll on phones. clip (not
   hidden) so the sticky header keeps working. */
html, body { overflow-x: clip; }
/* No grey tap flash on touch; focus-visible styles still cover keyboard users. */
a, button, .btn, [role="button"], input, textarea { -webkit-tap-highlight-color: transparent; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { color: var(--ink); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -0.015em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent-hover); text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
em { font-style: normal; color: var(--ink); font-weight: 500; }

.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ----------------------------- Layout helpers --------------------------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
/* Leave room for the sticky header when scrollIntoView targets a section. */
:where(section[id], footer[id]) { scroll-margin-top: calc(var(--header-h) + 12px); }

/* All section kickers share one readable format (matches the hero eyebrow). */
.eyebrow {
  font-family: var(--font-mono); font-size: 0.85rem; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-secondary);
  display: inline-flex; align-items: center; gap: 0.7rem; margin: 0 0 1.4rem;
}
.eyebrow::before { content: ""; width: 32px; height: 2px; background: var(--accent); transform: scaleX(var(--tick, 1)); transform-origin: left center; }

.section-title { font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.1; letter-spacing: -0.02em; max-width: 22ch; }
.section-body { font-size: 1.0625rem; color: var(--ink-secondary); max-width: 62ch; margin-top: 1.5rem; }

/* ----------------------------- Scenes (full-page, top-aligned) ---------- */
/* Sections are content-height with generous padding (no forced 100vh, which left
   big empty bands when a section's content was shorter than the viewport). */
.scene { padding-block: clamp(5.5rem, 10vh, 8rem) clamp(4.5rem, 8vh, 6.5rem); }
/* No scroll-snap: it pulled the page toward section edges when scrolling slowly,
   which fought the user. Full-viewport scenes + reveals keep the "one screen per
   idea" feel without hijacking the scroll. */

/* ----------------------------- Accessibility ---------------------------- */
.skip-link {
  position: fixed; top: 0.75rem; left: 0.75rem; z-index: 200;
  background: var(--ink); color: #fff; padding: 0.65rem 1rem; border-radius: var(--r-sm);
  transform: translateY(-160%); transition: transform 0.2s ease;
}
.skip-link:focus { transform: translateY(0); }
:where(a, button, input, textarea, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; box-shadow: 0 0 0 4px var(--accent-wash); border-radius: var(--r-sm); }

/* ----------------------------- Buttons ---------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-size: 0.95rem; font-weight: 500; line-height: 1; padding: 0.85rem 1.4rem;
  border-radius: var(--r-sm); border: 1px solid transparent;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}
.btn-sm { padding: 0.6rem 1rem; font-size: 0.875rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(11,14,20,0.10), 0 8px 20px -10px rgba(31,94,255,0.55); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 1px 2px rgba(11,14,20,0.12), 0 14px 30px -10px rgba(31,94,255,0.62); }
.btn-primary:active { transform: translateY(0.5px); box-shadow: 0 1px 2px rgba(31,94,255,0.45), 0 4px 12px -8px rgba(31,94,255,0.5); }
.btn-ghost { color: var(--ink); background: transparent; }
.btn-ghost:hover { color: var(--accent-hover); }
.btn-ghost .btn-arrow { width: 16px; height: 16px; transition: transform 0.2s ease; }
.btn-ghost:hover .btn-arrow { transform: translateX(3px); }
.js-magnetic { will-change: transform; }

/* ----------------------------- Header ----------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  display: flex; align-items: center; border-bottom: 1px solid transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease, backdrop-filter 0.25s ease;
}
.site-header.is-scrolled {
  background: rgba(251, 251, 250, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px);
  border-bottom-color: var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); }
.brand-mark { width: 26px; height: 26px; color: var(--ink); }
.brand-name { font-weight: 600; font-size: 1.1rem; letter-spacing: -0.02em; }

/* ----------------------------- Hero ------------------------------------- */
.hero { position: relative; padding-top: clamp(3rem, 6vh, 5rem); }
.measure-grid {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(11,14,20,0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(11,14,20,0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 92% 70% at 50% 30%, #000 36%, transparent 80%);
          mask-image: radial-gradient(ellipse 92% 70% at 50% 30%, #000 36%, transparent 80%);
}
.hero-inner {
  position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr 0.95fr;
  align-items: stretch; gap: clamp(2rem, 5vw, 4rem); width: 100%;
}
/* left copy fills the same height as the analysis panel, vertically centered */
.hero-copy { display: flex; flex-direction: column; justify-content: center; }
/* Sentence-grouped via <br>; balance keeps any wrapped sentence even. */
.hero-title { font-size: clamp(2.4rem, 5vw, 3.7rem); line-height: 1.06; letter-spacing: -0.026em; font-weight: 700; margin-bottom: 1.5rem; }
.hero-deck { font-size: clamp(1.02rem, 1.35vw, 1.18rem); color: var(--ink-secondary); max-width: 54ch; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem; margin-top: 2rem; }
.hero-trust { margin-top: 1.8rem; font-size: 0.875rem; color: var(--ink-muted); max-width: 54ch; }

.plate-stamp { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }

/* ----------------------------- Analysis panel (hero centerpiece) -------- */
.hero-artifact {
  position: relative;
  background:
    radial-gradient(135% 82% at 88% -12%, rgba(31,94,255,0.08), transparent 55%),
    linear-gradient(165deg, #FFFFFF 0%, #FCFCFB 52%, #F5F8FF 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lift), 0 30px 60px -28px rgba(31,94,255,0.18), inset 0 1px 0 rgba(255,255,255,0.7);
  padding: 1.1rem 1.2rem 1.2rem; overflow: hidden;
}
.hero-artifact::before, .hero-artifact::after { content: ""; position: absolute; width: 14px; height: 14px; border: 1.5px solid var(--border-strong); z-index: 3; }
.hero-artifact::before { top: 7px; left: 7px; border-right: none; border-bottom: none; }
.hero-artifact::after { bottom: 7px; right: 7px; border-left: none; border-top: none; }

.analysis-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.analysis-live { display: inline-flex; align-items: center; gap: 0.55rem; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; animation: livePulse 1.7s ease-in-out infinite; }
@keyframes livePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(31,94,255,0.35); opacity: 0.7; } 50% { box-shadow: 0 0 0 5px rgba(31,94,255,0); opacity: 1; } }
.cc-progress { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.08em; color: var(--accent-hover); white-space: nowrap; }
.analysis-toggle {
  position: relative;
  width: 26px; height: 26px; display: inline-grid; place-items: center;
  background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--ink-secondary);
  transition: color 0.18s ease, border-color 0.18s ease;
}
/* Expand the touch target to ~46px without changing the visual box. */
.analysis-toggle::after { content: ""; position: absolute; inset: -10px; }
.analysis-toggle:hover { color: var(--accent-hover); border-color: var(--border-strong); }
.analysis-toggle .ic { width: 13px; height: 13px; }
.analysis-toggle .ic-play { display: none; }
.analysis-toggle[aria-pressed="true"] .ic-pause { display: none; }
.analysis-toggle[aria-pressed="true"] .ic-play { display: block; }

.analysis-variant { font-family: var(--font-mono); font-size: 0.66rem; color: var(--ink-muted); letter-spacing: 0.01em; padding: 0.7rem 0 0.85rem; }

.cc-vehicle-wrap {
  position: relative; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 0.6rem 0.7rem; margin-bottom: 1rem;
  background-color: #FAFBFE;
  background-image:
    radial-gradient(120% 100% at 50% 0%, rgba(31,94,255,0.08), transparent 62%),
    linear-gradient(rgba(11,14,20,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11,14,20,0.05) 1px, transparent 1px);
  background-size: 100% 100%, 22px 22px, 22px 22px;
}
.cc-vehicle { width: 100%; height: auto; max-height: 170px; margin-inline: auto; position: relative; z-index: 1; }
.cc-scan { position: absolute; top: 6px; bottom: 6px; left: 0; width: 2px; z-index: 2; background: linear-gradient(180deg, transparent, var(--accent) 22%, var(--accent) 78%, transparent); box-shadow: 0 0 12px 2px rgba(31,94,255,0.45); opacity: 0; }
.hotspot circle { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.4; transition: fill 0.25s ease, stroke 0.25s ease; }
.hotspot.lit circle { fill: var(--accent); stroke: var(--accent); }
.hotspot.fail circle { fill: var(--danger); stroke: var(--danger); }

.cc-checks { border-top: 1px solid var(--border); }
.cc-row { display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 0.8rem; padding: 0.6rem 0.4rem; border-bottom: 1px solid var(--border); border-radius: var(--r-sm); transition: background-color 0.3s ease, opacity 0.3s ease; }
/* during the live re-run: pending rows dim, the row being checked stands out */
.cc-row.checking { opacity: 0.5; }
.cc-row.checking.active { opacity: 1; background: var(--accent-wash); }
.cc-row.active .cc-dot { border-color: var(--accent); }
.cc-row[data-fail] { background: var(--danger-wash); }
.cc-code { font-family: var(--font-mono); font-size: 0.7rem; color: var(--ink); font-weight: 500; }
.cc-name { font-size: 0.84rem; color: var(--ink-secondary); }
.cc-measure { display: block; font-family: var(--font-mono); font-size: 0.6rem; color: var(--ink-muted); margin-top: 0.18rem; letter-spacing: 0.01em; }
.cc-row[data-fail] .cc-measure { color: var(--danger-text); }
.cc-status { display: inline-flex; align-items: center; gap: 0.35rem; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.04em; text-transform: uppercase; transition: opacity 0.3s ease; white-space: nowrap; }
.cc-status svg { width: 13px; height: 13px; }
.cc-status[data-verdict="pass"] { color: var(--success); }
.cc-status[data-verdict="fail"] { color: var(--danger-text); }

/* Callout default = the flagged result (so it is never an empty box, even with
   no JS); .is-scanning shows the neutral "analysing" state during the live re-run. */
.cc-callout { margin-top: 1rem; background: var(--danger-wash); border: 1px solid rgba(194,65,12,0.25); border-left: 3px solid var(--danger); border-radius: var(--r-sm); padding: 0.8rem 1rem; min-height: 4.4rem; transition: background-color 0.35s ease, border-color 0.35s ease; }
.cc-callout-tag { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.12em; color: var(--danger-text); display: block; margin-bottom: 0.35rem; }
.cc-state { font-size: 0.85rem; color: var(--ink); margin: 0; }
.cc-callout [data-tag-scan], .cc-callout .cc-state-scan { display: none; }
.cc-callout.is-scanning { background: var(--surface-sunken); border-color: var(--border); border-left-color: var(--border-strong); }
.cc-callout.is-scanning .cc-callout-tag { color: var(--ink-muted); }
.cc-callout.is-scanning [data-tag-result], .cc-callout.is-scanning .cc-state-result { display: none; }
.cc-callout.is-scanning [data-tag-scan], .cc-callout.is-scanning .cc-state-scan { display: block; }

/* Per-row verdict cell: a pending dot during the live re-run, the verdict otherwise */
.cc-verdict-cell { display: inline-flex; align-items: center; justify-content: flex-end; min-width: 130px; }
.cc-dot { width: 13px; height: 13px; border-radius: 50%; border: 1.6px solid var(--border-strong); display: none; }
.cc-row.checking .cc-dot { display: inline-block; animation: dotPulse 0.9s ease-in-out infinite; }
.cc-row.checking .cc-status { display: none; }
@keyframes dotPulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.95; } }

/* Classification chips + rule cards (reused in How-it-works diptych) */
.chip { display: inline-flex; align-items: center; gap: 0.3rem; font-family: var(--font-mono); font-size: 0.6rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.25rem 0.5rem; border-radius: var(--r-sm); white-space: nowrap; }
.chip svg { width: 11px; height: 11px; }
.chip-mandatory { color: var(--danger-text); background: var(--danger-wash); }
.chip-conditional { color: var(--warning-text); background: var(--warning-wash); }
.chip-optional { color: var(--success); background: var(--success-wash); }
.rule-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 0.85rem 0.95rem; box-shadow: var(--shadow-card); }
.rule-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.4rem; }
.rule-cite { font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent-hover); }
.rule-text { color: var(--ink); font-size: 0.92rem; font-weight: 500; line-height: 1.45; }
.rule-meta { font-family: var(--font-mono); font-size: 0.64rem; color: var(--ink-muted); margin-top: 0.4rem; }

/* ----------------------------- Problem / stats -------------------------- */
.problem { padding-top: clamp(3.5rem, 7vh, 5rem); }
.problem-head { max-width: 66ch; }
.problem .section-title { max-width: 26ch; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1.5rem, 3vw, 2.5rem); margin-top: clamp(2.5rem, 5vw, 3.5rem); padding-top: clamp(2rem, 4vw, 2.5rem); border-top: 1px solid var(--border); }
.stat { position: relative; padding-left: 1.1rem; }
.stat::before { content: ""; position: absolute; left: 0; top: 0.4rem; bottom: 0.4rem; width: 2px; background: var(--accent); border-radius: 2px; opacity: 0.85; }
.stat-value { font-size: clamp(2.4rem, 4.5vw, 3.4rem); line-height: 1; color: var(--accent-hover); font-weight: 500; }
.stat-value .num { font-weight: 500; }
.stat-label { margin-top: 0.85rem; font-size: 0.9rem; color: var(--ink-secondary); max-width: 26ch; }
.stat-source { margin-top: 1.75rem; font-size: 0.78rem; color: var(--ink-muted); }

/* ----------------------------- How it works (scroll expander) ----------- */
.solution { padding-top: clamp(5rem, 10vh, 7.5rem); }
.solution-head { max-width: 60ch; }
.steps-stage { margin-top: clamp(1.5rem, 3vw, 2.5rem); }
.steps-pin { display: flex; align-items: center; }
.steps-pin .container { position: relative; }
@media (min-width: 961px) { .steps-pin { min-height: 100vh; } }
.steps-stack { width: 100%; display: flex; flex-direction: column; gap: 0.8rem; }

/* Continuous progress rail down the pinned pipeline. Shown only in the exact
   scenario the expander pins (wide AND tall enough); otherwise hidden so no
   empty track lingers when every step is shown open. */
.steps-rail { display: none; position: absolute; left: calc(var(--gutter) + 0.7rem); top: 0.6rem; bottom: 0.6rem; width: 2px; background: var(--border); border-radius: 2px; z-index: 1; pointer-events: none; }
.steps-rail-fill { position: absolute; inset: 0; background: var(--accent); border-radius: 2px; transform-origin: top center; transform: scaleY(0); }
@media (min-width: 961px) and (min-height: 800px) {
  .can-animate .steps-rail { display: block; }
  .can-animate .steps-stack { padding-left: 2.4rem; }
}

.step-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-card); padding: 1.5rem 1.8rem; opacity: 0.5; transition: opacity 0.45s ease, box-shadow 0.45s ease, border-color 0.45s ease, transform 0.45s ease; }
.step-card.is-active { opacity: 1; box-shadow: var(--shadow-lift), inset 3px 0 0 var(--accent); border-color: var(--border-strong); }
.step-card:not(.is-active) { padding-top: 1.1rem; padding-bottom: 1.1rem; }
.step-card-row { position: relative; display: flex; align-items: center; gap: 1.2rem; padding-right: 2rem; }
.step-card-row::after { content: ""; position: absolute; right: 0.2rem; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--ink-muted); border-bottom: 2px solid var(--ink-muted); transform: translateY(-70%) rotate(45deg); transition: transform 0.45s ease, border-color 0.45s ease; }
.step-card.is-active .step-card-row::after { border-color: var(--accent); transform: translateY(-30%) rotate(-135deg); }
.step-num { font-family: var(--font-mono); font-size: 0.95rem; color: var(--ink-muted); font-weight: 500; margin: 0; transition: color 0.45s ease; }
.step-card.is-active .step-num { color: var(--accent); }
.step-title { font-size: clamp(1.2rem, 1.9vw, 1.6rem); margin: 0; }
/* Body: open by default so a no-JS load shows every step. Under .can-animate it
   collapses with a true-height grid-rows transition (no fake max-height snap) and
   JS opens exactly the active step. */
.step-card-body { margin-top: 1.3rem; }
.can-animate .step-card-body { display: grid; grid-template-rows: 0fr; margin-top: 0; opacity: 0; transition: grid-template-rows 0.55s cubic-bezier(0.16,1,0.3,1), opacity 0.4s ease, margin-top 0.45s ease; }
.can-animate .step-card-body > .step-body-grid { overflow: hidden; min-height: 0; }
.can-animate .step-card.is-active .step-card-body { grid-template-rows: 1fr; opacity: 1; margin-top: 1.3rem; }
.step-desc { font-size: 1.02rem; color: var(--ink-secondary); max-width: 56ch; }
.step-visual { margin-top: 0; }
.step-body-grid { display: grid; grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); gap: clamp(2rem, 4vw, 3.5rem); align-items: center; }
.step-body-text { min-width: 0; }
.step-points { margin-top: 1.1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.step-points { margin-top: 1.3rem; gap: 0.75rem; }
.step-points li { display: flex; align-items: flex-start; gap: 0.65rem; font-size: 0.96rem; color: var(--ink-secondary); }
.step-points li::before { content: "\2713"; color: var(--accent); font-weight: 700; font-size: 0.82rem; line-height: 1.6; flex-shrink: 0; }

/* shared slide-visual layout */
.sv-extract { display: grid; grid-template-columns: minmax(0, 1.05fr) auto minmax(0, 0.95fr); align-items: center; gap: clamp(0.8rem, 2vw, 1.6rem); max-width: 760px; }
.sv-arrow { display: inline-flex; color: var(--accent); }
.sv-arrow svg { width: 34px; height: 16px; }

/* tall "device" panel that fills the right column */
.sv-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-card); overflow: hidden; will-change: transform; }
.sv-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.7rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface-sunken); }
.sv-card-head .lbl { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.sv-card-body { padding: 1.05rem 1.15rem; }
.sv-card .sv-obj { background: var(--surface-sunken); box-shadow: none; }
.sv-down { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin: 0.85rem 0; color: var(--ink-muted); font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.08em; text-transform: uppercase; }
.sv-down svg { width: 16px; height: 16px; color: var(--accent); }
.sv-eval { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.95rem; }
.sv-eval-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-family: var(--font-mono); font-size: 0.64rem; padding: 0.45rem 0.65rem; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--r-sm); }
.sv-eval-row b { color: var(--danger-text); font-weight: 500; }
.sv-eval-note { display: block; margin-top: 0.7rem; font-family: var(--font-mono); font-size: 0.58rem; color: var(--ink-muted); letter-spacing: 0.04em; }

/* a regulation "document" with a highlighted clause */
.sv-doc { background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 0.95rem 1.05rem; min-width: 0; }
.sv-doc-head { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); display: block; margin-bottom: 0.7rem; }
.sv-lines { margin: 0; font-family: var(--font-mono); font-size: 0.68rem; line-height: 2; color: var(--ink-muted); white-space: pre-wrap; word-break: break-word; }
.sv-lines .l { display: block; padding: 0.14rem 0.45rem; border-radius: 3px; }
.sv-lines .hl { background: var(--accent-wash); color: var(--ink); box-shadow: inset 2px 0 0 var(--accent); }

/* a structured "rule object" / data record */
.sv-obj { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 0.95rem 1.05rem; box-shadow: var(--shadow-card); }
.sv-obj-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.7rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--border); }
.sv-obj-id { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.02em; color: var(--accent-hover); }
.sv-obj-id::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 0.45rem; vertical-align: middle; }
.sv-ver { font-family: var(--font-mono); font-size: 0.56rem; color: var(--ink-muted); }
.sv-field { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; font-family: var(--font-mono); font-size: 0.68rem; padding: 0.34rem 0; }
.sv-field span { color: var(--ink-muted); }
.sv-field b { color: var(--ink); font-weight: 500; text-align: right; }
.sv-obj-foot { display: block; margin-top: 0.5rem; padding-top: 0.45rem; border-top: 1px dashed var(--border); font-family: var(--font-mono); font-size: 0.55rem; color: var(--ink-muted); }

/* a deterministic predicate */
.sv-obj-code { max-width: 420px; }
.sv-pred { margin: 0; padding: 0.95rem 1.05rem; background: var(--surface-sunken); border-radius: var(--r-sm); border-left: 2px solid var(--accent); font-family: var(--font-mono); font-size: 0.72rem; line-height: 2.1; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.sv-pred .kw { color: var(--accent-hover); }
.sv-pred b { font-weight: 600; }
.sv-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 0.85rem; }
.sv-note { font-size: 0.9rem; color: var(--ink-secondary); }

/* system badges */
.sv-systems-col { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; }
.sv-systems { display: inline-flex; gap: 0.45rem; }
.sv-systems span { font-family: var(--font-mono); font-size: 0.64rem; padding: 0.4rem 0.65rem; border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--ink-secondary); background: var(--surface); }
.sv-locked { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 0.7rem; font-family: var(--font-mono); font-size: 0.62rem; color: var(--success); }
.sv-locked svg { width: 14px; height: 14px; }

/* a verdict result list */
.sv-result { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-card); padding: 1.1rem 1.25rem; max-width: 520px; }
.sv-result-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.65rem; padding-bottom: 0.65rem; border-bottom: 1px solid var(--border); }
.sv-vlist li { display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 0.7rem; padding: 0.65rem 0.35rem; border-bottom: 1px solid var(--border); }
.sv-vlist li:last-child { border-bottom: none; }
.sv-vlist li.sv-fail { background: var(--danger-wash); border-radius: var(--r-sm); border-bottom-color: transparent; box-shadow: inset 2px 0 0 var(--danger); }
.sv-vname { font-size: 0.88rem; color: var(--ink-secondary); }
.sv-result-foot { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.85rem; font-size: 0.84rem; color: var(--ink-secondary); }
.sv-flag-tag { font-family: var(--font-mono); font-size: 0.56rem; letter-spacing: 0.1em; color: var(--danger-text); background: var(--danger-wash); border: 1px solid rgba(194,65,12,0.25); padding: 0.28rem 0.5rem; border-radius: var(--r-sm); white-space: nowrap; }
.sv-vlist .cc-code { font-family: var(--font-mono); font-size: 0.7rem; color: var(--ink); }

/* ----------------------------- Features --------------------------------- */
.features-head { margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.features .section-title { max-width: 20ch; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.feature-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 1.6rem 1.5rem 1.7rem; box-shadow: var(--shadow-card); transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; }
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--border-strong); }
.feature-corner { position: absolute; width: 11px; height: 11px; border: 1.5px solid var(--accent); opacity: 0.55; }
.feature-corner.tl { top: 9px; left: 9px; border-right: none; border-bottom: none; }
.feature-corner.br { bottom: 9px; right: 9px; border-left: none; border-top: none; }
.feature-icon { width: 44px; height: 44px; display: grid; place-items: center; background: var(--accent-wash); border-radius: var(--r-sm); color: var(--accent); margin-bottom: 1.25rem; }
.feature-icon svg { width: 22px; height: 22px; }
.feature-title { font-size: 1.125rem; margin-bottom: 0.55rem; }
.feature-desc { font-size: 0.92rem; color: var(--ink-secondary); }

/* ----------------------------- Use cases -------------------------------- */
.use-head { margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.case-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.case-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 1.8rem 1.6rem; box-shadow: var(--shadow-card); display: flex; flex-direction: column; transition: transform 0.28s cubic-bezier(0.16,1,0.3,1), box-shadow 0.28s cubic-bezier(0.16,1,0.3,1), border-color 0.28s ease; }
.case-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--border-strong); }

/* Cursor-aware spotlight: a faint accent glow that tracks the pointer (set via JS
   --mx/--my). Pure CSS + opacity, gated to fine-pointer devices in JS. */
.case-card::before, .step-card.is-active::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: 0; pointer-events: none;
  background: radial-gradient(200px circle at var(--mx, -200px) var(--my, -200px), rgba(31,94,255,0.07), transparent 62%);
  opacity: 0; transition: opacity 0.3s ease;
}
.case-card:hover::before, .step-card.is-active:hover::before { opacity: 1; }
.case-card > *, .step-card > * { position: relative; z-index: 1; }
.case-metric { font-size: clamp(2.6rem, 4vw, 3.2rem); line-height: 1; color: var(--accent-hover); font-weight: 500; }
.case-title { font-size: 1.0625rem; margin: 1rem 0 0.6rem; }
.case-desc { font-size: 0.9rem; color: var(--ink-secondary); }
.case-quote { margin: 1.5rem 0 0; padding-top: 1.4rem; border-top: 1px solid var(--border); }
.case-quote p { font-size: 0.95rem; color: var(--ink); line-height: 1.55; }
.case-quote cite { display: block; margin-top: 0.9rem; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.03em; color: var(--ink-muted); font-style: normal; }

/* ----------------------------- CTA / form ------------------------------- */
.cta-inner { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; width: 100%; }
.cta .section-title { max-width: 18ch; }
.cta-points { margin-top: 2rem; display: flex; flex-direction: column; gap: 0.85rem; }
.cta-points li { display: flex; align-items: center; gap: 0.7rem; font-size: 0.95rem; color: var(--ink-secondary); }
.cta-points svg { width: 16px; height: 16px; color: var(--success); flex-shrink: 0; }
.cta-form-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lift); padding: clamp(1.5rem, 3vw, 2.25rem); position: relative; min-height: 430px; }
.demo-form { display: flex; flex-direction: column; gap: 1.1rem; }
.demo-form[hidden], .form-success[hidden] { display: none; }
/* Honeypot anti-spam field: visually hidden with a zero-footprint clip (NOT
   left:-9999px, which can create a sideways-scrollable page on mobile) and not
   type=hidden, so bots still fill it. */
.hp { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; opacity: 0; pointer-events: none; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-size: 0.82rem; font-weight: 500; color: var(--ink); }
.field .optional { color: var(--ink-muted); font-weight: 400; }
.field input, .field textarea {
  font-family: var(--font-sans); font-size: 0.95rem; color: var(--ink); background: var(--surface-sunken);
  border: 1px solid var(--border); border-radius: var(--r-sm); padding: 0.75rem 0.85rem; width: 100%; resize: vertical;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-muted); }
.field input:focus, .field textarea:focus { outline: none; background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,94,255,0.15); }
.field.invalid input, .field.invalid textarea { border-color: var(--danger); }
.field-error { font-size: 0.78rem; color: var(--danger-text); min-height: 0; }
.form-fineprint { font-size: 0.78rem; color: var(--ink-muted); text-align: center; margin-top: 0.2rem; }
.form-success { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem; }
.success-icon { width: 56px; height: 56px; margin-bottom: 1.25rem; }
.form-success h3 { font-size: 1.4rem; margin-bottom: 0.6rem; }
.form-success p { font-size: 0.95rem; color: var(--ink-secondary); max-width: 38ch; }

/* ----------------------------- Footer ----------------------------------- */
.site-footer { border-top: 1px solid var(--border); padding-top: clamp(3rem, 6vw, 5rem); padding-bottom: 2.5rem; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 3fr; gap: clamp(2rem, 5vw, 4rem); }
.footer-tag { margin-top: 1rem; color: var(--ink-secondary); font-size: 0.92rem; max-width: 30ch; }
.footer-trust { margin-top: 1rem; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; color: var(--ink-muted); }
.footer-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.footer-col-title { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink); margin-bottom: 1.1rem; }
.footer-col ul { display: flex; flex-direction: column; gap: 0.7rem; }
.footer-col a { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-secondary); transition: color 0.18s ease; }
.footer-col a:hover { color: var(--accent-hover); }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem; margin-top: clamp(3rem, 6vw, 4.5rem); padding-top: 1.75rem; border-top: 1px solid var(--border); }
.footer-legal p { font-size: 0.76rem; color: var(--ink-muted); max-width: 60ch; }

/* ----------------------------- Scroll cue (prominent flowing arrow) ----- */
.scroll-hint {
  position: fixed; left: 50%; bottom: clamp(1rem, 2.6vw, 1.8rem); transform: translateX(-50%); z-index: 80;
  pointer-events: none; transition: opacity 0.4s ease, visibility 0.4s ease;
}
.scroll-hint.is-hidden { opacity: 0; visibility: hidden; }
.scroll-hint svg { width: 30px; height: 34px; }
.sc-ch { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0; animation: scFlow 1.5s ease-in-out infinite; }
.sc-ch2 { animation-delay: 0.22s; }
@keyframes scFlow { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }

/* ==========================================================================
   Pre-animation hidden states — only when JS will animate (html.can-animate)
   ========================================================================== */
.can-animate [data-split] { opacity: 0; }
.can-animate [data-reveal],
.can-animate [data-feature],
.can-animate [data-case],
.can-animate [data-foot] { opacity: 0; }
/* Hero centerpiece arrives with the headline (revealed by initHeroAnalysis). */
.can-animate .hero-artifact { opacity: 0; }
/* Eyebrow ticks start collapsed so the headline reveal can draw them in without
   a flash; if JS never runs, .can-animate is stripped and they revert to full. */
.can-animate .eyebrow { --tick: 0; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }

@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-artifact { max-width: 560px; margin-inline: auto; width: 100%; }
  .cta-inner { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .case-grid { grid-template-columns: repeat(2, 1fr); }
  /* Match the single-column hero collapse: 2-up stats/footer at tablet width. */
  .stat-grid, .footer-cols { grid-template-columns: repeat(2, 1fr); }
  /* Tighten the hero analysis panel so the fail row + payoff callout reach the
     first screen rather than sitting below the fold on a phone. */
  .cc-vehicle-wrap { padding: 0.45rem 0.6rem; }
  .cc-vehicle { max-height: 120px; }
  .cc-row { padding-block: 0.45rem; }
  /* No pinning on small screens: all steps open, stacked. */
  .steps-pin { min-height: 0; display: block; }
  .steps-pin .container { position: static; }
  .steps-rail, .can-animate .steps-rail { display: none; }
  .can-animate .steps-stack { padding-left: 0; }
  .step-card { opacity: 1; }
  .step-card-body, .can-animate .step-card-body { display: block; grid-template-rows: none; opacity: 1; margin-top: 1.1rem; }
  .can-animate .step-card-body > .step-body-grid { overflow: visible; }
  .step-body-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .sv-extract { grid-template-columns: 1fr; }
  .sv-arrow { justify-self: center; transform: rotate(90deg); }
}

@media (max-width: 720px) {
  :root { --header-h: 56px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .case-grid { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { gap: 1.5rem; }
  /* 16px inputs so iOS does not zoom the whole page on field focus. */
  .field input, .field textarea { font-size: 16px; }
  /* Comfortable 44px touch targets for the persistent CTA and footer links. */
  .site-header .btn-sm { min-height: 44px; padding-block: 0.7rem; }
  .footer-col a { display: inline-flex; align-items: center; min-height: 44px; }
  .footer-col ul { gap: 0.2rem; }
  /* Scrolling is the default gesture on a phone; drop the fixed scroll cue. */
  .scroll-hint { display: none; }
}

/* Touch devices never run the magnetic / spotlight effects, so drop the layer
   promotion they would otherwise hold for nothing. */
@media (hover: none) {
  .js-magnetic, .sv-card { will-change: auto; }
}

@media (max-width: 560px) {
  .feature-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .footer-cols { grid-template-columns: 1fr; }
  .cc-name { font-size: 0.78rem; }
  .footer-legal { flex-direction: column; }
  /* Stack the verdict under the code + name so the long fail row never clips. */
  .cc-row { grid-template-columns: 84px 1fr; gap: 0.4rem 0.5rem; }
  .cc-verdict-cell { grid-column: 1 / -1; justify-content: flex-start; min-width: 0; margin-top: 0.1rem; }
  /* Same treatment for the step-04 verdict list (the product payoff). */
  .sv-vlist li { grid-template-columns: auto 1fr; gap: 0.3rem 0.5rem; }
  .sv-vlist li .cc-status { grid-column: 1 / -1; justify-self: start; margin-top: 0.15rem; }
  /* Full-width stacked CTAs read as the primary action on a phone. */
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
}

/* ==========================================================================
   Reduced motion
   --------------------------------------------------------------------------
   Scroll reveals and the step choreography run identically with or without
   reduced motion (scroll-position-driven motion is WCAG 2.3.3, AAA, optional),
   so the page keeps its full composition for everyone. Only the continuously
   auto-looping pieces are stilled here: the hero analysis loop carries a pause
   control (WCAG 2.2.2, Level A), and the three CSS keyframe loops below are
   held at a resting state so nothing moves on its own.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .live-dot, .cc-row.checking .cc-dot, .sc-ch { animation: none; }
  .live-dot { opacity: 1; }
  .sc-ch { opacity: 0.9; }
}
