/* Only the introduction is pinned. Its media is the stage, never a portrait card. */
html { scroll-snap-type: none; }
main > section, body > footer { scroll-snap-align: none; scroll-margin-top: var(--header-height); }
main > .hero-scroll-story { display: block; position: relative; overflow: visible; height: auto; min-height: 100svh; padding: 0; }
.hero-story-stage { position: relative; isolation: isolate; min-height: 100svh; padding: calc(var(--header-height) + 40px) var(--page-gutter) 88px; }
.hero-scroll-story .hero-layout { position: relative; z-index: 2; width: 100%; max-width: 1240px; margin: auto; grid-template-columns: minmax(320px, .85fr) minmax(0, 1.15fr); gap: clamp(24px, 4vw, 64px); }
.hero-scroll-story .hero-main { gap: 36px; min-width: 0; }
.hero-scroll-story .hero-copy { min-width: 0; }
.hero-scroll-story .story-copy h2 { font-size: clamp(36px, 4vw, 54px); line-height: 1.2; letter-spacing: -.03em; white-space: pre-line; text-wrap: balance; margin: 0; }
.hero-scroll-story .story-copy h2 span { color: var(--color-primary-strong); }
.hero-scroll-story .story-copy > p:not(.label) { color: var(--color-muted); font-size: 16px; line-height: 1.75; max-width: 43ch; margin: 24px 0 0; }
.story-copy + .story-copy { margin-top: 48px; }
.story-copy { min-width: 0; overflow-wrap: anywhere; }
/* Workspace exits establish one story chapter before exposing the hero again. */
[data-story-returning="true"] .story-copy:not([data-story-chapter="0"]) { display: none; }
[data-story-returning="true"] .story-copy, [data-story-returning="true"] .story-copy > :is(h1,h2,p) { transition: none !important; }
.hero-scroll-story .hero-companion { position: absolute; inset: 0; display: block; width: 100%; height: 100svh; padding: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.hero-story-media { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; overflow: hidden; }
.hero-story-media canvas, .story-poster { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.story-foreground { opacity: 0; }
.story-wash { position: absolute; left: 0; top: 0; opacity: 0; background: var(--color-background); pointer-events: none; mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent), linear-gradient(to bottom, transparent, #000 4%, #000 94%, transparent); -webkit-mask-composite: source-in; mask-composite: intersect; }
.story-poster { object-fit: contain; object-position: 78% center; mask-image: linear-gradient(to right, transparent 30%, #000 64%, transparent); }
.hero-story-media[data-ready="true"] .story-foreground { opacity: 1; }
.hero-story-media[data-ready="true"] .story-poster { visibility: hidden; }
.hero-companion::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, var(--color-background) 0%, var(--color-background) 32%, transparent 63%), linear-gradient(0deg, var(--color-background), transparent 16%, transparent 88%, var(--color-background)); }
.story-lookup { width: 100%; max-width: 480px; }
.story-skip { position: absolute; z-index: 3; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: inline-flex; align-items: center; justify-content: center; gap: 16px; min-height: 52px; max-width: calc(100% - 48px); padding: 14px 24px; border: 0; border-radius: 999px; background: var(--color-surface); box-shadow: 0 6px 24px #162d3226; color: var(--color-primary-strong); font-size: 14px; font-weight: 700; text-decoration: none; transition: background 160ms ease, transform 160ms ease; }
.story-skip:active { transform: translateX(-50%) scale(.98); }
.hero-scroll-story[data-story-pinned="true"] { height: 400svh; }
#home[data-hero-preview-mode="B"][data-story-pinned="true"] { height: 800svh; }
[data-story-pinned="true"] .hero-story-stage { position: sticky; top: 0; height: 100svh; }
[data-story-pinned="true"] .hero-layout { height: 100%; max-height: 100%; }
[data-story-pinned="true"] .story-copy-stack { display: grid; grid-template-columns: minmax(0,1fr); align-items: center; }
[data-story-pinned="true"] .story-copy { grid-area: 1 / 1; margin: 0; opacity: 0; visibility: hidden; }
[data-story-pinned="true"] { --story-text-offset: 12px; }
[data-story-pinned="true"][data-story-direction="backward"] { --story-text-offset: -12px; }
[data-story-pinned="true"] .story-copy > :is(h1,h2) { transform: translateY(var(--story-text-offset)); }
[data-story-pinned="true"] .story-copy > p { transform: translateY(calc(var(--story-text-offset) / 2)); }
[data-story-animated="true"][data-story-pinned="true"] .story-copy { transition: opacity 280ms ease-out, visibility 280ms; }
[data-story-animated="true"][data-story-pinned="true"] .story-copy > :is(h1,h2) { transition: transform 380ms cubic-bezier(.22,1,.36,1); }
[data-story-animated="true"][data-story-pinned="true"] .story-copy > p { transition: transform 340ms cubic-bezier(.22,1,.36,1) 35ms; }
[data-story-pinned="true"] .story-copy[data-active="true"] { opacity: 1; visibility: visible; }
[data-story-pinned="true"] .story-copy[data-active="true"] > :is(h1,h2,p) { transform: translateY(0); }
[data-story-input="keyboard"] .story-copy,[data-story-input="keyboard"] .story-copy > :is(h1,h2,p) { transition: none !important; }
/* A's copy follows the same drawn frames as its canvas. The form keeps its
   layout position; only the text's composited transform and opacity change. */
html:not([data-report-mounted]) #home[data-hero-preview-mode="B"][data-character-copy-motion] .story-copy { visibility: visible; transition: none; }
html:not([data-report-mounted]) #home[data-hero-preview-mode="B"][data-character-copy-motion] .story-copy > :is(h1,h2,p) { transform: none; transition: none; }
html:not([data-report-mounted]) #home[data-hero-preview-mode="B"][data-character-copy-motion] .hero-copy { clip-path: inset(-16px 0 0); }
@media (min-width: 1024px) {
  html:not([data-report-mounted]) #home[data-hero-preview-mode="B"][data-character-copy-motion] .hero-copy { clip-path: inset(-48px 0 0); }
}
html[data-story-active="true"] .back-to-top { display: none; }
.hero-scroll-story a:focus-visible { outline: 2px solid var(--color-primary-strong); outline-offset: 5px; }
/* When enlarged copy cannot fit, keep the illustration in the document rather
   than behind four readable chapters. Never crop content to force the stage. */
html:not([data-report-mounted]) [data-story-pinned="false"] .hero-story-stage { display: flex; flex-direction: column; }
html:not([data-report-mounted]) [data-story-pinned="false"] .hero-layout { order: 0; height: auto; max-height: none; }
html:not([data-report-mounted]) [data-story-pinned="false"] .hero-companion { position: relative; inset: auto; order: 1; height: 300px; max-width: 560px; align-self: center; }
html:not([data-report-mounted]) [data-story-pinned="false"] .story-skip { position: static; order: 2; align-self: center; transform: none; margin-top: 24px; }
html:not([data-report-mounted]) [data-story-pinned="false"] .story-skip:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) { .story-skip:hover { background: var(--color-primary-soft); } }
@media (max-width: 767px) {
  .hero-story-stage { padding: calc(var(--header-height) + 8px) 24px calc(72px + env(safe-area-inset-bottom)); }
  .hero-scroll-story .hero-layout { display: block; max-width: 560px; }
  .hero-scroll-story .hero-main { display: flex; gap: 24px; }
  [data-story-pinned="true"] .hero-main { height: 100%; display: grid; grid-template-rows: auto minmax(80px,1fr) auto; gap: 8px; }
  [data-story-pinned="true"] .hero-copy { grid-row: 1; }
  [data-story-pinned="true"] .hero-action { grid-row: 3; }
  .hero-scroll-story .lookup-feedback:not(:has(> :not([hidden]):not(:empty))) { min-height: 0; margin: 0; }
  [data-story-pinned="true"] .hero-copy::before { content: ''; position: absolute; z-index: -1; inset: -12px -24px -12px; pointer-events: none; background: linear-gradient(90deg, var(--color-background), color-mix(in srgb, var(--color-background) 70%, transparent) 40%, transparent 75%); mask-image: linear-gradient(#000 50%, transparent); }
  [data-story-pinned="true"] .story-lookup { position: relative; isolation: isolate; }
  [data-story-pinned="true"] .story-lookup::before { content: ''; position: absolute; z-index: -1; inset: -16px -24px 0; pointer-events: none; background: linear-gradient(180deg, transparent, var(--color-background) 24px); mask-image: linear-gradient(90deg, #000 80%, transparent); }
  .hero-scroll-story .hero-copy .label { font-size: 11px; margin-bottom: 10px; }
  .hero-scroll-story #hero-title, .hero-scroll-story .story-copy h2 { font-size: clamp(28px, 7.7vw, 36px); line-height: 1.18; letter-spacing: -.025em; }
  .hero-scroll-story .story-copy > p:not(.label) { font-size: 13px; line-height: 1.6; margin-top: 14px; max-width: 46ch; }
  .hero-scroll-story .story-copy .lead br { display: none; }
  .hero-companion::after { background: linear-gradient(180deg, transparent 76%, var(--color-background)); }
  .story-skip { bottom: calc(16px + env(safe-area-inset-bottom)); min-height: 48px; padding: 12px 20px; font-size: 13px; gap: 12px; }
  .hero-scroll-story .hero-action .vehicle-lookup h2 { font-size: 18px; margin-bottom: 12px; }
}
/* Phones need one quiet lower surface, not a plate-sized patch on the scene. */
@media (max-width: 599px) {
  .hero-story-stage { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  [data-story-pinned="true"] .story-lookup::before { content: none; }
  [data-story-pinned="true"] .hero-companion::after { background: linear-gradient(180deg, transparent max(0px, calc(var(--story-lookup-top, 75svh) - 64px)), var(--color-background) var(--story-lookup-top, 75svh)); }
  .story-skip { box-shadow: 0 4px 16px #183d3612; }
}
/* Keep the left-copy/right-art composition at narrow tablet widths too. */
@media (min-width: 600px) and (max-width: 767px) {
  .hero-scroll-story .hero-layout { max-width: none; }
  [data-story-pinned="true"] .hero-main { display: flex; width: 48%; max-width: 340px; gap: 36px; }
}
@media (max-width: 767px) and (max-height: 700px) {
  .hero-story-stage { padding-top: calc(var(--header-height) + 4px); }
  [data-story-pinned="true"] .hero-main { gap: 6px; }
  .hero-scroll-story .story-copy > p:not(.label) { margin-top: 12px; }
  .hero-scroll-story .hero-action .vehicle-lookup h2 { margin-bottom: 8px; }
}
/* Keep the existing report/plate FLIP, and remove the stage while it is mounted. */
html[data-report-mounted] main > .hero-scroll-story { height: auto; min-height: 100svh; padding: 0; }
html[data-report-mounted] .hero-story-stage { position: static; height: auto; min-height: 100svh; padding: calc(var(--header-height) + 40px) var(--page-gutter) 40px; }
html[data-report-mounted] .hero-scroll-story .hero-layout { height: auto; max-height: none; }
html[data-report-mounted] [data-story-fold] { display: none; }
html[data-report-mounted] .hero-scroll-story .hero-main { display: flex; height: auto; }
@media (max-width: 1099px) {
  html[data-report-mounted] .hero-scroll-story .hero-layout { display: grid; grid-template-columns: minmax(0,1fr); }
  html[data-report-mounted] .hero-story-stage { padding: calc(var(--header-height) + 24px) 24px 40px; }
}
@media (prefers-reduced-motion: reduce) { .hero-scroll-story :is(.story-copy, .story-skip, .story-copy > h1, .story-copy > h2, .story-copy > p) { transition: none; } }
@media (prefers-reduced-motion: reduce) { .story-wash { display: none; } }
