/* ==========================================================================
   Polish pass. Loaded last.
     1  chapter doors on phones: a statement that sits on the arriving sheet, no empty screen
     2  section rhythm on phones: no stacked paddings between the plans and the closing ask
     3  card visuals: a glass window with a crystal illustration and native labels
     4  How it works: light panel with depth, a line that draws through the three steps
     5  entrances follow the scroll where the browser can do it (view timelines), and
        fall back to the one-shot reveals everywhere else
   ========================================================================== */

/* ---------- 3  card visuals ---------- */
.ecard-vis,.stage-frame,.path{overflow:clip}
.chap-body.cut .ecard-vis>.gv,.ecard-vis>.gv{position:absolute}
.gv{
  inset:8% 7%;z-index:1;border-radius:16px;display:grid;place-items:center;
  background:linear-gradient(150deg,rgba(255,255,255,.17) 0,rgba(255,255,255,.05) 40%,rgba(22,96,84,.12) 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.42),inset 0 0 0 1px rgba(255,255,255,.14),0 26px 50px -26px rgba(0,0,0,.75);
}
/* edge light in the scene's own gold and teal */
.gv::before{
  content:"";position:absolute;inset:0;border-radius:inherit;padding:1.5px;pointer-events:none;
  background:linear-gradient(135deg,rgba(244,208,120,1) 0,rgba(244,208,120,.3) 22%,rgba(255,255,255,.14) 50%,rgba(84,214,182,.34) 76%,rgba(84,214,182,1) 100%);
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;
          mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0);
}
/* window dots, top right */
.gv::after{
  content:"";position:absolute;right:13px;top:14px;width:30px;height:6px;pointer-events:none;opacity:.7;
  background:radial-gradient(circle at 3px 3px,#fff 2.6px,transparent 3px) 0 0/12px 6px repeat-x;
}
.gv-art{position:relative;display:block;width:70%;height:70%;object-fit:contain;translate:-3% -4%;filter:drop-shadow(0 16px 22px rgba(0,0,0,.42))}
.gv-chip{
  position:absolute;z-index:2;display:inline-flex;align-items:center;gap:7px;white-space:nowrap;
  font-size:11.5px;line-height:1;letter-spacing:0;color:#fff;padding:7px 11px;border-radius:999px;
  background:rgba(9,9,9,.5);box-shadow:inset 0 0 0 1px rgba(255,255,255,.2);
}
.gv-a{left:9px;top:9px}
.gv-b{right:9px;bottom:9px}
.gv-b::before{content:"";width:6px;height:6px;border-radius:50%;background:#e8c56d;box-shadow:0 0 8px rgba(232,197,109,.9)}
/* the window keeps most of the scene: a light pool only */
.chap-body.cut .ecard-vis::after{background:radial-gradient(70% 70% at 50% 54%,rgba(9,9,9,.34),rgba(9,9,9,.16) 62%,transparent 100%)}
@media(min-width:821px) and (hover:hover){.gv{-webkit-backdrop-filter:blur(7px) saturate(1.25);backdrop-filter:blur(7px) saturate(1.25)}}
@media(max-width:767px){
  .gv{inset:7% 6%;border-radius:18px}
  .gv-chip{font-size:12.5px;padding:8px 12px}
  .gv-a{left:10px;top:10px}.gv-b{right:10px;bottom:10px}
}

/* ---------- 4  How it works ---------- */
#how.inverse{
  position:relative;
  background:
    radial-gradient(90% 60% at 100% 0,rgba(47,143,108,.14),transparent 60%),
    radial-gradient(80% 55% at 0 100%,rgba(214,170,84,.17),transparent 62%),
    linear-gradient(180deg,#fcfbf7 0,#f1efe8 100%);
  box-shadow:
    inset 0 1px 0 #fff,inset 0 0 0 1px rgba(9,9,9,.05),inset 0 -34px 60px -44px rgba(11,58,56,.22),
    0 0 0 1px rgba(255,255,255,.1),0 34px 70px -34px rgba(0,0,0,.7),0 0 70px -18px rgba(47,143,108,.32);
}
#how .sec-head h2{max-width:none}
.steps3{position:relative;--sp:1;gap:28px;padding-top:44px}
.steps3 article{position:relative;border-top:0;padding-top:0;gap:10px}
.steps3 article::before{
  font-size:clamp(34px,4.2vw,56px);letter-spacing:-.055em;line-height:1;margin-bottom:clamp(6px,1.4vw,18px);
  color:#0b3a38;transition:color .6s var(--ease);
}
/* the line: a faint track, and a fill that the scroll draws from step one to step three */
.steps3::before,.steps3::after{content:"";position:absolute;left:6px;top:6px;height:2px;width:var(--rail,66.6%);border-radius:2px;pointer-events:none}
.steps3::before{background:rgba(9,9,9,.1)}
.steps3::after{
  background:linear-gradient(90deg,#d6aa54 0,#2f8f6c 58%,#0b3a38 100%);
  transform:scaleX(var(--sp));transform-origin:0 50%;transition:transform .28s linear;will-change:transform;
}
.steps3 article::after{
  content:"";position:absolute;left:0;top:-44px;width:14px;height:14px;border-radius:50%;z-index:1;
  background:#2f8f6c;box-shadow:0 0 0 2px #2f8f6c,0 0 0 7px rgba(47,143,108,.16),0 0 20px rgba(214,170,84,.7);
  transition:background .5s var(--ease),box-shadow .5s var(--ease),transform .5s var(--ease);
}
/* waiting state exists only while the scroll is driving it */
.steps3.live article:not(.on)::before{color:rgba(9,9,9,.26)}
.steps3.live article:not(.on)::after{background:#f6f4ee;box-shadow:0 0 0 2px rgba(9,9,9,.2),0 0 0 7px rgba(47,143,108,0),0 0 0 rgba(214,170,84,0);transform:scale(.82)}
.steps3.live article h3,.steps3.live article p{transition:opacity .6s var(--ease)}
.steps3.live article:not(.on) h3{opacity:.7}
.steps3.live article:not(.on) p{opacity:.8}
.proof{border-top:0;position:relative}
.proof::before{content:"";position:absolute;left:0;right:0;top:0;height:1px;background:linear-gradient(90deg,rgba(214,170,84,.7),rgba(47,143,108,.5) 40%,transparent 86%)}
@media(max-width:780px){
  #how.inverse{padding-block:38px 40px;margin-inline:6px}
  #how .sec-head{margin-bottom:26px}
  #how .sec-head h2{max-width:none;font-size:clamp(29px,8.5vw,36px);line-height:1.02;text-wrap:initial}
  .steps3{gap:30px;padding:0 0 0 44px}
  .steps3::before,.steps3::after{left:12px;top:20px;width:2px;height:var(--rail,calc(100% - 150px))}
  .steps3::after{background:linear-gradient(180deg,#d6aa54 0,#2f8f6c 58%,#0b3a38 100%);transform:scaleY(var(--sp));transform-origin:50% 0}
  .steps3 article::after{left:-38px;top:13px}
  .steps3 article::before{font-size:40px;margin-bottom:6px}
  .steps3 h3{font-size:21px}
  .proof{margin-top:34px;padding-top:22px}
}

/* ---------- composer in the closing ask: the button sits under the field on phones ---------- */
@media(max-width:560px){
  .close .composer form{flex-direction:column;align-items:stretch;gap:10px;padding:6px 14px 14px 16px}
  .close .composer textarea{min-height:48px;flex:none;font-size:16px}
  .close .composer .send{justify-content:center;height:46px}
}

/* ---------- 1 + 2  phones ---------- */
@media(max-width:767px){
  /* hero lets go sooner: the first chapter is already rising when the hero copy fades */
  .pinm .hero-pin{height:calc(var(--hero-h,100svh) + 132svh)}

  /* door: the scene opens above, the statement rides on the edge of the sheet that follows */
  .chap .chap-door{min-height:0;align-items:flex-end;padding:clamp(130px,27svh,250px) 0 66px}
  .chap .chap-door::before{background:linear-gradient(180deg,transparent 0,rgba(9,9,9,.14) 26%,rgba(9,9,9,.6) 58%,rgba(9,9,9,.84) 100%)}
  .chap .door-eyebrow{margin-bottom:12px;text-shadow:0 1px 10px rgba(0,0,0,.8),0 0 2px rgba(0,0,0,.6)}
  .chap .door-sub{margin-top:14px;font-size:clamp(26px,7.5vw,34px);line-height:1.04;letter-spacing:-.045em;max-width:13ch;text-wrap:balance}
  .door-jobs{display:flex;flex-wrap:wrap;gap:8px;margin:22px 0 0;padding:0;list-style:none}
  .door-jobs li{font-size:13px;line-height:1;padding:9px 13px;border-radius:999px;color:#fff;background:rgba(255,255,255,.1);box-shadow:inset 0 0 0 1px rgba(255,255,255,.24)}

  /* rhythm: one gap of the same size (--gap, text to text) between every section, never paddings stacked */
  .chap.tail{--gap:104px}
  #result{padding-block:calc(var(--gap) - 21px) 64px;margin-bottom:0}
  #apps{padding-block:calc(var(--gap) - 64px) var(--gap)}
  #start{padding-block:var(--gap) 0}
  .chap.tail .chap-body{padding-bottom:0}
  .close{padding-block:104px 56px}
  .close::before{background:linear-gradient(to bottom,#090909 0,rgba(9,9,9,.4) 34%,rgba(9,9,9,.4) 70%,#090909 100%)}
  footer{padding-top:22px}
}
@media(min-width:768px){#visibility .chap-door::before{background:linear-gradient(90deg,rgba(9,9,9,.5) 0,rgba(9,9,9,.46) 30%,rgba(9,9,9,.3) 44%,rgba(9,9,9,.1) 56%,transparent 66%)}.door-jobs{display:none}#start{padding-bottom:clamp(36px,6vh,64px)}.gv-chip{font-size:11px;padding:6px 10px}}
/* a sliver of the pinned scene must never show under the last sheet */
.chap .chap-body.cut{background:linear-gradient(#090909,#090909) 0 100%/100% 4px no-repeat}

/* ---------- 5  entrances that follow the scroll ---------- */
/* Phones keep the timed entrances (content drifts in once as it arrives, door words rise on a clock):
   a swipe moves the page too fast for a scroll-linked fade to be seen, and every scroll-linked element
   costs the main thread on each frame. */
@supports (animation-timeline:view()){
  @media(prefers-reduced-motion:no-preference) and (min-width:768px){
    /* door copy: each word rises as the block comes up the screen, and the block lifts away as it leaves */
    .fx .door-inner{view-timeline:--dcopy block;animation:door-leave linear both;animation-timeline:view();animation-range:exit 6% exit 86%}
    .fx .chap-door[data-in] .dw-i{
      animation:dw-rise linear both;animation-timeline:--dcopy;
      animation-range:entry calc(var(--wi,0) * 4%) entry calc(68% + var(--wi,0) * 4%);
    }
    .fx .door-jobs li{animation:rv-flow linear both;animation-timeline:--dcopy;animation-range:entry 70% entry 100%}
    /* content: fades up over the first quarter of its way up the screen; later items trail a little */
    .js [data-rv]:not(.close [data-rv]){
      opacity:1;transform:none;transition:none;
      animation:rv-flow linear both;animation-timeline:view();
      animation-range:entry 0% cover calc(13% + var(--rv-i,0) * 4%);
    }
    /* card illustration drifts inside its window the whole way through */
    .js .gv-art{animation:gv-drift linear both;animation-timeline:view();animation-range:cover 0% cover 100%}
  }
}
@keyframes dw-rise{from{transform:translateY(calc(100% + .1em))}to{transform:none}}
@keyframes door-leave{from{opacity:1;transform:none}to{opacity:0;transform:translate3d(0,-26px,0)}}
@keyframes rv-flow{from{opacity:0;transform:translate3d(0,34px,0)}55%{opacity:1}to{opacity:1;transform:none}}
@keyframes gv-drift{from{transform:translate3d(0,16px,0) scale(.94)}to{transform:translate3d(0,-12px,0) scale(1.03)}}

@media(max-width:767px) and (prefers-reduced-motion:no-preference){
  .gv-art{filter:none}
}

/* ---------- 6  scroll cost ----------
   --arch-k and --e are written on every frame of a scroll. As ordinary custom properties they inherit, so each
   write restyled a whole chapter (hundreds of elements). Registered as non-inheriting they restyle only the
   elements that draw with them; the sheet and its arch opt back in by name. */
@property --arch-k{syntax:"<number>";inherits:false;initial-value:.25}
@property --e{syntax:"<number>";inherits:false;initial-value:1}
.chap>.chap-body,.chap>.chap-body::before{--arch-k:inherit}

@media(prefers-reduced-motion:reduce){
  .steps3::after{transition:none}
  .steps3 article::before,.steps3 article::after{transition:none}
}

/* ---------- 7  card visuals are product screens ----------
   The window is an app window: a title bar in native type (what it is, and its state) over a sample screen. The scene still shows around the window. No blur behind it any more: the window is opaque, so the
   blur did nothing but cost. */
.gv{overflow:clip;background:#0b1016;display:grid;grid-template:auto minmax(0,1fr)/minmax(0,1fr) auto;place-items:stretch;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
.gv::before{z-index:4}
.gv::after{display:none}
.gv-art{grid-area:2/1/3/3;width:100%;height:100%;min-height:0;object-fit:contain;translate:none;filter:none!important}
.gv .gv-chip{position:relative;inset:auto;z-index:3;border-radius:0;justify-content:flex-start;background:#10161d;box-shadow:none;padding:8px 12px;color:rgba(255,255,255,.92)}
.gv .gv-a{grid-area:1/1;border-bottom:1px solid rgba(255,255,255,.09);font-weight:500;overflow:hidden;text-overflow:ellipsis}
.gv .gv-b{grid-area:1/2;border-bottom:1px solid rgba(255,255,255,.09);color:rgba(255,255,255,.8);font-size:11px}
.chap-body.cut .ecard-vis::after{background:radial-gradient(70% 70% at 50% 54%,rgba(9,9,9,.3),rgba(9,9,9,.12) 62%,transparent 100%)}
@keyframes gv-drift{from{transform:translate3d(0,4px,0)}to{transform:translate3d(0,-4px,0)}}


/* ---------- 8  chapter doors: always readable, and one flowing hand-over between chapters ----------
   Door copy (title, statement, chips) is plain text, visible by default. The word-by-word rise exists only on
   desktop (html.fx, set by site.js for a fine pointer on a wide screen); anywhere else there are no wrappers, no
   clip boxes and no hidden start state, so no script, clock or observer stands between the page and its text.
   The rules below make that hold even if a split were ever present off desktop. */
html:not(.fx) .dw{overflow:visible}
html:not(.fx) .dw-i{transform:none!important;animation:none!important;will-change:auto}
html:not(.fx) .door-jobs li{opacity:1!important}

@media(max-width:767px){
  /* spacing: one full gap above a door (to a soft edge), less under it */
  #content .chap-body,#followup .chap-body{padding-bottom:104px}
  .chap .chap-body{padding-top:40px}
  #followup,#visibility{margin-top:0;border-radius:0}
  .chap .chap-door{padding:clamp(150px,31svh,290px) 0 48px}
  /* top edge: the scene comes out of the page instead of starting at a line */
  #followup .chap-door::after,#visibility .chap-door::after{
    content:"";display:block;position:absolute;left:0;right:0;top:-1px;bottom:auto;height:clamp(96px,19svh,180px);z-index:0;pointer-events:none;border-radius:0;
    background:linear-gradient(180deg,#090909 0,rgba(9,9,9,.86) 22%,rgba(9,9,9,.38) 62%,rgba(9,9,9,0) 100%);
  }
  /* bottom edge: the shade behind the copy runs on into what follows. A chapter whose sheet starts right under the
     door ends in the sheet's own colour; the open chapter hands the same shade on to the header under it. */
  .chap .chap-door::before{background:linear-gradient(180deg,rgba(9,9,9,0) 0,rgba(9,9,9,.14) 26%,rgba(9,9,9,.58) 54%,rgba(9,9,9,.78) 76%,#090909 96%)}
  #followup .chap-door::before{bottom:-120px;background:linear-gradient(180deg,rgba(9,9,9,0) 0,rgba(9,9,9,.14) calc((100% - 120px) * .26),rgba(9,9,9,.58) calc((100% - 120px) * .54),rgba(9,9,9,.58) calc(100% - 120px),rgba(9,9,9,0) 100%)}
  /* the two shades cross over the same 120px, each ending at nothing, so neither has an edge to show */
  #followup .chap-body[data-open-top]::after{background:linear-gradient(to bottom,rgba(9,9,9,0) 0,rgba(9,9,9,.52) 120px,rgba(9,9,9,.52) calc(var(--duo-b,38%) - 2%),rgba(9,9,9,.1) calc(var(--duo-b,38%) + 9%),rgba(9,9,9,.1) 100%)}
}

/* The hand-over itself follows the scroll, on the compositor (opacity and transform only), where the browser has
   view timelines. Without them, or with reduced motion, everything above is simply in place. Nothing here can hide
   door copy: the copy only ever moves a few pixels. */
@supports (animation-timeline:view()){
  @media(max-width:767px) and (prefers-reduced-motion:no-preference){
    /* 1  the list above lets go as it leaves the top of the screen */
    #content .itemgrid,#followup .itemgrid{animation:sec-leave linear both;animation-timeline:view();animation-range:exit 0% exit 100%}
    /* 2  the scene comes up out of the dark and grows to size while the door is pulled up */
    #followup>.chap-bg,#visibility>.chap-bg{animation:bg-in linear both;animation-timeline:--chap;animation-range:entry 0% entry 72%}
    #followup .chap-bg .scene,#visibility .chap-bg .scene{animation:chap-par-in linear both;animation-timeline:--chap;animation-range:cover}
    /* 3  the copy settles: it trails the page by a few pixels and lands as the door fills the screen */
    .chap .door-inner{animation:door-settle linear both;animation-timeline:view();animation-range:entry 0% entry 100%}
  }
}
@keyframes sec-leave{from{opacity:1;transform:none}to{opacity:.3;transform:translate3d(0,-10px,0)}}
@keyframes bg-in{from{opacity:.18}to{opacity:1}}
@keyframes chap-par-in{from{transform:translate3d(0,-4lvh,0) scale(1.005)}13%{transform:translate3d(0,-3lvh,0) scale(1.08)}to{transform:translate3d(0,4lvh,0) scale(1.08)}}
@keyframes door-settle{from{transform:translate3d(0,38px,0)}to{transform:none}}

/* ---------- Ad Management section: reuses the chapter header (duo) and itemised list ---------- */
.ads{padding-block:clamp(24px,5vh,56px) clamp(24px,5vh,56px)}
.ads .chan{gap:clamp(28px,4vw,48px)}
.ads-eyebrow{display:block;margin-bottom:14px;font-size:12px;letter-spacing:.14em;text-transform:uppercase;color:#fff}
.ads .duo-side{padding-top:clamp(0px,2.2vw,30px)}
.ads-list{list-style:none;margin:0;padding:0;grid-template-columns:1fr}
.ads-list li{display:block;padding:15px 0;font-size:clamp(13px,1.1vw,15px);line-height:1.45;color:rgba(255,255,255,.8);border-bottom:1px solid rgba(255,255,255,.08)}
