/* =========== v5 part A: hero phone, cloud stability, services tiles =========== */

/* ---------- hero phone ----------
   Frame look comes from style.css (light silver frame). Here only the screen details:
   status bar with a small dynamic island, SVG icons, home indicator. */
.phone-screen{padding-top:0;isolation:isolate}
/* the chart bleeds 18px past the screen padding on both sides; the global svg{max-width:100%}
   capped it at the content width, so it stopped short on the right */
.ps-chart{max-width:none}

/* status bar: time in the left ear, icons in the right ear, both centred on the island */
.ps-status{
  --iw:72px;--ih:21px;--it:10px;
  display:grid;grid-template-columns:1fr var(--iw) 1fr;align-items:center;
  height:calc(var(--it) * 2 + var(--ih));margin:0 -18px;font-size:14px;
}
.ps-status b{justify-self:center;font-weight:600;letter-spacing:-.01em;font-feature-settings:"tnum";color:var(--ink);transform:translateX(4px)}
.ps-island{
  position:absolute;left:50%;top:var(--it);width:var(--iw);height:var(--ih);margin-left:calc(var(--iw) / -2);
  border-radius:999px;
  background:radial-gradient(circle at calc(100% - var(--ih) / 2) 50%,rgba(70,96,140,.55) 0,rgba(28,38,58,.7) 1.3px,#0c0f15 2.4px,transparent 3.3px),#020304;
  box-shadow:inset 0 0 0 .5px rgba(255,255,255,.04);
}
.ps-icons{grid-column:3;justify-self:center;width:54px;height:auto;aspect-ratio:auto;border-radius:0;background:none;opacity:1;color:var(--ink);transform:translateX(-3px);overflow:visible}
.ps-head{margin-top:16px}
.ps-home{position:absolute;z-index:3;left:50%;bottom:7px;width:36%;height:5px;transform:translateX(-50%);border-radius:9px;background:var(--ink);opacity:.88}

@media (max-width:640px){
  .ps-status{--iw:60px;--ih:18px;--it:8px;font-size:12.5px}
  .ps-icons{width:45px}
  .ps-home{height:4px;bottom:6px}
}

/* ---------- cloud bands: rock solid on iOS Safari ----------
   1. no vertical clip on the belt (content never touches an edge, so no hard cut when it moves)
   2. whole-pixel tile width so the repeat joint never lands on a half pixel (hairline seam)
   3. the rounded apply panel clips through its own composited sky layer */
.cloudbelt{overflow:visible;contain:layout}
.drift{contain:paint}
.drift i{transform:translate3d(0,0,0)}
@supports (width:round(1.5px,1px)){
  .drift{--tile:round(calc(var(--h) * 1.8395),1px)}
}
.sky-small{border-radius:inherit}
@media (pointer:coarse){
  .sky-photo{will-change:auto}
}

/* ---------- hero cloud bank in front of the phone ----------
   cloudbank.webp is derived from cloudband.webp: the densest rows, alpha lifted so the core is opaque,
   closing into solid white underneath (seamless horizontally, aspect 4.3956).
   Puffy contour sits at ~5-27% of the band, fully opaque from ~49%. The band hangs from the hero bottom,
   so the phone (stage = last block of the hero) always meets the same contour, no vh/svh involved. */
.hero{--cb:clamp(240px,24vw,340px)}
.hero .drift-over{
  --h:var(--cb);--dur:150s;--tile:calc(var(--h) * 4.3956);
  top:auto;bottom:calc(var(--h) * -.37);opacity:1;
}
@supports (width:round(1.5px,1px)){
  .hero .drift-over{--tile:round(calc(var(--h) * 4.3956),1px)}
}
.hero .drift-over i{background-image:url(img/cloudbank.webp);background-position:0 0;background-size:var(--tile) 100%}
/* the stage (static wrapper, never animated itself) fades its bottom out where the bank closes,
   so no frame edge or feed row shows through the soft rim of the clouds */
.hero-stage{-webkit-mask-image:linear-gradient(0deg,transparent calc(var(--cb) * .14),#000 calc(var(--cb) * .5));mask-image:linear-gradient(0deg,transparent calc(var(--cb) * .14),#000 calc(var(--cb) * .5))}
/* full bleed: the stage (and with it the mask box) spans the whole hero, edge to edge. Before, it sat inside
   the hero's side padding, so the mask cut the phone shadow and the right float card ~16px from the screen
   edge: a lighter block in the middle, plain sky in both gutters. The content keeps its old box via stage-inner. */
.hero-stage{width:calc(100% + 2 * var(--gut));max-width:none;margin-left:calc(-1 * var(--gut));margin-right:calc(-1 * var(--gut))}
.stage-inner{left:max(var(--gut),calc((100% - 1100px) / 2));right:max(var(--gut),calc((100% - 1100px) / 2))}
/* veil: a second, airier and slower cloud layer just above the bank (feathered contour of cloudbank.webp
   dissolves into it), so the bank's top reads as wisps, not as a cut-out edge */
.hero .drift-veil{
  --h:calc(var(--cb) * .6);--dur:260s;--tile:calc(var(--h) * 2.9724);
  top:auto;bottom:calc(var(--cb) * .34);z-index:4;opacity:.45;
}
@supports (width:round(1.5px,1px)){
  .hero .drift-veil{--tile:round(calc(var(--h) * 2.9724),1px)}
}
.hero .drift-veil i{background-image:url(img/cloudbelt-m.webp);background-position:0 0;background-size:var(--tile) 100%;animation-direction:reverse}
/* desktop parallax lifts the band by 8% at most; it reaches 37% below the hero, so nothing opens up */
/* white bank fades into the next section's background (white in A, light blue in B) */
.hero::after{height:120px;background:linear-gradient(180deg,rgba(255,255,255,0),var(--page) 92%)}
/* floats clearly above the cloud contour */
.float-chat{top:54%}
@media (max-width:640px){
  .float-r{top:250px}
}

/* ---------- services · marketing: the 1% Method reads as exclusive ---------- */
.flow .priv text{font-size:8.2px;letter-spacing:.13em}
.flow .t2s{fill:rgba(255,255,255,.72);font-weight:500}
.flow .sec-ring{fill:none;stroke:var(--blue);stroke-width:1.4;opacity:.22;transform-box:fill-box;transform-origin:center;animation:secRing 3.2s var(--ease) infinite}
@keyframes secRing{0%,100%{opacity:.14}50%{opacity:.5}}
.flow .sec-sheen{transform:translateX(0);animation:secSheen 4.6s cubic-bezier(.45,0,.25,1) infinite}
@keyframes secSheen{0%,45%{transform:translateX(0)}85%,100%{transform:translateX(330px)}}
.flow .dots circle.ds{fill:var(--blue-l);filter:drop-shadow(0 0 5px var(--blue)) drop-shadow(0 0 2px #fff)}
.flow .fp-s{stroke-width:2.2}

/* ---------- services · chat: spent chip ticks up on a sale ---------- */
.chat-top .spent{font-feature-settings:"tnum";transition:background .5s var(--ease),box-shadow .5s var(--ease),transform .5s var(--ease)}
.chat-top .spent.is-up{background:#d0ede1;background:color-mix(in srgb,var(--ok) 20%,#fff);box-shadow:0 0 0 3px rgba(20,163,107,.12);box-shadow:0 0 0 3px color-mix(in srgb,var(--ok) 12%,transparent);animation:spentBump .7s var(--ease)}
@keyframes spentBump{0%{transform:scale(1)}35%{transform:scale(1.07)}100%{transform:scale(1)}}
.chat-body>*{flex-shrink:0}
.chat-body{-webkit-mask-image:linear-gradient(180deg,transparent 0,#000 26px);mask-image:linear-gradient(180deg,transparent 0,#000 26px)}
@media (max-width:640px){ .ppv-img{height:62px} }
.ppv-row b{white-space:nowrap}

/* ---------- phone: cloud belts as bright as the hero clouds ----------
   cloudbelt-m.webp is derived from cloudband.webp (scratchpad tools/beltm.py): bodies made opaque and lifted
   toward white, underside fading out, seamless horizontally, aspect 2.9724.
   A light sky tint sits behind so the white reads; it fades out at the top and bottom of the belt. */
@media (max-width:640px){
  .cloudbelt{--bh:270px;
    background:linear-gradient(180deg,transparent 0,rgba(241,248,255,.8) 16%,#ddeeff 40%,var(--sky-2) 58%,rgba(241,248,255,.75) 78%,transparent 96%);background:linear-gradient(180deg,transparent 0,color-mix(in srgb,var(--sky-1) 80%,transparent) 16%,color-mix(in srgb,var(--sky-2) 85%,var(--sky-3)) 40%,var(--sky-2) 58%,color-mix(in srgb,var(--sky-1) 75%,transparent) 78%,transparent 96%)}
:where(html[data-v="b"]) .cloudbelt{background-image:linear-gradient(180deg,transparent 0,rgba(244,248,255,.8) 16%,#dfe9ff 40%,var(--sky-2) 58%,rgba(244,248,255,.75) 78%,transparent 96%);background-image:linear-gradient(180deg,transparent 0,color-mix(in srgb,var(--sky-1) 80%,transparent) 16%,color-mix(in srgb,var(--sky-2) 85%,var(--sky-3)) 40%,var(--sky-2) 58%,color-mix(in srgb,var(--sky-1) 75%,transparent) 78%,transparent 96%)}
  .cloudbelt .drift i{background-image:url(img/cloudbelt-m.webp);background-position:0 0;background-size:var(--tile) 100%}
  .cloudbelt .drift{--tile:calc(var(--h) * 2.9724)}
  .cloudbelt .cb1{--h:calc(var(--bh) * .74);--dur:150s;top:58%;z-index:1;opacity:1}
  .cloudbelt .cb2{--h:calc(var(--bh) * .5);--dur:95s;top:36%;z-index:0;opacity:.7}
}
@supports (width:round(1.5px,1px)){
  @media (max-width:640px){ .cloudbelt .drift{--tile:round(calc(var(--h) * 2.9724),1px)} }
}

/* ---------- phone + tablet: results follow the cloud bank with a normal rhythm ----------
   Below 900px the bank (--cb 240px) closes into plain white ~86px above the hero bottom, and the results
   padding added another ~80px of white on top. Pull the section up into that white; it paints above the
   bank and the hero's bottom fade (z-index 4/5), and both are plain page colour there, so the join stays seamless. */
@media (max-width:900px){
  .hero + .results{margin-top:-118px;z-index:6}
}

/* chat bubbles wrap like a real chat: ~72% of the chat width, and never one long line on wide tiles */
.chat-body .msg{max-width:min(72%,20em)}

/* footer without the 3d mark: the bottom bar is hidden down here (apply panel still in view), so the
   phone footer only needs a little air under the wordmark */
@media (max-width:900px){ .foot{padding-bottom:calc(36px + env(safe-area-inset-bottom))} }

/* ---------- cloud belts, lighter (v5.3) ----------
   cloudbelt-d.webp / cloudbelt-m.webp come from cloudband.webp (scratchpad tools/gen53.py): shading pressed
   toward white, contour feathered, underside fading out. Desktop keeps the old geometry (aspect 1.8386 ~ 1.8395). */
@media (min-width:641px){
  .cloudbelt{background:linear-gradient(180deg,transparent 0,rgba(225,240,255,.7) 28%,#d8ebff 50%,rgba(225,240,255,.7) 72%,transparent 100%);background:linear-gradient(180deg,transparent 0,color-mix(in srgb,var(--sky-2) 70%,transparent) 28%,color-mix(in srgb,var(--sky-2) 70%,var(--sky-3)) 50%,color-mix(in srgb,var(--sky-2) 70%,transparent) 72%,transparent 100%)}
:where(html[data-v="b"]) .cloudbelt{background-image:linear-gradient(180deg,transparent 0,rgba(227,236,255,.7) 28%,#dae5ff 50%,rgba(227,236,255,.7) 72%,transparent 100%);background-image:linear-gradient(180deg,transparent 0,color-mix(in srgb,var(--sky-2) 70%,transparent) 28%,color-mix(in srgb,var(--sky-2) 70%,var(--sky-3)) 50%,color-mix(in srgb,var(--sky-2) 70%,transparent) 72%,transparent 100%)}
  .cloudbelt .drift{--tile:calc(var(--h) * 1.8386)}
  .cloudbelt .drift i{background-image:url(img/cloudbelt-d.webp)}
  .cloudbelt .cb2{opacity:.8}
}
@supports (width:round(1.5px,1px)){
  @media (min-width:641px){ .cloudbelt .drift{--tile:round(calc(var(--h) * 1.8386),1px)} }
}

/* ---------- apply panel: Safari-safe sky (v5.3) ----------
   Before: the drifting cloud layer sat under two rounded overflow clips (panel + .sky-small with translateZ),
   the panel itself was moved by the reveal tween, the band hung at bottom:-6% of a panel whose height changes
   with every form step, and the photo kept scaling (skyb) inside the same clip. iOS Safari loses rounded
   overflow clipping over composited animated children, so the corners and the bottom edge flickered.
   Now: one static clip on the panel via clip-path (no overflow clip, never transformed: the reveal moves the
   section instead; the drop shadow sits on a plate behind it), the band anchored in px to the panel bottom with its own soft underside ending above the
   edge, a static gradient overlay as the last fade, and a still photo. */
.apply{--apr:clamp(28px,4vw,44px);position:relative}
@media (max-width:640px){ .apply{--apr:30px} }
.apply-panel{border-radius:var(--apr);overflow:visible;-webkit-clip-path:inset(0 round var(--apr));clip-path:inset(0 round var(--apr));box-shadow:inset 0 0 0 1px rgba(255,255,255,.6)}
/* clip-path also clips the panel's own drop shadow, so the shadow is drawn by a plate right behind it */
.apply::before{content:"";position:absolute;top:clamp(72px,9vw,120px);bottom:0;left:max(var(--gut),calc((100% - var(--max)) / 2));right:max(var(--gut),calc((100% - var(--max)) / 2));border-radius:var(--apr);box-shadow:var(--shadow-2);pointer-events:none}
.sky-small{overflow:visible}
.sky-small .sky-photo{will-change:auto}
.sky-small .sky-photo img{animation:none;transform:scale(1.02)}
.sky-small .drift-front{top:auto;bottom:calc(var(--h) * -.2)}
.sky-small::after{content:"";position:absolute;z-index:1;left:0;right:0;bottom:0;height:64px;background:linear-gradient(180deg,rgba(255,255,255,0),rgba(241,248,255,.5));background:linear-gradient(180deg,rgba(255,255,255,0),color-mix(in srgb,var(--sky-1) 50%,transparent));pointer-events:none}
:where(html[data-v="b"]) .sky-small::after{background-image:linear-gradient(180deg,rgba(255,255,255,0),rgba(244,248,255,.5));background-image:linear-gradient(180deg,rgba(255,255,255,0),color-mix(in srgb,var(--sky-1) 50%,transparent))}

/* ---------- cloud belts: you pass through them (v5.5) ----------
   While a belt crosses the viewport (enters at the bottom, leaves at the top) the front layer slides left and
   the back layer slides right, linear with scroll. Opposite directions = depth: a chapter break you rise through.
   The OUTER .drift moves; the inner <i> keeps its slow idle drift. Engine: CSS scroll-driven animation
   (compositor, no JS scroll handler, smooth on iOS). Fallback without support: GSAP scrub on fine pointers only
   (app.js), touch stays static. Travel: front +-fx, back -+bx (bx = .56 fx), fx 75px on phones up to 130px at 1440.
   Each moved layer gets fx + 12px overscan per side, so no tile edge can show at either end; the belt clips
   only horizontally (overflow-x:clip is no scroll container and keeps the vertical feathering unclipped). */
.cloudbelt{--fx:clamp(75px,9vw,130px);--bx:calc(var(--fx) * .56);--ov:calc(var(--fx) + 12px);--fy:0%;--by:0%}
@media (pointer:fine){ .cloudbelt{--fy:8%;--by:7%} }
@keyframes beltFront{from{transform:translate3d(var(--fx),var(--fy),0)}to{transform:translate3d(calc(-1 * var(--fx)),calc(-1 * var(--fy)),0)}}
@keyframes beltBack{from{transform:translate3d(calc(-1 * var(--bx)),calc(-1 * var(--by)),0)}to{transform:translate3d(var(--bx),var(--by),0)}}
@supports (animation-timeline:view()){
  /* body had overflow-x:hidden, which makes it a (non-scrolling) scroll container: every view() timeline then
     tracked the body instead of the page and stood still. clip keeps the sideways guard (html clips too) without that. */
  body{overflow-x:clip}
  @media (prefers-reduced-motion:no-preference){
    .cloudbelt{overflow-x:clip;overflow-y:visible;view-timeline:--belt block;view-timeline-inset:0}
    .cloudbelt .drift{left:calc(-1 * var(--ov));right:calc(-1 * var(--ov));
      animation-timing-function:linear;animation-fill-mode:both;animation-timeline:--belt;animation-range:cover 0% cover 100%}
    .cloudbelt .cb1{animation-name:beltFront}
    .cloudbelt .cb2{animation-name:beltBack}
  }
}
/* GSAP fallback (fine pointer, no scroll-driven animations): same overscan + horizontal clip */
.belt-gsap .cloudbelt{overflow-x:clip;overflow-y:visible}
.belt-gsap .cloudbelt .drift{left:calc(-1 * var(--ov));right:calc(-1 * var(--ov))}
