/* ============================================================================
   RIG site-v2 — CHAPTERED-SCROLL FRAMEWORK (chaptered-scroll.css)

   A reusable guided-scroll system any door page includes to get the blueprint's
   "finite path, not a maze" mechanic:
     • full-bleed chapters (one screen each)
     • chapter ARROWS (down / up)
     • a chapter RAIL showing position (e.g. 2/6) with jump-to-chapter
     • metaphor transition between chapters (fade + lift)
     • an always-visible "↑ doors" home affordance
     • "Book a call" reachable from any chapter (top-nav CTA + per-chapter CTA)

   Markup contract (see chaptered-scroll.js header):
     <div class="cs" data-chaptered-scroll>
       <section class="cs-chapter" data-cs-chapter data-cs-label="Origin"> ... </section>
       ...
     </div>
   The rail + arrows are injected by chaptered-scroll.js.

   Degrades to native vertical scroll on mobile / reduced-motion (the JS sets
   .cs--native), and never lets media sit above the interactive layer
   (z-index contract enforced via nav.css .cs-stage / .cs-ui).
   ============================================================================ */

:root{
  --cs-gold:#C8A96E;
  --cs-gold-light:#D4BC8B;
  --cs-noir:#000;
  --cs-noir-lift:#0A0A0A;
  --cs-stone:#A09890;
  --cs-warm:#F5F0EB;
  --cs-mono:"JetBrains Mono",ui-monospace,monospace;
  --cs-serif:"Cormorant Garamond",Georgia,serif;
  --cs-sans:"Inter",system-ui,-apple-system,sans-serif;
  --cs-ease:cubic-bezier(.16,1,.3,1);
}

/* ---- the scroller ---- */
.cs{position:relative;background:var(--cs-noir);color:var(--cs-warm)}
/* v20 · the page scrolls on the WINDOW; Lenis drives it with smooth momentum when
   motion is enabled (.cs--anim). Chapters keep their one-per-screen rhythm via
   min-height — no hard scroll-snap (it fights smooth scroll + scroll-driven motion). */

.cs-chapter{
  position:relative;
  min-height:100svh;
  display:flex;flex-direction:column;justify-content:center;
  padding:clamp(5rem,12vh,8rem) clamp(1.4rem,7vw,7rem) clamp(4rem,10vh,6rem);
  z-index:var(--z-content,10);
  overflow:hidden;
}

/* ============================================================================
   v20 · CINEMATIC REVEAL CHOREOGRAPHY
   Chapters enter like a film cut: the block rises + settles with a slow expo
   ease, then the typographic atoms inside stagger up behind it. Compositor-only
   (opacity/transform), GPU-hinted, fully disabled under reduced-motion.
   ============================================================================ */
:root{ --cs-expo:cubic-bezier(.16,1,.3,1); }
.cs.cs--anim .cs-chapter > *{
  opacity:0;transform:translateY(48px) scale(.984);
  transition:opacity 1.05s var(--cs-expo),transform 1.15s var(--cs-expo);
  will-change:opacity,transform;
}
/* reveal once a chapter is SEEN (even partially) and KEEP it revealed — .cs-seen is
   added by the observer and never removed, so content in view on load is never stuck
   hidden behind the single-active gate (the haze bug). .is-active still drives chrome. */
.cs.cs--anim .cs-chapter.is-active > *,
.cs.cs--anim .cs-chapter.cs-seen > *{opacity:1;transform:none}

/* the inner atoms choreograph behind the block — eyebrow → title → lede → action */
.cs.cs--anim .cs-chapter :is(.cs-eyebrow,.rig-eyebrow,.num,.mk-head,
  .cs-title,.rig-h2,h1,h2,.cs-lede,.rig-lede,.cs-cta-row,.mk-wrap > *){
  opacity:0;transform:translateY(30px);
  transition:opacity .9s var(--cs-expo),transform 1s var(--cs-expo);
  will-change:opacity,transform;
}
.cs.cs--anim .cs-chapter.is-active :is(.cs-eyebrow,.rig-eyebrow,.num,.mk-head,
  .cs-title,.rig-h2,h1,h2,.cs-lede,.rig-lede,.cs-cta-row,.mk-wrap > *),
.cs.cs--anim .cs-chapter.cs-seen :is(.cs-eyebrow,.rig-eyebrow,.num,.mk-head,
  .cs-title,.rig-h2,h1,h2,.cs-lede,.rig-lede,.cs-cta-row,.mk-wrap > *){opacity:1;transform:none}
.cs.cs--anim .cs-chapter.is-active :nth-child(2){transition-delay:.07s}
.cs.cs--anim .cs-chapter.is-active :nth-child(3){transition-delay:.14s}
.cs.cs--anim .cs-chapter.is-active :nth-child(4){transition-delay:.21s}
.cs.cs--anim .cs-chapter.is-active :nth-child(5){transition-delay:.28s}
.cs.cs--anim .cs-chapter.is-active :nth-child(n+6){transition-delay:.34s}

@media (prefers-reduced-motion:reduce){
  .cs.cs--anim .cs-chapter > *,
  .cs.cs--anim .cs-chapter :is(.cs-eyebrow,.rig-eyebrow,.num,.mk-head,.cs-title,.rig-h2,h1,h2,.cs-lede,.rig-lede,.cs-cta-row,.mk-wrap > *){
    opacity:1 !important;transform:none !important;transition:none !important;will-change:auto}
}

/* ============================================================================
   v20 · ATMOSPHERE — a fixed film-grain + a warm light-fall give the flat cream
   page real depth and a "shot on film" feel. Pure CSS, fixed, pointer-events
   none, sits above content but never blocks a click. Off under reduced-motion.
   ============================================================================ */
html::before{content:"";position:fixed;inset:0;z-index:var(--z-overlay,120);pointer-events:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  opacity:.04;mix-blend-mode:overlay}
html::after{content:"";position:fixed;inset:0;z-index:var(--z-overlay,120);pointer-events:none;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255,250,238,.45), transparent 55%),
    radial-gradient(130% 120% at 50% 115%, rgba(74,52,24,.14), transparent 60%);}
@media (prefers-reduced-motion:reduce){ html::before{display:none} }

/* v20 · refined CTA micro-interaction — a magnetic lift + an arrow that leans in */
.cs-cta--primary,.cs-cta--ghost{position:relative;transition:transform .35s var(--cs-expo,cubic-bezier(.16,1,.3,1)),background .25s,border-color .25s,color .25s,box-shadow .35s}
.cs-cta--primary:hover{transform:translateY(-3px);box-shadow:0 14px 28px -12px rgba(139,111,58,.6)}
.cs-cta--ghost:hover{transform:translateY(-3px)}

/* v20 · DEPTH propagated across the doors — flat card surfaces get light-from-above
   + a cast shadow (Meet Mike's .mm/.essay/.gate handled in-page; this covers the rest) */
.vcard,.ccard,.ben,.rcpt,.cmp-side,.fit-form,.plan .q,.tl-detail,.book-info,.mcard,.step{
  box-shadow:0 1px 0 rgba(255,255,255,.4) inset, 0 16px 38px -28px rgba(80,56,26,.4)}
.vcard,.ccard,.rcpt{transition:transform .42s var(--cs-expo,cubic-bezier(.16,1,.3,1)),box-shadow .42s,border-color .25s,background .25s}
.vcard:hover,.ccard:hover,.rcpt:hover{transform:translateY(-4px);box-shadow:0 1px 0 rgba(255,255,255,.5) inset,0 30px 60px -28px rgba(80,56,26,.5)}

/* ---- chapter media (always below the interactive layer — z contract) ---- */
/* the stage is the chapter's BACKGROUND — it must sit BEHIND the content. (It was
   z-index:5 while content wrappers were z-index:2, so the media + cream scrim painted
   OVER the copy and washed it into a haze. The floor is z:0; content is forced above.) */
.cs-stage{position:absolute;inset:0;z-index:0;overflow:hidden;pointer-events:none}
.cs-chapter > .cs-inner,.cs-chapter > .mk-wrap,.cs-chapter > .mm,
.cs-chapter > .cs-cta-row,.cs-chapter > .cs-eyebrow,.cs-chapter > .cs-title,
.cs-chapter > .cs-lede,.cs-chapter > .rig-eyebrow,.cs-chapter > .rig-h2,.cs-chapter > .rig-lede{position:relative;z-index:1}
.cs-stage::after{content:"";position:absolute;inset:0;
  background:linear-gradient(180deg,rgba(0,0,0,.55),rgba(0,0,0,.78))}
.cs-stage video,.cs-stage img{width:100%;height:100%;object-fit:cover;opacity:.5;transform:scale(1.02)}
/* v20 · slow ken-burns on the active chapter's media — cinematic life, GPU-only */
.cs.cs--anim .cs-chapter.is-active .cs-stage video,
.cs.cs--anim .cs-chapter.is-active .cs-stage img{animation:csKenBurns 22s ease-out both}
@keyframes csKenBurns{from{transform:scale(1.02)}to{transform:scale(1.1)}}
@media (prefers-reduced-motion:reduce){.cs-chapter.is-active .cs-stage video,.cs-chapter.is-active .cs-stage img{animation:none}}

/* ---- typographic atoms ---- */
.cs-eyebrow{font-family:var(--cs-mono);font-size:.66rem;letter-spacing:.28em;text-transform:uppercase;
  color:var(--cs-gold);margin:0 0 1.1rem;display:flex;align-items:center;gap:.7rem}
.cs-eyebrow::before{content:"";width:2.2rem;height:1px;background:var(--cs-gold)}
.cs-title{font-family:var(--cs-serif);font-weight:400;line-height:1.02;letter-spacing:-.01em;
  font-size:clamp(2.4rem,6vw,5rem);margin:0 0 1.2rem;max-width:18ch}
.cs-title em{font-style:italic;color:var(--cs-gold-light)}
.cs-lede{font-size:clamp(1rem,1.5vw,1.25rem);color:#D8D2C8;line-height:1.6;max-width:52ch;margin:0 0 2rem}
.cs-placeholder{font-family:var(--cs-mono);font-size:.7rem;letter-spacing:.18em;text-transform:uppercase;
  color:var(--cs-stone);border:1px dashed rgba(200,169,110,.3);border-radius:3px;
  padding:1rem 1.2rem;max-width:46ch;line-height:1.7}

/* per-chapter CTA row — Book a call reachable from every chapter */
.cs-cta-row{display:flex;flex-wrap:wrap;gap:.9rem;align-items:center;position:relative;z-index:var(--z-ui,40)}
.cs-cta{font-family:var(--cs-mono);font-size:.68rem;letter-spacing:.12em;text-transform:uppercase;
  text-decoration:none;padding:.8rem 1.4rem;border-radius:2px;transition:transform .12s ease,background .25s,border-color .25s,color .25s}
.cs-cta--primary{background:var(--cs-gold);color:#0a0a0a}
.cs-cta--primary:hover{background:var(--cs-gold-light)}
.cs-cta--ghost{background:transparent;border:1px solid rgba(200,169,110,.4);color:var(--cs-gold)}
.cs-cta--ghost:hover{border-color:var(--cs-gold);color:var(--cs-gold-light)}
.cs-cta:active{transform:scale(.96)}
.cs-cta:focus-visible{outline:2px solid var(--cs-gold);outline-offset:3px}

/* ============================================================================
   THE CHAPTER RAIL (injected) — position indicator + jump
   ============================================================================ */
.cs-rail{
  position:fixed;right:clamp(1rem,3vw,2.2rem);top:50%;transform:translateY(-50%);
  z-index:var(--z-ui,40);
  display:flex;flex-direction:column;align-items:center;gap:.65rem;
}
.cs-rail__count{font-family:var(--cs-mono);font-size:.6rem;letter-spacing:.14em;color:var(--cs-gold-light);
  margin-bottom:.4rem;white-space:nowrap}
.cs-rail__count b{color:var(--cs-warm)}
.cs-rail__dot{
  width:11px;height:11px;border-radius:50%;border:1px solid rgba(200,169,110,.5);
  background:transparent;cursor:pointer;padding:0;position:relative;
  transition:background .25s,border-color .25s,transform .2s;
}
.cs-rail__dot::after{content:attr(data-label);position:absolute;right:1.7rem;top:50%;transform:translateY(-50%);
  font-family:var(--cs-mono);font-size:.58rem;letter-spacing:.1em;text-transform:uppercase;color:var(--cs-stone);
  white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .2s}
.cs-rail__dot:hover,.cs-rail__dot:focus-visible{border-color:var(--cs-gold);transform:scale(1.2)}
.cs-rail__dot:hover::after,.cs-rail__dot:focus-visible::after{opacity:1}
.cs-rail__dot:focus-visible{outline:2px solid var(--cs-gold);outline-offset:3px}
.cs-rail__dot.is-active{background:var(--cs-gold);border-color:var(--cs-gold)}

/* ============================================================================
   CHAPTER ARROWS (injected) — down / up
   ============================================================================ */
.cs-arrows{
  position:fixed;right:clamp(1.2rem,4vw,3rem);bottom:clamp(1.6rem,5vh,2.6rem);
  z-index:var(--z-ui,40);display:flex;gap:.55rem;
}
.cs-arrow{
  width:2.9rem;height:2.9rem;border-radius:50%;
  border:1px solid rgba(200,169,110,.4);background:rgba(0,0,0,.55);
  color:var(--cs-gold);cursor:pointer;font-size:1rem;line-height:1;
  display:flex;align-items:center;justify-content:center;
  transition:border-color .2s,background .2s,transform .12s,opacity .2s;
}
.cs-arrow:hover{border-color:var(--cs-gold);background:rgba(0,0,0,.8)}
.cs-arrow:active{transform:scale(.92)}
.cs-arrow:focus-visible{outline:2px solid var(--cs-gold);outline-offset:2px}
.cs-arrow[disabled]{opacity:.3;cursor:default;pointer-events:none}

/* ============================================================================
   "↑ DOORS / HOME" — always-visible back-out to the front door
   ============================================================================ */
.cs-home{
  position:fixed;left:clamp(1rem,3vw,2rem);bottom:clamp(1.6rem,5vh,2.6rem);
  z-index:var(--z-ui,40);
  font-family:var(--cs-mono);font-size:.6rem;letter-spacing:.16em;text-transform:uppercase;
  color:var(--cs-gold);text-decoration:none;
  border:1px solid rgba(200,169,110,.4);background:rgba(0,0,0,.55);
  padding:.7rem 1rem;border-radius:3px;
  transition:border-color .2s,background .2s,color .2s;
}
.cs-home:hover{border-color:var(--cs-gold);color:var(--cs-gold-light);background:rgba(0,0,0,.8)}
.cs-home:focus-visible{outline:2px solid var(--cs-gold);outline-offset:2px}

/* a tiny scroll cue on the first chapter */
.cs-cue{position:absolute;left:50%;bottom:1.8rem;transform:translateX(-50%);
  font-family:var(--cs-mono);font-size:.56rem;letter-spacing:.24em;text-transform:uppercase;color:var(--cs-stone);
  z-index:var(--z-ui,40);opacity:.7;animation:csCue 2.4s ease-in-out infinite}
@keyframes csCue{0%,100%{transform:translate(-50%,0)}50%{transform:translate(-50%,6px)}}

/* ============================================================================
   MOBILE + REDUCED-MOTION — native scroll, no snap hijack, simpler chrome.
   ============================================================================ */
.cs.cs--native{height:auto;overflow:visible;scroll-snap-type:none}
.cs.cs--native .cs-chapter{min-height:auto;padding-top:6.5rem}
.cs.cs--native .cs-chapter > *{opacity:1;transform:none}
.cs.cs--native .cs-arrows{display:none}   /* native scroll handles travel */

@media (max-width:760px){
  .cs-rail{right:.7rem;gap:.5rem}
  .cs-rail__dot::after{display:none}      /* no hover labels on touch */
  .cs-arrows{display:none}
  .cs-home{left:.7rem;bottom:.9rem}
}
@media (prefers-reduced-motion:reduce){
  .cs.cs--anim{scroll-behavior:auto}
  .cs-chapter > *{opacity:1 !important;transform:none !important;transition:none !important}
  .cs-cue{animation:none}
}
