/* ==========================================================================
   Parallel Machines / footage.css
   Treated footage: a Higgsfield clip developed as a toned blue print with its
   white dot-matrix twin, live in the browser (assets/js/footage/footage-fx.js),
   mounted by assets/js/footage/footage.js. Solid = the machine; dots = its record.
   Reads the spec tokens (tokens.css) with fallbacks, so it also works alone.

   Markup (footage.js fills in the poster and canvas when they are missing):
     <figure class="footage" data-footage="c10-twin-arms-sync">
       <div class="footage__stage" role="img" aria-label="Two robot arms in step, as a toned print beside their dot twin.">
         <canvas class="footage__canvas" aria-hidden="true"></canvas>
         <img class="footage__poster" src="assets/video/c10-twin-arms-sync-poster.webp" alt="" width="1280" height="720">
       </div>
       <figcaption class="footage__cap">fig. 02 · two arms in step · solid: the machine · dots: its record</figcaption>
     </figure>
   Sizing: .footage__stage is 16:9 by default (--footage-ratio); .footage--fill
   makes the stage fill a positioned parent (heroes, plates).
   State: footage-fx sets data-fx-state="loading|live|paused|still|manual|poster"
   on .footage__stage. The poster shows until the first treated frame, and stays
   for Save-Data, no WebGL2, errors and pages that never start the clip.
   ========================================================================== */

.footage { margin: 0; position: relative; }

.footage__stage {
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--footage-ratio, 16 / 9);
  width: 100%;
  background: var(--print-1, #0F2466);
  contain: layout paint;
  isolation: isolate;
}
.footage--fill,
.footage--fill .footage__stage { position: absolute; inset: 0; aspect-ratio: auto; width: auto; height: auto; }

.footage__canvas,
.footage__poster,
.footage-fx__poster {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
}
.footage__poster,
.footage-fx__poster { object-fit: cover; z-index: 0; }
.footage__canvas {
  z-index: 1;
  opacity: 0;
  transition: opacity var(--dur-2, 480ms) var(--ease, cubic-bezier(.2,.7,.1,1));
}

/* a treated frame is on the canvas: show it, let the poster go */
.footage__stage:is([data-fx-state="live"], [data-fx-state="paused"], [data-fx-state="still"], [data-fx-state="manual"]) .footage__canvas { opacity: 1; }
/* poster mode (Save-Data, no WebGL2, error): no canvas at all */
.footage__stage[data-fx-state="poster"] .footage__canvas { display: none; }

/* the hidden decoder element footage-fx keeps in the stage (frames must be presented, but never seen) */
.footage__stage > video { position: absolute; left: 0; top: 0; width: 2px; height: 2px; opacity: .001; pointer-events: none; }

/* caption: mono fig. line, like the twin stage: lowercase as written (spec: "fig. 01 · … · solid: the machine · dots: its record") */
.footage__cap {
  margin-top: 10px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: var(--fs-label, .75rem);
  letter-spacing: var(--tr-mono, .02em);
  text-transform: none;
  color: var(--fg-3, currentColor);
}

/* hover on a card that holds footage: the stage stays still; cards lift elsewhere (components.css) */
@media (prefers-reduced-motion: reduce) {
  .footage__canvas { transition: none; }
}
