/* ==========================================================================
   REBELL ENGINEERS — motion
   ---------------------------------------------------------------------------
   One orchestrated moment when the hero paints, quiet fade-ups as sections
   arrive, and scroll-linked parallax fed by a --px custom property. Transform
   and opacity only, so nothing triggers layout. Without JavaScript the page
   renders fully visible; prefers-reduced-motion stops all of it.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hero opening sequence
   -------------------------------------------------------------------------- */
.js .open .hero__kick,
.js .open .hero h1 .l > span,
.js .open .open__note,
.js .open .open__do {
  opacity: 0;
  transform: translateY(32px);
}

.open.ready .hero__kick,
.open.ready .hero h1 .l > span,
.open.ready .open__note,
.open.ready .open__do {
  opacity: 1;
  transform: none;
  transition: opacity 0.85s var(--ease-out), transform 1.1s var(--ease-out);
}

.open.ready .hero__kick { transition-delay: 0.05s; }
.open.ready .hero h1 .l:nth-child(1) > span { transition-delay: 0.16s; }
.open.ready .hero h1 .l:nth-child(2) > span { transition-delay: 0.26s; }
.open.ready .hero h1 .l:nth-child(3) > span { transition-delay: 0.36s; }
.open.ready .open__note { transition-delay: 0.46s; }
.open.ready .open__do { transition-delay: 0.56s; }

.js .hero__bar { transform: translateY(100%); }
.open.ready .hero__bar {
  transform: none;
  transition: transform 0.9s var(--ease-out) 0.6s;
}

/* The capacities band rises into place under the hero */
.js .open .caps { opacity: 0; transform: translateY(34px); }
.open.ready .caps,
.caps.on {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s var(--ease-out) 0.7s, transform 1s var(--ease-out) 0.7s;
}

/* --------------------------------------------------------------------------
   Section reveals
   -------------------------------------------------------------------------- */
.js [data-in] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-out), transform 0.95s var(--ease-out);
}
.js [data-in="left"] { transform: translateX(-32px); }
.js [data-in="right"] { transform: translateX(32px); }
.js [data-in="still"] { transform: none; }
[data-in].on { opacity: 1; transform: none; }

/* Grid and reel children arrive in sequence; the delay is written by the script */
.js [data-seq] > * {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.85s var(--ease-out),
    box-shadow var(--slow) var(--ease-out),
    border-color var(--fast) var(--ease-soft);
}
[data-seq].on > * {
  opacity: 1;
  transform: none;
  transition-delay: var(--d, 0s);
}
.js [data-seq] > .build__split { transform: translateY(10px); }

/* The reveal above resets transform on every child of a [data-seq], which at
   equal specificity would cancel a card's hover lift. Restated to win. */
[data-seq].on > .bcard:hover,
[data-seq].on > .bcard:focus-visible { transform: translateY(-8px); }
[data-seq].on > a.block:hover { transform: translateY(-5px); }

/* Photographs are uncovered by a panel sliding off, then settle */
.js [data-plate] { position: relative; overflow: hidden; }
.js [data-plate]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--primary);
  transform-origin: right;
  transition: transform 1s var(--ease-out);
  z-index: 4;
}
[data-plate].on::after { transform: scaleX(0); }

.js [data-plate] img {
  transform: translate3d(0, var(--px, 0px), 0) scale(1.14);
  transition: transform 1.5s var(--ease-out);
}
[data-plate].on img { transform: translate3d(0, var(--px, 0px), 0) scale(1.05); }
/* once the uncover has run, drop the easing so parallax tracks the scroll */
[data-plate].on.settled img { transition: none; }

/* --------------------------------------------------------------------------
   Hover polish — smooth, never springy
   -------------------------------------------------------------------------- */
.act,
.tie,
.sector,
.block,
.bcard,
.plates button,
.social a { transition-timing-function: var(--ease-out); }

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js [data-in],
  .js [data-seq] > *,
  .js .open .caps,
  .js .open .hero__kick,
  .js .open .hero h1 .l > span,
  .js .open .open__note,
  .js .open .open__do {
    opacity: 1 !important;
    transform: none !important;
  }
  .js .hero__bar { transform: none !important; }
  .js [data-plate]::after { transform: scaleX(0) !important; }
  .js [data-plate] img { transform: none !important; }
  .hero__stage > *,
  .strip img,
  .px img { transform: none !important; }
  .strip img { inset: 0; height: 100%; }
  .prog { display: none; }
  .reel { scroll-behavior: auto; }
}

/* --------------------------------------------------------------------------
   Safety net: an engine without CSS Grid may also fail to apply the reveal
   classes, which would leave copy invisible. Show everything there.
   -------------------------------------------------------------------------- */
@supports not (display: grid) {
  .js [data-in],
  .js [data-seq] > *,
  .js .open .caps,
  .js .open .hero__kick,
  .js .open .hero h1 .l > span,
  .js .open .open__note,
  .js .open .open__do { opacity: 1 !important; transform: none !important; }
  .js .hero__bar { transform: none !important; }
  .js [data-plate]::after { display: none !important; }
  .js [data-plate] img { transform: none !important; }
}
