/* Section 3 (the film), the bridge's landing and section 4 (membership) with its transitions.
   js/journey.js sets: --os on .j-film (the 1.15 % overscan that hides the encodes' black edge rows), the caption's box (left, top or
   bottom, max-width, --k), --f on each chapter segment, --p on the phone's progress line, the zoom layers' geometry and the
   reveal's clip-path. js/stage.js sets --b-live on .stage during the bridge and the film's opacity there. */

/* ============================================================== the bridge: the paper's live content fades to blank paper */
.stage[data-scene="bridge"] #paper > *, .stage[data-scene="bridge"] .tb-note { opacity: var(--b-live, 1); }

/* ============================================================== section 3 · the film */
.js .sc-journey { inset: 0; z-index: 32; overflow: hidden; background: #000; opacity: 0; visibility: hidden;
  transition: opacity 420ms var(--ease-out), visibility 0s linear 420ms; }
.stage[data-scene="journey"] .sc-journey, .stage[data-scene="membership"] .sc-journey { opacity: 1; visibility: visible; transition-delay: 0s; }
.stage[data-scene="bridge"] .sc-journey { visibility: visible; transition: none; } /* opacity follows the bridge (js) */
/* the film layer takes clicks only while it is the scene (and during the move into section 4): fading out, at opacity 0, it must
   not swallow the tour's first click (F3) */
.js .sc-journey { pointer-events: none; }
.stage[data-scene="journey"] .sc-journey, .stage[data-scene="membership"] .sc-journey { pointer-events: auto; }
.js .j-h { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.js .j-list, .js .sc-journey > .j-who { display: none; }

.j-film { position: absolute; inset: 0; overflow: hidden; transform: scale(var(--os, 1)); transform-origin: 50% 50%; }
.j-video, .j-poster, .j-join { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 50%; }
.j-join { opacity: 0; pointer-events: none; }
.j-poster { opacity: 0; transition: opacity 0ms linear; pointer-events: none; }
.j-poster[data-on] { opacity: 1; }

/* the desktop zoom into section 4: the white-paper hold, a veil in the page colour, the DOM page on the film's page, the hands */
.j-zoom { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; }
.j-zin { position: absolute; inset: 0; will-change: transform; }
.j-still, .j-hands { position: absolute; max-width: none; }
.j-veil { position: absolute; inset: 0; opacity: 0; }
.j-page { position: absolute; left: 0; top: 0; width: 1000px; height: 750px; transform-origin: 0 0; opacity: 0; backface-visibility: hidden; }

/* captions: a compact ivory chip, title and one line, placed per chapter where the film has no action */
.j-cap { position: absolute; z-index: 3; left: 24px; top: 120px; width: max-content; max-width: 420px; --k: 1; margin: 0;
  padding: calc(var(--k) * 10px) calc(var(--k) * 14px) calc(var(--k) * 11px); border-radius: 12px; background: #fbfaf7eb; color: var(--graphite);
  box-shadow: 0 1px 0 #ffffff inset, 0 14px 34px -16px #000000b3; pointer-events: none; transition: opacity 200ms var(--ease-out); }
.j-cap[data-swap] { opacity: 0 !important; }
.j-cap p { margin: 0; }
.j-cap-k { font: 800 max(12px, calc(var(--k) * 12px))/1.2 var(--font-body); letter-spacing: .09em; text-transform: uppercase; color: var(--slate); }
.j-cap-t { margin-top: calc(var(--k) * 4px) !important; font: 650 calc(var(--k) * 21px)/1.15 var(--font-display); letter-spacing: -.02em; text-wrap: balance; }
.j-cap-l { margin-top: calc(var(--k) * 5px) !important; font: 560 max(12.5px, calc(var(--k) * 15.5px))/1.4 var(--font-body); color: #2c3139; }
.j-cap-who { margin-top: calc(var(--k) * 8px) !important; padding-top: calc(var(--k) * 6px); border-top: 1px solid var(--line); font: 600 max(12px, calc(var(--k) * 12px))/1.35 var(--font-body); color: var(--slate); }
.j-cap[data-compact] .j-cap-k, .j-cap[data-compact] .j-cap-l { display: none; }
.j-cap[data-compact] .j-cap-t { margin-top: 0 !important; }
/* the AI-character disclosure is the last thing a tight box gives up: never (PT-3). Tiny drops the title instead, and a box still too
   small lets the chip grow up into the band (js fit) rather than lose the line */
.j-cap[data-tiny] .j-cap-t { display: none; }
.j-cap[data-tiny] .j-cap-who { margin-top: 0 !important; padding-top: 0; border-top: 0; }
.stage[data-fmt="phone"] .j-cap { padding: calc(var(--k) * 9px) calc(var(--k) * 12px) calc(var(--k) * 10px); }
.stage[data-fmt="phone"] .j-cap-t { font-size: calc(var(--k) * 17.5px); }
.stage[data-fmt="phone"] .j-cap-l { font-size: max(12.5px, calc(var(--k) * 14.5px)); }
.stage[data-fmt="phone"] .j-cap-who { font-size: max(12px, calc(var(--k) * 12px)); margin-top: calc(var(--k) * 6px) !important; padding-top: calc(var(--k) * 5px); }

/* the bar: chapters, Back, Pause/Play, Next (Continue at the end), Skip, The beta ↓, the temporary-media note */
.j-bar { position: absolute; z-index: 4; left: max(24px, env(safe-area-inset-left, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: grid; gap: 6px; padding: 6px; border-radius: 15px; background: #0d0f13b8; -webkit-backdrop-filter: blur(12px) saturate(1.1); backdrop-filter: blur(12px) saturate(1.1);
  box-shadow: 0 0 0 1px #ffffff1f inset; transition: opacity 280ms var(--ease-out); }
.j-bar[data-hide] { opacity: 0; pointer-events: none; }
.j-bar[data-hide]:has(:focus-visible) { opacity: 1; pointer-events: auto; }
.j-segs { list-style: none; margin: 0; padding: 0 2px; display: flex; gap: 4px; }
.j-seg { position: relative; display: block; width: 32px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 6px; }
.j-seg::before, .j-seg i { content: ''; position: absolute; left: 3px; right: 3px; top: 10px; height: 4px; border-radius: 4px; }
.j-seg::before { background: #ffffff52; }
.j-seg i { background: var(--ivory); transform-origin: 0 50%; transform: scaleX(var(--f, 0)); }
.j-seg[aria-current="step"]::before { background: #ffffff85; }
.j-seg:hover::before { background: #ffffffa6; }
.j-btns { display: flex; align-items: center; gap: 4px; }
.j-b, .j-p { min-height: 40px; border-radius: 999px; border: 1.5px solid #ffffff5c; background: #00000047; color: var(--ivory); cursor: pointer; }
.j-b { flex: none; width: 40px; padding: 0; display: inline-grid; place-items: center; } /* the 40 px circles never shrink */
.j-b svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.j-b:hover, .j-p:hover { background: #000000a6; }
.j-play { background: var(--ivory); border-color: var(--ivory); color: var(--graphite); }
.j-play:hover { background: #fff; }
.j-play .j-ic-play path { fill: currentColor; stroke-width: 1.6; }
/* slow link (M4): a loading ring around Pause/Play while the film buffers; the button keeps working (label "…, loading") */
.j-play { position: relative; }
.sc-journey[data-buffering] .j-play::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2.5px solid #ffffff3d; border-top-color: var(--ivory); animation: j-spin .9s linear infinite; pointer-events: none; }
html[data-motion="reduced"] .sc-journey[data-buffering] .j-play::after { animation: none; border-color: var(--ivory) #ffffff3d #ffffff3d; }
@keyframes j-spin { to { transform: rotate(360deg); } }
.j-play svg { display: none; }
.j-play[data-state="pause"] .j-ic-pause, .j-play[data-state="play"] .j-ic-play, .j-play[data-state="retry"] .j-ic-retry { display: block; }
.j-next-t { display: none; }
.j-next[data-cont] { width: auto; padding: 0 8px 0 14px; display: inline-flex; gap: 2px; background: var(--ivory); border-color: var(--ivory); color: var(--graphite); }
.j-next[data-cont] .j-next-t { display: inline; font: 750 14px/1 var(--font-body); }
.j-p { padding: 0 9px; font: 700 12.5px/1 var(--font-body); white-space: nowrap; }
.j-temp { border-style: dashed; color: #e9e6df; }
.j-prog { display: none; }

/* phone: one row along the bottom, below every chapter's action (master y 1690+, MEDIA-ANALYSIS-DETAIL P9) */
.stage[data-fmt="phone"] .j-bar { left: max(10px, env(safe-area-inset-left, 0px)); right: max(10px, env(safe-area-inset-right, 0px)); bottom: max(8px, env(safe-area-inset-bottom, 0px));
  display: block; padding: 4px; border-radius: 999px; }
.stage[data-fmt="phone"] .j-segs { display: none; }
.stage[data-fmt="phone"] .j-btns { gap: 5px; }
.stage[data-fmt="phone"] .j-prog { display: block; position: relative; flex: 1 1 auto; min-width: 0; height: 4px; border-radius: 4px; background: #ffffff4d; overflow: hidden; }
.stage[data-fmt="phone"] .j-prog i { position: absolute; inset: 0; background: var(--ivory); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
.stage[data-fmt="phone"] .j-p { flex: none; padding: 0 9px; font-size: 12.5px; }
/* phone: Continue keeps its ivory fill as the cue but drops its word (aria-label "Continue to membership"); at the end Skip and
   Continue both go to membership, so Skip steps aside. The 40 px circles keep their size at 320–430 px in both offers (F1). */
.stage[data-fmt="phone"] .j-next[data-cont] { width: 40px; padding: 0; display: inline-grid; }
.stage[data-fmt="phone"] .j-next[data-cont] .j-next-t { display: none; }
.stage[data-fmt="phone"] .j-btns:has(.j-next[data-cont]) #jSkip { display: none; }
@media (max-width: 359px) { .stage[data-fmt="phone"] .j-btns { gap: 3px; } .stage[data-fmt="phone"] .j-p { padding: 0 7px; } }

/* short laptop windows (height under 480 px, phones held sideways): one compact row with a short progress line instead of the
   chapter segments, so the bar stays low and clear of the hands (F4) */
.stage[data-short="1"] .j-segs { display: none; }
.stage[data-short="1"] .j-bar { padding: 4px; border-radius: 999px; bottom: calc(6px + env(safe-area-inset-bottom, 0px)); }
.stage[data-short="1"] .j-prog { display: block; position: relative; flex: none; width: 44px; height: 4px; border-radius: 4px; background: #ffffff4d; overflow: hidden; }
.stage[data-short="1"] .j-prog i { position: absolute; inset: 0; background: var(--ivory); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* the bridge and section 4's transition: the film's caption and bar step aside */
.stage[data-scene="bridge"] .j-cap, .stage[data-scene="bridge"] .j-bar,
.stage[data-scene="membership"] .j-cap, .stage[data-scene="membership"] .j-bar { visibility: hidden; }
/* the move into section 4 fades the caption and bar out instead of cutting them in one frame (recheck NEW-2) */
.stage[data-scene="membership"] .j-cap, .stage[data-scene="membership"] .j-bar { opacity: 0; transition: opacity 180ms var(--ease-out), visibility 0s linear 180ms; }
.stage[data-scene="bridge"] .j-cap, .stage[data-scene="bridge"] .j-bar { opacity: 0; } /* landing on chapter 0's gates fades nothing out */

/* section 4's transition layer (a copy of #final drawn over the stage; the real section takes over when the page unlocks) */
.js .j-reveal { inset: 0; z-index: 50; overflow: hidden; pointer-events: none; }
.j-reveal .s4 { background: transparent; }

/* ============================================================== section 4 · membership */
.s4 { --s4-acc: var(--coral-text); --s4-accv: var(--coral); --s4-soft: var(--coral-soft);
  position: relative; min-height: 100svh; display: grid; align-items: center; margin: 0; background: var(--ivory); color: var(--graphite);
  padding: clamp(36px, 8vh, 88px) max(20px, env(safe-area-inset-right, 0px)) clamp(36px, 8vh, 88px) max(20px, env(safe-area-inset-left, 0px));
  font: 500 16px/1.5 var(--font-body); text-align: left; -webkit-user-select: text; user-select: text; }
.s4[data-companion="theo"] { --s4-acc: var(--cobalt-text); --s4-accv: var(--cobalt); --s4-soft: var(--cobalt-soft); }
.s4:focus { outline: none; }
.s4-in { width: 100%; max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.s4 p, .s4 ul, .s4 h2, .s4 h3 { margin: 0; }
.s4-kicker { font: 800 12.5px/1.2 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--s4-acc); }
.s4-title { margin-top: 10px !important; font: 650 clamp(34px, 4.4vw, 60px)/1.02 var(--font-display); letter-spacing: -.035em; color: var(--graphite); }
.s4-title:focus { outline: none; }
.s4 .s4-title:focus-visible { outline: none; box-shadow: none; } /* a programmatic landing point, not a control */
.s4-lead { margin-top: 16px !important; max-width: 44ch; font-size: 18px; line-height: 1.5; color: #3a3f48; }
.s4-offer { margin-top: 22px; padding: 14px 16px; border-left: 3px solid var(--s4-accv); border-radius: 0 12px 12px 0; background: var(--s4-soft); max-width: 52ch; }
.s4-offer-h { font: 700 20px/1.2 var(--font-display); letter-spacing: -.01em; }
.s4-offer-p { margin-top: 4px !important; font-size: 15px; color: #3a3f48; }
.s4-offer-p--paid { margin-top: 0 !important; font-weight: 650; color: var(--graphite); }
.s4-actions { margin-top: 24px !important; display: flex; flex-wrap: wrap; gap: 12px; }
.s4-cta { background: var(--graphite); color: var(--ivory); box-shadow: 0 14px 30px -16px #1d2128; }
.s4-cta:hover { background: var(--graphite-light); }
.s4-again { border-color: var(--line-strong); color: var(--graphite); background: transparent; }
.s4-again:hover { background: var(--plaster); }
.s4-back { margin-top: 8px !important; }
.s4-back a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--graphite); text-underline-offset: 4px; }
.s4-card { position: relative; padding: 24px 26px; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-shadow: 0 30px 60px -40px #1d212880; overflow: hidden; }
/* the AI's pulse on the card's edge, in the chosen companion's colour (STORYBOARD: one idea, four places) */
.s4-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--s4-accv); animation: s4-pulse 5.6s var(--ease-inout) 1s infinite; }
@keyframes s4-pulse { 0%, 100% { opacity: .55; } 12% { opacity: 1; box-shadow: 0 0 14px 2px var(--s4-accv); } 30% { opacity: .55; box-shadow: none; } }
.s4-card-h { font: 700 13px/1.2 var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--slate); }
.s4-card-h + ul { margin-top: 10px !important; }
.s4-inc + .s4-card-h { margin-top: 20px !important; }
.s4-inc, .s4-soon { list-style: none; padding: 0; display: grid; gap: 8px; }
.s4-inc li { position: relative; padding-left: 28px; font-weight: 650; }
.s4-inc li::before { content: ''; position: absolute; left: 2px; top: .3em; width: 16px; height: 16px; border-radius: 50%; background: var(--s4-soft); box-shadow: inset 0 0 0 1.5px var(--s4-accv); }
.s4-inc li::after { content: ''; position: absolute; left: 7px; top: calc(.3em + 4px); width: 5px; height: 8px; border: solid var(--s4-acc); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.s4-inc small { display: block; font: 600 13px/1.3 var(--font-body); color: var(--slate); }
.s4-soon li { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--slate); font-weight: 600; }
.s4-tag { flex: none; font: 800 12px/1 var(--font-body); letter-spacing: .04em; padding: 5px 8px; border-radius: 999px; background: var(--plaster); color: var(--graphite); }
.s4-note { grid-column: 1 / -1; font: 600 13px/1.4 var(--font-body); color: var(--slate); }
.s4-terms { background: var(--stage); color: var(--graphite); padding: clamp(48px, 10vh, 96px) max(20px, env(safe-area-inset-left, 0px)); }
.s4-terms-in { max-width: 760px; margin: 0 auto; display: grid; gap: 14px; }
.s4-terms h2 { margin: 0; font: 650 clamp(26px, 3vw, 36px)/1.1 var(--font-display); letter-spacing: -.02em; }
.s4-terms ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: #3a3f48; }
.s4-proto { margin: 0; font: 600 13px/1.4 var(--font-body); color: var(--slate); }
.s4 :focus-visible, .s4-terms :focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; }

/* phone and narrow windows: one column */
@media (max-width: 760px) {
  .s4 { align-items: start; padding-top: calc(28px + env(safe-area-inset-top, 0px)); padding-bottom: 32px; }
  .s4-in { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .s4-title { font-size: clamp(32px, 9vw, 42px); }
  .s4-lead { font-size: 16.5px; margin-top: 12px !important; }
  .s4-offer { margin-top: 16px; }
  .s4-actions { margin-top: 18px !important; gap: 10px; }
  .s4-actions .btn { flex: 1 1 100%; }
  .s4-card { padding: 18px 18px 20px; }
}

/* ============================================================== no JavaScript: the film reads as a list of chapters */
.no-js .sc-journey { background: #0d0f13; color: var(--ivory); padding: 40px 16px 56px; }
.no-js .j-film, .no-js .j-zoom, .no-js .j-cap, .no-js .j-bar, .no-js .j-reveal { display: none; }
.no-js .j-h { max-width: 760px; margin: 0 auto 16px; font: 650 28px/1.15 var(--font-display); }
.no-js .j-list { max-width: 760px; margin: 0 auto; padding: 0; list-style: none; display: grid; gap: 12px; }
.no-js .j-list li { background: #ffffff0d; border-radius: 14px; padding: 16px 18px; }
.no-js .j-list h3 { margin: 0; font-size: 20px; }
.no-js .j-list p { margin: 6px 0 0; color: #dcdfe5; }
.no-js .sc-journey > .j-who { max-width: 760px; margin: 16px auto 0; font-size: 13px; color: #c9ccd2; }
