/*
  crt.css — the tube.

  Everything else in this cascade decides WHAT is on screen; this file decides
  what the screen IS. The dossier pages are supposed to read like they are up
  on Addapa's own hardware — a monochrome phosphor terminal a couple of
  procurement cycles out of date — and until this layer existed they rendered
  like a 2020s laptop LCD: perfectly flat, perfectly even, no optics at all.

  Three effects, all of them properties of the glass rather than the content:

    bloom      lit phosphor is not a hard-edged pixel; it halos. Full-phosphor
               glyphs and the 2px panel frames get a soft green shadow.
    scanlines  the raster. A fixed overlay repeats one dark line every
               --scan-pitch; the tube face, not the page, so it does not
               scroll with content.
    vignette   the face is curved and the corners sit further from the gun;
               light falls off toward them.

  THE LAW SURVIVES. wonder's brief §1 forbids animating on wall-clock alone,
  and this whole file is inert: no keyframes, no transitions, no flicker, no
  rolling refresh bar. A real tube flickers; drawing that would be motion with
  no state behind it — exactly the lie the law exists to stop. The tube here
  glows and stands still. When something on the page moves, it moves for its
  own reasons, and the medium never does.

  The overlay is aria-hidden, pointer-events: none, and purely additive — the
  page is complete without it. Users who ask the OS for higher contrast get
  the flat rendering back (@media prefers-contrast: more), and print gets
  paper, not a photograph of a monitor (@media print).
*/

/* ---- the glass: scanlines + vignette, one fixed element ---- */
.crt-layer {
  position: fixed;
  inset: 0;
  z-index: 999;               /* over the topbar (100); under nothing */
  pointer-events: none;
  background:
    radial-gradient(120% 92% at 50% 42%, transparent 58%, var(--vignette-edge) 100%),
    repeating-linear-gradient(
      to bottom,
      var(--scan-ink) 0,
      var(--scan-ink) 1px,
      transparent 1px,
      transparent var(--scan-pitch)
    );
}

/* ---- bloom: the frames ----
   Every lit panel border halos, outside and (faintly) in. Quiet panels run
   the dim border2 green — barely lit phosphor barely blooms, so they get
   nothing rather than a fake halo. */
.panel { box-shadow: var(--bloom-border), var(--bloom-border-in); }
.panel.quiet { box-shadow: none; }

/* ---- bloom: the glyphs ----
   Only the FULL-phosphor carriers halo. The alpha ladder stays untouched —
   grey prose on a real tube barely glows, and blurring body text would trade
   legibility for theater. The masthead is deliberately one step dimmer than
   the cover (it reads as chrome) so it keeps its flat quiet; the cover
   wordmark, panel titles, the statusbar host, the active rail glyph and the
   white-hot chips are the elements the palette already calls "lit". */
.figlet-band:not(.masthead) .figlet,
.panel.titled > .panel-title,
.statusbar .host,
.statusbar .caret,
.rail-btn[aria-current="page"],
.chip.st-active,
.chip.clr-pgp,
.chip.clr-aes {
  text-shadow: var(--bloom-text);
}

/* ---- the medium steps aside ---- */
@media (prefers-contrast: more) {
  .crt-layer { display: none; }
  .panel { box-shadow: none; }
  .figlet-band:not(.masthead) .figlet,
  .panel.titled > .panel-title,
  .statusbar .host,
  .statusbar .caret,
  .rail-btn[aria-current="page"],
  .chip.st-active,
  .chip.clr-pgp,
  .chip.clr-aes {
    text-shadow: none;
  }
}

@media print {
  .crt-layer { display: none; }
  .panel { box-shadow: none; }
}
