/* ═══════════════════════════════════════════════════════════════
   HOME — Project RA teardown sequence (scroll-scrubbed)

   A pinned stage holding a 31-frame WebP sequence of the Super Shock
   coming apart, scrubbed by scroll, handing off to video. The frames are
   rendered offline from the Three.js teardown scene in the concept repo
   (revamp/tools/render-sequence.html); nothing here needs Three.js or
   GSAP at runtime, so this section does not depend on the GSAP bundle
   functions.php loads for the hero.

   Markup lives in Pages -> Home, Elementor HTML widget (container appended
   2026-10-07). This file is enqueued by superfly_home_sequence_assets().

   ── colours ──
   Everything below uses the theme palette, not hardcoded hex. The concept
   version of this section used #FF19AB, which is the magenta recorded in
   the project docs; the live theme ships accent-1 as #ec1e79. The live
   theme is the source of truth here, so this uses the preset var and will
   follow the theme if it is ever corrected.
   ═══════════════════════════════════════════════════════════════ */

.sf-sequence,
.sf-sequence *{
  /* declared on the ROOT as well as descendants on purpose. Elementor's
     frontend CSS sets box-sizing on `.elementor *` — descendants only — so
     a root left at content-box measures differently inside the builder than
     outside it, and a max-width silently means two different things. Stating
     it here makes this section render identically either way. */
  box-sizing:border-box;
}

.sf-sequence{
  position:relative;

  /* z-index 2 is REQUIRED, not decoration. The Project RP container above
     this one (Elementor `sfrp01`) is `position:sticky; top:0; z-index:1`,
     and its sticky containing block is the whole Elementor page wrapper —
     so once it reaches the top of the viewport it stays stuck there for the
     rest of the page, painting over everything that follows.

     `.sf-dealers` already carries `z-index:2` for exactly this reason. Every
     section placed after the livery needs it. Without it this section
     renders perfectly and is simply covered — assets load, the scrub runs,
     and nothing is visible, which looks like a failed deploy. */
  z-index:2;
  /* NO overflow:hidden. position:sticky does not stick inside a clipping
     ancestor, and the pin below is the whole point of this section. */
  padding:clamp(72px,10vh,140px) clamp(20px,5vw,80px);
  background:
    radial-gradient(120% 60% at 50% 0%,
      color-mix(in srgb, var(--wp--preset--color--accent-1) 9%, transparent),
      transparent 62%),
    var(--wp--preset--color--base, #171717);
  color:var(--wp--preset--color--contrast, #f2f2f4);
}

/* ───────────────────────  head  ─────────────────────── */

.sf-sequence__head{
  max-width:var(--sf-measure-box);
  margin:0 auto clamp(28px,4vh,56px);
  text-align:center;
}

.sf-sequence__eyebrow{
  margin:0 0 14px;
  font-family:'Chakra Petch', system-ui, sans-serif;
  font-weight:600;
  font-size:13px;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:var(--wp--preset--color--accent-1, #ec1e79);
}

.sf-sequence__title{
  margin:0 0 16px;
  font-family:'Archivo Black', 'Arial Black', sans-serif;
  font-size:clamp(30px,4.6vw,58px);
  line-height:1.02;
  letter-spacing:-.02em;
  text-transform:uppercase;
  color:var(--wp--preset--color--contrast, #f2f2f4);
}

.sf-sequence__intro{
  max-width:54ch;
  margin:0 auto;
  font-family:'Archivo', system-ui, sans-serif;
  font-size:16px;
  line-height:1.65;
  color:var(--wp--preset--color--accent-4, rgba(242,242,244,.58));
}

/* ───────────────────────  the pin  ───────────────────────
   The runway IS the scroll budget: the sticky child is 100vh, so the extra
   50vh is scroll that happens while the stage is held still. Shorten the
   runway and the sequence scrubs faster. */

.sf-sequence__runway{
  position:relative;
  height:150vh;
}

.sf-sequence__screen{
  position:sticky;
  top:0;
  height:100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:clamp(14px,2.5vh,28px);
}

.sf-sequence__stage{
  position:relative;
  width:min(62vh, 86vw, 620px);
  max-width:92vw;
  aspect-ratio:1 / 1;
}

/* a soft accent bloom under the product, so a cut-out render does not read
   as pasted onto the page */
.sf-sequence__stage::before{
  content:'';
  position:absolute;
  left:50%; top:52%;
  width:78%; aspect-ratio:1 / 1;
  transform:translate(-50%,-50%);
  background:radial-gradient(circle,
    color-mix(in srgb, var(--wp--preset--color--accent-1) 16%, transparent) 0%,
    color-mix(in srgb, var(--wp--preset--color--accent-1) 5%, transparent) 42%,
    transparent 68%);
  pointer-events:none;
}

.sf-sequence__layer{
  position:absolute;
  inset:0;
  /* deliberately no transition: these are scrubbed every frame, and a
     transition on a value that is already updating per frame only adds lag
     behind the scroll */
}

.sf-sequence__layer img,
.sf-sequence__layer video{
  display:block;
  width:100%;
  height:100%;
}

.sf-sequence__layer--frames img{ object-fit:contain; }

.sf-sequence__layer--clip{ opacity:0; }
.sf-sequence__layer--clip video{
  object-fit:cover;
  border-radius:6px;
  border:1px solid var(--wp--preset--color--accent-5, rgba(242,242,244,.12));
}

/* edges fall off into the page instead of ending on a hard rectangle */
.sf-sequence__scrim{
  position:absolute;
  inset:0;
  border-radius:6px;
  pointer-events:none;
  background:
    radial-gradient(120% 120% at 50% 45%, transparent 52%,
      color-mix(in srgb, var(--wp--preset--color--base) 55%, transparent) 100%),
    linear-gradient(to top,
      color-mix(in srgb, var(--wp--preset--color--base) 45%, transparent),
      transparent 38%);
}

.sf-sequence__caption{
  max-width:52ch;
  margin:0;
  text-align:center;
  font-family:'Archivo', system-ui, sans-serif;
  font-size:15px;
  line-height:1.7;
  color:var(--wp--preset--color--accent-4, rgba(242,242,244,.58));
  opacity:0;            /* raised with the clip by home-sequence.js */
}

/* ───────────────────────  narrow  ─────────────────────── */

@media (max-width:900px){
  /* a shorter runway so the pin does not eat three phone screens */
  .sf-sequence__runway{ height:128vh; }
}

/* ───────────────────────  reduced motion  ───────────────────────
   The JS separately pins the scrub at its end state and never autoplays
   the clip; this just removes the pin so nothing is held. */

@media (prefers-reduced-motion: reduce){
  .sf-sequence__runway{ height:auto; }
  .sf-sequence__screen{ position:static; height:auto; padding-block:40px; }
  .sf-sequence__caption{ opacity:1; }
}
