/* The old screen: the page switches on like a TV, pictures resolve out of pixels, sections change like
   channels. All of it is skipped for visitors who ask for reduced motion. Nothing here takes a click. */

/* The full-screen layers below are drawn with ::before and ::after on zero-size holders, so no page
   element ever sits on top of the text. */

/* 1. Switching on, about three and a half seconds, in three acts:
      warm-up   a dark screen; the station name jolts on, three status lines print one by one, a bar fills
      power     everything cuts to a single line, the line tears open, the screen flashes white
      picture   the page flickers through with a bar rolling down it, then holds
   Any key, click, tap or scroll skips it (src/screen.js), and it plays once per visit. */
.boot, .boot > *, .channel { position: fixed; left: 0; top: 0; width: 0; height: 0; pointer-events: none; }
.boot { --t: 3400ms; z-index: 60; font: 600 clamp(1rem, 1.9vw, 1.6rem)/1.9 var(--font); letter-spacing: .14em; color: var(--accent); }
.boot ::before, .boot ::after, .boot::before, .boot::after { content: ""; position: fixed; }
.boot::before { inset: 0; background: var(--ink); animation: boot-off var(--t) steps(1, end) forwards; }                                   /* the dark screen */
.boot i::before { content: "BOMB SHACK TV"; left: 0; right: 0; top: 26vh; text-align: center; white-space: nowrap; font-size: clamp(2.6rem, 10vw, 9rem); line-height: 1; letter-spacing: -0.03em; opacity: 0; animation: boot-name var(--t) steps(1, end) forwards; }
.boot i::after { content: "WARMING UP THE TUBE\A TUNING CH 1 \00B7  307 NORTH ST\A SIGNAL OK"; white-space: pre; left: 0; right: 0; top: calc(26vh + clamp(3.4rem, 12vw, 10.5rem)); text-align: center; animation: boot-text var(--t) steps(1, end) forwards; }
.boot u::before { left: 0; right: 0; top: calc(26vh + clamp(3.4rem, 12vw, 10.5rem)); height: 5.8em; background: var(--ink); animation: boot-print var(--t) steps(1, end) forwards; }   /* uncovers the lines one at a time */
.boot u::after { left: calc(50% - min(30vw, 260px)); width: min(60vw, 520px); top: calc(26vh + clamp(3.4rem, 12vw, 10.5rem) + 6.6em); height: 14px; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); animation: boot-bar var(--t) steps(1, end) forwards; }
.boot s::before { left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; background: var(--accent); transform: scaleX(0); animation: boot-line var(--t) cubic-bezier(.7, 0, .2, 1) forwards, boot-off var(--t) steps(1, end) forwards; }   /* the line that tears open */
.boot s::after { left: 0; right: 0; top: -24vh; height: 20vh; background: var(--light); opacity: 0; animation: boot-roll var(--t) linear forwards; }   /* the bar rolling down the picture */
.boot::after { inset: 0; background: var(--light); opacity: 0; animation: boot-flash var(--t) steps(1, end) forwards; }                      /* the white flash */
@keyframes boot-name { 0% { opacity: 0; } 5% { opacity: 1; transform: translateX(-14px) scaleY(1.3); } 7% { opacity: .3; transform: translateX(10px); } 9% { opacity: 1; transform: translateX(-4px); } 11% { opacity: 1; transform: none; } 44% { opacity: 1; transform: translateX(6px); } 45% { opacity: 1; transform: none; } 60% { opacity: 1; transform: scaleY(.04); } 62%, 100% { opacity: 0; } }
@keyframes boot-text { 0% { opacity: 1; } 60%, 100% { opacity: 0; } }
@keyframes boot-print { 0% { transform: translateY(0); } 15% { transform: translateY(1.9em); } 28% { transform: translateY(3.8em); } 41% { transform: translateY(5.8em); } 60%, 100% { transform: translateY(5.8em); opacity: 0; } }
@keyframes boot-bar { 0%, 12% { transform: scaleX(0); } 16% { transform: scaleX(.12); } 20% { transform: scaleX(.2); } 25% { transform: scaleX(.34); } 29% { transform: scaleX(.4); } 34% { transform: scaleX(.58); } 39% { transform: scaleX(.66); } 43% { transform: scaleX(.9); } 48% { transform: scaleX(1); opacity: 1; } 52% { opacity: 0; } 55% { opacity: 1; } 58% { opacity: 0; transform: scaleX(1); } 100% { opacity: 0; transform: scaleX(1); } }
@keyframes boot-line { 0%, 60% { transform: scaleX(0) scaleY(1); } 66% { transform: scaleX(1) scaleY(1); } 68% { transform: scaleX(1) scaleY(3); } 74%, 100% { transform: scaleX(1) scaleY(420); } }
@keyframes boot-flash { 0%, 71% { opacity: 0; } 72% { opacity: .95; } 74% { opacity: .5; } 76%, 100% { opacity: 0; } }
@keyframes boot-off { 0% { opacity: 1; } 76% { opacity: .45; } 79% { opacity: .95; } 82% { opacity: .25; } 85% { opacity: .75; } 88% { opacity: .15; } 91% { opacity: .5; } 94% { opacity: .08; } 97% { opacity: .22; } 100% { opacity: 0; } }
@keyframes boot-roll { 0%, 75% { opacity: 0; transform: translateY(0); } 76% { opacity: .22; transform: translateY(0); } 88% { opacity: .22; transform: translateY(150vh); } 88.1% { opacity: .16; transform: translateY(0); } 100% { opacity: 0; transform: translateY(150vh); } }
.booted .boot, html:not(.js) .boot { display: none; }   /* later pages in the same visit, a skipped boot, and visitors without JavaScript (who could not skip it) */

/* 2. Scan lines over everything, very faint. A tiny tiled picture, not a gradient. */
html::after { content: ""; position: fixed; inset: 0; z-index: 55; pointer-events: none; opacity: .04; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='3' height='3'%3E%3Crect width='3' height='1'/%3E%3C/svg%3E"); background-size: 3px 3px; }

/* 3. Pictures resolving out of pixels: a coarse two-tone copy sits on the picture, sharpens in steps, then goes. */
.panel__photo, .duo { position: relative; }
.dither { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; pointer-events: none; transition: opacity 260ms steps(3, end); }
.panel__photo .dither { object-position: 50% 42%; transform-origin: 50% 45%; }
.dither--logo { object-fit: contain; }
.dither.is-done { opacity: 0; }

/* 4. Changing channel: a dim flicker, a bar rolling down the screen, and the channel named in the corner. */
.channel { z-index: 56; }
.channel::before { content: ""; position: fixed; inset: 0; background: var(--ink); opacity: 0; }
.channel::after { content: ""; position: fixed; left: 0; right: 0; top: -22vh; height: 18vh; background: var(--accent); opacity: 0; }
.channel b { position: fixed; top: calc(var(--margin) + 3.75rem); right: var(--margin); white-space: nowrap; background: var(--ink); color: var(--accent); padding: .45rem .7rem .5rem; font: 600 var(--step-lead)/1 var(--font); letter-spacing: .08em; text-transform: uppercase; opacity: 0; transition: opacity 200ms steps(2, end); }
.channel b::before { content: attr(data-ch); }
.channel.is-on b { opacity: 1; }
.channel.is-flip::before { animation: flip 280ms steps(1, end); }
.channel.is-flip::after { animation: roll 280ms linear; }
@keyframes flip { 0% { opacity: .4; } 25% { opacity: .08; } 50% { opacity: .26; } 75% { opacity: .05; } 100% { opacity: 0; } }
@keyframes roll { from { opacity: .2; transform: translateY(0); } to { opacity: .2; transform: translateY(145vh); } }

@media (max-width: 900px) { .channel b { top: calc(var(--margin) + 3rem); font-size: var(--step-small); } }
@media (prefers-reduced-motion: reduce) { .boot, .channel, .dither { display: none; } html::after { content: none; } }
