/* Scroll reveal: the copy bands fade up as you arrive at them.
 *
 * Ported from playground/css_animations/final (assets/landing.css:253-257 plus
 * the observer at landing.en.html:726-730). The numbers below are that page's,
 * not new ones — it is a graft of something already tuned on a real page.
 *
 * Load AFTER base.css / glass.css and BEFORE each file's own <style>, the same
 * slot glass.css documents, so a variation can still override any of this.
 *
 * The moving half lives in reveal.js. This file only describes the two states;
 * it never decides WHICH elements are in them — that is the selector below,
 * and reveal.js repeats it verbatim. Change one, change the other.
 */

:root {
  /* OUR OWN easing token, deliberately not the bare `--ease`.
     `--ease` is defined TWICE in assets/ with different curves — base.css:16
     is cubic-bezier(0.4, 0, 0.2, 1), wall.css:15 is cubic-bezier(0.22, 0.61,
     0.36, 1) — so a page referencing it would get whichever stylesheet the
     cascade happened to land on last. That is not a choice, it is an accident,
     and it would silently change the feel of every reveal the day someone
     reorders a <link>. The value here is the one the reference page actually
     ran (its inline <style> overrode wall.css), so this is the port. */
  --reveal-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* THE .js GATE. The class is added by an inline <head> script that runs before
   first paint, so the hidden state exists from the very first frame — no flash
   of content that then hides itself. Just as important is the failure mode: if
   the script never runs (JS off, blocked, a crawler), the class never lands,
   none of this applies, and the page is simply readable. A page whose entire
   job is to be read must never be able to end up permanently blank.

   THE SELECTOR — what is in, and the two things deliberately left out.

   In: the direct .wrap child of every content section. That is the band of
   copy, and it is the same hook the reference used (its seven revealed
   elements were all `<div class="wrap reveal">`). The <header> and <footer>
   wraps are not inside a .sec, so they are untouched, which also matches.

   Out 1 — .hero. It is above the fold. Fading in the page you have only just
   landed on is not a reveal, it is a stall. The reference leaves its hero as a
   plain .wrap for the same reason.

   Out 2 — .carousel-block / .carousel, and every .wrap inside them
   (.carousel-head, .carousel-bar, .ring-bar, .ring-grid, .demo-bar,
   .demo-rail, .demo-note — the set differs per variation). This one is NOT
   taste, it is correctness: a `transform` on an ancestor of the preserve-3d
   ring establishes a containing block and flattens the 3D wall. Put reveal on
   those wraps and the carousel visibly breaks. Do not "fix" this by adding
   them back.

   The `> ` matters for V6, which nests its whole carousel section inside
   `.hero .wrap` as a grid child. Hero is excluded outright, so the wall is
   safe there twice over, but the child combinator is what keeps the exclusion
   from depending on how deep a variation happens to nest a section. */
.js .sec:not(.hero):not(.carousel-block):not(.carousel) > .wrap {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--reveal-ease), transform 0.7s var(--reveal-ease);
}

/* `transform: none`, not `translateY(0)`. Once a band has arrived it must stop
   being a containing block entirely, so nothing downstream inherits a stacking
   context it did not ask for. */
.js .sec:not(.hero):not(.carousel-block):not(.carousel) > .wrap.in {
  opacity: 1;
  transform: none;
}

/* Reduced motion does not mean "the same animation, faster" — it means the
   content is simply there. Nothing hidden, nothing to transition. reveal.js
   still adds .in; this rule makes that a no-op. */
@media (prefers-reduced-motion: reduce) {
  .js .sec:not(.hero):not(.carousel-block):not(.carousel) > .wrap {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
