/* ---- the CRT screen ------------------------------------------------------------
   The look the Bitcoin2 Daily card, the profile picture and the banner share
   (btc2-daily/crt.html, and ~/crt-effects-for-website.md for the brief): lit
   things glow in their own colour, fine dark scanlines run across everything,
   a faint grain sits over it, and the edges are a little darker. Every layer is
   subtle, and the black stays black.

   On the door (and the whitepaper on it), the terminal, /arb and /charts; not
   the games. crt.js turns it on (html.crt-glow for the glow, html.crt for the overlays) and
   leaves it off for headless captures (the daily card does its own CRT pass on
   them) and inside a frame (the page around it already has the overlays).
   ?crt=0 turns it off, ?crt=1 forces it on.

   The overlays are plain alpha, not blend modes: multiplying by 89% is the same
   as 11% black over the top, and a screen-blended white speck is the same as a
   white speck at that alpha, so nothing here needs the compositor to blend the
   page beneath every frame. */

/* ONE layer, not three (21 Nov 2026): the vignette over the scanlines over
   the grain, as three backgrounds on a single fixed element. Each full-screen
   layer is blended again on every frame anything on the page moves, and on
   his laptop that is the whole page every time. The grain's old 6% opacity
   is baked into the tile crt.js draws. */
.crt-screen {
  position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  background:
    /* darker edges, brighter middle */
    radial-gradient(ellipse 85% 85% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.5) 100%),
    /* a 1.5px line every 3px at 11% black */
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.11) 0 1.5px, transparent 1.5px 3px),
    /* a 256px tile of faint bright specks */
    var(--crt-grain, none);
  background-size: auto, auto, 256px 256px;
}

/* THE GLOW: the figures, chips and accents, each in its own colour (two
   radii, 4.8px at 55% and 16.8px at 35%, as on the card). Not body copy. */
@supports (color: color-mix(in srgb, red 50%, transparent)) {
  html.crt-glow :is(
    /* the door */
    .gd-price, .gate-sub, .gc-tick, .gd-sup, .gh-d, .gc-chg, .gate-stats b, .gate-stats em,
    .gate-vol b, .gate-buck b, .gate-buy,
    /* the whitepaper */
    .paper-fig,
    /* the terminal */
    .hud b, .ticker b, .ticker i,
    /* the arb page and the charts room */
    .mt-big, .bpm-big b, aside .stat b, .ch-read .stat b
  ) {
    text-shadow:
      0 0 4.8px color-mix(in srgb, currentColor 55%, transparent),
      0 0 16.8px color-mix(in srgb, currentColor 35%, transparent);
  }
  /* tinted chips and the solid buy button glow from their own colour too */
  html.crt-glow :is(.gc-chg:not(:empty), .gh-d:not(:empty)) {
    box-shadow: 0 0 10px color-mix(in srgb, currentColor 30%, transparent);
  }
  html.crt-glow .gate-buy { box-shadow: 0 0 14px rgba(247, 147, 26, 0.45), 0 0 34px rgba(247, 147, 26, 0.2); }
  /* the marks */
  html.crt-glow :is(.gate-mark-wrap, .brand-mark) { filter: drop-shadow(0 0 6px rgba(247, 147, 26, 0.35)); }
}

@media print { .crt-screen { display: none; } }
