/* Sections 1–3 prototype v2 · one guided stage (THREE-PANEL-BEHAVIOUR.md, STEP-02-BRIDGE-CONTRACT.md).
   Without JS (html.no-js) every scene is ordinary flow. With JS, .stage is one fixed screen and js/stage.js sets:
   --vh (inner height), --px/--py/--pw/--ph (the paper's rectangle on screen), data-scene, data-fmt (laptop|phone). */

.skip-link { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--ivory); color: var(--graphite); padding: 10px 14px; border-radius: 10px; font-weight: 800; }
.skip-link:focus { top: 12px; }

/* ============================================================== stage frame */
.js.locked, .js.locked body { overflow: hidden; height: 100%; overscroll-behavior: none; }
.js .stage { position: fixed; inset: 0; height: var(--vh, 100dvh); overflow: hidden; background: #000; color: var(--ivory); z-index: 10;
  touch-action: pinch-zoom; -webkit-user-select: none; user-select: none; }
.js:not(.locked) .stage { position: relative; touch-action: auto; }
.js .stage input, .js .stage blockquote, .js .stage .j-cap { -webkit-user-select: text; user-select: text; }
.js .stage > * { position: absolute; }

/* top bar: wordmark, temp-media note, one context control */
.st-top { top: 0; left: 0; right: 0; z-index: 40; display: flex; align-items: center; gap: 8px; height: 56px;
  padding: env(safe-area-inset-top, 0px) max(14px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  transition: opacity 500ms var(--ease-out); }
.st-wm { font: 700 22px/1 var(--font-display); letter-spacing: -.04em; color: var(--ivory); text-decoration: none; margin-right: auto; min-height: 44px; display: inline-flex; align-items: center; text-shadow: 0 1px 12px #000a; }
.st-temp, .st-ctl, .h-replay { min-height: 36px; padding: 0 12px; border-radius: 999px; font: 700 13px/1 var(--font-body); cursor: pointer; }
.st-temp { border: 1px dashed #ffffff66; background: #0007; color: #e9e6df; }
.st-ctl, .h-replay { border: 1px solid #ffffff59; background: #000000a6; color: var(--ivory); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.st-ctl:hover, .h-replay:hover { background: #000000cc; }
/* during the entrance, Skip fills as the film plays */
.st-ctl.is-intro { background: linear-gradient(90deg, #ffffff40 calc(var(--prog, 0) * 100%), #000000a6 0); }
/* bigger hit area without a bigger pill */
.st-temp, .st-ctl { position: relative; }
.st-temp::after, .st-ctl::after { content: ''; position: absolute; inset: -5px -2px; }
.stage[data-scene="tour"] .st-top, .stage[data-scene="bridge"] .st-top, .stage[data-scene="journey"] .st-top, .stage[data-scene="membership"] .st-top { opacity: 0; pointer-events: none; }
.stage[data-scene="hero"][data-hero="dark"] .st-wm, .stage[data-scene="hero"][data-hero="dark"] .st-temp { opacity: 0; pointer-events: none; }
.st-pop { top: calc(56px + env(safe-area-inset-top, 0px)); right: 12px; z-index: 45; width: min(360px, calc(100vw - 24px)); background: #101216f2; color: #e9e6df;
  border: 1px solid #ffffff26; border-radius: 12px; padding: 12px 14px; font: 600 13px/1.45 var(--font-body); box-shadow: 0 18px 40px -18px #000; }
.st-pop b { color: #fff; font-weight: 800; }
.st-pop p { margin: 0 0 6px; }
.st-pop p:last-child { margin: 0; }

/* ============================================================== section 1 · the entrance */
.js .sc-hero { inset: 0; z-index: 20; overflow: hidden; background: #000; transition: visibility 0s linear 700ms; }
.js .stage:not([data-scene="hero"]) .sc-hero { visibility: hidden; }
.js .stage[data-scene="hero"] .sc-hero { transition-delay: 0s; }
.h-media { position: absolute; inset: 0; }
.h-poster, .h-film { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.h-film { opacity: 0; transition: opacity 900ms linear; }
.sc-hero[data-film="on"] .h-film { opacity: 1; }
.h-poster { opacity: 0; }
.sc-hero[data-phase="settled"] .h-poster { opacity: 1; }
.sc-hero[data-phase="settled"][data-film="on"] .h-poster { opacity: 0; }
/* each format's film and poster keep their own composition under cover cropping */
.h-poster, .h-film { object-position: var(--hpos, 50% 50%); }
.h-scrim { position: absolute; inset: 0; opacity: 0; transition: opacity 1200ms var(--ease-out);
  background: linear-gradient(90deg, #000000c7 0%, #00000080 30%, #0000 56%), linear-gradient(0deg, #0009 0%, #0000 28%); }
.sc-hero[data-phase="copy"] .h-scrim, .sc-hero[data-phase="settled"] .h-scrim { opacity: 1; }

/* copy: hidden until the pair settles, then a film-title reveal */
.h-copy { position: absolute; z-index: 3; left: clamp(24px, 6vw, 104px); top: 50%; transform: translateY(-46%); width: min(40vw, 560px); }
.h-eyebrow { margin: 0 0 14px; font: 800 12px/1.2 var(--font-body); letter-spacing: .16em; text-transform: uppercase; color: #cfd6ea; }
.h-title { margin: 0; font: 650 clamp(40px, 5.2vw, 76px)/.98 var(--font-display); letter-spacing: -.035em; color: #fff; }
.h-line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.h-line > span { display: inline-block; }
.h-promise { margin: 18px 0 0; max-width: 46ch; font: 500 17px/1.5 var(--font-body); color: #dfe1e6; }
.h-actions { margin: 26px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.h-cta { position: relative; overflow: hidden; background: var(--ivory); color: var(--graphite); box-shadow: 0 0 0 1px #ffffff40, 0 14px 40px -12px #3e6bef88; }
.h-cta::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, #8ea6ff8c 46%, #ffffffcc 50%, #8ea6ff8c 54%, transparent 70%); transform: translateX(-120%); }
.sc-hero[data-phase="copy"] .h-cta::after { animation: h-sweep 1400ms 1500ms var(--ease-inout) 1 both; }
@keyframes h-sweep { to { transform: translateX(120%); } }
.h-tour { color: var(--ivory); font: 700 15px/1 var(--font-body); text-decoration: underline; text-underline-offset: 5px; min-height: 44px; display: inline-flex; align-items: center; }
.h-price { margin: 14px 0 0; font: 650 14px/1.4 var(--font-body); color: #d2d5db; }
.h-label { margin: 6px 0 0; font: 600 12px/1.35 var(--font-body); color: #9da2ab; max-width: 52ch; }

/* the reveal: lines rise out of their own mask and sharpen; the rest follows in a short cascade */
.js .h-in { opacity: 0; transform: translateY(.6em); filter: blur(8px); }
.js .h-line > .h-in { transform: translateY(108%); filter: blur(6px); }
.js .sc-hero[data-phase="copy"] .h-in, .js .sc-hero[data-phase="settled"] .h-in { opacity: 1; transform: none; filter: none;
  transition: opacity 700ms var(--ease-out), transform 900ms cubic-bezier(.16,.84,.2,1), filter 700ms var(--ease-out); transition-delay: calc(var(--d) * 70ms); }
.js .sc-hero[data-phase="copy"] .h-eyebrow { letter-spacing: .16em; }
.js .sc-hero:not([data-phase="copy"]):not([data-phase="settled"]) .h-eyebrow { letter-spacing: .5em; }
.js .h-eyebrow { transition: letter-spacing 1600ms var(--ease-out) !important; }

.h-cue { position: absolute; z-index: 3; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); margin: 0; transform: translateX(-50%); display: grid; justify-items: center; gap: 8px;
  font: 800 12px/1 var(--font-body); letter-spacing: .2em; text-transform: uppercase; color: #ffffffb3; opacity: 0; transition: opacity 800ms 1200ms; pointer-events: none; }
.h-cue i { width: 1px; height: 30px; background: linear-gradient(#fff0, #fff); transform-origin: top; transform: scaleY(1); }
.sc-hero[data-phase="settled"] .h-cue i { animation: h-cue 1.8s var(--ease-inout) 1.2s 2 backwards; }
@keyframes h-cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
.sc-hero[data-phase="copy"] .h-cue, .sc-hero[data-phase="settled"] .h-cue { opacity: 1; }
.h-replay { position: absolute; z-index: 4; right: max(14px, env(safe-area-inset-right, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }

/* phone: the title and button take the top 35 %, the pair stands lower */
.stage[data-fmt="phone"] .h-copy { left: 20px; right: 20px; top: calc(60px + env(safe-area-inset-top, 0px)); width: auto; transform: none; }
.stage[data-fmt="phone"] .h-eyebrow { font-size: 12px; margin-bottom: 8px; }
/* the phone eyebrow opens only as wide as one line allows (≈ .2em at 340 px to .37em at 430 px), so the title never jumps */
.js .stage[data-fmt="phone"] .sc-hero:not([data-phase="copy"]):not([data-phase="settled"]) .h-eyebrow { letter-spacing: max(.16em, calc(3vw - 8.4px)); }
.stage[data-fmt="phone"] .h-title { font-size: clamp(32px, 9.4vw, 44px); }
.h-promise--short { display: none; }
.stage[data-fmt="phone"] .h-promise { display: none; }
.stage[data-fmt="phone"] .h-promise--short { display: block; margin-top: 8px; font-size: 15px; line-height: 1.4; max-width: 30ch; }
.stage[data-fmt="phone"] .h-actions { margin-top: 12px; gap: 6px 12px; }
.stage[data-fmt="phone"] .h-actions .btn--lg { min-height: 48px; padding: 0 16px; font-size: 15px; }
.stage[data-fmt="phone"] .h-price { margin-top: 6px; font-size: 14px; line-height: 1.3; }
.stage[data-fmt="phone"] .h-label { position: fixed; left: 16px; right: 84px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); font-size: 12px; color: #c9ccd2; text-shadow: 0 1px 8px #000; }
.stage[data-fmt="phone"] .h-scrim { background: linear-gradient(180deg, #000000e0 0%, #000000b8 32%, #00000073 48%, #0000 62%), linear-gradient(0deg, #000a 0%, #0000 20%); }
.stage[data-fmt="phone"] .h-cue { display: none; }

/* ============================================================== section 2 · the tour on the paper */
.js .sc-tour { inset: 0; z-index: 30; transform: translateY(102%); will-change: transform; transition: transform 700ms cubic-bezier(.66,0,.2,1), visibility 0s linear 0s; }
.js .stage[data-scene="hero"] .sc-tour { visibility: hidden; transition: transform 700ms cubic-bezier(.66,0,.2,1), visibility 0s linear 700ms; }
.js .stage[data-scene="tour"] .sc-tour, .js .stage[data-scene="bridge"] .sc-tour, .js .stage[data-scene="journey"] .sc-tour, .js .stage[data-scene="membership"] .sc-tour { transform: none; }
.js .stage[data-scene="journey"] .sc-tour, .js .stage[data-scene="membership"] .sc-tour { visibility: hidden; }
.js .stage[data-scene="bridge"] .sc-tour { transition: none; }
.tb-table { position: absolute; inset: 0; background:
  radial-gradient(ellipse 62vw 66vh at 50% 50%, #5a554f 0%, #45413c 46%, #2c2a26 82%, #1e1c19 100%) #1e1c19; }
.stage[data-scene="bridge"] .tb-table { inset: -260%; }
.tb-table::after { content: ''; position: absolute; inset: 0; opacity: .22; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.tb-note { left: 16px; bottom: 8px; margin: 0; position: absolute; font: 700 12px/1.2 var(--font-body); color: #ffffff73; letter-spacing: .02em; }
.stage[data-fmt="phone"] .tb-note { display: none; }

/* the paper and the app on it: css/app.css. Section 3 (the film), the bridge's landing and section 4: css/journey.css */

/* ============================================================== reduced motion (system or the footer's Pause motion) */
html[data-motion="reduced"] .sc-tour, html[data-motion="reduced"] .p-track, html[data-motion="reduced"] .h-film, html[data-motion="reduced"] .sc-journey,
html[data-motion="reduced"] .j-cap, html[data-motion="reduced"] .j-bar, html[data-motion="reduced"] .j-poster[data-on] { transition: none !important; }
html[data-motion="reduced"] .h-in { transition-duration: 1ms !important; transition-delay: 0s !important; }
html[data-motion="reduced"] .h-cue i, html[data-motion="reduced"] .h-cta::after, html[data-motion="reduced"] .s4-card::before { animation: none !important; }

/* ============================================================== no JavaScript: ordinary readable flow */
.no-js .stage { position: static; color: var(--ivory); }
.no-js .st-top, .no-js .st-pop, .no-js .h-film, .no-js .h-cue, .no-js .h-replay,
.no-js .p-tabs, .no-js .p-foot, .no-js .p-temp, .no-js .p-skip, .no-js .tb-note, .no-js .tb-table { display: none; }
.no-js .sc-hero { position: relative; min-height: 100svh; display: grid; align-items: end; padding: 96px 20px 40px; }
.no-js .h-poster { opacity: .55; }
.no-js .h-copy { position: relative; left: auto; top: auto; transform: none; width: auto; max-width: 620px; }
.no-js .sc-tour { background: #2c2a26; padding: 40px 16px; }
.no-js .paper { max-width: 1100px; margin: 0 auto; display: block; }
.no-js .p-track { display: block; }
.no-js .p-step { display: grid; gap: 12px; padding: 20px; border-top: 1px solid var(--line); }
.no-js .ps-b { display: block; margin-top: 12px; }
.no-js .app { display: block; } .no-js .a-top, .no-js .earned { display: none; }

/* ============================================================== audit v4 fixes (31 Oct 2026) */
.no-js #motionToggle { display: none; }
/* no flash of the title before the entrance takes the screen: hidden until stage.js has chosen the first state */
.js:not(.st-ready) .h-in { opacity: 0 !important; transition: none !important; }
/* offer copy follows window.MISCLO_OFFER (html[data-offer], set in the head; STORYBOARD O5: free beta at launch, $39/$97 lines only
   when paid places open). Without JS the beta copy shows. */
html:not([data-offer="paid"]) [data-offer-only="paid"], html[data-offer="paid"] [data-offer-only="beta"] { display: none !important; }
/* the refund line (owner, 31 Oct 2026; paid offer only since the 7 Nov free-beta decision) */
.h-terms { margin: 4px 0 0; font: 600 13px/1.35 var(--font-body); color: #c3c7cf; max-width: 58ch; }
.stage[data-fmt="phone"] .h-terms { font-size: 12.5px; }
/* phone: "Take the tour" stays beside the CTA down to 360 px, so the price and refund lines stay in the dark top half */
.stage[data-fmt="phone"] .h-tour { font-size: 14px; }
/* V-A8 · without JavaScript the phone hero copy gets its own dark backing */
@media (max-aspect-ratio: 85/100) { .no-js .h-copy { background: #000000c2; padding: 16px; border-radius: 14px; } }

/* audit v6 · U-1: short windows and 200 % zoom (laptop format under 620 px tall). The copy sits below the top bar, wider and tighter,
   with the owner's short promise, so every line from the eyebrow to the AI-media label stays on screen. */
@media (max-height: 620px) {
  .stage[data-fmt="laptop"] .h-copy { top: calc(56px + env(safe-area-inset-top, 0px)); transform: none; width: min(64vw, 600px); }
  .stage[data-fmt="laptop"] .h-eyebrow { margin-bottom: 6px; }
  .stage[data-fmt="laptop"] .h-title { font-size: clamp(26px, 8vh, 48px); }
  .stage[data-fmt="laptop"] .h-promise { display: none; }
  .stage[data-fmt="laptop"] .h-promise--short { display: block; margin-top: 6px; font-size: 14px; line-height: 1.35; max-width: 46ch; }
  .stage[data-fmt="laptop"] .h-actions { margin-top: 10px; gap: 6px 18px; }
  .stage[data-fmt="laptop"] .h-actions .btn--lg { min-height: 44px; padding: 0 18px; font-size: 15px; }
  .stage[data-fmt="laptop"] .h-price { margin-top: 6px; line-height: 1.3; }
  .stage[data-fmt="laptop"] .h-label { margin-top: 4px; }
  .stage[data-fmt="laptop"] .h-cue { display: none; }
  .stage[data-fmt="laptop"] .h-scrim { background: linear-gradient(90deg, #000000d9 0%, #000000a6 52%, #0000 80%), linear-gradient(0deg, #0009 0%, #0000 28%); }
}
/* A-3: once pinch-zoomed, one finger pans the magnified page (the script never steps while zoomed) */
.js .stage.is-zoomed { touch-action: auto; }
/* audit v6 · U-6 / A-6: on phone the price and refund lines carry their own dark backing, so they keep AA contrast over the
   eyes and any film frame without darkening the pair */
.stage[data-fmt="phone"] .h-price, .stage[data-fmt="phone"] .h-terms { width: fit-content; max-width: 100%; margin-left: -6px; padding: 1px 6px; border-radius: 6px; background: #000000b8; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.stage[data-fmt="phone"] .h-terms { margin-top: 2px; }
/* audit v7 · U-9: the SCROLL cue waits for the script, so it never shows in the dark opening */
.js:not(.st-ready) .h-cue { opacity: 0 !important; }
/* v3 · no poster flash: until the script has chosen the dark opening or the settled hold, the final-frame poster stays hidden */
.js:not(.st-ready) .h-poster { opacity: 0 !important; }
/* audit v8 · E-1: the phone hero's AI-media label is pinned to the screen only while the stage covers it; once the
   page is unlocked it returns to the copy and scrolls away with the hero, so it never sits over section 4 */
.js:not(.locked) .stage[data-fmt="phone"] .h-label { position: static; margin-top: 6px; }
/* audit v8 · A-1: over photos and film the cobalt ring (owner decision 13) carries a two-tone halo, ivory inside and
   near-black outside, so it keeps 3:1 against any frame */
.skip-link:focus-visible, .st-top :focus-visible, .sc-hero :focus-visible, .sc-journey :focus-visible { box-shadow: 0 0 0 2px #fbfaf7, 0 0 0 7px #0d0f13; }
.j-seg:focus-visible { z-index: 1; } /* the halo paints above the neighbouring segment */
