/* ============================================================
   Relay — cinematic homepage opening ("The Living Phone")
   Loaded by index.html only, after style.css (shares its tokens).
   Adapted from previews/css/preview.css — previews/ stays untouched.

   Rebuilt 2026-07-11 night (K's spec):
   - live: the phone opens the page SOLO, full-screen — no nav, no
     headline column. ~2 screens of story scrub (300vh scroller), then
     the landing content (headline + CTAs) rides up inside the last
     viewport of the scroller while the NAV MATERIALIZES (scan-line
     pill assembly, below).
   - default (no JS / WebGL failed): landing content reads FIRST
     (flex order swap), then the story beats stack as a document,
     3D stage hidden, nav visible.
   - body.static-mode (reduced motion / ?static): same document flow
     plus one rendered still of the scene. Nav visible from load.
   ============================================================ */

/* Lenis owns smoothness while the cinematic is active; CSS smooth
   scrolling on top of it causes double-easing on anchor jumps. */
html.hero3d{scroll-behavior:auto}

/* ---------- document-first layout (no-JS / static default) ----------
   .cine is a column; the scroller dissolves (display:contents) so the
   landing block can order itself FIRST — a no-JS visitor gets the
   pitch, then the story, with the nav visible. Live mode re-blocks it. */
.cine{position:relative;display:flex;flex-direction:column}
.cine-scroller{position:relative;--scenelen:300vh;display:contents}
.cine-land{order:-1;padding:150px 24px 30px;text-align:center}
.land-inner{max-width:700px;margin:0 auto}
html.hero3d body:not(.static-mode) .cine{display:block}
html.hero3d body:not(.static-mode) .cine-scroller{display:block;height:var(--scenelen)}

/* ---------- the 3D stage (canvas + giant type + vignette) ---------- */
.cine-stage{display:none;pointer-events:none}
html.hero3d .cine-stage{display:block}
html.hero3d body:not(.static-mode) .cine-stage{position:fixed;inset:0;z-index:-1}
/* story over: the stage unpins and scrolls away with the page (a dimmed
   scene leaving upward — never a black hole between story and sections) */
html.hero3d body:not(.static-mode) .cine-stage.parked{position:absolute;inset:auto 0 0 0;height:100vh}
body.static-mode .cine-stage{position:relative;height:72vh;z-index:0;overflow:hidden}
.cine-stage canvas{position:absolute;inset:0;width:100%;height:100%;display:block;z-index:1}

/* giant display type living BEHIND the phone */
.cine-type{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:0;
  font-family:var(--disp);font-weight:700;letter-spacing:-.04em;line-height:.92;
  font-size:clamp(64px,17vw,260px);text-align:center;white-space:nowrap;pointer-events:none;
  color:transparent;-webkit-text-stroke:1px rgba(246,243,255,.14);opacity:0}
body.static-mode .cine-type{opacity:1}

.cine-vignette{position:absolute;inset:0;z-index:2;pointer-events:none;
  background:radial-gradient(120% 100% at 50% 45%, transparent 55%, rgba(4,2,10,.55) 100%)}

/* ---------- HUD micro-labels (live cinema only) ---------- */
.cine-hud{display:none;position:fixed;z-index:6;font-family:ui-monospace,'SF Mono',Menlo,monospace;
  font-size:10px;letter-spacing:.22em;text-transform:uppercase;color:rgba(246,243,255,.5);pointer-events:none}
html.hero3d body:not(.static-mode) .cine-hud{display:block}
.hud-bl{bottom:18px;left:22px}
.hud-br{bottom:18px;right:22px}

/* scroll cue */
.cine-cue{display:none;position:fixed;left:50%;bottom:26px;transform:translateX(-50%);z-index:6;
  font-family:ui-monospace,'SF Mono',Menlo,monospace;font-size:10px;letter-spacing:.3em;
  text-transform:uppercase;color:rgba(246,243,255,.55);flex-direction:column;align-items:center;gap:8px;
  pointer-events:none;transition:opacity .5s}
html.hero3d body:not(.static-mode) .cine-cue{display:flex}
.cine-cue::after{content:'';width:1px;height:34px;
  background:linear-gradient(to bottom,var(--cyan),transparent);
  animation:cuedrop 1.6s ease-in-out infinite}
@keyframes cuedrop{0%{transform:scaleY(.2);transform-origin:top}55%{transform:scaleY(1)}100%{transform:scaleY(.2);transform-origin:bottom;opacity:0}}

/* ---------- story beats ---------- */
/* default / static: beats stack as a readable page */
.beat{max-width:620px;margin:0 auto;padding:10vh 24px;text-align:center}
html.hero3d body:not(.static-mode) .beat{
  position:fixed;left:50%;z-index:5;transform:translateX(-50%);margin:0;padding:0 24px;
  width:min(92vw,660px);opacity:0;visibility:hidden;pointer-events:none}
html.hero3d body:not(.static-mode) .beat--low{bottom:12vh}
/* side beats: editorial column beside the phone (desktop only) */
@media(min-width:901px){
  html.hero3d body:not(.static-mode) .beat--side-l,
  html.hero3d body:not(.static-mode) .beat--side-r{
    top:50%;bottom:auto;transform:translateY(-50%);text-align:left;
    width:min(34vw,460px)}
  html.hero3d body:not(.static-mode) .beat--side-l{left:5vw}
  html.hero3d body:not(.static-mode) .beat--side-r{left:auto;right:5vw}
  html.hero3d body:not(.static-mode) .beat--side-l .sub,
  html.hero3d body:not(.static-mode) .beat--side-r .sub{margin-left:0}
}
@media(max-width:900px){
  html.hero3d body:not(.static-mode) .beat--side-l,
  html.hero3d body:not(.static-mode) .beat--side-r{bottom:10vh}
}
.beat-inner{will-change:transform,opacity;position:relative;z-index:0}
/* soft scrim keeps beat type readable over the bright 3D scene */
html.hero3d body:not(.static-mode) .beat-inner::before{content:'';position:absolute;z-index:-1;
  inset:-26px -44px;border-radius:40px;
  background:radial-gradient(58% 64% at 50% 50%,rgba(6,4,14,.5),rgba(6,4,14,0) 74%)}

.beat .eyebrow{font-family:ui-monospace,'SF Mono',Menlo,monospace;font-size:10.5px;letter-spacing:.28em;
  text-transform:uppercase;color:var(--violet-text);display:block;margin-bottom:14px}
.beat h2{font-family:var(--disp);font-weight:700;
  font-size:clamp(30px,5.2vw,58px);line-height:1.04;letter-spacing:-.025em}
.beat .sub{color:var(--muted);font-size:clamp(15px,1.9vw,18px);margin-top:14px;margin-inline:auto}
.beat .grad{background:var(--grad);-webkit-background-clip:text;background-clip:text;color:transparent}
.beat .hand{font-family:var(--hand);font-size:clamp(20px,2.6vw,28px);color:var(--lime);font-weight:600}

/* ---------- the landing: headline + CTAs arrive as the story ends ----------
   Lives inside the scroller's final viewport, so it rides up naturally
   and the parked stage + landing scroll away together — no pin juggling. */
.cine-h1{font-family:var(--disp);font-weight:700;font-size:clamp(38px,6vw,72px);
  line-height:1.03;letter-spacing:-.02em;margin-bottom:20px}
.cine-land .badge{margin-bottom:26px}
.cine-land .lead{margin-inline:auto;margin-bottom:30px}
.cine-land .hero-cta{justify-content:center}
.cine-land .trust{justify-content:center}
html.hero3d body:not(.static-mode) .cine-land{
  order:0;position:absolute;left:0;right:0;bottom:0;height:100svh;z-index:5;
  display:flex;align-items:center;justify-content:center;
  padding:100px 24px 40px;opacity:0;visibility:hidden}
html.hero3d body:not(.static-mode) .land-inner{position:relative;margin:0;will-change:transform,opacity}
/* soft scrim so the type stays readable over particles / the phone glow */
html.hero3d body:not(.static-mode) .land-inner::before{content:'';position:absolute;z-index:-1;
  inset:-36px -40px;border-radius:48px;
  background:radial-gradient(60% 62% at 50% 50%,rgba(6,4,14,.5),rgba(6,4,14,0) 76%)}
@media(min-width:901px){
  /* desktop: content column left — the phone glides right to meet it */
  html.hero3d body:not(.static-mode) .cine-land{justify-content:flex-start;
    padding-left:max(6vw,calc((100vw - var(--maxw))/2))}
  html.hero3d body:not(.static-mode) .land-inner{max-width:600px;text-align:left}
  html.hero3d body:not(.static-mode) .cine-land .lead{margin-inline:0}
  html.hero3d body:not(.static-mode) .cine-land .hero-cta{justify-content:flex-start}
  html.hero3d body:not(.static-mode) .cine-land .trust{justify-content:flex-start}
}
body.static-mode .cine-land{padding-top:140px}

/* ---------- nav: veiled during the story, MATERIALIZES at its end ----------
   Hidden = opacity only (links stay focusable — keyboard focus always
   brings the nav back). No transition on the veiled state (instant),
   the materialize animation owns the entrance. */
html.hero3d body.nav-veil .hdr{opacity:0;pointer-events:none}
html.hero3d body.nav-veil .hdr:focus-within{opacity:1;pointer-events:auto}
/* while the story is on screen, main.js's hide-on-scroll-down is
   suppressed — the nav never slides away mid-cinematic */
body.cine-live .hdr.hide{transform:translateX(-50%)}

/* the signature: the glass pill powers on like a neon sign — a thin
   light-bar stretches wide, snaps open into the pill, a candy sweep
   runs through it, then brand/links/CTA pop in on a stagger */
html.hero3d .hdr.mat{animation:hdrMat .8s cubic-bezier(.3,.85,.25,1) both}
html.hero3d .hdr.mat::before{content:'';position:absolute;inset:0;border-radius:inherit;
  pointer-events:none;z-index:1;
  background:linear-gradient(105deg,transparent 32%,rgba(44,224,224,.5) 46%,rgba(255,95,176,.4) 54%,transparent 68%);
  background-size:260% 100%;animation:hdrSweep .8s ease-out .22s both}
@keyframes hdrMat{
  0%{opacity:0;clip-path:inset(47% 48% 47% 48% round 60px);box-shadow:0 0 0 rgba(44,224,224,0)}
  30%{opacity:1;clip-path:inset(44% 5% 44% 5% round 60px);box-shadow:0 0 34px rgba(44,224,224,.45)}
  64%{clip-path:inset(0 0 0 0 round 60px);box-shadow:0 0 46px rgba(44,224,224,.3)}
  100%{opacity:1;clip-path:inset(0 0 0 0 round 60px);box-shadow:0 12px 40px rgba(0,0,0,.4)}
}
@keyframes hdrSweep{from{background-position:130% 0;opacity:1}to{background-position:-60% 0;opacity:0}}
.hdr.mat .brand,.hdr.mat .nav-links a,.hdr.mat .nav-right{animation:hdrItem .45s cubic-bezier(.2,.7,.2,1) both}
.hdr.mat .brand{animation-delay:.30s}
.hdr.mat .nav-links a:nth-child(1){animation-delay:.36s}
.hdr.mat .nav-links a:nth-child(2){animation-delay:.40s}
.hdr.mat .nav-links a:nth-child(3){animation-delay:.44s}
.hdr.mat .nav-links a:nth-child(4){animation-delay:.48s}
.hdr.mat .nav-links a:nth-child(5){animation-delay:.52s}
.hdr.mat .nav-links a:nth-child(6){animation-delay:.56s}
.hdr.mat .nav-right{animation-delay:.60s}
@keyframes hdrItem{from{opacity:0;transform:translateY(9px)}to{opacity:1;transform:none}}

/* ---------- loader (shown only once the hero module is actually running) ---------- */
#cine-loader{display:none;position:fixed;inset:0;z-index:200;background:var(--bg);
  align-items:center;justify-content:center;flex-direction:column;gap:14px;
  transition:opacity .6s,visibility .6s}
html.hero3d #cine-loader{display:flex}
#cine-loader.done{opacity:0;visibility:hidden}
#cine-loader .mark{font-family:var(--disp);font-weight:700;font-size:clamp(34px,6vw,54px);
  letter-spacing:-.03em}
#cine-loader .mark em{font-style:normal;background:var(--grad);-webkit-background-clip:text;
  background-clip:text;color:transparent}
#cine-loader .tag{font-family:ui-monospace,'SF Mono',Menlo,monospace;font-size:10px;letter-spacing:.3em;
  text-transform:uppercase;color:rgba(246,243,255,.4)}

/* ============================================================
   PAGE DIET (index only — this file loads only on the homepage)
   Merged sections + a tighter, consistent vertical rhythm.
   ============================================================ */

/* one spacing scale for the whole page */
.sec{padding:68px 0}
@media(max-width:640px){.sec{padding:52px 0}}
footer{margin-top:10px}

/* -- watch block: flow rail + dashboard split + stat line -- */
.flow--slim{margin-top:38px}
.flow--slim .ring{width:68px;height:68px;font-size:25px;margin-bottom:12px}
.flow--slim::before{top:34px}
.flow--slim .pulse{top:29px}
.flow--slim .fnode h3{font-size:14.5px}
.flow--slim .fnode p{font-size:12.5px}
.watch-split{margin-top:52px}
.h3ish{font-family:var(--disp);font-weight:700;font-size:clamp(24px,3.2vw,38px);
  line-height:1.1;letter-spacing:-.02em;margin-bottom:14px}
.statline{display:flex;flex-wrap:wrap;justify-content:center;align-items:baseline;gap:14px 54px;
  margin-top:42px;padding:20px 28px 16px;border:1px solid var(--stroke);border-radius:60px;
  background:linear-gradient(140deg,rgba(124,92,255,.14),rgba(44,224,224,.07))}
.statline>div{display:flex;align-items:baseline;gap:10px}
.statline .num{font-family:var(--disp);font-weight:700;font-size:clamp(24px,2.6vw,32px);
  background:linear-gradient(120deg,var(--coral),var(--violet));-webkit-background-clip:text;background-clip:text;color:transparent}
.statline .lbl{color:var(--muted);font-size:13px}
.statline .statnote{flex-basis:100%;text-align:center;font-size:11.5px;color:var(--faint)}
@media(max-width:720px){.statline{gap:10px 26px;border-radius:26px}}

/* -- toolkit: compact "also in the stack" chip row (was 3 link columns) -- */
.incl-mini{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:8px;margin-top:28px}
.incl-mini-lab{font-family:var(--disp);font-size:11px;letter-spacing:.14em;text-transform:uppercase;
  color:var(--violet-text);margin-right:6px}
.incl-mini a{position:relative;font-size:13px;color:var(--muted);padding:8px 14px 8px 30px;border-radius:40px;
  background:var(--card);border:1px solid var(--stroke);transition:color .2s,background .2s,border-color .2s}
.incl-mini a::before{content:'✓';position:absolute;left:9px;top:50%;transform:translateY(-50%);
  width:15px;height:15px;border-radius:50%;display:grid;place-items:center;font-size:9px;color:#160f25;
  background:linear-gradient(120deg,var(--lime),var(--cyan))}
.incl-mini a:hover{color:var(--ink);background:var(--card2);border-color:var(--stroke2)}
@media(pointer:coarse){.incl-mini a{min-height:44px;display:inline-flex;align-items:center}}

/* -- try-it zone: demo + customize as one moment -- */
.try-sub{margin-top:68px}
.try-sub::before{content:'';display:block;width:min(520px,70%);height:1px;margin:0 auto 44px;
  background:linear-gradient(90deg,transparent,var(--stroke2),transparent)}
.try-sub .sub{margin-inline:auto}
.tryzone .demo-tabs{margin-top:32px}
.tryzone .demo-chat{min-height:260px}
.tryzone .cz-grid{margin-top:30px;gap:34px}
.tryzone .cz-panel{padding:20px}
.tryzone .cz-row{margin-bottom:14px}
.tryzone .cz-preview{margin-top:16px;padding:14px 16px}
.tryzone .cz-p{margin-bottom:14px}
.tryzone .cz-list{gap:8px;margin-bottom:16px}
.tryzone .cz-honest{padding:13px 15px}

/* -- toolkit: tighter bento -- */
.bento{margin-top:38px;grid-auto-rows:188px}

/* -- websites band: one slim strip -- */
.also--strip{display:flex;align-items:center;gap:16px;padding:14px 14px 14px 24px;border-radius:60px}
.also--strip .also-ic{font-size:22px;line-height:1}
.also--strip p{flex:1;font-size:14px;color:var(--muted);max-width:none;margin:0}
.also--strip p b{color:var(--ink);font-family:var(--disp);font-weight:600}
.also--strip .btn{font-size:13.5px;padding:9px 16px;flex-shrink:0}
@media(max-width:760px){
  .also--strip{flex-direction:column;text-align:center;gap:10px;border-radius:26px;padding:20px}
}

/* -- CTA: tighter -- */
.cta-box{padding:56px 36px}

@media(max-width:640px){
  .hud-bl,.hud-br{display:none!important}
  .watch-split,.statline{margin-top:44px}
  .try-sub{margin-top:64px}
}
@media (prefers-reduced-motion: reduce){
  .cine-cue::after{animation:none}
}
