/* Zeta "Paper World" v4 — the v3-2 experience, extended.

   Same design language as v3-2, with its own type: Gambarino for display
   type, Schibsted Grotesk for everything else, ink on the light renders and cream
   on the dark ones, champagne foil for small accents.

   LEGIBILITY BY PLACEMENT, NOT DIMMING (carried over from v3-2). No scrim,
   wash or gradient sits over a render. Each panel stands in its shot's
   clear space. The one busy, light render (the paper field, second part of
   "Why") gets the torn-paper placard, as it did in v3-2.

   Where each panel stands, measured at 1440 x 900:
   - hero       Thirty render: forms rise at the right, text upper-left
   - labs       prism: heading upper-left above the light shaft, the paper
                item lower-left below it (v3-2's placement)
   - unforget   full width. Three shapes across the middle: heading above
                them, one caption under each. Slides sideways to the figures.
   - products   lantern family at the right, text and the brief deck left
   - why 1/2/3  Unfold (left), paper field (placard, left), Core (left)
   - contact    plane centre-left, text in the clear right column */

@font-face {
    font-family: "Gambarino";
    src: url("../assets/fonts/gambarino-regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: block;   /* the hero words are sized for this face: show nothing rather than a wrong-size fallback */
}

@font-face {
    font-family: "Schibsted Grotesk";
    src: url("../assets/fonts/schibsted-grotesk-latin-variable.woff2") format("woff2");
    font-weight: 400 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --paper: #f0e7d6;
    --paper-hi: #f7f0e2;
    --ink: #191510;
    --ink-70: #4b4437;
    --ink-45: #7d7563;
    --foil: #a9792f;
    --foil-hi: #d0ab63;
    --cream: #f4ecd9;
    --cream-70: rgba(244, 236, 217, 0.80);
    --cream-45: rgba(244, 236, 217, 0.52);
    --night: #0c0906;

    /* Type. The display face is a sharp, upright serif whose thin strokes
       end in points, like paper cut with a blade. It has one weight, so
       hierarchy comes from size, never from bold. The text face is a sturdy
       grotesque that stays readable over the pictures. Both are served
       from assets/fonts. */
    --font-display: "Gambarino", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    --ink-above: 0.16em;   /* how far this display face can reach above a line box of height 1 */
    --ink-below: 0.32em;   /* and below it: the tails of g, p and y */
    --font-sans: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    --gutter: clamp(1.4rem, 4vw, 3.5rem);
    --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);

    /* Each panel sets these two for its ground. */
    --fg: var(--ink);
    --fg-soft: var(--ink-70);
    --rule: rgba(25, 21, 16, 0.4);
}


/* ───────────────────────────── Base ───────────────────────────── */

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

html { background: var(--paper); -webkit-text-size-adjust: 100%; font-synthesis: none; }   /* never fake a bold or an italic the faces do not have */

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-sans);
    font-weight: 400;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

:focus-visible { outline: 2px solid var(--foil-hi); outline-offset: 4px; border-radius: 2px; }

::selection { background: var(--ink); color: var(--paper); }


/* ───────────────────────────── Top bar ───────────────────────────── */

.hud-top {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(1.1rem, 2.4vw, 1.9rem) var(--gutter);
    color: var(--ink);
    transition: color 400ms ease;
}

body.is-dusk .hud-top { color: var(--cream); }

.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* The Z mark is a white-on-transparent png used as a mask, so it takes the text colour. */
.brand-mark {
    width: 26px;
    height: 26px;
    background: currentColor;
    -webkit-mask: url(../assets/brand/zeta-mark.png) center / contain no-repeat;
    mask: url(../assets/brand/zeta-mark.png) center / contain no-repeat;
}

.hud-nav { display: flex; gap: clamp(1.2rem, 2.6vw, 2.4rem); }

.hud-nav a {
    font-size: 1rem;
    font-weight: 500;
    padding: 0.4rem 0;
    transition: opacity 250ms ease;
}

.hud-nav a:hover { opacity: 0.6; }


/* ───────────────────────────── Journey index ───────────────────────────── */

/* Six ticks on the right edge: the parts of the walk, in order. The one in
   view is longer. A tick's name appears when you point at it. */
.journey {
    position: fixed;
    right: clamp(0.7rem, 1.2vw, 1.3rem);
    top: 50%;
    z-index: 60;
    transform: translateY(-50%);
    color: var(--ink);
    transition: color 400ms ease;
}

body.is-dusk .journey { color: var(--cream); }

.journey ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: flex-end; }

.journey a { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0; font-size: 0.85rem; font-weight: 500; }

.journey span {
    opacity: 0;
    transform: translateX(6px);
    white-space: nowrap;
    transition: opacity 250ms ease, transform 350ms var(--ease-spring);
}

.journey i { width: 14px; height: 2px; background: currentColor; opacity: 0.38; transition: width 500ms var(--ease-spring), opacity 300ms ease; }

.journey a:hover span, .journey a:focus-visible span { opacity: 1; transform: none; }
.journey a.is-on i { width: 30px; opacity: 1; }


/* ───────────────────────────── Stage ───────────────────────────── */

main { position: relative; z-index: 2; }

/* The length of the walk. The scene maps scroll through it onto 7 fold
   transitions plus the hold inside Spectral Unforgetting. */
.story-scroll { position: relative; height: 1190vh; }

.story-stage {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    background: var(--night);
}

#scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0;
    transition: opacity 900ms ease;
}

body.is-ready #scene { opacity: 1; }

/* The plane of the last scene. The script places it over the dunes every
   frame: it glides in as the scene arrives, then floats, banks and leans
   toward the cursor. Its shadow stays on the ground under it. */
.glider {
    position: absolute;
    inset: 0;
    z-index: 2;
    overflow: hidden;
    pointer-events: none;
    visibility: hidden;
}

.glider.is-flying { visibility: visible; }

.glider-plane,
.glider-shadow {
    position: absolute;
    left: 0;
    top: 0;
    will-change: transform;
}

.glider-plane { height: auto; transform-origin: 46% 56%; }

.glider-shadow {
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(96, 62, 20, 0.50), rgba(96, 62, 20, 0.22) 55%, rgba(96, 62, 20, 0));
}

/* Scraps of paper on the wind. They pass the plane from nose to tail, which
   is what tells the eye the plane is moving forward. */
.fleck {
    position: absolute;
    left: 100%;
    width: 11px;
    height: 7px;
    background: #f3e2bf;
    clip-path: polygon(0 30%, 55% 0, 100% 45%, 70% 100%, 12% 82%);
    box-shadow: inset -2px -2px 0 rgba(150, 110, 50, 0.35);
    opacity: 0;
    animation: fleck-pass 13s linear infinite paused;
}

.glider.is-flying .fleck { animation-play-state: running; }

.fleck:nth-of-type(1) { top: 31%; animation-duration: 11s; animation-delay: -2s; }
.fleck:nth-of-type(2) { top: 47%; animation-duration: 15s; animation-delay: -9s;  width: 8px;  height: 5px; }
.fleck:nth-of-type(3) { top: 58%; animation-duration: 9s;  animation-delay: -5s;  width: 14px; height: 9px; }
.fleck:nth-of-type(4) { top: 24%; animation-duration: 17s; animation-delay: -13s; width: 7px;  height: 5px; }
.fleck:nth-of-type(5) { top: 66%; animation-duration: 12s; animation-delay: -7s;  width: 10px; height: 6px; }

@keyframes fleck-pass {
    0%   { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
    8%   { opacity: 0.8; }
    50%  { transform: translate3d(-58vw, 3.5vh, 0) rotate(-260deg); }
    92%  { opacity: 0.8; }
    100% { transform: translate3d(-116vw, -1vh, 0) rotate(-560deg); opacity: 0; }
}

.story-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}


/* ───────────────────────────── Panels ───────────────────────────── */

.panel {
    position: absolute;
    left: var(--gutter);
    top: 0;
    height: 100%;
    width: min(44rem, 50vw);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.4rem;
    padding: clamp(6rem, 14vh, 8.4rem) 0 clamp(2.4rem, 6vh, 3.6rem);
    color: var(--fg);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    /* --mx / --my are the smoothed cursor position, -1..1, set by paper-world-v4-ui.js.
       The copy drifts a few pixels against the cursor, so it floats in front of the render. */
    transform: translate3d(calc(var(--mx, 0) * -12px), calc(var(--my, 0) * -8px), 0);
    transition: opacity 420ms ease, visibility 0s linear 420ms;
}

.panel.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 420ms ease, visibility 0s;
}

.panel.on-dark {
    --fg: var(--cream);
    --fg-soft: var(--cream-70);
    --rule: rgba(244, 236, 217, 0.36);
}

.panel h1, .panel h2, .panel h3 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: -0.012em;
    line-height: 1.05;   /* tails of one line must not touch the tops of the next */
    text-wrap: balance;
}

/* On the dark renders a warm light crosses the headline where the cursor is.
   --lx / --ly are the cursor's position inside the headline, in pixels. */
.panel.on-dark [data-light] {
    background: radial-gradient(circle 17rem at var(--lx, -60rem) var(--ly, -60rem), #ffe2a3 0%, #f8ecd2 34%, var(--cream) 70%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;

    /* A background clipped to text is still only painted inside the
       element's own box. The display face has tall ascenders and long
       tails that reach past a tight line box, so they were cut off flat.
       The box gets room above and below, and a negative margin of the same
       size takes it back, so nothing in the layout moves. */
    padding-block: var(--ink-above) var(--ink-below);
    margin-block: calc(var(--ink-above) * -1) calc(var(--ink-below) * -1);
}

/* the hero words sit 0.4vw under their lead-in line; keep that with the room added above */
.panel.on-dark .hero-giant { margin-top: calc(0.4vw - var(--ink-above)); }

[data-magnetic] { display: inline-block; will-change: transform; }

.display-xl { font-size: clamp(2.9rem, 5.6vw, 5.1rem); }
/* Sized by the smaller of the window's width and height: a wide window is
   often a short one, and a section must never run off the bottom. */
.display-l  { font-size: clamp(2.6rem, min(5.7vw, 9.6vh), 5.4rem); }
.display-m  { font-size: clamp(2.1rem, min(4.2vw, 7vh), 3.9rem); }

.lede {
    margin: 0;
    max-width: 30rem;
    font-size: clamp(1.05rem, 1.35vw, 1.25rem);
    line-height: 1.5;
    color: var(--fg-soft);
}

/* An underlined text link, used for every in-copy action. */
.links a, .text-link, .su-source a, .su-step-line a {
    font-weight: 600;
    border-bottom: 1.5px solid currentColor;
    padding-bottom: 2px;
    transition: opacity 250ms ease;
}

.links a:hover, .text-link:hover, .su-source a:hover, .su-step-line a:hover { opacity: 0.65; }

.links { margin: 0.2rem 0 0; display: flex; gap: 1.8rem; font-size: 1.06rem; }


/* ───────────────────────────── 1. Hero ───────────────────────────── */

/* A poster set inside the picture. A small lead-in, then two giant words
   that span the sky of the render. The words are masked by the render's
   foreground, so the tips of the gold forms stand in FRONT of them. */
.p-hero {
    left: 0;
    width: 100%;
    padding: 0 var(--gutter);
    display: block;
}

.hero-title { position: absolute; left: var(--gutter); top: clamp(5rem, 12.5vh, 7.4rem); margin: 0; }

.hero-lead {
    display: block;
    margin-left: 0.35vw;
    font-size: clamp(1.7rem, 3.4vw, 3.2rem);
    line-height: 1;
}

.hero-giant {
    display: block;
    margin-top: 0.4vw;
    font-size: clamp(5rem, 23.6vw, 25rem);   /* the two words are 3.61 em wide in this face: they span the frame and end under the tall forms */
    line-height: 0.86;
    letter-spacing: -0.02em;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 900ms ease 150ms;

    /* The matte is the render's foreground, cut out. paper-world-v4-ui.js keeps
       it lined up with the render through every camera move. */
    /* Three mask layers, added together. The first is the matte, sized and
       placed over the render. The other two are solid blocks for the parts
       of the words that the matte does not reach: ABOVE the render's top
       edge (tall screens), and LEFT of its left edge (wide screens, where
       the view reaches past the render). */
    -webkit-mask-image: url(../assets/concepts/paper-world/v5-hero-matte.png), linear-gradient(#000, #000), linear-gradient(#000, #000);
    mask-image: url(../assets/concepts/paper-world/v5-hero-matte.png), linear-gradient(#000, #000), linear-gradient(#000, #000);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: var(--matte-w, 100vw) var(--matte-h, 100vh), 100% max(0px, var(--matte-y, 0px)), max(0px, var(--matte-x, 0px)) 100%;
    mask-size: var(--matte-w, 100vw) var(--matte-h, 100vh), 100% max(0px, var(--matte-y, 0px)), max(0px, var(--matte-x, 0px)) 100%;
    -webkit-mask-position: var(--matte-x, 0) var(--matte-y, 0), 0 0, 0 0;
    mask-position: var(--matte-x, 0) var(--matte-y, 0), 0 0, 0 0;
}

.p-hero.is-active .hero-giant { opacity: 1; }

/* The small copy runs along the bottom edge, on the confetti field, clear of the forms. */
.hero-foot {
    position: absolute;
    left: var(--gutter);
    right: calc(var(--gutter) + 3rem);
    bottom: clamp(1.4rem, 3.4vh, 2.2rem);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 3rem;
}

.hero-foot .lede { max-width: 31rem; color: var(--cream); font-weight: 500; }
.hero-foot .links { margin: 0; }


/* ───────────────────────────── 2. Research ───────────────────────────── */

.p-labs { width: min(38rem, 46vw); }

.paper-item {
    margin-top: auto;
    width: min(34rem, 100%);
    display: flex;
    align-items: center;
    gap: 1.4rem;
    padding-top: 1.3rem;
    border-top: 1px solid var(--rule);
}

/* The Spectral Unforgetting mark, drawn by paper-world-v4-ui.js from the
   paper's real spectrum. Outside the dashed circle (the cut): thirty gold
   spokes, one for each change that is kept, winding down like a shell.
   Inside it: fine grey static, the noise, which never sits still. */
.paper-mark, .su-source-mark {
    flex: none;
    display: block;
    --dial-gold: var(--foil);
    --dial-noise: rgba(25, 21, 16, 0.42);
    --dial-line: rgba(25, 21, 16, 0.5);
}

.paper-mark { width: 124px; height: 124px; transition: transform 700ms var(--ease-spring); }
.paper-item:hover .paper-mark { transform: rotate(24deg) scale(1.04); }

.paper-mark svg, .su-source-mark svg { display: block; width: 100%; height: 100%; overflow: visible; }

.dial-ring  { stroke: var(--dial-line); stroke-width: 0.7; }
.dial-cut   { stroke: var(--dial-gold); stroke-width: 0.8; }
.dial-core  { fill: var(--dial-gold); }
.dial-kept  { stroke: var(--dial-gold); stroke-width: 1.15; stroke-linecap: round; }
.dial-tip   { fill: var(--dial-gold); }
.dial-noise { stroke: var(--dial-noise); stroke-width: 0.75; stroke-linecap: round; }

.paper-text { display: flex; flex-direction: column; gap: 0.35rem; }

.paper-kicker { font-size: 0.9rem; color: var(--fg-soft); }

.paper-name {
    font-family: var(--font-display);
    font-size: 2.15rem;
    font-weight: 400;
    letter-spacing: -0.008em;
    line-height: 1.05;
}

.paper-line { font-size: 1.04rem; line-height: 1.45; color: var(--fg-soft); }

.paper-go {
    align-self: flex-start;
    margin-top: 0.35rem;
    font-size: 1rem;
    font-weight: 600;
    border-bottom: 1.5px solid currentColor;
    padding-bottom: 2px;
}


/* ───────────────────────────── 3. Spectral Unforgetting ───────────────────────────── */

/* Full width: it holds a track of two pages that slides sideways. */
.p-unforget {
    left: 0;
    width: 100%;
    padding: 0;
    overflow: hidden;
    transform: none;   /* it spans the screen; a drift would show its edges */
}

.su-track {
    display: flex;
    width: 200vw;
    height: 100%;
    will-change: transform;
}

.su-page {
    position: relative;
    flex: none;
    width: 100vw;
    height: 100%;
    padding: clamp(6rem, 12.5vh, 7.4rem) var(--gutter) clamp(3.6rem, 9vh, 5rem);
}

/* Page 1: the idea. A heading above the three shapes, one caption under each. */
.su-idea { display: flex; flex-direction: column; justify-content: space-between; }

.su-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1.4rem, 3vw, 2.6rem);
}

.su-steps li {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--rule);
}

.su-step-name {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 2.3vw, 2.1rem);
    font-weight: 400;
    letter-spacing: -0.005em;
    line-height: 1.1;
}

.su-step-line { font-size: clamp(1rem, 1.3vw, 1.18rem); line-height: 1.45; color: var(--fg-soft); }

/* One state is told at a time. Its caption stays lit, and the scene keeps
   the light on its shape (see statesLife in the scene script). The scroll
   moves from one state to the next, and the gold rule above the caption
   fills as it goes: --tick 0..1. */
/* On a wide window the render is pulled back and stands in the middle, so
   the three captions are moved in to stay under the three shapes. The script
   measures the render: --shapes-left and --shapes-width. */
.su-steps { width: var(--shapes-width, auto); margin-left: var(--shapes-left, 0px); }

.su-steps li { position: relative; cursor: pointer; outline: none; }

.su-steps li > span { transition: opacity 500ms ease, color 500ms ease; }
.su-steps[data-telling] li:not(.is-on) > span { opacity: 0.4; }

.su-steps li::before {
    content: '';
    position: absolute;
    left: 0;
    top: -1px;
    width: 100%;
    height: 2px;
    background: var(--foil-hi);
    transform: scaleX(0);
    transform-origin: left;
}

.su-steps li.is-on::before { transform: scaleX(var(--tick, 1)); }
.su-steps li:focus-visible .su-step-name { text-decoration: underline; text-underline-offset: 0.25em; }

/* Page 2: the evidence. A solid night ground, because the render has slid
   away. Read top to bottom, then left to right: the lead, then three
   numbered steps. The steps come in one after another as you scroll, so
   there is always one obvious place to look. --fig runs 0..1 as it settles. */
.su-evidence {
    --fig: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: clamp(1.2rem, 3vh, 2.2rem);
    isolation: isolate;
    background: var(--night);
}

/* A slow warm glow behind the figures. One part follows the cursor; one
   part swells and fades on its own, so the page is never quite still. */
.su-aura {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(46rem circle at calc(50% + var(--mx, 0) * 36%) calc(52% + var(--my, 0) * 30%), rgba(208, 171, 99, 0.13), transparent 62%);
}

.su-aura::before, .su-aura::after {
    content: "";
    position: absolute;
    width: 62vw;
    height: 62vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(196, 140, 62, 0.11), transparent 62%);
    animation: aura-breathe 11s ease-in-out infinite;
}

.su-aura::before { left: -18vw; top: -22vw; }
.su-aura::after  { right: -20vw; bottom: -30vw; animation-delay: -5.5s; animation-duration: 14s; }

@keyframes aura-breathe {
    0%, 100% { transform: scale(0.86) translate3d(0, 0, 0); opacity: 0.55; }
    50%      { transform: scale(1.12) translate3d(2vw, -1.5vw, 0); opacity: 1; }
}

.su-evidence-head { display: flex; flex-direction: column; gap: 0.9rem; max-width: 52rem; }
.su-evidence-head .lede { max-width: 44rem; }
.su-evidence-head h3 { font-size: clamp(2.1rem, 3.7vw, 3.4rem); }   /* a little under display-m: this page also holds three figures */

.su-flow {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.78fr);
    gap: clamp(1.6rem, 3vw, 3rem);
    align-items: start;
}

/* A step is dim until the scroll reaches it (--at), then it comes up to full. */
.su-flow-step {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    min-width: 0;
    opacity: clamp(0.13, calc((var(--fig) - var(--at)) * 7), 1);
}

.su-flow-step[data-step="1"] { --at: 0.02; }
.su-flow-step[data-step="2"] { --at: 0.34; }
.su-flow-step[data-step="3"] { --at: 0.66; }

.su-flow-head {
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    min-height: 3.2em;
    font-family: var(--font-sans);
    font-size: clamp(1.02rem, 1.3vw, 1.2rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.su-num {
    flex: none;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--foil-hi);
    color: var(--night);
    font-size: 1.15rem;
    letter-spacing: 0;
}

.su-flow-note { margin: 0; font-size: clamp(0.95rem, 1.15vw, 1.05rem); line-height: 1.45; color: var(--fg-soft); }

/* Both figures sit on the same kind of surface. Its edge glows and fades
   slowly, and it tilts a little toward the cursor, so it sits in space. */
.fig-surface {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    max-height: 35vh;
    border: 1px solid rgba(244, 236, 217, 0.16);
    border-radius: 6px;
    background: rgba(12, 9, 6, 0.55);
    transform: perspective(1400px) rotateY(calc(var(--mx, 0) * 2.4deg)) rotateX(calc(var(--my, 0) * -1.8deg));
    animation: surface-breathe 7s ease-in-out infinite;
}

svg.fig-surface { animation-delay: -3.5s; cursor: crosshair; }

@keyframes surface-breathe {
    0%, 100% { border-color: rgba(244, 236, 217, 0.13); box-shadow: 0 0 0 rgba(208, 171, 99, 0); }
    50%      { border-color: rgba(208, 171, 99, 0.34); box-shadow: 0 0 70px rgba(208, 171, 99, 0.09); }
}

/* Chart parts, drawn by paper-world-v4-ui.js. They come in as step 2 arrives. */
.su-evidence .axis { stroke: rgba(244, 236, 217, 0.3); }
.su-evidence .axis, .su-evidence .tick-label { opacity: clamp(0, calc((var(--fig) - 0.34) * 6), 1); }
.su-evidence .bulk-line {
    fill: none;
    stroke: rgba(244, 236, 217, 0.55);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1;
    stroke-dashoffset: calc(1 - clamp(0, (var(--fig) - 0.46) * 4.5, 1));
}
.su-evidence .kept-dot {
    fill: var(--foil-hi);
    opacity: clamp(0, calc((var(--fig) - 0.37 - var(--i) * 0.004) * 10), 1);
}
.su-evidence .cut-line {
    stroke: var(--foil-hi);
    stroke-width: 1.25;
    stroke-dasharray: 6 5;
    opacity: clamp(0, calc((var(--fig) - 0.56) * 7), 1);
}
.su-evidence .note { opacity: clamp(0, calc((var(--fig) - 0.6) * 7), 1); }
.su-evidence svg text { font-family: var(--font-sans); font-size: 15px; fill: rgba(244, 236, 217, 0.62); }
.su-evidence svg text.note-gold { fill: var(--foil-hi); font-weight: 600; font-size: 17px; }
.su-evidence svg text.note-plain { fill: rgba(244, 236, 217, 0.8); font-size: 17px; }

/* The reader: a guide and a marker follow the cursor along the curve. */
.su-evidence .guide  { stroke: rgba(244, 236, 217, 0.4); stroke-width: 1; opacity: 0; transition: opacity 200ms ease; }
.su-evidence .marker { fill: var(--night); stroke: var(--cream); stroke-width: 2; opacity: 0; transition: opacity 200ms ease; }
.su-evidence .is-reading .guide, .su-evidence .is-reading .marker { opacity: 1; }
.su-evidence .is-reading-kept .marker { stroke: var(--foil-hi); }

.fig-readout { display: block; margin-top: 0.3rem; min-height: 2.9em; max-width: 30rem; color: var(--cream-45); }

/* Step 3: what it bought, as four plain numbers. */
.su-numbers { margin: 0; display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.su-numbers div { display: flex; align-items: baseline; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid rgba(244, 236, 217, 0.14); }
.su-numbers dt {
    flex: none;
    width: 4.6ch;
    font-family: var(--font-display);
    font-size: clamp(2.1rem, 3vw, 2.9rem);
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1;
    color: var(--foil-hi);
    font-variant-numeric: tabular-nums;
}
.su-numbers dd { margin: 0; font-size: clamp(0.95rem, 1.15vw, 1.05rem); line-height: 1.35; color: var(--fg-soft); }

.su-source { margin: 0.6rem 0 0; display: flex; align-items: center; gap: 1rem; font-size: 1.04rem; }
.su-source-mark { width: 46px; height: 46px; --dial-gold: var(--foil-hi); --dial-noise: rgba(244, 236, 217, 0.5); --dial-line: rgba(244, 236, 217, 0.45); }

/* Where you are inside the section: the idea, then the evidence. */
.su-progress {
    position: absolute;
    left: 50%;
    bottom: clamp(1rem, 2.6vh, 1.6rem);
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.9rem;
    font-size: 0.86rem;
    color: var(--cream-45);
}

.su-progress [data-su-label].is-on { color: var(--cream); }

.su-progress-bar { width: 9rem; height: 2px; background: rgba(244, 236, 217, 0.22); }
.su-progress-bar span { display: block; height: 100%; width: 100%; background: var(--foil-hi); transform-origin: left; transform: scaleX(0); }


/* ───────────────────────────── 4. Products ───────────────────────────── */

/* The briefs are the centrepiece: a large fanned deck that floats in the
   lantern light, with the words beside it. */
.p-products { width: min(60rem, 60vw); }

.product {
    margin-top: auto;
    display: flex;
    align-items: flex-end;
    gap: clamp(5rem, 12vw, 12rem);   /* room for the fanned cards behind the front one */
}

.deck {
    position: relative;
    flex: none;
    width: min(clamp(12rem, 16vw, 16.5rem), 27vh);   /* never taller than the window can hold */
    aspect-ratio: 635 / 1206;
    animation: deck-float 7s ease-in-out infinite;
}

@keyframes deck-float {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(-0.6deg); }
    50%      { transform: translate3d(0, -10px, 0) rotate(0.6deg); }
}

.deck-card {
    position: absolute;
    inset: 0;
    display: block;
    border-radius: 10px;
    overflow: hidden;
    background: #f2ecdf;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), 0 0 60px rgba(232, 150, 60, 0.12);
    transform-origin: left bottom;
    /* --k is the card's place in the stack: 0 is the front */
    transform: translate(calc(var(--k) * 17%), calc(var(--k) * -3.2%)) rotate(calc(var(--k) * 2.2deg)) scale(calc(1 - var(--k) * 0.045));
    opacity: calc(1 - var(--k) * 0.14);
    z-index: calc(10 - var(--k));
    transition: transform 800ms var(--ease-spring), opacity 600ms ease;
    pointer-events: none;
}

.deck-card img { display: block; width: 100%; height: 100%; object-fit: cover; }

.deck-card.is-front { pointer-events: auto; }
.deck-card.is-front:hover { transform: translateY(-2%) scale(1.02); }

/* The front card leaves to the left, then joins the back of the stack. */
.deck-card.is-leaving {
    transform: translate(-36%, 4%) rotate(-9deg) scale(0.96);
    opacity: 0;
    transition: transform 520ms ease-in, opacity 420ms ease-in;
}

.product-text { display: flex; flex-direction: column; align-items: flex-start; gap: 0.8rem; padding-bottom: 0.3rem; max-width: 20rem; }
.product-text p { margin: 0; }

.product-name { line-height: 1; }

/* PaperGlide's wordmark, exactly as its own site sets it (.sw-wm in its
   stylesheet): its sans face, bold, wide tracking, GLIDE in its red. It is
   another company's mark, so it does not take this page's typefaces. */
.pg-wordmark {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: clamp(1.35rem, 1.75vw, 1.7rem);
    font-weight: 700;
    letter-spacing: 0.14em;
    white-space: nowrap;
    color: #f2f2f2;
}

.pg-wordmark i { font-style: normal; color: #e63329; }

.product-line { font-size: 1.06rem; line-height: 1.45; color: var(--fg-soft); }


/* ───────────────────────────── 5. Why ───────────────────────────── */

/* One argument in three parts. Each part is a single large statement that
   holds the calm side of its picture, with one line under it. */
.p-why { justify-content: center; padding-top: clamp(5rem, 10vh, 7rem); width: min(52rem, 55vw); gap: 1.6rem; }

.p-why h2 { font-size: clamp(2.8rem, min(6.6vw, 11vh), 6.3rem); line-height: 1.03; }
.p-why .lede { font-size: clamp(1.1rem, 1.5vw, 1.4rem); max-width: 32rem; }

.why-part { margin: 0; display: flex; align-items: center; gap: 0.9rem; font-size: 0.98rem; color: var(--fg-soft); }
.why-dots { display: flex; gap: 0.35rem; }
.why-dots i { width: 1.4rem; height: 2px; background: var(--rule); }
.why-dots i.is-on { background: var(--fg); }

/* The paper field is busy and light, so its copy stands on a torn sheet of paper. */
.p-why-2 { width: min(48rem, 52vw); }
.p-why-2 h2 { font-size: clamp(2.6rem, min(5.8vw, 9.6vh), 5.6rem); }

.placard {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    padding: clamp(2rem, 3.6vw, 3.2rem) clamp(2rem, 3.6vw, 3.2rem) clamp(2.2rem, 3.8vw, 3.4rem);
}

.placard::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--paper-hi);
    box-shadow: 0 18px 40px rgba(60, 44, 18, 0.28);
    filter: url(#placard-torn);
}

.p-why-3 { width: min(40rem, 42vw); }
.p-why-3 h2 { font-size: clamp(2.6rem, min(5.7vw, 9.6vh), 5.5rem); }


/* ───────────────────────────── 6. Contact ───────────────────────────── */

/* The plane sits centre-left; the right column of the render is clear. */
.p-contact {
    left: auto;
    right: var(--gutter);
    width: min(22rem, 25vw);
    justify-content: center;
    padding-top: clamp(6rem, 12vh, 8rem);
}

.signoff { margin: 0.6rem 0 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0.9rem; padding-top: 1.1rem; border-top: 1px solid var(--rule); width: 100%; }

.email-link {
    font-family: var(--font-display);
    font-size: clamp(1.45rem, 1.95vw, 1.9rem);
    font-weight: 400;
    letter-spacing: 0;
    border-bottom: 1.5px solid transparent;
    transition: border-color 250ms ease;
}

.email-link:hover { border-color: currentColor; }

.legal { font-size: 0.88rem; color: var(--fg-soft); }


/* ───────────────────────────── Scroll cue ───────────────────────────── */

.scroll-cue {
    position: absolute;
    left: 50%;
    bottom: 1.4rem;
    z-index: 5;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--cream-70);
    transition: opacity 500ms ease;
}

.scroll-cue.is-hidden { opacity: 0; }

.cue-line { width: 1px; height: 26px; background: linear-gradient(var(--cream-70), transparent); }


/* ───────────────────────────── Narrow screens ───────────────────────────── */
/* Not a designed phone layout yet (see notes/v4-build-spec.md). These rules
   only keep the page readable and free of sideways scroll. */

/* A phone held upright. The scene pulls each render back and seats it in
   the lower part of the screen (see `tall` in the story table), so the
   copy stands above it on the render's own sky. Everything is one column. */
@media (max-width: 820px) {
    .panel {
        width: calc(100vw - 2 * var(--gutter));
        padding-top: clamp(5.2rem, 11vh, 6.4rem);
        padding-bottom: clamp(1.4rem, 3.5vh, 2.2rem);
        gap: 0.9rem;
        transform: none;
    }

    .lede { font-size: 1rem; }
    .display-l { font-size: clamp(2.3rem, 10.4vw, 3.1rem); }
    .display-m { font-size: clamp(1.7rem, 7.2vw, 2.2rem); }
    .su-evidence-head h3 { font-size: clamp(1.7rem, 7.2vw, 2.2rem); }
    .journey, .scroll-cue { display: none; }
    .hud-nav { gap: 1rem; }
    .hud-nav a { font-size: 0.95rem; }

    /* hero: the two words span the phone; the small copy stacks at the bottom */
    .p-hero { width: 100%; padding: 0; }
    .hero-title { top: 5.6rem; }
    .hero-lead { font-size: 8vw; }
    /* the small copy sits under the two words, on the sky, clear of the forms */
    .hero-foot {
        top: calc(5.6rem + 8vw + 23.6vw * 0.86 + 1.9rem);
        bottom: auto;
        right: var(--gutter);
        flex-direction: column;
        align-items: flex-start;
        gap: 0.9rem;
    }
    .hero-foot .lede { max-width: none; font-weight: 400; }

    /* research: words above the prism, the paper on a sheet of its own below it */
    .p-labs { width: calc(100vw - 2 * var(--gutter)); }
    .paper-item {
        width: 100%;
        gap: 0.9rem;
        padding: 0.9rem 1rem;
        border-top: 0;
        border-radius: 4px;
        background: var(--paper-hi);
        box-shadow: 0 14px 34px rgba(60, 44, 18, 0.28);
    }
    .paper-mark { width: 78px; height: 78px; }
    .paper-name { font-size: 1.45rem; }
    .paper-line { font-size: 0.95rem; }

    /* Spectral Unforgetting: the three shapes sit in a band; captions stack under it */
    .p-unforget { width: 100%; padding: 0; }   /* it spans the screen; it holds the sliding track, and each page pads itself */
    .su-page { padding: 5.4rem var(--gutter) 3.4rem; }
    /* Each name stands right under its own shape (the script measures where
       the shapes end: --shapes-foot). One description shows at a time,
       under the names, for the state being told. Tap a name to choose. */
    .su-steps {
        position: absolute;
        left: 0;
        right: 0;
        top: var(--shapes-foot, 52%);
        width: auto;
        margin-left: 0;
        gap: 0;
        padding: 0 0.3rem;
    }
    .su-steps li { display: contents; }
    .su-steps li::before { content: none; }
    .su-step-name {
        grid-row: 1;
        padding: 0.7rem 0.3rem 0.8rem;
        font-family: var(--font-sans);   /* too small here for the thin display face */
        font-size: 0.9rem;
        font-weight: 600;
        letter-spacing: -0.01em;
        text-align: center;
        text-wrap: balance;
        border-top: 2px solid transparent;
    }
    .su-steps li.is-on .su-step-name { color: var(--foil-hi); }
    .su-step-line {
        grid-row: 2;
        grid-column: 1 / -1;
        padding: 0.9rem calc(var(--gutter) - 0.3rem) 0;
        border-top: 1px solid var(--rule);
        font-size: 1.05rem;
        line-height: 1.45;
        pointer-events: none;
    }
    .su-steps li:not(.is-on) > .su-step-line,
    .su-steps[data-telling] li:not(.is-on) > .su-step-line { opacity: 0; }
    .su-steps li.is-on > .su-step-line { pointer-events: auto; }

    /* the evidence: one numbered step at a time, in the order the scroll reaches them */
    .su-evidence { justify-content: flex-start; gap: 1rem; }
    .su-evidence-head .lede { font-size: 0.95rem; }
    .su-flow { grid-template-columns: 1fr; }
    .su-flow-step { grid-area: 1 / 1; opacity: 0; pointer-events: none; transition: opacity 350ms ease; }
    .su-flow[data-current="1"] [data-step="1"],
    .su-flow[data-current="2"] [data-step="2"],
    .su-flow[data-current="3"] [data-step="3"] { opacity: 1; pointer-events: auto; }
    .su-flow-head { min-height: 0; font-size: 1.12rem; }
    .fig-surface { max-height: 34vh; transform: none; }
    .fig-readout { min-height: 3.2em; }
    .su-numbers dt { font-size: 2.3rem; }
    .su-progress { gap: 0.6rem; white-space: nowrap; }
    .su-progress-bar { width: 4.5rem; }

    /* products: the deck beside its words, under the lantern */
    .p-products { width: calc(100vw - 2 * var(--gutter)); }
    .product { margin-top: 0.9rem; align-items: flex-end; gap: 5.6rem; }   /* the gap is where the fanned cards show */
    .deck { width: 6.6rem; }
    .product-text { max-width: none; gap: 0.5rem; }
    .pg-wordmark { font-size: 1.2rem; }
    .product-line { font-size: 0.92rem; line-height: 1.35; }

    /* why: each statement stands at the top, above its picture */
    .p-why { width: calc(100vw - 2 * var(--gutter)); justify-content: flex-start; padding-top: 5.6rem; gap: 0.9rem; }
    .p-why h2, .p-why-2 h2, .p-why-3 h2 { font-size: clamp(2.3rem, 10.6vw, 3.2rem); }
    .p-why .lede { font-size: 1rem; }
    .p-why-2 { justify-content: center; padding-top: 5.6rem; }
    .placard { padding: 1.3rem 1.3rem 1.5rem; gap: 0.8rem; }

    /* contact: the words stand above the plane */
    .p-contact { left: var(--gutter); right: auto; width: calc(100vw - 2 * var(--gutter)); justify-content: flex-start; padding-top: 5.8rem; }
    .email-link { font-size: 1.7rem; }
}


/* ───────────────────────────── Reduced motion ───────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .fleck { display: none; }
    .panel, .deck-card, .paper-mark { transition: none; }
    .panel, .fig-surface { transform: none; }
    .su-aura::before, .su-aura::after, .fig-surface, .deck { animation: none; }
    .su-flow-step { opacity: 1; }
    .su-evidence { --fig: 1 !important; }
}
