/* ============================================================================
   WFEMA — cinema.css   ·   VARIANT: "Cinema Sovereign" (v2-cinema)
   Loaded AFTER wfema.css (tokens) and site.css (base layout/motion).
   Adds ONE signature per scene, never two:
     · Hero        — real B-roll video behind the existing layers + green scrim.
     · Scenes      — scroll-driven parallax on decorative layers + rising gap
                     numerals (CSS scroll timelines; graceful no-op fallback).
     · Transitions — a "cartella" top-rounding where a light section covers the
                     dark scene above it.
     · Interstitial— a full-bleed cinematic board-horizon band before the FAQ.
   NEVER redefines a brand token, colour, or font — references var(--token)
   and the literal scrim greens specified in the brief only.
   Every new motion is disabled under prefers-reduced-motion and @media print;
   nothing new may become invisible without JS.
   ============================================================================ */

/* ----------------------------------------------------------------------------
   1. HERO — cinematic B-roll
   The video sits behind the existing hero-glow layer and the new legibility
   scrim; the parchment-on-green text stays comfortably AAA over the scrim.
   The board/grid textures are removed from the hero in this variant (markup).
   ---------------------------------------------------------------------------- */
.hero-video {
  position: absolute;
  inset: 0;
  z-index: 0;                /* behind .layer scrim/glow (auto) and .z1 content */
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  pointer-events: none;
  background: var(--green);  /* colour under the poster while it loads */
}

/* Legibility scrim over the video: the exact green wash from the brief, plus a
   soft radial that darkens the edges. Guarantees the parchment copy is legible
   over any bright frame of the footage. */
.hero-scrim {
  background:
    radial-gradient(ellipse 92% 78% at 50% 40%, transparent 34%, rgba(0,40,28,.48) 100%),
    linear-gradient(rgba(0,66,54,.55), rgba(0,66,54,.72) 60%, #004236 96%);
}

/* ----------------------------------------------------------------------------
   2. SCENE TRANSITIONS — the "cartella" that covers the film
   Light sections that follow a dark (green/ink) scene lift a touch and round
   their top edge, so they read as a title card sliding over the footage.
   Applied only to the dark->light junctions where it reads cleanly:
   #what (after hero) · #how (after gap) · #doors (after workshops) ·
   #faq (after the cinematic band). Layout props are static (no animation).
   ---------------------------------------------------------------------------- */
#what,
#how,
#doors,
#faq {
  position: relative;
  z-index: 1;                /* paint above the darker scene it overlaps */
  margin-top: -22px;
  border-radius: 24px 24px 0 0;
}

/* ----------------------------------------------------------------------------
   3. CINEMATIC BAND — full-bleed board-on-the-horizon interstitial
   Sits between the vision scene and the FAQ. Decorative (aria-hidden, alt="").
   Its one signature is a gentle scroll-driven vertical pan (§5).
   ---------------------------------------------------------------------------- */
.cine-band {
  position: relative;
  height: clamp(180px, 32vw, 400px);
  overflow: hidden;
  background: var(--ink);
}
.cine-band__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 58%;
  transform: scale(1.1);     /* overscan so the pan never reveals an edge */
}
.cine-band__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 62% at 50% 46%, transparent 42%, rgba(6,36,27,.42) 100%),
    linear-gradient(rgba(6,36,27,.34), rgba(6,36,27,.14) 42%, rgba(6,36,27,.52));
}

/* ----------------------------------------------------------------------------
   4. GAP NUMERALS — reserved transform origin
   (animation lives in §5; this keeps the numerals composited on their own layer)
   ---------------------------------------------------------------------------- */
#gap .stat { will-change: transform; }

/* ----------------------------------------------------------------------------
   5. SCROLL-DRIVEN SCENES  (progressive enhancement)
   Only where CSS scroll timelines are supported AND motion is welcome. Without
   support, or under reduced motion, every element renders at rest — the base
   IntersectionObserver reveals already handle section entrances. Transform/
   opacity/filter only; never a layout property.
   ---------------------------------------------------------------------------- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {

    /* (1) decorative layers drift as their scene crosses the viewport */
    #workshops .board-texture {
      animation: sceneParallax linear both;
      animation-timeline: view();
      animation-range: entry 0% exit 100%;
    }
    #vision .hero-glow {
      animation: sceneParallax linear both;
      animation-timeline: view();
      animation-range: entry 0% exit 100%;
      /* this layer is not the animated hero glow, so it does not fight the
         base glowBreathe keyframes (those run only on the hero .hero-glow). */
    }

    /* (2) the oversized gap numerals rise ~24px through the scene */
    #gap .stat {
      animation: gapRise linear both;
      animation-timeline: view();
      animation-range: entry 8% exit 92%;
    }

    /* band pan — the interstitial's single signature */
    .cine-band__img {
      animation: bandPan linear both;
      animation-timeline: view();
    }
  }
}

@keyframes sceneParallax {
  from { transform: translateY(-4%); }
  to   { transform: translateY(4%); }
}
@keyframes gapRise {
  from { transform: translateY(18px); }
  to   { transform: translateY(-6px); }
}
@keyframes bandPan {
  from { transform: scale(1.1) translateY(-3%); }
  to   { transform: scale(1.1) translateY(3%); }
}

/* ----------------------------------------------------------------------------
   6. REDUCED MOTION — freeze everything new, keep everything visible
   The video is paused and its poster shown by the inline hero script; here we
   guarantee no scroll-driven transform lingers and no new element is hidden.
   ---------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  #workshops .board-texture,
  #vision .hero-glow,
  #gap .stat,
  .cine-band__img {
    animation: none !important;
    transform: none !important;
  }
  .cine-band__img { transform: scale(1.02) !important; } /* still fills the band */
  .hero-video { /* poster is shown via the inline script's pause() */ }
}

/* ----------------------------------------------------------------------------
   7. PRINT — static, legible, no JS/scroll dependency
   Show the poster under the green scrim in place of the video; freeze the band;
   drop the cartella overlap so sections read as plain blocks on paper.
   ---------------------------------------------------------------------------- */
@media print {
  .hero-video { display: none !important; }
  .hero {
    background-image:
      linear-gradient(rgba(0,66,54,.55), rgba(0,66,54,.72) 60%, #004236 96%),
      url("assets/hero-queen-1920.webp");
    background-size: cover;
    background-position: center;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  #what, #how, #doors, #faq {
    margin-top: 0;
    border-radius: 0;
  }
  #workshops .board-texture,
  #vision .hero-glow,
  #gap .stat {
    animation: none !important;
    transform: none !important;
  }
  .cine-band { height: 200px; break-inside: avoid; }
  .cine-band__img { animation: none !important; transform: scale(1) !important; }
}
