/* build-reel — the sample-site preview, the self-building card and the build
   reel. Shared by index.html (hero card + scroll reel) and /websites.html (the
   play-mode demo). Moved VERBATIM from index.html's inline <style> and
   home-wow.css §C, §F, §I, §J (2026-10-17, T020); the homepage must render to
   the pixel as before (screenshot-diff, motion on and off). Driven by
   build-reel.js; the hero card's timer stays in home-wow.js.

   Only edit with both pages open: every rule here paints on two surfaces. */

/* ---- the sample-site preview (was index.html inline). --card/--rule are the
        homepage's tokens; the fallbacks are their values, for pages without them. */
/* The hero's sample-page preview. Everything .vp-frame is, minus the
   width transition it has no control to drive — including the
   container-query context, which is what keeps .vp-page a real
   responsive layout rather than a picture of one, and the pinned
   palette, so the customer's sample never recolours to our surface. */
.vp-preview {
    container-type: inline-size;
    width: 100%; max-width: 390px; margin-inline: auto;
    position: relative;
    background: var(--card, #FFFFFF);
    border: 1px solid var(--rule, #DCE8EB);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(12, 32, 39, .10);
    --kms-card: #FFFFFF;
    --kms-ink: #0C2027;
    --kms-ink-2: #3D5560;
    --kms-muted: #5D757E;
    --kms-rule: #DCE8EB;
    --kms-deep: #0B6E82;
    --kms-gold-ink: #7A4E05;
}

/* ======================== C. the self-building card ======================== */

/* The hero stage is 172px tall and clips nothing on purpose (contrast-audit
   counts clipped text as occluded), so every stage below must fit inside it. */
.build {
    max-width: 390px;
    transition:
        width .7s cubic-bezier(.65, 0, .35, 1),
        max-width .7s cubic-bezier(.65, 0, .35, 1),
        border-radius .7s cubic-bezier(.65, 0, .35, 1),
        border-width .7s ease;
}
.build .b-hero {
    display: grid; gap: .8rem; align-items: center;
    padding: .9rem 1rem 1rem;
}
.build .b-art { display: none; border-radius: 7px; overflow: hidden; height: 84px; background: #E3ECEF; }
.build .b-art img, .reel-screen .b-art img {
    display: block; width: 100%; height: 100%; object-fit: cover;
    transition: opacity .6s ease, transform 1.2s cubic-bezier(.16, 1, .3, 1);
}
.build .vp-title { font-size: 1.7em; margin-bottom: .45rem; }
.build .vp-cta, .reel-screen .vp-cta { transition: background-color .5s ease, color .5s ease; }
.build .vp-kicker, .reel-screen .vp-kicker { transition: color .5s ease; }

/* Wide enough: copy beside the photo, real nav. */
@container (min-width: 300px) {
    .build .b-hero { grid-template-columns: 1.15fr .85fr; }
    .build .b-art { display: block; }
}
@container (min-width: 360px) {
    .build .vp-nav { display: flex; }
    .build .vp-burger { display: none; }
}
@container (max-width: 220px) {
    .build .vp-title { font-size: 1.3em; margin-bottom: .35rem; }
    .build .b-hero { padding: .6rem .75rem .7rem; }
    .build .vp-bar { padding: .5rem .75rem; }
    .build .vp-kicker { margin-bottom: .2rem; }
}

/* ---- stages. No [data-stage] (no JS, or reduced motion) = the finished site. ---- */

/* 0 · layout: every text run becomes a grey bar, the photo an empty block. */
.build .b-t, .reel-screen .b-t {
    transition: color .45s ease, background-color .45s ease, box-shadow .45s ease;
    border-radius: 3px;
}
.build[data-stage="layout"] .b-t,
.build[data-stage="layout"] .vp-nav b,
.reel-screen[data-stage="layout"] .b-t,
.reel-screen[data-stage="layout"] .vp-nav b {
    color: transparent;
    background-color: #E3ECEF;
    box-shadow: 0 0 0 1px #E3ECEF;
}
.build[data-stage="layout"] .vp-burger i,
.reel-screen[data-stage="layout"] .vp-burger i { background: #D3DFE3; }
.build[data-stage="layout"] .vp-cta,
.build[data-stage="type"] .vp-cta,
.reel-screen[data-stage="layout"] .vp-cta,
.reel-screen[data-stage="type"] .vp-cta {
    background: #E3ECEF; color: transparent;
}
/* 1 · type: real words, but monochrome. */
.build[data-stage="type"] .vp-kicker,
.reel-screen[data-stage="type"] .vp-kicker { color: var(--kms-ink-2); }
/* 0–2: no photo yet. */
.build[data-stage="layout"] .b-art img,
.build[data-stage="type"] .b-art img,
.build[data-stage="colour"] .b-art img,
.reel-screen[data-stage="layout"] .b-art img,
.reel-screen[data-stage="type"] .b-art img,
.reel-screen[data-stage="colour"] .b-art img {
    opacity: 0; transform: scale(1.12);
}
/* 4 · phone: the frame narrows to a handset and the layout re-forms inside it. */
.build[data-stage="phone"] {
    max-width: 176px;
    border-radius: 20px;
    border-width: 3px;
    border-color: #0C2027;
}

/* The step chip: tells the eye what just changed. Decorative; the card's
   aria-label carries the meaning. A SIBLING of the card, pinned to the stage
   corner: inside the card it sat on the phone frame's "Order ahead" button. */
.wing-stage:has(> .build) { position: relative; }
.build-chip {
    position: absolute; right: 6px; bottom: 6px; z-index: 1;
    font: 600 .68rem/1 var(--display, system-ui);
    letter-spacing: .06em; text-transform: uppercase;
    color: #fff; background: rgba(11, 110, 130, .92);
    padding: .38rem .55rem; border-radius: 999px;
    /* visibility, not just opacity: opacity-0 text is still text, and the
       contrast gate rightly refuses to grade it. */
    visibility: hidden; opacity: 0; transform: translateY(4px);
    transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s;
    pointer-events: none;
}
.build[data-stage] + .build-chip { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }

@media (prefers-reduced-motion: reduce) {
    html:not(.motion-on) .build, html:not(.motion-on) .build * { transition: none !important; }
}

/* ============================ F. the build reel ============================
   Static by default: a normal section, step list beside the finished site.
   html.reel-on (home-wow.js: wide screen, motion allowed) pins it and hands every
   moving part to the scroll position via --p and per-step classes. */

.reel { background: #0A2A33; color: #EAF7FA; padding: clamp(3rem, 6vw, 5rem) 0; overflow: clip; }
.reel-pin {
    display: grid; gap: 2.5rem; align-items: center;
    width: min(1360px, 100% - 3rem); margin-inline: auto;
}
@media (min-width: 1024px) { .reel-pin { grid-template-columns: 300px 1fr; } }

.reel-k {
    font: 700 .78rem/1.2 var(--display, system-ui); letter-spacing: .16em; text-transform: uppercase;
    color: #7FE0EE; margin: 0 0 1rem;
}
.reel-say { position: relative; min-height: 2.3em; margin: 0 0 1.6rem;
    font: 800 clamp(2rem, 3.6vw, 3.1rem)/1.05 var(--display, system-ui); letter-spacing: -.025em; color: #fff; }
.reel-say span { display: block; }
.reel-say span:not(.is-on) { display: none; }
.reel-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; counter-reset: s; }
.reel-steps li {
    counter-increment: s; display: flex; align-items: center; gap: .7rem;
    font: 600 .95rem/1.3 var(--body, system-ui); color: rgba(234, 247, 250, .62);
    transition: color .3s ease;
}
.reel-steps li::before {
    content: counter(s); display: grid; place-items: center; flex: none;
    width: 1.7rem; height: 1.7rem; border-radius: 50%;
    border: 1.5px solid rgba(127, 224, 238, .45); font-size: .78rem;
    transition: background-color .3s ease, border-color .3s ease, color .3s ease;
}
.reel-steps li.is-on { color: #fff; }
.reel-steps li.is-on::before, .reel-steps li.is-done::before { background: #12A0BC; border-color: #12A0BC; color: #04222B; }
.reel-steps li.is-done { color: rgba(234, 247, 250, .85); }

.reel-stage { display: grid; justify-items: center; }
.reel-browser {
    width: 100%; max-width: 1000px;
    background: #fff; border-radius: 14px; overflow: hidden;
    box-shadow: 0 40px 90px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .08);
}
.reel-chrome {
    display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px;
    background: #EEF4F6; border-bottom: 1px solid #DCE8EB;
}
.reel-chrome > i { width: 10px; height: 10px; border-radius: 50%; background: #CBD8DC; }
.reel-chrome > i:nth-child(1) { background: #F2A39A; }
.reel-chrome > i:nth-child(2) { background: #F3D28A; }
.reel-chrome > i:nth-child(3) { background: #9FD9A8; }
.reel-url {
    margin-left: 10px; flex: 1; max-width: 360px; height: 22px; border-radius: 6px; background: #fff;
    display: flex; align-items: center; gap: 8px; padding: 0 10px;
    font: 500 12px/1 var(--body, system-ui); color: #3D5560; overflow: hidden; white-space: nowrap;
}
.reel-live {
    font: 700 10px/1 var(--display, system-ui); letter-spacing: .08em; text-transform: uppercase;
    color: #0B5A2A; background: #CFF2DA; padding: 3px 6px; border-radius: 999px;
    opacity: 0; transform: scale(.6); transition: opacity .3s ease, transform .45s cubic-bezier(.2, 1.6, .4, 1);
}
/* Static section (no pinning): the site shown IS the launched one. */
html:not(.reel-on) .reel-live, .reel.is-live .reel-live { opacity: 1; transform: none; }

/* The site inside: same live page as the demo, bigger type, its own container. */
.reel-site.build {
    max-width: none; width: 100%; border: 0; border-radius: 0; box-shadow: none; margin: 0;
    container-type: inline-size; transition: none;
}
.reel-site .vp-page { font-size: clamp(11px, 1.55cqw, 15px); }
.reel-site .vp-sub { display: block; }
.reel-site .b-art { height: auto; aspect-ratio: 16 / 10; }
.reel-site .vp-cards { display: grid; gap: .6rem; padding: 0 1rem 1rem; }
@container (min-width: 620px) {
    .reel-site .b-hero { padding: 1.6rem 1.8rem; gap: 1.6rem; }
    .reel-site .vp-cards { grid-template-columns: repeat(3, 1fr); padding: 0 1.8rem 1.8rem; }
}
.reel-site.build[data-stage="layout"] .vp-card { border-color: #E3ECEF; }

.reel-width {
    margin: .9rem 0 0; min-height: 1.4em;
    font: 600 .85rem/1.4 var(--display, system-ui); letter-spacing: .04em; color: #7FE0EE;
}

/* ---- pinned, scroll-driven ---- */
html.reel-on .reel { height: 360vh; padding: 0; }
html.reel-on .reel-pin {
    position: sticky; top: 0; height: 100vh; padding-top: 70px; box-sizing: border-box;
}
html.reel-on .reel-browser {
    /* --in: 0 -> 1 over the first eighth of the scroll: the browser swings up
       out of a tilt and scales to full size. --s/--o: the squeeze (below). */
    transform: perspective(1600px) rotateX(calc((1 - var(--in, 1)) * 22deg)) scale(calc((.82 + var(--in, 1) * .18) * var(--s, 1)));
    opacity: calc((.25 + var(--in, 1) * .75) * var(--o, 1));
}
html.reel-on .reel-site { height: min(560px, 100vh - 200px); overflow: hidden; }
html.reel-on .reel-say span { display: block; position: absolute; inset: 0 0 auto 0;
    opacity: 0; transform: translate3d(0, 28px, 0); transition: opacity .35s ease, transform .5s cubic-bezier(.2, .9, .2, 1); }
html.reel-on .reel-say span.is-past { transform: translate3d(0, -28px, 0); }
html.reel-on .reel-say span.is-on { opacity: 1; transform: none; }
html.reel-on .reel-say { min-height: 2.2em; }

/* ====================== I. Play the build (unpinned reel) ======================
   The pinned reel is wide screens with full motion. Everyone else gets the
   static section plus this button: pressing Play is asking for the motion. */
.reel-play-row { margin: 1.6rem 0 0; }
.reel-play-row[hidden], html.reel-on .reel-play-row { display: none; }
.reel-play {
    display: inline-flex; align-items: center; gap: .6rem; min-height: 44px; padding: 0 1.2rem 0 .9rem;
    font-family: inherit; font-size: .95rem; font-weight: 700; line-height: 1;
    color: #04222B; background: #7FE0EE; border: 0; border-radius: 999px; cursor: pointer;
}
.reel-play:hover { background: #A6EBF4; }
.reel-play:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.reel-play .rp-icon {
    width: 0; height: 0; border-style: solid; border-width: 6px 0 6px 10px;
    border-color: transparent transparent transparent currentColor;
}
.reel.is-playing .reel-play .rp-icon { width: 10px; height: 10px; border: 0; background: currentColor; border-radius: 2px; }
.reel.is-playing:not(.is-live) .reel-live { opacity: 0; transform: scale(.6); }

/* ======================= J. the squeeze, without layout =======================
   Desktop -> tablet -> phone used to animate the browser's WIDTH, so the page
   inside reflowed on every frame. Chrome counts each reflow as a layout shift:
   scrolling the pinned reel scored CLS 0.68 (old homepage 0.016; "poor" is
   0.25), and a scroll is not "recent input", so every desktop visit paid it.
   Now the browser keeps its width. home-wow.js clones it at 700px and 375px
   (each laid out once, at its true width, in its own container query) and
   the squeeze is only scale + crossfade: transforms and opacity never shift
   layout. Clones exist only after a first squeeze, never in the HTML. */
.reel-stage { position: relative; }
.reel-browser { transform-origin: 50% 80%; }
html:not(.reel-on) .reel-browser { transform: scale(var(--s, 1)); opacity: var(--o, 1); }
.reel-alt {
    position: absolute; top: 0; left: 50%;
    width: var(--aw); max-width: none; margin-left: calc(var(--aw) / -2);
    transform: scale(var(--s, 1)); opacity: var(--o, 0); pointer-events: none;
}
.reel:not(.is-squeezing) .reel-alt { visibility: hidden; }
.reel-alt-tablet { border-radius: 20px; box-shadow: 0 0 0 6px #0C2027, 0 40px 90px rgba(0, 0, 0, .45); }
.reel-alt-phone  { border-radius: 30px; box-shadow: 0 0 0 7px #0C2027, 0 40px 90px rgba(0, 0, 0, .45); }

/* ===================== K. play mode: three real screens =====================
   /websites.html. The same six steps, driven by Play or by the step buttons,
   on a phone, a tablet and a desktop. Each device holds its own copy of the
   sample page laid out ONCE at its true width (375 / 760 / 1100), so its
   container queries give three genuinely different layouts; build-reel.js
   clones the desktop one. Choosing a device is a crossfade, never a reflow:
   §J's lesson, where animating a width scored CLS 0.68.

   The stage has a fixed height and each device is scaled to fit it in CSS
   alone — tan(atan2(a, b)) is a/b as a plain number, the one way to divide
   two lengths in calc() — so nothing here needs JS to size, and nothing below
   the stage ever moves. */
.reel-demo {
    /* §F names its fonts --display/--body, the homepage's tokens. A page
       without them fell to system-ui (design-tells: overused-font). */
    --display: var(--ws-font, 'Outfit', 'Inter', sans-serif);
    --body: var(--ws-font, 'Inter', sans-serif);
    background: none; color: inherit; padding: 0; overflow: visible;
    display: grid; gap: 1.4rem; margin: 1.6rem 0 1.2rem;
}
@media (min-width: 1024px) { .reel-demo { grid-template-columns: 16rem 1fr; align-items: center; } }
/* Narrow: the screens first, the controls under them — the sample is the hook. */
@media (max-width: 1023px) { .reel-demo .reel-copy { order: 2; } }

.reel-demo .reel-play-row { margin: 0 0 1.1rem; }
.reel-demo .reel-steps { gap: .35rem; }
@media (max-width: 1023px) {
    .reel-demo .reel-steps { display: flex; flex-wrap: wrap; gap: .35rem .9rem; }
}
.reel-steps button {
    display: inline-flex; align-items: center; min-height: 32px; padding: 0 .2rem;
    font: inherit; color: inherit; background: none; border: 0; border-radius: 6px; cursor: pointer;
}
.reel-steps button:hover { color: #fff; }
.reel-steps button:focus-visible, .reel-pick button:focus-visible { outline: 2px solid #7FE0EE; outline-offset: 2px; }

.reel-pick { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.1rem 0 0; }
.reel-pick[hidden] { display: none; }
.reel-pick-k {
    width: 100%; margin: 0 0 .1rem;
    font: 700 .7rem/1.2 var(--display, system-ui); letter-spacing: .14em; text-transform: uppercase;
    color: rgba(234, 247, 250, .78);
}
.reel-pick button {
    display: inline-flex; align-items: center; gap: .45rem; min-height: 36px; padding: 0 .8rem;
    font: 600 .82rem/1 var(--body, system-ui); color: #EAF7FA; cursor: pointer;
    background: rgba(2, 16, 26, .55); border: 1px solid rgba(127, 224, 238, .35); border-radius: 999px;
}
.reel-pick button[aria-checked="true"] { color: #04222B; background: #7FE0EE; border-color: #7FE0EE; }
.reel-pick .sw { width: .8rem; height: .8rem; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .7); }
/* Phones (SC-005): the controls under the screens were 436px — three
   label rows, a two-row colour group and a three-row step list. The group
   labels are aria-hidden repeats of each radiogroup's aria-label, the colours
   read as swatches (their names stay the accessible names), and the steps
   pack into two rows. Every control is still there. */
@media (max-width: 640px) {
    .reel-demo .reel-pick { margin-top: .6rem; }
    .reel-demo .reel-pick-k { display: none; }
    .reel-demo .reel-pick .sw-name {
        position: absolute; width: 1px; height: 1px; overflow: hidden;
        clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
    }
    .reel-demo .reel-pick button:has(.sw) { width: 44px; min-height: 44px; padding: 0; justify-content: center; }
    .reel-demo .reel-pick .sw { width: 1.25rem; height: 1.25rem; }
    .reel-demo .reel-steps { gap: .2rem .7rem; }
    .reel-demo .reel-steps li { gap: .4rem; font-size: .88rem; }
    .reel-demo .reel-steps li::before { width: 1.45rem; height: 1.45rem; font-size: .72rem; }
}
.sw-teal { background: #0B6E82; }
.sw-terracotta { background: #A8461F; }
.sw-forest { background: #2E6B3F; }
.sw-berry { background: #9C2B55; }

.reel-devices {
    /* No overflow clip: it cut the device's shadow into a hard rectangle. The
       devices are scaled to fit, and a transform's scaled box is what counts
       toward scroll overflow, so nothing pokes out sideways. */
    position: relative; container-type: size;
    height: clamp(400px, 50vw, 540px);
}
.reel-device {
    --w: 1100px; --h: 640px; --bz: 0px;
    position: absolute; left: 50%; top: 50%; box-sizing: border-box;
    width: calc(var(--w) + 2 * var(--bz)); height: calc(var(--h) + 2 * var(--bz));
    display: flex; flex-direction: column;
    background: #fff; border: var(--bz) solid #0C2027; border-radius: 14px; overflow: hidden;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .08);
    transform: translate(-50%, -50%) scale(min(1,
        tan(atan2(calc(100cqw - 8px), calc(var(--w) + 2 * var(--bz)))),
        tan(atan2(calc(100cqh - 8px), calc(var(--h) + 2 * var(--bz))))));
    opacity: 0; visibility: hidden;
    transition: opacity .45s ease, visibility 0s linear .45s;
}
.reel-device.is-on { opacity: 1; visibility: visible; transition-delay: 0s; }
.reel-device[data-device="tablet"] { --w: 760px; --h: 960px;  --bz: 16px; border-radius: 30px; }
.reel-device[data-device="phone"]  { --w: 375px; --h: 740px;  --bz: 12px; border-radius: 44px; }
.reel-device:not([data-device="desktop"]) .reel-chrome { display: none; }
.reel-device .reel-chrome { flex: none; }

/* The page inside: a real site's proportions, not the thumbnail's. */
.reel-screen.vp-preview {
    flex: 1; max-width: none; width: 100%; margin: 0;
    border: 0; border-radius: 0; box-shadow: none; overflow: hidden;
}
.reel-screen .vp-page { font-size: 15px; }
.reel-screen .vp-bar { padding: .9rem 1.2rem; }
.reel-screen .vp-hero-art { height: 190px; }
.reel-screen .b-art { background: #E3ECEF; }
@container (min-width: 620px) {
    .reel-screen .vp-hero-art { height: 250px; }
}
@container (min-width: 900px) {
    .reel-screen .vp-page { font-size: 16px; }
    .reel-screen .vp-hero-art { height: 300px; }
}

.reel-readout {
    margin: .7rem 0 0; min-height: 1.4em; text-align: center;
    font: 600 .85rem/1.4 var(--display, system-ui); letter-spacing: .04em; color: #7FE0EE;
}

/* The homepage's Live badge springs (a y>1 bezier). Here it eases: design-tells
   ratchets overshoot curves, and this page had none of its own. */
.reel-demo .reel-live { transition-timing-function: ease, cubic-bezier(.2, .9, .2, 1); }

/* Off: every state still reachable, each one arrives as a still. */
html.motion-off .reel-demo *, html.motion-off .reel-demo *::before { transition: none !important; }
