/* ==========================================================================
   imprimante — style.css
   a dos box, taped off an old tv/vcr combo.
   1 fonts · 2 channels · 3 base · 4 the set · 5 the tube · 6 the dos box
   7 on-screen display, menu, tape artefacts · 8 the control panel
   ========================================================================== */

/* 1. fonts -------------------------------------------------------------------
   ibm vga 9x16 + ibm bios 8x8: "the ultimate oldschool pc font pack" by vileR (int10h.org), cc by-sa 4.0
   vt323 (the vcr's on-screen display): sil ofl                                  */
@font-face {
  font-family: "IBM VGA";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("../fonts/ibm-vga-9x16.woff") format("woff");
}
@font-face {
  font-family: "IBM BIOS";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("../fonts/ibm-bios-8x8.woff") format("woff");
}
@font-face {
  font-family: "VT323";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/vt323-normal-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "VT323";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/vt323-normal-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* 2. tokens + channels -------------------------------------------------------
   channels are the monitor's colour modes: 03 blue · 04 black · 05 amber · 06 green */
:root {
  --f-dos: "IBM VGA", "VT323", ui-monospace, "Courier New", monospace;
  --f-osd: "VT323", ui-monospace, "Courier New", monospace;
  --f-print: "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* the set */
  --m: clamp(6px, 1.8vmin, 24px);
  --bz: clamp(10px, 2.6vmin, 34px);
  --depth: clamp(26px, 7vmin, 84px);
  --r: clamp(14px, 3vmin, 40px);
  --tube: clamp(22px, 5vmin, 64px);

  --osd: #f4f4ee;
  --osd-shadow: 2px 2px 0 rgba(0, 0, 0, .65), -1px 0 0 rgba(255, 50, 90, .45), 1px 0 0 rgba(40, 220, 255, .45);
  --stamp: #ffc93c;
  --rec: #ff3b2f;
  --vcr-blue: #1626b4;
}

:root,
[data-channel="blue"] {
  --bg: #1424ab;
  --win: #1424ab;
  --txt: #c3c8d8;
  --hi: #ffffff;
  --dim: #8d97c4;
  --frame: #eef0f6;
  --frame-dim: #8f9ac6;
  --acc: #ffec5c;
  --cy: #61f0f0;
  --sel: #22a9ae;
  --sel-ink: #04070c;
  --bar: #b9bdc8;
  --bar-ink: #0c0c10;
  --hot: #b5140e;
  --drop: rgba(0, 0, 14, .58);
  --shade: #61f0f0;
  --glow: 0 0 .45em rgba(160, 190, 255, .35);
  --room: rgba(45, 75, 240, .3);
  --live: #3dff6e;
  --scan: .2;
  --grain: .09;
}
[data-channel="black"] {
  --bg: #0a0b0c;
  --win: #0a0b0c;
  --txt: #c6c7c4;
  --hi: #f6f6f1;
  --dim: #7b7d79;
  --frame: #d9dad5;
  --frame-dim: #6a6c68;
  --acc: #ffd23c;
  --cy: #7fd6ff;
  --sel: #c6c7c4;
  --sel-ink: #0a0b0c;
  --bar: #c6c7c4;
  --bar-ink: #0a0b0c;
  --hot: #b5140e;
  --drop: rgba(0, 0, 0, 0);
  --shade: #5a5c58;
  --glow: 0 0 .45em rgba(255, 255, 255, .22);
  --room: rgba(255, 255, 255, .05);
  --live: #3dff6e;
  --scan: .26;
  --grain: .08;
}
[data-channel="amber"] {
  --bg: #170c00;
  --win: #170c00;
  --txt: #ffad33;
  --hi: #ffd890;
  --dim: #b06f12;
  --frame: #ffbf55;
  --frame-dim: #a8650c;
  --acc: #ffe3a8;
  --cy: #ffcf70;
  --sel: #ffad33;
  --sel-ink: #170c00;
  --bar: #ffad33;
  --bar-ink: #170c00;
  --hot: #5a2a00;
  --drop: rgba(0, 0, 0, 0);
  --shade: #8a4d05;
  --glow: 0 0 .5em rgba(255, 160, 40, .55);
  --room: rgba(255, 150, 30, .16);
  --live: #ffe3a8;
  --scan: .3;
  --grain: .1;
}
[data-channel="green"] {
  --bg: #021207;
  --win: #021207;
  --txt: #43ff76;
  --hi: #c4ffd2;
  --dim: #1f9a43;
  --frame: #5dff8a;
  --frame-dim: #1d8a3c;
  --acc: #d8ff9c;
  --cy: #8cffb0;
  --sel: #43ff76;
  --sel-ink: #021207;
  --bar: #43ff76;
  --bar-ink: #021207;
  --hot: #0b4a1d;
  --drop: rgba(0, 0, 0, 0);
  --shade: #157a33;
  --glow: 0 0 .5em rgba(60, 255, 120, .55);
  --room: rgba(60, 255, 110, .13);
  --live: #d8ff9c;
  --scan: .32;
  --grain: .1;
}

/* 3. base ------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #070708;
}
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  color: var(--txt);
  font-family: var(--f-dos);
  font-size: 16px;
  line-height: 1.25;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

svg { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
p, h1, h2, h3, ul, ol, dl, dd { margin: 0; }
h1, h2, h3 { font-weight: inherit; font-size: inherit; }

::selection { background: var(--sel); color: var(--sel-ink); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: fixed; left: 12px; top: 12px; z-index: 200;
  padding: 6px 12px;
  background: #ffec5c; color: #111;
  font: 18px/1 var(--f-dos);
  text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

.only-touch { display: none; }
@media (hover: none) {
  .only-fine { display: none; }
  .only-touch { display: inline; }
}

.osd {
  font-family: var(--f-osd);
  color: var(--osd);
  text-shadow: var(--osd-shadow);
  text-transform: uppercase;
  letter-spacing: .03em;
  line-height: 1;
}
.icon { width: 1em; height: 1em; fill: currentColor; flex: 0 0 auto; }
@keyframes blink { 50% { opacity: 0; } }

.noscript {
  position: fixed; left: 50%; bottom: 24px; z-index: 300;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: #000; color: #fff;
  font: 18px/1 var(--f-dos);
}

/* 4. the set ------------------------------------------------------------------ */
.room {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 42%, var(--room), transparent 70%),
    radial-gradient(ellipse 120% 60% at 50% 120%, rgba(0, 0, 0, .8), transparent 60%),
    linear-gradient(180deg, #111014, #070708);
  transition: background .6s;
}

.stage {
  position: fixed;
  inset: 0;
  padding:
    calc(var(--m) + env(safe-area-inset-top))
    calc(var(--m) + env(safe-area-inset-right))
    calc(var(--m) + env(safe-area-inset-bottom))
    calc(var(--m) + env(safe-area-inset-left));
  perspective: 1800px;
  perspective-origin: 50% 45%;
}

.tv {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
}

/* depth: four walls and a back, so turning the set shows its body */
.tv__side,
.tv__back { position: absolute; pointer-events: none; }
.tv__side--l,
.tv__side--r { top: var(--r); bottom: var(--r); width: var(--depth); background: linear-gradient(90deg, #050506, #18181b 70%, #202023); }
.tv__side--l { left: 0; transform-origin: left center; transform: rotateY(90deg); }
.tv__side--r { right: 0; transform-origin: right center; transform: rotateY(-90deg); background: linear-gradient(270deg, #050506, #18181b 70%, #202023); }
.tv__side--t,
.tv__side--b { left: var(--r); right: var(--r); height: var(--depth); }
.tv__side--t { top: 0; transform-origin: center top; transform: rotateX(-90deg); background: linear-gradient(180deg, #2a2a2e, #161619); }
.tv__side--b { bottom: 0; transform-origin: center bottom; transform: rotateX(90deg); background: linear-gradient(0deg, #040405, #101012); }
.tv__back { inset: 0; border-radius: var(--r); background: #040405; transform: translateZ(calc(var(--depth) * -1)); }

/* the cabinet: moulded black abs, a satin top edge, a darker chin */
.tv__front {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  border-radius: var(--r);
  background:
    radial-gradient(130% 70% at 20% 0%, rgba(255, 255, 255, .07), transparent 55%),
    linear-gradient(180deg, #29292d, #1c1c1f 55%, #151517);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .17),
    inset 0 -2px 0 rgba(0, 0, 0, .6),
    inset 1px 0 0 rgba(255, 255, 255, .05),
    inset -1px 0 0 rgba(0, 0, 0, .45);
  transform: translateZ(0);
}
.tv__front::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .06;
  pointer-events: none;
}

/* the bezel slopes in toward the tube */
.tv__bezel {
  position: relative;
  min-height: 0;
  margin: var(--bz) var(--bz) 0;
  padding: clamp(5px, 1.1vmin, 14px);
  border-radius: calc(var(--tube) + 8px);
  background:
    linear-gradient(180deg, #0c0c0e, #19191c 22%, #1d1d20 70%, #2a2a2e);
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, .9),
    inset 0 -1px 0 rgba(255, 255, 255, .1),
    0 1px 0 rgba(255, 255, 255, .06);
}

/* 5. the tube ------------------------------------------------------------------ */
.tv__screen {
  position: relative;
  z-index: 1;
  height: 100%;
  overflow: hidden;
  overflow: clip;
  border-radius: var(--tube);
  background: #050807;
  box-shadow: 0 0 0 1px #000, 0 0 0 2px rgba(255, 255, 255, .05);
  isolation: isolate;
}
.picture {
  position: absolute;
  inset: 0;
  overflow: hidden;
  overflow: clip; /* never scrolls, even when something inside asks to be shown */
  border-radius: inherit;
  background: var(--bg);
  transform-origin: 50% 50%;
  transition: background .3s;
}
.tv__screen.is-off .picture { visibility: hidden; }

.scroller {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.scroller::-webkit-scrollbar { display: none; }
.picture.no-tape .scroller { overflow: hidden; }

/* the tape's picture is soft and a little wobbly, like a second-generation dub */
@media (hover: hover) and (pointer: fine) {
  .scroller { filter: blur(.4px) saturate(1.12) contrast(1.04); }
}
@media (prefers-reduced-motion: no-preference) {
  .scroller { animation: hjitter 4.2s steps(1, end) infinite; }
}
@keyframes hjitter {
  0%, 100% { transform: translateX(0); }
  13% { transform: translateX(1px); }
  14% { transform: translateX(0); }
  47% { transform: translateX(-1px); }
  48% { transform: translateX(.5px); }
  49% { transform: translateX(0); }
  81% { transform: translateX(1.5px); }
  82% { transform: translateX(0); }
}

/* curved glass: vignette into the corners, a fixed sheen, a glare that slides as the set turns */
.glass {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 45% at 30% 2%, rgba(255, 255, 255, .09), transparent 62%),
    radial-gradient(ellipse 100% 95% at 50% 50%, transparent 58%, rgba(0, 0, 0, .5));
  box-shadow:
    inset 0 0 6vmin 1vmin rgba(0, 0, 0, .55),
    inset 0 0 1.4vmin rgba(0, 0, 0, .95),
    inset 0 1px 0 rgba(255, 255, 255, .06);
}
.glass__glare {
  position: absolute;
  left: 4%;
  top: -24%;
  width: 60%;
  height: 80%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .075), transparent);
  will-change: transform;
}
.afterglow {
  position: absolute;
  left: 50%; top: 50%;
  z-index: 4;
  width: 2.2vmin; height: 2.2vmin;
  margin: -1.1vmin 0 0 -1.1vmin;
  border-radius: 50%;
  background: radial-gradient(circle, #fff, rgba(200, 255, 255, .6) 35%, transparent 70%);
  opacity: 0;
  pointer-events: none;
}

/* 6. the dos box ------------------------------------------------------------------ */
.dos {
  --cell: 1ch;
  min-height: 100%;
  padding:
    clamp(54px, 9.5vmin, 98px)
    clamp(14px, 3.4vmin, 44px)
    clamp(78px, 12vmin, 124px);
  font-size: clamp(14px, calc(.5vw + 9.6px), 20px);
  color: var(--txt);
  text-shadow: var(--glow), -.06em 0 0 rgba(255, 40, 80, .28), .06em 0 0 rgba(40, 220, 255, .28);
}
.dos:focus { outline: none; }
.dos a { text-decoration: none; }
.dos u { text-decoration: none; color: var(--hot); text-shadow: none; }

/* menu bar + status line, like every 80s ide */
.dos__bar,
.dos__status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .1em 2ch;
  padding: .12em 1ch .08em;
  background: var(--bar);
  color: var(--bar-ink);
  text-shadow: none;
  box-shadow: 0 0 .6em rgba(255, 255, 255, .12);
}
/* the ≡: opens a pull-down of the pages, like the system menu of an old dos app */
.sysmenu { position: relative; display: inline-flex; }
.dos__sys { position: relative; padding: 0 .6ch; border: 0; background: var(--sel); color: var(--sel-ink); font: inherit; line-height: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
@media (pointer: coarse) { .dos__sys { min-width: 2.4em; min-height: 32px; } }
.dos__sys:hover, .dos__sys:focus-visible, .dos__sys[aria-expanded="true"] { background: var(--acc); color: #111; outline: none; }
.sysmenu__list {
  position: absolute;
  left: 0;
  top: calc(100% + .14em);
  z-index: 30;
  min-width: 16ch;
  margin: 0;
  padding: .35em 0;
  list-style: none;
  background: var(--bar);
  color: var(--bar-ink);
  outline: 1px solid var(--bar-ink);
  outline-offset: -.3em;
  box-shadow: .6ch .4em 0 var(--drop);
}
.sysmenu__list[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) { .sysmenu__list { animation: pulldown .16s steps(4, end); } }
@keyframes pulldown { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.sysmenu__list a { display: flex; gap: 1ch; padding: .12em 1.6ch .08em 1ch; color: inherit; text-decoration: none; }
.sysmenu__mark { width: 1ch; color: var(--hot); visibility: hidden; }
.sysmenu__list a[aria-current="page"] .sysmenu__mark { visibility: visible; }
.sysmenu__list a:hover, .sysmenu__list a:focus-visible { background: var(--sel); color: var(--sel-ink); outline: none; }
.sysmenu__list a:hover .sysmenu__mark, .sysmenu__list a:focus-visible .sysmenu__mark { color: inherit; }
.dos__clock { margin-left: auto; }
.dos__status { margin-top: 1.6em; }
.dos__status b { font-weight: 400; color: var(--hot); }
.dos__status a { position: relative; margin-left: auto; text-decoration: underline; text-underline-offset: .2em; }
.dos__status a:hover,
.dos__status a:focus-visible { background: var(--bar-ink); color: var(--bar); }
@media (max-width: 640px) { .dos__opt { display: none; } .dos__bar { gap: .1em 1.6ch; } }

/* windows: framed by hand, in white pencil, like someone drew over the screen.
   the frame you're in "boils" (redrawn a few times a second, like hand animation). */
.win {
  position: relative;
  margin-top: 1.6em;
  padding: 1.25em calc(2ch + 4px) 1.1em;
  background: var(--win);
}
.win__t {
  position: absolute;
  top: -.72em;
  left: 50%;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: .6ch;
  margin: 0;
  padding: 0 1ch;
  background: var(--win);
  color: var(--hi);
  white-space: nowrap;
  transform: translateX(-50%);
}
.win__t .doodle { width: 1.6em; height: 1.6em; color: var(--acc); stroke-width: 1.8; }

/* the doodles: stroked, never filled, round pen ends */
.doodle {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -.2em;
  overflow: visible;
  filter: drop-shadow(0 0 .2em rgba(255, 255, 255, .25));
}
.doodle--spark { margin-right: .6ch; color: var(--live); }
@media (prefers-reduced-motion: no-preference) {
  .doodle--spark { animation: twinkle 2.4s steps(1, end) infinite; }
}
@keyframes twinkle { 0%, 100% { transform: rotate(0) scale(1); } 50% { transform: rotate(12deg) scale(.82); } }

/* pencil lines, drawn by main.js into each [data-sketch] */
[data-sketch] { position: relative; }
.sketch {
  position: absolute;
  left: -10px;
  top: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 20px);
  overflow: visible;
  pointer-events: none;
  fill: none;
  stroke: var(--frame-dim);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sketch path { filter: drop-shadow(0 0 .25em rgba(255, 255, 255, .18)); }
.sketch path + path { visibility: hidden; }
.win.is-active > .sketch,
.win:hover > .sketch,
.win:focus-within > .sketch { stroke: var(--frame); }
.win .sketch { z-index: 0; }
@media (prefers-reduced-motion: no-preference) {
  .win.is-active > .sketch path,
  .win:hover > .sketch path,
  .win:focus-within > .sketch path { animation: boil .42s steps(1, end) infinite; }
  .win.is-active > .sketch path:nth-child(2),
  .win:hover > .sketch path:nth-child(2),
  .win:focus-within > .sketch path:nth-child(2) { animation-delay: -.14s; }
  .win.is-active > .sketch path:nth-child(3),
  .win:hover > .sketch path:nth-child(3),
  .win:focus-within > .sketch path:nth-child(3) { animation-delay: -.28s; }
}
@keyframes boil { 0% { visibility: visible; } 33.33% { visibility: hidden; } }
.fm__cols > .sketch,
.deck__frame > .sketch { stroke: var(--frame-dim); }

/* the ink: hover anything you can use and a pen circles it */
.ink {
  position: absolute;
  overflow: visible;
  pointer-events: none;
  fill: none;
  stroke: var(--hi);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 .2em rgba(255, 255, 255, .35));
}
.ink path {
  stroke-dasharray: 1 1.1; /* a gap a bit longer than the line, so no dot is left at the end of it */
  stroke-dashoffset: 1;
  transition: stroke-dashoffset .12s ease-in;
}
.is-inked > .ink path { stroke-dashoffset: 0; transition: stroke-dashoffset .32s cubic-bezier(.3, .6, .2, 1); }
.ink .ink__mark { stroke: var(--acc); }

.dos__cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.1fr);
  gap: 0 3ch;
  align-items: start;
}
.dos__side { min-width: 0; }
@media (max-width: 860px) { .dos__cols { grid-template-columns: minmax(0, 1fr); } }

/* the title: the name in giant bios blocks, with a dithered ▒ drop shadow */
.banner { margin: .4em 0 .9em; }
.banner__link {
  position: relative;
  display: block;
  color: var(--hi);
  cursor: pointer;
  -webkit-user-drag: none;
}
.banner__text {
  display: block;
  font: clamp(40px, 9vw, 120px)/1 "IBM BIOS", var(--f-dos);
  letter-spacing: -.02em;
  color: var(--hi);
  word-break: break-all;
}
.banner.is-art .banner__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.banner__art { display: none; }
.banner.is-art .banner__art { display: block; }
.banner__art svg { width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 0 .18em rgba(255, 255, 255, .3)); }
.banner__art .px { fill: var(--hi); }
.banner__art .sh { fill: var(--shade); }
.banner__link:hover .px,
.banner__link:focus-visible .px { fill: var(--acc); }
.banner__link.is-down { transform: translate(1px, 1px); }
.banner.is-glitch .banner__art svg { animation: bannerglitch .3s steps(2) infinite; }
@keyframes bannerglitch {
  0% { transform: translateX(0); clip-path: inset(0 0 0 0); }
  25% { transform: translateX(-1.5%); clip-path: inset(10% 0 55% 0); }
  50% { transform: translateX(1%); clip-path: inset(48% 0 12% 0); }
  75% { transform: translateX(-.5%); clip-path: inset(0 0 0 0); }
}
.banner__tag {
  position: absolute;
  right: 0;
  bottom: -1.4em;
  padding: 0 .6ch;
  background: var(--sel);
  color: var(--sel-ink);
  text-shadow: none;
  font-size: .85em;
  opacity: 0;
  transition: opacity .1s steps(1);
}
.banner__link:hover .banner__tag,
.banner__link:focus-visible .banner__tag { opacity: 1; }
@media (hover: none) { .banner__tag { position: static; display: inline-block; margin-top: .5em; opacity: 1; } }

.hero__tag { color: var(--acc); }
.kv {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: .15em 2ch;
  margin-top: .9em;
}
.kv dt { color: var(--dim); }
.kv dt::after { content: " ........"; color: var(--dim); opacity: .7; }
.kv dd { color: var(--hi); overflow-wrap: anywhere; }
@media (max-width: 560px) { .kv { gap: .15em 1.5ch; } .kv dt::after { content: ""; } }
.kv a { color: var(--cy); }
.kv a:hover, .kv a:focus-visible { background: var(--cy); color: var(--win); text-shadow: none; }
.dot { display: inline-block; width: .6em; height: .6em; margin-right: .8ch; background: var(--live); box-shadow: 0 0 .5em var(--live); vertical-align: .05em; animation: blink 2.2s steps(1, end) infinite; }
.prompt { margin-top: 1em; color: var(--hi); white-space: pre-wrap; overflow-wrap: anywhere; }
.caret { animation: blink 1s steps(1, end) infinite; }

/* 7. the vcr's on-screen display ------------------------------------------------ */
.osd-top {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: calc(clamp(12px, 2.6vmin, 30px) + env(safe-area-inset-top)) calc(clamp(18px, 4vmin, 48px) + env(safe-area-inset-right)) 0 calc(clamp(18px, 4vmin, 48px) + env(safe-area-inset-left));
  pointer-events: none;
}
.osd-top > * { pointer-events: auto; }
.osd-top > .state { pointer-events: none; } /* just a readout: clicks go through to the page under it */
.state {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 8.5ch;
  font-size: clamp(24px, 3vw, 40px);
  transition: opacity .2s steps(2);
}
.state .icon { width: .62em; height: .62em; filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, .6)); }
.state small { font-size: .5em; opacity: .85; align-self: flex-end; margin-bottom: .12em; }
.state.is-hidden { opacity: 0; }
.state.is-blink [data-state-text],
.state.is-blink .icon { animation: blink 1.1s steps(1, end) infinite; }
.state.is-jitter { animation: jitter .18s steps(2) infinite; }
@keyframes jitter { 50% { transform: translateY(1px); } }
.osd-ch {
  padding: 3px 8px 2px;
  border: 0;
  background: transparent;
  font: clamp(20px, 2.2vw, 28px)/1 var(--f-osd);
  color: var(--osd);
  text-shadow: var(--osd-shadow);
  cursor: pointer;
}
.osd-ch:hover,
.osd-ch.is-down { background: var(--osd); color: #111; text-shadow: none; }

.datestamp {
  position: absolute;
  right: calc(clamp(18px, 4vmin, 48px) + env(safe-area-inset-right));
  bottom: calc(clamp(12px, 2.6vmin, 30px) + env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  justify-items: end;
  gap: 2px;
  font-size: clamp(17px, 2vw, 28px);
  color: var(--stamp);
  pointer-events: none;
}
.flash {
  position: absolute;
  left: 50%; top: 50%;
  z-index: 25;
  max-width: calc(100% - 32px);
  padding: 4px 12px 2px;
  background: rgba(0, 0, 0, .45);
  font-size: clamp(24px, 3.4vw, 46px);
  text-align: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
  visibility: hidden;
}
.flash.is-on { visibility: visible; }
.chbig {
  position: absolute;
  right: clamp(18px, 4vmin, 48px);
  top: clamp(56px, 9vmin, 92px);
  z-index: 25;
  font-size: clamp(54px, 7.5vw, 110px);
  color: #74ff5a;
  pointer-events: none;
  visibility: hidden;
}
.chbig.is-on { visibility: visible; }
.typed {
  position: absolute;
  left: 50%;
  bottom: clamp(54px, 9vmin, 92px);
  z-index: 25;
  font-size: clamp(22px, 2.6vw, 34px);
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
  visibility: hidden;
}
.typed.is-on { visibility: visible; }
.typed i { font-style: normal; animation: blink .8s steps(1, end) infinite; }
.volbar {
  position: absolute;
  left: 50%;
  bottom: clamp(16px, 3.4vmin, 38px);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: clamp(22px, 2.6vw, 32px);
  color: #74ff5a;
  transform: translateX(-50%);
  pointer-events: none;
  visibility: hidden;
}
.volbar.is-on { visibility: visible; }
.volbar__bars { display: flex; gap: 3px; }
.volbar__bars i { width: clamp(5px, .7vw, 9px); height: .8em; background: currentColor; opacity: .18; box-shadow: 2px 2px 0 rgba(0, 0, 0, .5); }
.volbar__bars i.on { opacity: 1; }
.notape {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: none;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: var(--vcr-blue);
  text-align: center;
}
.notape p { font-size: clamp(40px, 6vw, 84px); }
.notape small { font-size: clamp(18px, 2vw, 26px); opacity: .85; padding: 0 16px; }
.picture.no-tape .notape { display: grid; }

/* the tv's own menu */
.menu {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  overflow-y: auto;
  padding: 48px 18px;
  background: var(--vcr-blue);
  visibility: hidden;
  scrollbar-width: none;
}
.menu::-webkit-scrollbar { display: none; }
.menu.is-open { visibility: visible; }
.menu__box { width: min(100%, 680px); margin: auto; padding: 20px 20px 16px; border: 6px double var(--osd); }
.menu__title { margin-bottom: 16px; font-size: 36px; text-align: center; }
.menu__list { list-style: none; padding: 0; display: grid; gap: 2px; }
.menu__list button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 4px 10px 2px;
  border: 0;
  background: none;
  font: inherit;
  font-size: clamp(24px, 3.4vw, 34px);
  color: inherit;
  text-shadow: inherit;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
}
.menu__list button > i { width: 1ch; font-style: normal; visibility: hidden; }
.menu__list button span { margin-left: auto; }
.menu__list button:focus,
.menu__list button:hover { outline: none; background: var(--osd); color: var(--vcr-blue); text-shadow: none; }
.menu__list button:focus > i { visibility: visible; animation: blink .9s steps(1, end) infinite; }
.menu__sep { height: 2px; margin: 8px 0; background: var(--osd); opacity: .5; }
.menu__hint { margin-top: 16px; font-size: 18px; text-align: center; opacity: .8; }
.menu__keys {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 3px 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 2px solid var(--osd);
  font-size: 17px;
  opacity: .85;
}
.menu__keys dt { color: #ffd83a; white-space: nowrap; }
@media (max-width: 700px) { .menu__keys { grid-template-columns: auto 1fr; } }
@media (hover: none) { .menu__hint, .menu__keys { display: none; } }

/* colour bars (the secret) */
.bars {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: none;
  grid-template-rows: 67fr 8fr 25fr;
  pointer-events: none;
}
.bars.is-on { display: grid; }
.bars > div { display: grid; }
.bars__top, .bars__mid { grid-template-columns: repeat(7, 1fr); }
.bars__low { grid-template-columns: 5fr 5fr 5fr 6fr 1fr 1fr 1fr 5fr; }
.bars i { display: block; }
.bars__msg {
  position: absolute;
  left: 50%; top: 40%;
  transform: translate(-50%, -50%);
  padding: 6px 14px;
  background: #000;
  font-size: clamp(24px, 3.6vw, 50px);
  white-space: nowrap;
  color: #f6f5ef;
}

/* tape artefacts, laid over everything on the tube */
.fx { position: absolute; inset: 0; z-index: 50; pointer-events: none; }
.fx--scan {
  background:
    repeating-linear-gradient(180deg, rgba(0, 0, 0, var(--scan)) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(255, 0, 0, .025) 0 1px, rgba(0, 255, 0, .025) 1px 2px, rgba(0, 0, 255, .025) 2px 3px);
}
/* chroma smears right on a vhs: a faint warm/cool shift across the whole picture */
.fx--bleed {
  background: linear-gradient(90deg, rgba(255, 60, 90, .035), transparent 30%, transparent 70%, rgba(40, 200, 255, .035));
  mix-blend-mode: screen;
}
.fx--grain {
  inset: -10%;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  animation: grain .7s steps(5) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5%, 3%); }
  40% { transform: translate(4%, -5%); }
  60% { transform: translate(-6%, -2%); }
  80% { transform: translate(5%, 6%); }
}
.fx--roll { overflow: hidden; }
.fx--roll::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 14%;
  background:
    linear-gradient(180deg, transparent, rgba(255, 255, 255, .045) 35%, rgba(255, 255, 255, .1) 48%, rgba(0, 0, 0, .12) 52%, rgba(255, 255, 255, .035) 70%, transparent),
    repeating-linear-gradient(180deg, transparent 0 2px, rgba(255, 255, 255, .045) 2px 3px);
  animation: roll 13s linear infinite;
}
@keyframes roll { from { transform: translateY(-120%); } to { transform: translateY(800%); } }
.fx--seek { opacity: 0; overflow: hidden; transition: opacity .1s; }
.fx--seek.is-on { opacity: 1; }
.fx--seek i {
  position: absolute;
  left: -5%; right: -5%;
  height: 7%;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .55) 0 3px, transparent 3px 9px, rgba(255, 255, 255, .25) 9px 11px, transparent 11px 23px),
    linear-gradient(180deg, transparent, rgba(255, 255, 255, .22) 45%, rgba(0, 0, 0, .35) 55%, transparent);
  animation: seekbar .42s steps(6) infinite;
}
.fx--seek i:nth-child(1) { top: 18%; }
.fx--seek i:nth-child(2) { top: 52%; height: 4%; animation-duration: .31s; animation-direction: reverse; }
.fx--seek i:nth-child(3) { top: 80%; height: 9%; animation-duration: .5s; }
@keyframes seekbar { from { transform: translate(0, 0); } to { transform: translate(-6%, 300%); } }
/* head-switching noise along the bottom + the odd dropout: drawn by main.js */
.fx--tape { width: 100%; height: 100%; opacity: .9; }
.static {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: none;
  width: 100%;
  height: 100%;
  background: #777;
  image-rendering: pixelated;
  pointer-events: none;
}
.js .static.is-on { display: block; }
html.js:not(.is-live) .static { animation: failsafe-hide .01s 2.5s forwards; }
@keyframes failsafe-hide { to { visibility: hidden; opacity: 0; } }

/* motion preferences ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .fx--grain, .fx--roll::before, .fx--seek i { animation: none; }
  .door__flap, .door__tape { transition: none; }
}

/* the pen needs a box to draw round */
.dos__status a, .gh { position: relative; display: inline-block; }

/* 8. the control panel --------------------------------------------------------------
   moulded abs, keys that sit in their cut-outs, the labels pad-printed on the plastic */
.tv__panel {
  --kw: clamp(30px, 4.3vmin, 50px);
  --kh: clamp(15px, 2.1vmin, 22px);
  --ink: rgba(222, 224, 230, .78);
  --door-h: clamp(24px, 3.6vmin, 40px);
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vmin, 30px);
  min-width: 0;
  padding: clamp(10px, 1.9vmin, 22px) calc(var(--bz) + 4px) clamp(10px, 1.9vmin, 20px);
}
/* a moulded seam between the bezel and the panel */
.tv__panel::before {
  content: "";
  position: absolute;
  left: var(--bz); right: var(--bz); top: clamp(4px, .8vmin, 9px);
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .7), rgba(255, 255, 255, .06));
}
/* a greasy smudge where thumbs go (the dust itself is alive: main.js draws it, you can wipe it) */
.tv__panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 0 0 var(--r) var(--r);
  pointer-events: none;
  background: radial-gradient(ellipse 60px 26px at 66% 62%, rgba(255, 255, 255, .025), transparent 70%);
}
.tv__panel > * { position: relative; z-index: 1; }
.tv__panel { touch-action: none; }
.tv__panel > .dust {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  border-radius: 0 0 var(--r) var(--r);
  pointer-events: none;
}

.grille {
  flex: 1 1 0;
  min-width: 40px;
  max-width: 260px;
  height: calc(var(--door-h) + 18px);
  border-radius: 4px;
  background:
    repeating-linear-gradient(180deg, #070708 0 2px, #1a1a1d 2px 3px, #222225 3px 5px);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .8), 0 1px 0 rgba(255, 255, 255, .05);
  -webkit-mask: linear-gradient(90deg, transparent, #000 6px, #000 calc(100% - 6px), transparent);
  mask: linear-gradient(90deg, transparent, #000 6px, #000 calc(100% - 6px), transparent);
}

.badge { display: grid; gap: 4px; flex: 0 0 auto; }
.badge__brand {
  font: italic 900 clamp(13px, 1.9vmin, 20px)/1 "Arial Black", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: .06em;
  color: #d9dbe0;
  background: linear-gradient(180deg, #f4f5f8, #9a9ca3 55%, #d6d8dd);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 -1px 0 rgba(0, 0, 0, .7));
}
.badge__model { font: 500 clamp(7px, .95vmin, 10px)/1 var(--f-print); letter-spacing: .22em; color: var(--ink); }
.badge__model i { font-style: normal; padding: 0 3px; margin-left: 3px; border: 1px solid currentColor; border-radius: 2px; }

/* cassette door + the blue-green vacuum fluorescent display */
.deckface { display: flex; align-items: center; gap: clamp(8px, 1.4vmin, 16px); flex: 0 0 auto; }
.door {
  position: relative;
  width: clamp(150px, 25vmin, 300px);
  height: var(--door-h);
  border-radius: 3px;
  background: #040405;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, .95), inset 0 -3px 4px -2px rgba(215, 212, 200, .07), 0 1px 0 rgba(255, 255, 255, .07);
  overflow: hidden;
  perspective: 120px;
}
.door__flap {
  position: absolute;
  inset: 3px;
  display: grid;
  place-items: center;
  border-radius: 2px;
  background:
    linear-gradient(180deg, #2e2e32, #1f1f22 60%, #19191b);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .13), inset 0 -1px 0 rgba(0, 0, 0, .6);
  transform-origin: 50% 0;
  transition: transform .18s ease-in;
}
.door__print { font: 600 clamp(5px, .75vmin, 8px)/1 var(--f-print); letter-spacing: .34em; color: rgba(215, 217, 224, .5); white-space: nowrap; }
.door__tape {
  position: absolute;
  inset: 4px 6px 2px;
  display: grid;
  place-items: center;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, #171717, #0b0b0b);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  transform: translateY(0);
  transition: transform .3s cubic-bezier(.2, .9, .1, 1);
}
.door__label {
  padding: 1px 8px;
  max-width: 86%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  border-radius: 1px;
  background: #ece6d6;
  color: #222;
  font: clamp(7px, 1vmin, 10px)/1.2 var(--f-dos);
}
/* the real eject takes a moment: the motor unthreads, then the flap lifts and the tape slides out */
.door.is-out .door__flap { transform: rotateX(-78deg); transition-delay: 1.15s; }
.door.is-out .door__tape { transform: translateY(2px); transition-delay: 1.3s; }

.vfd {
  position: relative;
  display: flex;
  align-items: center;
  gap: .45em;
  height: var(--door-h);
  padding: 0 .6em;
  border-radius: 3px;
  background: radial-gradient(120% 140% at 50% 0%, #0c1a1c, #030606 70%);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .95), 0 1px 0 rgba(255, 255, 255, .07);
  color: #8af8ff;
  font: clamp(15px, 2.3vmin, 26px)/1 var(--f-osd);
  text-shadow: 0 0 6px rgba(70, 235, 255, .85), 0 0 1px #d8ffff;
  overflow: hidden;
}
.vfd::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .35) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, rgba(255, 255, 255, .06), transparent 40%);
  pointer-events: none;
}
.vfd__ico .icon { width: .6em; height: .6em; filter: drop-shadow(0 0 3px rgba(70, 235, 255, .9)); }
.vfd__digits { letter-spacing: .05em; }
.vfd__side { display: grid; gap: 2px; font-size: .45em; line-height: 1; }
.vfd__side i { font-style: normal; }
.vfd__side b { font-weight: 400; }

/* keys: the label is printed on the panel above the key, the key is plain plastic */
.keys { display: flex; align-items: flex-end; gap: clamp(6px, 1vmin, 12px); flex: 0 0 auto; }
.key { display: grid; justify-items: center; gap: clamp(4px, .6vmin, 7px); }
.key__ink {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font: 600 clamp(6px, .9vmin, 9.5px)/1 var(--f-print);
  letter-spacing: .1em;
  color: var(--ink);
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}
.key__ink .icon { width: 1em; height: 1em; }
.key__pair { display: flex; gap: 3px; }

.key__cap {
  position: relative;
  width: var(--kw);
  height: var(--kh);
  padding: 0;
  border: 0;
  border-radius: 2.5px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .03) 38%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, .22)),
    #2b2b2f;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .2),
    inset 0 -1px 0 rgba(0, 0, 0, .6),
    inset 1px 0 0 rgba(255, 255, 255, .04),
    inset -1px 0 0 rgba(0, 0, 0, .3),
    0 0 0 1px #060607,
    0 2px 0 1px #040405,
    0 3px 5px 1px rgba(0, 0, 0, .55);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 50ms, box-shadow 50ms, background-color 50ms;
}
.key__cap::after { content: ""; position: absolute; inset: -10px -3px; }
.key__cap--sm { width: calc(var(--kw) * .78); }
.key__cap--wide { width: calc(var(--kw) * 1.45); }
.key__cap.is-down {
  transform: translateY(1.5px);
  background-color: #262629;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .1),
    inset 0 -1px 0 rgba(0, 0, 0, .6),
    0 0 0 1px #060607,
    0 .5px 0 1px #040405,
    0 1px 1px 1px rgba(0, 0, 0, .5);
}
.key__cap:focus-visible { outline: 2px solid #ffec5c; outline-offset: 3px; }
/* the little lamp above PLAY */
.key--play .key__ink::after {
  content: "";
  width: 4px; height: 4px;
  margin-left: 2px;
  border-radius: 50%;
  background: #1e3a22;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .6);
}
.key--play.is-lit .key__ink::after { background: #4dff7c; box-shadow: 0 0 5px #4dff7c, 0 0 1px #d4ffe0; }

.pwr { display: grid; justify-items: center; gap: clamp(4px, .6vmin, 7px); flex: 0 0 auto; }
.pwr__ink { font: 600 clamp(6px, .9vmin, 9.5px)/1 var(--f-print); letter-spacing: .1em; color: var(--ink); }
.pwr__row { display: flex; align-items: center; gap: clamp(6px, 1vmin, 10px); }
.pwr__cap {
  display: grid;
  place-items: center;
  width: calc(var(--kh) * 1.9);
  height: calc(var(--kh) * 1.5);
  color: rgba(210, 212, 218, .55);
}
.pwr__cap .icon { width: 42%; height: 42%; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .8)); }
.led {
  width: clamp(5px, .75vmin, 8px);
  height: clamp(5px, .75vmin, 8px);
  border-radius: 50%;
  background: #3a0c0a;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .6), 0 0 0 1px #050505;
}
.led.is-standby { background: #ff3b2f; box-shadow: 0 0 6px rgba(255, 50, 40, .9), inset 0 -1px 1px rgba(0, 0, 0, .3), 0 0 0 1px #050505; }
.led.is-on { background: #46ff78; box-shadow: 0 0 7px rgba(70, 255, 120, .9), inset 0 -1px 1px rgba(0, 0, 0, .25), 0 0 0 1px #050505; }

/* narrower sets: lose the grille, then the brand, then the spare keys */
@media (max-width: 1180px) { .grille { display: none; } }
@media (max-width: 1000px) { .badge { display: none; } .key--opt { display: none; } }

/* phones: two rows. the deck on top, the keys under it */
@media (max-width: 760px) {
  .tv__panel {
    --kw: clamp(34px, 10vw, 46px);
    --kh: 18px;
    --door-h: 28px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "deck deck deck" "vcr tvk pwr";
    align-items: end;
    gap: 12px 8px;
    padding-top: 14px;
  }
  .deckface { grid-area: deck; }
  .door { flex: 1 1 auto; width: auto; }
  .keys--vcr { grid-area: vcr; justify-content: space-between; gap: 6px; }
  .keys--tv { grid-area: tvk; }
  .keys--tv .key--mute { display: none; }
  .pwr { grid-area: pwr; }
  .key__ink, .pwr__ink { font-size: 7.5px; }
}
/* tiny phones: the transport keys keep just their symbols, like plenty of real decks */
@media (max-width: 400px) {
  .tv__panel { --kw: clamp(26px, 8.4vw, 40px); column-gap: 12px; }
  .keys--vcr .key__ink { font-size: 0; gap: 0; }
  .keys--vcr .key__ink .icon { width: 8px; height: 8px; }
  .keys--vcr .key--play .key__ink::after { margin-left: 3px; }
}
/* phones on their side: one slim row */
@media (max-height: 520px) and (orientation: landscape) {
  :root { --bz: 8px; }
  .tv__panel {
    --door-h: 22px;
    --kw: 38px;
    --kh: 14px;
    display: flex;
    gap: 10px;
    padding-block: 8px 6px;
  }
  .grille, .badge, .key--opt, .door__print { display: none; }
  .deckface { flex: 1 1 auto; min-width: 0; }
  .door { flex: 1 1 auto; width: auto; min-width: 60px; }
  .keys--vcr { gap: 5px; }
  .key__ink, .pwr__ink { font-size: 7px; }
}

/* motion preferences ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .fx--grain, .fx--roll::before, .fx--seek i { animation: none; }
  .caret, .dot, .dots::after, .fm__row.is-playing .fm__n, .deck.is-playing .deck__state::before { animation: none; }
  .door__flap, .door__tape { transition: none; }
}

/* the pen needs a box to draw round */
.kv a, .dos__status a { position: relative; display: inline-block; }

/* 9. booting + the tape's moods ------------------------------------------------- */
/* the boot screens sit over the picture, under the vcr's own on-screen display */
.boot { position: absolute; inset: 0; z-index: 18; display: none; overflow: hidden; pointer-events: none; }
.boot.is-on { display: block; }
.boot--clear { background: transparent; }
.boot--blue { background: var(--vcr-blue); }

/* the bios: plain vga text on black */
.boot--post {
  padding: clamp(46px, 8vmin, 84px) clamp(16px, 4vmin, 48px);
  background: #000;
  font: clamp(11px, calc(.55vw + 7px), 18px)/1.35 var(--f-dos);
  color: #aaa;
  text-shadow: 0 0 .35em rgba(255, 255, 255, .25);
}
.post__txt div { white-space: pre-wrap; overflow-wrap: anywhere; }
.post__txt .is-hi { color: #fff; }
.post__logo {
  float: right;
  display: grid;
  justify-items: end;
  gap: .3em;
  margin: 0 0 1em 1.5em;
  padding: .5em .8em;
  border: 2px solid #3a7bd5;
  color: #6fb6ff;
  text-align: right;
}
.post__logo b { font: 400 1.5em/1 "IBM BIOS", var(--f-dos); letter-spacing: .04em; color: #9fd0ff; }
.post__logo span { font-size: .8em; color: #5fd35f; }
@media (max-width: 560px) { .post__logo { display: none; } }

/* the slate after the colour bars */
.boot--slate { display: none; place-items: center; background: #050505; }
.boot--slate.is-on { display: grid; }
.slate { display: grid; justify-items: center; gap: .7em; text-align: center; }
.slate__t { font: clamp(28px, 6vw, 72px)/1 "IBM BIOS", var(--f-dos); color: #f4f4ee; text-shadow: 0 0 .25em rgba(255, 255, 255, .4); }
.slate__s { font-size: clamp(16px, 2vw, 26px); }

/* an old home video left on the tape: a sunset and a camcorder title */
.boot--over {
  background:
    radial-gradient(circle at 50% 66%, rgba(255, 236, 170, .95) 0 6%, rgba(255, 190, 110, .55) 9%, transparent 24%),
    linear-gradient(180deg, #2a3466 0%, #7a4d7e 30%, #d9707a 50%, #f4a261 63%, #f7c47a 66%, #43302f 67%, #1e1716 100%);
  filter: saturate(1.25) blur(.5px);
}
.over__sun { position: absolute; left: 0; right: 0; top: 67%; height: 2px; background: rgba(255, 220, 160, .5); }
.over__title {
  position: absolute;
  left: 50%;
  top: 30%;
  transform: translateX(-50%);
  font: clamp(38px, 8vw, 96px)/1 var(--f-osd);
  letter-spacing: .06em;
  white-space: nowrap;
  color: #fff35c;
  text-shadow: 3px 0 0 #000, -3px 0 0 #000, 0 3px 0 #000, 0 -3px 0 #000, 3px 3px 0 #000, -3px -3px 0 #000, 5px 5px 0 rgba(0, 0, 0, .4);
}
.over__stamp {
  position: absolute;
  right: clamp(18px, 4vmin, 48px);
  bottom: clamp(14px, 3vmin, 34px);
  font-size: clamp(17px, 2vw, 28px);
  line-height: 1.1;
  text-align: right;
  color: var(--stamp);
}
/* the splice: the old recording tears sideways and a rainbow of chroma noise runs through it */
.boot.is-tear { animation: tear .44s steps(6, end) forwards; }
.boot.is-tear::after {
  content: "";
  position: absolute;
  left: -5%;
  right: -5%;
  top: -20%;
  height: 16%;
  background: linear-gradient(90deg, #f0f, #0ff 20%, #ff0 40%, #f00 60%, #0f0 80%, #00f);
  mix-blend-mode: screen;
  opacity: .7;
  animation: tearband .44s linear forwards;
}
@keyframes tear {
  0% { transform: none; filter: none; }
  20% { transform: translateX(-6%) skewX(-8deg); filter: hue-rotate(60deg); }
  40% { transform: translateX(9%) skewX(10deg) scaleY(1.05); filter: hue-rotate(-90deg) brightness(1.4); }
  60% { transform: translateX(-3%) translateY(-12%); filter: saturate(3) contrast(1.6); }
  80% { transform: translateX(4%) translateY(18%) skewX(-4deg); filter: brightness(2); }
  100% { transform: translateY(30%); filter: brightness(3); opacity: .4; }
}
@keyframes tearband { to { top: 110%; } }

/* the tracking readout while it hunts */
.boot__track {
  position: absolute;
  left: 50%;
  bottom: clamp(60px, 11vmin, 110px);
  transform: translateX(-50%);
  font-size: clamp(20px, 2.6vw, 34px);
  white-space: nowrap;
}

/* pause on a vhs: the still frame shivers and two noise bars sit across it */
.fx--pause { display: none; overflow: hidden; }
.picture.is-paused .fx--pause { display: block; }
.fx--pause i {
  position: absolute;
  left: -4%;
  right: -4%;
  height: 4.5%;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .6) 0 2px, transparent 2px 7px, rgba(255, 255, 255, .3) 7px 9px, transparent 9px 19px, rgba(0, 0, 0, .4) 19px 23px, transparent 23px 31px),
    linear-gradient(180deg, transparent, rgba(255, 255, 255, .25) 40%, rgba(0, 0, 0, .35) 60%, transparent);
}
.fx--pause i:nth-child(1) { top: 24%; }
.fx--pause i:nth-child(2) { top: 71%; height: 3.4%; }
/* the 60 hz hum bar: a soft dark band that rolls up through the picture now and then */
.fx--hum { overflow: hidden; }
.fx--hum::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 24%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .16) 45%, rgba(0, 0, 0, .16) 55%, transparent);
}
.fx--hum.is-on::before { animation: hum 5.5s linear 1 forwards; }
@keyframes hum { to { top: -26%; } }

/* the deck's display after a power cut */
.vfd.is-12 .vfd__digits { position: relative; visibility: hidden; }
.vfd.is-12 .vfd__digits::after { content: "12:00"; position: absolute; left: 0; top: 0; visibility: visible; animation: blink 1s steps(1, end) infinite; }

@media (prefers-reduced-motion: no-preference) {
  .fx--pause i { animation: pausebar .18s steps(2, end) infinite; }
  .fx--pause i:nth-child(2) { animation-duration: .23s; animation-direction: reverse; }
  .picture.is-paused .scroller { animation: pausejit .16s steps(2, end) infinite; }
  .picture.is-search .scroller { animation: searchjit .1s steps(2, end) infinite; }
  .picture.is-hunt .scroller { animation: huntjit .14s steps(2, end) infinite; }
}
@keyframes pausebar { 50% { transform: translate(-1.5%, 2px); } }
@keyframes pausejit { 50% { transform: translateY(1px); } }
@keyframes searchjit {
  0% { transform: skewX(-2.5deg) translateX(-5px) scaleY(1.02); }
  50% { transform: skewX(1.5deg) translateX(4px) scaleY(.99); }
}
@keyframes huntjit { 0% { transform: translateX(-3px); } 50% { transform: translateX(2px); } }

/* the tape's condition: a mint tape is crisp, a chewed one smears and fizzes */
[data-tape="mint"] .fx--grain { opacity: calc(var(--grain) * .7); }
[data-tape="chewed"] .fx--grain { opacity: calc(var(--grain) * 1.6); }
[data-tape="mint"] .dos { text-shadow: var(--glow), -.04em 0 0 rgba(255, 40, 80, .22), .04em 0 0 rgba(40, 220, 255, .22); }
[data-tape="chewed"] .dos { text-shadow: var(--glow), -.1em 0 0 rgba(255, 40, 80, .36), .1em 0 0 rgba(40, 220, 255, .36); }
[data-tape="chewed"] .fx--roll::before { animation-duration: 7s; }
@media (hover: hover) and (pointer: fine) {
  [data-tape="mint"] .scroller { filter: blur(.25px) saturate(1.15) contrast(1.04); }
  [data-tape="chewed"] .scroller { filter: blur(.65px) saturate(.9) contrast(1.08) brightness(.97); }
}
@media (prefers-reduced-motion: no-preference) {
  [data-tape="chewed"] .scroller { animation-duration: 2.3s; }
  [data-tape="mint"] .scroller { animation-duration: 7s; }
}
@media (prefers-reduced-motion: reduce) {
  .boot.is-tear, .boot.is-tear::after, .fx--hum.is-on::before, .vfd.is-12 .vfd__digits::after { animation: none; }
}

/* 10. the home: imprimante's page, like a game's page, on the tape ------------------ */
/* PLAY ON WEB: the big key, with a little globe */
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 1em 2.4ch; margin-top: .4em; }
.weplay {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 1.1ch;
  padding: .45em 2.2ch .38em;
  border: 0;
  background: var(--sel);
  color: var(--sel-ink);
  font: inherit;
  font-size: clamp(18px, 2.4vmin, 28px);
  letter-spacing: .06em;
  text-shadow: none;
  box-shadow: .6ch .4em 0 var(--drop);
  cursor: pointer;
  touch-action: manipulation;
}
a.weplay { text-decoration: none; }
/* the other systems, small under the download */
.dl__more { margin: .9em 0 0; font-size: clamp(13px, 1.6vmin, 17px); color: var(--dim, #9aa0c8); letter-spacing: .04em; }
.dl__more a { color: inherit; text-decoration: underline; text-underline-offset: .2em; }
.dl__more a:hover, .dl__more a:focus-visible { color: var(--acc); outline: none; }
.dl__more a[aria-current="true"] { color: var(--ink, #fff); text-decoration: none; }
.weplay svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.weplay:hover, .weplay:focus-visible { background: var(--acc); color: #111; outline: none; }
.weplay.is-down { transform: translate(.6ch, .4em); box-shadow: none; }

/* the dos boxes' own keys: solid drop shadow, like the play key */
.dkey {
  padding: .12em 1.2ch .08em;
  border: 0;
  background: var(--bar);
  color: var(--bar-ink);
  font: inherit;
  text-shadow: none;
  box-shadow: .6ch .4em 0 var(--drop);
  cursor: pointer;
  touch-action: manipulation;
}
@media (pointer: coarse) { .dkey { min-height: 34px; padding-top: .35em; } }
.dkey:hover, .dkey:focus-visible { background: var(--acc); color: #111; outline: none; }
.dkey.is-down { transform: translate(.6ch, .4em); box-shadow: none; }
/* the menu key in the status line */
.dos__key { padding: 0 .4ch; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.dos__key b { font-weight: 400; color: var(--hot); }
.dos__key:hover, .dos__key:focus-visible { background: var(--bar-ink); color: var(--bar); outline: none; }

/* pics.vhs: the game, on tape. ◀◀ / ▶▶ go through it, ▮▮ holds it */
.dos__cols--home { grid-template-columns: minmax(0, 1fr); }
.win--pics .pics, .win--pics .pics__bar { max-width: 1040px; margin-inline: auto; }
.pics { margin: 0; }
.pics__screen { position: relative; display: block; padding: 4px; }
.pics__frame { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.pics__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pics__frame.is-seek .pics__img { animation: seek .32s steps(4, end); }
@keyframes seek {
  0% { transform: translateY(0); filter: brightness(1.3) contrast(1.3); clip-path: inset(0 0 0 0); }
  25% { transform: translateY(-6%) skewX(-3deg); clip-path: inset(30% 0 40% 0); }
  50% { transform: translateY(4%) skewX(2deg); filter: brightness(.8) saturate(1.6); }
  75% { transform: translateY(-2%); clip-path: inset(0 0 12% 0); }
  100% { transform: none; filter: none; clip-path: inset(0 0 0 0); }
}
.pics__osd, .pics__count { position: absolute; z-index: 1; font-family: var(--f-osd); font-size: clamp(14px, 1.9vmin, 22px); color: #fff; text-shadow: 2px 2px 0 rgba(0, 0, 0, .7); pointer-events: none; }
.pics__osd { left: 4%; top: 5%; }
.pics__count { right: 4%; bottom: 5%; color: #ffd36a; }
.pics__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8em 2ch; margin-top: .7em; }
.pics__keys { display: flex; gap: .6em 1.2ch; }
.pics__thumbs { display: flex; gap: 1ch; padding: 0; list-style: none; }
.pics__thumbs button { position: relative; display: block; width: clamp(40px, 6vmin, 76px); aspect-ratio: 16 / 9; padding: 0; border: 2px solid var(--frame-dim); background: #000 center / cover no-repeat; cursor: pointer; opacity: .65; }
.pics__thumbs button[aria-current="true"] { border-color: var(--acc); opacity: 1; }
.pics__thumbs button:hover, .pics__thumbs button:focus-visible { opacity: 1; outline: none; }

/* the tip jar: a quiet ♡ tip in the status line. it opens a small box above it, nothing more */
.dos__status .tipjar { position: relative; margin-left: auto; }
.dos__status .tipjar + a { margin-left: 2ch; }
.tipjar__btn { display: inline-flex; align-items: center; gap: .5ch; }
.tipjar__btn .doodle { width: .9em; height: .9em; stroke-width: 2.2; vertical-align: 0; filter: none; color: var(--hot); }
.tipjar__btn[aria-expanded="true"] { background: var(--bar-ink); color: var(--bar); }
@media (pointer: coarse) { .tipjar__btn { min-height: 32px; } }
.tipjar__pop {
  position: absolute;
  right: 0;
  bottom: calc(100% + 1.2em);
  z-index: 30;
  display: grid;
  gap: .8em;
  width: max-content;
  padding: 1em calc(1.6ch + 4px) .9em;
  background: var(--win);
  color: var(--txt);
  text-shadow: var(--glow);
  box-shadow: .6ch .4em 0 var(--drop);
}
.tipjar__pop[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) { .tipjar__pop:not([hidden]) { animation: popup .16s steps(4, end); } }
@keyframes popup { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
.tip__bar { display: flex; align-items: stretch; gap: 1.2ch; }
.tip__field {
  display: inline-flex;
  align-items: baseline;
  gap: .2ch;
  padding: .05em .8ch 0;
  background: rgba(0, 0, 20, .42);
  box-shadow: inset 0 0 0 1px var(--frame-dim);
}
.tip__field:focus-within { box-shadow: inset 0 0 0 1px var(--frame), 0 0 .6em rgba(255, 255, 255, .15); }
.tip__amount {
  width: 1.3ch; /* the script sizes it to the number */
  min-width: 1.3ch;
  padding: 0;
  border: 0;
  background: none;
  color: var(--hi);
  font: inherit;
  font-size: 1.5em;
  line-height: 1.15;
  text-align: right;
  caret-color: var(--acc);
  outline: none;
}
.tip__amount[aria-invalid="true"] { color: var(--hot); }
.tip__cur { font-size: 1.25em; color: var(--acc); }
.tipgo { justify-self: stretch; }
.tip__note { margin: 0; max-width: 24ch; font: 1.1em/1.15 "Gochi Hand", var(--f-dos); color: var(--acc); text-shadow: none; rotate: -1deg; }
.tip__note:empty { display: none; }
.tip__note.is-on { animation: tagin .25s ease-out; }

/* github, as a little block logo in the status line */
.gh { position: relative; display: inline-block; width: 1.5em; vertical-align: -.35em; }
.gh[hidden] { display: none; }
.gh__art svg { display: block; width: 100%; height: auto; overflow: visible; color: var(--shade); }
.gh__art .px { fill: var(--bar-ink); }
.gh:hover .px, .gh:focus-visible .px { fill: var(--hot); }
.gh:focus-visible { outline: none; }

/* the game takes the whole window: the set steps out of the way */

/* in the game: full screen (where the browser can) */
.game__full {
  position: absolute;
  left: calc(clamp(14px, 3vmin, 36px) + env(safe-area-inset-left));
  bottom: calc(clamp(10px, 2.2vmin, 26px) + env(safe-area-inset-bottom));
  z-index: 3;
  padding: .1em .6ch;
  border: 0;
  background: rgba(10, 14, 52, .55);
  font-size: clamp(13px, 1.7vmin, 18px);
  color: rgba(255, 253, 246, .85);
  cursor: pointer;
}
.game__full[hidden] { display: none; }
.game__full:hover, .game__full:focus-visible { background: #fffdf6; color: #1b1a4a; text-shadow: none; outline: none; }
