/* Scroll story: plate to report, and the page's opening ("the envelope").
 * Base rules = the static end state (phones, short windows, reduced motion, no JS, GSAP failure): the hero, the report still, then every step.
 * .story--live (story.js adds it for the timeline build and removes it if the build fails) pins one screen: the closed envelope, scrubbed by scroll, ending in the hero.
 * Source of the motion: stackcheck-reels/plate-to-report-story (HyperFrames). Live code, never a frame sequence. */
.story { --paper: #FDFBF7; --cream: #F5F1E8; --ink: #2D2A26; --ink-2: #4A4640; --forest: #1B4332; --terra: #E07A5F; --rule: #E2DACB; --caption-reserve: 10rem; scroll-margin-top: 5rem; }

/* Static: one column in DOM order (hero, still, steps); the stage and the cue only show when live */
.story--envelope .story-pin { display: flex; flex-direction: column; gap: 2rem; padding-block: 2.5rem; }
/* Static end state: the report screen at a readable size on the paper table. The animated stage only shows when live. */
.story-still { margin: 0; display: grid; place-items: center; padding: 2rem 1rem; border-radius: 20px; background: #EFE6D6 url("/assets/story/table.jpg") center / cover; box-shadow: 0 2px 4px rgba(45, 42, 38, 0.06), 0 30px 60px -30px rgba(45, 42, 38, 0.35); }
.story-still img { display: block; width: min(64%, 300px); height: auto; border-radius: 24px; box-shadow: 0 1px 2px rgba(45, 42, 38, 0.08), 0 24px 40px -22px rgba(45, 42, 38, 0.45); }
.story-stage { display: none; }
.story-cue { display: none; }
.story--live .story-stage { display: block; }
.story--live .story-still { display: none; }
.story-stage { position: relative; width: 100%; max-width: 1320px; aspect-ratio: 1320 / 720; border-radius: 20px; overflow: hidden; background: var(--paper); box-shadow: 0 2px 4px rgba(45, 42, 38, 0.06), 0 30px 60px -30px rgba(45, 42, 38, 0.35); }
.story-inner { position: absolute; left: 0; top: 0; width: 1320px; height: 720px; transform-origin: 0 0; transform: scale(var(--k, 1)); perspective: 2200px; }
.story-card { position: absolute; inset: 0; border-radius: 20px; background: var(--paper); box-shadow: 0 2px 4px rgba(45, 42, 38, 0.06), 0 30px 60px -30px rgba(45, 42, 38, 0.35); }

/* Static end state: only the table and the phone show; the live layers are hidden until story.js runs */
.story-layer { position: absolute; inset: 0; }
.story-live-only { display: none; }
.story-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 47% 50%; }
.story-shot { position: absolute; left: 503px; top: 20px; width: 314px; height: 680px; border-radius: 24px; overflow: hidden; box-shadow: 0 1px 2px rgba(45, 42, 38, 0.08), 0 24px 40px -22px rgba(45, 42, 38, 0.45); }
.story-shot { background: #111; }
.story-screen { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.story-screen:not([data-screen="report"]) { display: none; }
.story--live .story-screen { display: block; }
.story-mark { position: absolute; left: 517px; top: 149px; width: 287px; height: 60px; border-radius: 10px; box-shadow: inset 0 0 0 3px var(--terra); }

.story-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; counter-reset: step; }
.story-steps li { counter-increment: step; display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); column-gap: 0.75rem; transition: opacity 220ms cubic-bezier(0.16, 1, 0.3, 1); }
.story-steps li::before { content: counter(step); font-family: "Fraunces", Georgia, serif; font-weight: 700; font-size: 1.5rem; line-height: 1.2; color: var(--forest); }
.story-steps h3 { grid-column: 2; margin: 0; font-family: "Fraunces", Georgia, serif; font-weight: 700; font-size: 1.25rem; line-height: 1.2; color: var(--forest); }
.story-steps p { grid-column: 2; margin: 0.2rem 0 0; color: var(--ink-2); font-size: 0.95rem; line-height: 1.45; }

/* Origami flaps, toy miniature, low poly (copied from the composition) */
.story-flap { position: absolute; inset: 0; backface-visibility: hidden; }
.story-flap.top { background: #E07A5F; clip-path: polygon(0 0, 100% 0, 50% 50%); transform-origin: 50% 0; }
.story-flap.bottom { background: #EBD9C4; clip-path: polygon(0 100%, 100% 100%, 50% 50%); transform-origin: 50% 100%; }
.story-flap.left { background: #1B4332; clip-path: polygon(0 0, 0 100%, 50% 50%); transform-origin: 0 50%; }
.story-flap.right { background: #F0E6D6; clip-path: polygon(100% 0, 100% 100%, 50% 50%); transform-origin: 100% 50%; }
.story-toy { filter: saturate(1.35) contrast(1.08) brightness(1.03); }
.story-toy.blur-top { filter: saturate(1.35) contrast(1.08) blur(9px); -webkit-mask-image: linear-gradient(#000 0%, transparent 38%); mask-image: linear-gradient(#000 0%, transparent 38%); }
.story-toy.blur-bottom { filter: saturate(1.35) contrast(1.08) blur(9px); -webkit-mask-image: linear-gradient(transparent 66%, #000 100%); mask-image: linear-gradient(transparent 66%, #000 100%); }
.story-capsule { position: absolute; width: 92px; height: 36px; border-radius: 18px; overflow: hidden; display: flex; box-shadow: 0 14px 12px -10px rgba(45, 42, 38, 0.45); }
.story-capsule::before { content: ""; flex: 1; background: #E07A5F; }
.story-capsule span { flex: 1; background: #FDFBF7; }
.story-capsule.c1 { left: 170px; top: 470px; transform: rotate(-18deg); }
.story-capsule.c2 { left: 250px; top: 530px; transform: rotate(12deg); }
.story-capsule.c2::before { background: #1B4332; }
.story-capsule.c3 { left: 1080px; top: 180px; transform: rotate(28deg); }
.story .mesh { position: absolute; inset: 0; width: 1320px; height: 720px; }
.story .tri { stroke: rgba(253, 251, 247, 0.16); stroke-width: 0.6; }

/* Live: one screen pinned under the sticky header (--story-top is the header's measured height, set by story.js).
 * The stage sits centred; captions show one step at a time under it; the hero waits on the left. */
.story--live .story-live-only { display: block; }
.story--live .story-track { height: 760vh; }
.story--live.story--envelope .story-pin { display: block; position: sticky; top: var(--story-top); height: calc(100vh - var(--story-top)); padding: 0; }
/* Height cap: on short windows the stage shrinks so the caption under it never overlaps it */
.story--live.story--envelope .story-stage { position: absolute; left: 50%; top: 46%; width: min(1040px, 72vw, calc((100vh - var(--story-top) - var(--caption-reserve)) * 1320 / 720)); margin: 0; background: transparent; box-shadow: none; overflow: visible; }
.story--live .story-inner { border-radius: 20px; overflow: hidden; }
.story--live.story--envelope .story-cue { display: block; position: absolute; left: 0; right: 0; bottom: 6%; text-align: center; margin: 0; font-size: 14px; color: #6A645C; }
.story--live.story--envelope .story-steps { position: absolute; left: 50%; bottom: 5%; width: min(720px, 80vw); transform: translateX(-50%); display: grid; text-align: center; }
.story--live.story--envelope .story-steps li { grid-area: 1 / 1; display: block; opacity: 0; }
.story--live.story--envelope .story-steps li::before { display: none; }
.story--live.story--envelope .story-steps li.is-active { opacity: 1; }
.story--live.story--envelope .story-steps h3 { font-size: 1.6rem; }

/* Live hero: the approved mock's type sizes and spacing (Byron, 2026-11-19); static mode keeps the page's Tailwind hero.
 * Opacity, not visibility, so the h1 and the links stay in the accessibility tree; story.js fades it in and turns pointer events on. */
.story--live.story--envelope .story-hero { position: absolute; left: 0; top: 50%; width: 46%; min-width: min-content; text-align: left; opacity: 0; pointer-events: none; } /* min-content: the box holds the one-line trust row */
.story--live.story--hero-on .story-hero { pointer-events: auto; }
.story--live .story-hero h1 { margin: 0; max-width: 15ch; font-size: clamp(2.5rem, 1.2rem + 3.2vw, 3.75rem); line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; } /* 15ch: three lines as in the mock, clear of the phone */
.story--live .story-lead { margin: 20px 0 0; font-size: 1.125rem; line-height: 1.6; max-width: 36rem; }
.story--live .story-ctas { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 16px; margin: 28px 0 0; }
.story--live .story-stores { justify-content: flex-start; gap: 12px; margin: 20px 0 0; }
.story--live .story-stores a { gap: 12px; padding: 10px 18px; }
.story--live .story-stores a > span, .story--live .story-stores a > span > span { line-height: 1.1; margin-top: 0; }
.story--live .story-terms { margin: 12px 0 0; text-align: left; }
.story--live .story-trust { flex-wrap: nowrap; white-space: nowrap; justify-content: flex-start; margin: 16px 0 0; }
