/*
 * Story pages (1.66.0, server/stories.js, story.js): the 3D fills the screen behind the story; the chapters scroll
 * over it, each with a floating card. The brand sets --accent, --bg, --display and --body (the page's own style block).
 * Without the 3D (no WebGL, or before it loads) the page reads as a plain article with the product's picture.
 */
:root {
    --ink: #f2f6f7;
    --ink-2: #b8c7cf;
    --ink-3: #8fa5af;
    --card: rgba(8, 19, 28, 0.62);
    --card-solid: rgba(8, 19, 28, 0.88);
    --card-line: rgba(255, 255, 255, 0.1);
    --solid: #0d1b25;
    --accent-ink: #06222a;
    --gutter: clamp(16px, 5.5vw, 88px);
    color-scheme: dark;
}
.st-light {
    --ink: #15191c;
    --ink-2: #3d474e;
    --ink-3: #59646b;
    --card: rgba(255, 255, 255, 0.72);
    --card-solid: rgba(255, 255, 255, 0.92);
    --card-line: rgba(0, 0, 0, 0.08);
    --solid: #ffffff;
    color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body.story {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font: 400 16px/1.55 var(--body), Inter, system-ui, sans-serif;
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
}
/* the soft light behind the product: a layer that stays put, so phones don't repaint it on every scroll (1.66.1) */
body.story::before {
    content: ''; position: fixed; left: 0; top: 0; width: 100%; height: 100vh; height: 100lvh; z-index: -1; pointer-events: none;
    background-image: radial-gradient(120% 90% at 62% 38%, color-mix(in srgb, var(--bg) 78%, #ffffff 14%) 0%, var(--bg) 52%, color-mix(in srgb, var(--bg) 70%, #000000) 100%);
}
.st-light.story::before {
    background-image: radial-gradient(120% 90% at 62% 38%, #ffffff 0%, var(--bg) 60%, color-mix(in srgb, var(--bg) 88%, #000000) 100%);
}
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.st-skip { position: absolute; left: -9999px; top: 8px; z-index: 50; padding: 10px 14px; border-radius: 8px; background: var(--solid); color: var(--ink); }
.st-skip:focus { left: 12px; }

/* ------------------------------------------------------------------ the stage: the 3D and what's drawn over it */
.st-stage { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.st-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 0.6s ease; }
.st-ready .st-canvas { opacity: 1; }
.st-poster {
    position: absolute; right: 12vw; top: 50%; transform: translateY(-50%);
    width: min(40vmin, 420px); aspect-ratio: 1; object-fit: cover; border-radius: 24px; opacity: 0.92;
    box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.6); transition: opacity 0.6s ease;
}
.st-ready .st-poster { opacity: 0; }
.st-word {
    position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%);
    font: 800 30vw/0.8 var(--display), sans-serif; letter-spacing: -0.04em; white-space: nowrap;
    color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--accent) 24%, transparent); user-select: none;
}
.st-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.st-lines polyline, .st-lines line { fill: none; stroke: var(--accent); stroke-width: 1.3; }
.st-lines circle { fill: var(--accent); stroke: var(--accent); stroke-opacity: 0.28; stroke-width: 9; }
.st-tags { position: absolute; inset: 0; }
.st-tag {
    position: absolute; left: 0; top: 0; max-width: 260px; padding: 8px 12px; border-radius: 10px;
    background: color-mix(in srgb, var(--solid) 64%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.st-tag strong { display: block; font-size: 15px; font-weight: 600; line-height: 1.25; }
.st-tag span { display: block; font-size: 13px; line-height: 1.35; color: var(--ink-2); }
.st-dot {
    position: absolute; left: 0; top: 0; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700;
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent);
}
.st-dot.st-plain { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
.st-dimlabel { position: absolute; left: 0; top: 0; white-space: nowrap; font: 700 20px/1 var(--display), sans-serif; }

/* ------------------------------------------------------------------ the top bar */
.st-bar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 14px var(--gutter); padding-top: max(14px, env(safe-area-inset-top));
    background: linear-gradient(color-mix(in srgb, var(--bg) 80%, transparent), transparent);
}
.st-logo { color: var(--ink); text-decoration: none; font: 800 24px/1 var(--display), sans-serif; letter-spacing: -0.02em; min-height: 44px; display: flex; align-items: center; }
.st-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.st-nav a { color: var(--ink-2); text-decoration: none; font-size: 14.5px; font-weight: 500; padding: 0 12px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 999px; }
.st-nav a:hover { color: var(--ink); }
.st-nav .st-buy { background: var(--accent); color: var(--accent-ink); font-weight: 700; margin-left: 6px; padding: 0 18px; }
.st-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 11; }
.st-progress span { display: block; height: 3px; width: 0; background: var(--accent); }

/* the chapters down the side (computers, made by story.js) */
.st-rail { position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 9; display: flex; flex-direction: column; gap: 2px; }
.st-rail a {
    display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-height: 28px; text-decoration: none;
    color: var(--ink-3); font-size: 12.5px; font-weight: 500;
}
.st-rail a::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 35%, transparent); }
.st-rail a[aria-current="step"] { color: var(--ink); }
.st-rail a[aria-current="step"]::after { width: 10px; height: 10px; background: var(--accent); }

/* ------------------------------------------------------------------ the chapters */
.st-main { position: relative; z-index: 2; }
.st-ch { position: relative; padding: 96px var(--gutter) 48px; }
.st-card {
    position: relative; width: min(440px, 100%); padding: 30px 32px 32px; border-radius: 22px;
    background: var(--card); border: 1px solid var(--card-line);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.5);
}
.st-eyebrow { margin: 0 0 12px; font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.st-light .st-eyebrow { color: color-mix(in srgb, var(--accent) 70%, #000000); }
.st-h1, .st-h2 { margin: 0; font-family: var(--display), sans-serif; color: var(--ink); text-wrap: balance; }
.st-h1 { font-size: clamp(44px, 7.2vw, 112px); font-weight: 800; line-height: 0.95; letter-spacing: -0.035em; }
.st-h2 { font-size: clamp(28px, 3.1vw, 46px); font-weight: 700; line-height: 1.04; letter-spacing: -0.02em; }
.st-text { margin: 14px 0 0; font-size: 16.5px; color: var(--ink-2); }
.st-intro .st-text { font-size: clamp(16px, 1.3vw, 19px); max-width: 32em; }
.st-scroll { display: flex; align-items: center; gap: 12px; margin: 28px 0 0; font-size: 13px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.st-mouse { width: 18px; height: 28px; border: 1.5px solid currentColor; border-radius: 9px; position: relative; }
.st-mouse::after { content: ''; position: absolute; left: 50%; top: 6px; width: 1.5px; height: 5px; margin-left: -0.75px; background: currentColor; }

/* the parts a chapter names: words in the page; on the 3D they're tags (computers) or numbered dots (phones) */
.st-named { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14.5px; color: var(--ink-2); }
.st-named strong { color: var(--ink); font-weight: 600; }
.st-n { display: none; }

/* colours */
.st-swatches { display: flex; flex-wrap: wrap; gap: 6px 4px; margin-top: 20px; }
.st-sw {
    display: flex; flex-direction: column; align-items: center; gap: 6px; width: 64px; padding: 4px 0; border: 0; background: none;
    color: var(--ink-2); font: 500 12.5px var(--body), sans-serif; cursor: pointer; min-height: 44px;
}
.st-sw-dot { width: 36px; height: 36px; border-radius: 50%; background: var(--sw, #8a8f94); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.st-sw[aria-pressed="true"] { color: var(--ink); }
.st-sw[aria-pressed="true"] .st-sw-dot { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.st-dims { margin: 14px 0 0; font: 700 18px/1.3 var(--display), sans-serif; }

/* the end: price and buttons */
.st-price { margin: 16px 0 0; font: 700 30px/1.1 var(--display), sans-serif; }
.st-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.st-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px;
    font: 700 15px var(--body), sans-serif; text-decoration: none; cursor: pointer;
}
.st-primary { border: 0; background: var(--accent); color: var(--accent-ink); }
.st-ghost { border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent); background: transparent; color: var(--ink); font-weight: 600; }
.st-ar-panel {
    display: flex; gap: 16px; align-items: center; margin-top: 18px; padding: 14px; border-radius: 14px;
    background: color-mix(in srgb, var(--accent) 9%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
    font-size: 13.5px; line-height: 1.5;
}
.st-ar-panel[hidden] { display: none; }
.st-ar-panel img { flex: none; width: 112px; height: 112px; border-radius: 8px; background: #ffffff; padding: 6px; }
.st-ar-panel p { margin: 0; }

/* specifications and questions: readable panels after the story */
.st-info { position: relative; max-width: 860px; margin: 0 auto 32px; padding: 32px; border-radius: 22px; background: var(--solid); border: 1px solid var(--card-line); }
.st-info:first-of-type { margin-top: 48px; }
.st-specs { width: 100%; margin-top: 18px; border-collapse: collapse; font-size: 15px; }
.st-specs th, .st-specs td { text-align: left; padding: 11px 0; border-top: 1px solid var(--card-line); vertical-align: top; }
.st-specs th { width: 40%; color: var(--ink-2); font-weight: 500; padding-right: 16px; }
.st-faq { border-top: 1px solid var(--card-line); padding: 4px 0; }
.st-faq:first-of-type { margin-top: 14px; }
.st-faq summary { cursor: pointer; padding: 12px 0; font-weight: 600; min-height: 44px; }
.st-faq p { margin: 0 0 12px; color: var(--ink-2); }

.st-foot { position: relative; z-index: 2; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 28px var(--gutter) 36px; border-top: 1px solid var(--card-line); background: color-mix(in srgb, var(--bg) 90%, transparent); color: var(--ink-3); font-size: 13px; }
.st-foot p { margin: 0; }

.st-loader {
    position: fixed; right: 22px; bottom: 20px; z-index: 12; display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 999px;
    background: color-mix(in srgb, var(--solid) 80%, transparent); border: 1px solid var(--card-line); font-size: 12.5px; color: var(--ink-2);
    white-space: nowrap;
}
.st-loader[hidden] { display: none; }
.st-loader-bar { width: 80px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--ink) 14%, transparent); overflow: hidden; }
.st-loader-bar span { display: block; height: 4px; width: 0; background: var(--accent); }
.st-preview-badge { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 13; margin: 0; padding: 8px 14px; border-radius: 999px; background: #a3341f; color: #ffffff; font-size: 13px; font-weight: 600; }

/* the cookie line (only on stories with the client's Google or Meta trackers) */
.st-consent {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 20; max-width: 560px; margin: 0 auto; padding: 16px 18px; border-radius: 16px;
    background: var(--solid); color: var(--ink); border: 1px solid var(--card-line); box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.55);
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; font-size: 14px; line-height: 1.5;
}
.st-consent p { margin: 0; flex: 1 1 260px; }
.st-consent div { display: flex; gap: 8px; }
.st-consent .st-btn { min-height: 44px; padding: 0 18px; font-size: 14px; }

/* without the 3D (or before it's known): the picture belongs to the first screen, the opening card is wide */
.story:not(.st-3d) .st-stage { position: absolute; height: 100vh; height: 100svh; }
.st-intro .st-card { width: min(760px, 100%); }

/* ------------------------------------------------------------------ with the 3D running: tall chapters, sticky cards */
/*
 * The 3D keeps one height, the tallest the screen gets (1.66.1): on phones the address bar comes and goes as the page
 * scrolls, and a stage that followed it would resize the 3D many times a second (it flickered, and could crash).
 */
.st-3d .st-stage { bottom: auto; height: 100vh; height: 100lvh; }
.st-3d .st-ch { padding: 0 var(--gutter); min-height: 100vh; }
.st-3d .st-intro { display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 13vh; }
.st-3d .st-intro .st-card { position: sticky; top: auto; width: min(760px, 100%); padding: 0; background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.st-3d .st-ch:not(.st-intro) .st-card { position: sticky; top: 50vh; transform: translateY(-50%); }
.st-3d .st-ch[data-side="right"]:not(.st-intro) { display: flex; justify-content: flex-end; align-items: flex-start; }
.st-3d .st-ch:not(.st-intro) { padding-right: calc(var(--gutter) + 90px); }
.st-3d .st-named:not(.st-many) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.st-3d .st-named.st-many { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ phones */
@media (max-width: 759px) {
    .st-nav a:not(.st-buy) { display: none; }
    .st-bar { padding-left: 16px; padding-right: 16px; }
    .st-card { padding: 20px 20px 22px; border-radius: 18px; }
    .st-poster { right: 50%; transform: translate(50%, -60%); width: 62vw; }
    .st-word { font-size: 42vw; top: 30%; }
    .st-h2 { font-size: 28px; }
    .st-text { font-size: 15px; }
    .st-info { margin: 0 12px 24px; padding: 22px 18px; }
    .st-rail { display: none; }
    .st-loader { left: 50%; right: auto; top: 64px; bottom: auto; transform: translateX(-50%); }
    /* the 3D sits in the top part of the screen; each card waits at the bottom until its chapter ends */
    .st-3d .st-ch:not(.st-intro) { display: flex; flex-direction: column; justify-content: flex-end; padding: 0 12px; }
    .st-3d .st-ch[data-side="right"]:not(.st-intro) { justify-content: flex-end; }
    .st-3d .st-ch:not(.st-intro) .st-card { top: auto; bottom: 12px; bottom: max(12px, env(safe-area-inset-bottom)); transform: none; width: 100%; margin-bottom: 12px; }
    .st-3d .st-intro { padding: 0 16px 6svh; }
    /* numbered dots on the 3D, and the numbers beside the names in the card */
    .st-3d .st-named.st-many { position: static; width: auto; height: auto; clip: auto; white-space: normal; display: flex; flex-wrap: wrap; gap: 8px 12px; font-size: 13px; }
    .st-3d .st-named.st-many .st-what { display: none; }
    .st-3d .st-named.st-many li { display: flex; align-items: center; gap: 6px; }
    .st-3d .st-named.st-many .st-n {
        display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%;
        background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700;
    }
    .st-ar-panel img { width: 96px; height: 96px; }
    .st-sw { width: 56px; }
}
/* phones and tablets: no blur behind the cards and tags (blurring the moving 3D on every frame is heavy), 1.66.1 */
@media (max-width: 759px), (hover: none) and (pointer: coarse) {
    .st-card { background: var(--card-solid); backdrop-filter: none; -webkit-backdrop-filter: none; }
    .st-tag { background: color-mix(in srgb, var(--solid) 90%, transparent); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
    .st-canvas, .st-poster { transition: none; }
}

/* ------------------------------------------------------------------ looks (1.69.0, the story's brand.style)
 * Dramatic (the first look, no class of its own): frosted cards over a soft glow, the big outline word.
 * Clean (st-look-clean): calm and flat: solid cards with a soft shadow, no glow behind the product, no outline word.
 * Editorial (st-look-editorial): like a magazine spread: on computers each chapter's words fill a tall panel at the
 * screen's edge beside the 3D (no chapter list then); on phones the panel is a sheet at the bottom. A rule over the
 * small line, roomier text. Each look's colours and fonts are only where it starts (the editor sets them; they change).
 */
.st-look-clean.story::before { background-image: none; }
.st-look-clean .st-word { display: none; }
.st-look-clean .st-card {
    background: var(--solid); border: 0; border-radius: 16px; backdrop-filter: none; -webkit-backdrop-filter: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 18px 50px -24px rgba(0, 0, 0, 0.3);
}
.st-look-clean .st-h1 { font-weight: 700; letter-spacing: -0.03em; }
.st-look-clean .st-h2 { font-weight: 650; letter-spacing: -0.015em; }
.st-look-clean .st-eyebrow { letter-spacing: 0.08em; }
.st-look-clean .st-tag { background: var(--solid); border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.32); }

.st-look-editorial .st-card { background: var(--solid); border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.st-look-editorial .st-eyebrow { display: inline-block; padding-top: 12px; border-top: 2px solid var(--accent); letter-spacing: 0.18em; }
.st-look-editorial .st-h1, .st-look-editorial .st-h2 { font-weight: 600; letter-spacing: -0.012em; line-height: 1.02; }
.st-look-editorial .st-h1 { font-size: clamp(48px, 7.6vw, 120px); }
.st-look-editorial .st-text { font-size: 18px; line-height: 1.62; }
.st-look-editorial .st-word { -webkit-text-stroke-width: 1px; }
@media (min-width: 760px) {
    .st-look-editorial .st-rail { display: none; }
    .st-look-editorial.st-3d .st-ch:not(.st-intro) { padding: 0; }
    .st-look-editorial.st-3d .st-ch:not(.st-intro) .st-card {
        top: 0; transform: none; width: min(42vw, 600px); min-height: 100vh; min-height: 100svh;
        display: flex; flex-direction: column; justify-content: center; padding: 96px clamp(32px, 4vw, 72px) 64px;
    }
    .st-look-editorial.st-3d .st-ch[data-side="left"]:not(.st-intro) .st-card { box-shadow: 1px 0 0 var(--card-line); }
    .st-look-editorial.st-3d .st-ch[data-side="right"]:not(.st-intro) .st-card { box-shadow: -1px 0 0 var(--card-line); }
}
@media (max-width: 759px) {
    .st-look-clean .st-card { border-radius: 14px; }
    .st-look-editorial.st-3d .st-ch:not(.st-intro) { padding: 0; }
    .st-look-editorial.st-3d .st-ch:not(.st-intro) .st-card { bottom: 0; margin-bottom: 0; border-radius: 0; padding: 22px 20px max(24px, env(safe-area-inset-bottom)); border-top: 1px solid var(--card-line); }
    .st-look-editorial .st-text { font-size: 16px; }
}
