/* ──────────────────────────────────────────────────────────────────────────
   S43 — CRT scanline card reveal (scroll-triggered).
   Shared across /website, /brand, /print-signage (same pattern as
   terminal-mode.css/js). Cards start invisible and reveal left-to-right as
   their row enters the viewport; a scanline overlay collapses like a CRT
   switching on, then the content materialises. One-shot per card.

   Implementation note: the reveal overlay is an injected `.crt-scan` <div>
   (added by crt-reveal.js), NOT a `::before` — the cards already use
   ::before/::after for their cyan/magenta corner brackets, so a pseudo-element
   overlay would clobber that decoration. Reveal is opacity-only (no display/
   height changes) so there is never a layout shift.
   ────────────────────────────────────────────────────────────────────────── */

.crt-card {
  opacity: 0;
  position: relative;            /* containing block for the .crt-scan overlay */
  transition: opacity 0.25s ease;
}
.crt-card.revealed {
  opacity: 1;
}

/* The CRT scanline overlay. Sits above the card content, sweeps away on fire.
   inset:0 + scaleY keeps it inside the card bounds, so no overflow clipping is
   needed (which preserves the -1px corner brackets). */
.crt-scan {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.45) 2px,
    rgba(0, 0, 0, 0.45) 4px
  );
}
.crt-card.crt-firing .crt-scan {
  animation: crt-sweep 0.35s ease-out forwards;
}
@keyframes crt-sweep {
  0%   { transform: scaleY(1);   opacity: 1;   }
  60%  { transform: scaleY(0.3); opacity: 0.6; }
  100% { transform: scaleY(0);   opacity: 0;   }
}

/* Content materialises ~after the sweep. Targets DIRECT children only (which on
   these cards are plain layout wrappers — the delicate hover transitions live on
   grandchildren and are untouched). Excludes .logo-cell, whose direct children
   are the logo <img> + name span carrying S39's hover-driven opacity/transform
   that must not be overridden, and excludes the overlay itself. */
.crt-card:not(.logo-cell) > *:not(.crt-scan) {
  opacity: 0;
  transition: opacity 0.2s ease 0.3s;   /* 0.3s delay ≈ after the CRT sweep */
}
.crt-card.revealed:not(.logo-cell) > *:not(.crt-scan) {
  opacity: 1;
}

/* Accessibility: no animation — reveal everything immediately. */
@media (prefers-reduced-motion: reduce) {
  .crt-card,
  .crt-card > * {
    opacity: 1 !important;
    transition: none !important;
  }
  .crt-scan { display: none !important; }
}
