/* 03-generic/crt — the phosphor CRT overlay (the signature "bigger" effect).
   A skin over an accessible document: scanlines + vignette on ::before/::after,
   pointer-events:none, and it all collapses under prefers-reduced-motion. */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    0deg,
    transparent 0 2px,
    rgba(0, 0, 0, 0.28) 2px 3px
  );
  mix-blend-mode: multiply;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(120% 100% at 50% 0%, transparent 55%, rgba(0, 0, 0, 0.55));
  box-shadow: inset 0 0 160px rgba(0, 0, 0, 0.9);
}

/* Opt out of the CRT overlay (admin, print, any flat surface): <body class="is-flat">.
   Flat means flat: drop the overlay AND the phosphor glow, so admin reads as honest
   dense output rather than the public tube with a class swapped. */
body.is-flat::before,
body.is-flat::after { display: none; }
body.is-flat h1,
body.is-flat h2,
body.is-flat h3,
body.is-flat h4 { text-shadow: none; }
body.is-flat a:hover { text-shadow: none; }

/* Flat means flat all the way down: the components that carry a phosphor bloom on
   the public tube (stat counters, holo-panels, the group divider
   prompt, paginator links, button hovers) render honestly switched-off in the back
   room, so admin reads as dense output rather than the public tube with a class
   swapped. The underlying figures and states are untouched — only the glow drops. */
body.is-flat .c-stat__n,
body.is-flat .c-stat__n--value { text-shadow: none; }
body.is-flat .c-panel,
body.is-flat .c-panel:hover,
body.is-flat .c-panel:focus-within { box-shadow: none; }
body.is-flat .c-group__label::before,
body.is-flat .c-pagination__link:hover,
body.is-flat .c-pagination__link:focus-visible { text-shadow: none; }
body.is-flat .c-btn:hover { box-shadow: none; }

/* One switch kills all motion; also drop the animated scanline character. */
@media (prefers-reduced-motion: reduce) {
  :root { --motion-scale: 0; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
