/* A VCR on a CRT: white on-screen-display text on black. Colour is only the REC light and errors. */
:root {
  --black: #050505;
  --white: #ececec;
  --dim: #8b8b8b;
  --red: #ff3b30;
  --amber: #ffb000;
  --osd: "VT323", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--black); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--black);
  color: var(--white);
  font: 24px/1.35 var(--osd);
  /* phosphor: a little glow, and the faint colour fringe of a composite signal */
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.28), 1px 0 0 rgba(255, 60, 60, 0.18), -1px 0 0 rgba(60, 160, 255, 0.18);
}

.crt { position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.28) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.5) 100%); }

.osd { position: fixed; top: 0; left: 0; right: 0; z-index: 40; display: flex; justify-content: space-between;
  padding: 18px 28px; font-size: 36px; line-height: 1; text-transform: uppercase; }
#osd-mode.recording::first-letter { color: var(--red); text-shadow: 0 0 8px var(--red); }

main { max-width: 680px; margin: 0 auto; padding: 130px 24px 70px; }
section { margin-top: 64px; }

h1 { margin: 0; font-size: 92px; font-weight: 400; line-height: 0.9; text-transform: uppercase; letter-spacing: 0.02em; }
h2 { margin: 0 0 14px; font-size: 32px; font-weight: 400; text-transform: uppercase; }
p { margin: 14px 0 0; }
.dim { color: var(--dim); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { background: var(--white); color: var(--black); text-decoration: none; text-shadow: none; }

/* the drop target reads like a VCR menu line; selected means inverted */
.insert { display: inline-block; margin: 0 0 0 -10px; padding: 4px 10px; border: 0; background: none; color: var(--white);
  font: 56px/1 var(--osd); text-transform: uppercase; text-shadow: inherit; cursor: pointer; }
.insert::before { content: "▶ "; }
.insert:not(:disabled):hover, .insert:focus-visible, body.dragging .insert {
  background: var(--white); color: var(--black); text-shadow: none; outline: none; }
/* once a tape is in, the line shows what the deck is doing and takes no clicks */
.insert:disabled { cursor: default; }
.insert:disabled .cursor { display: none; }
.insert[data-tape="reading"] { color: var(--dim); cursor: progress; }
.insert[data-tape="reading"]::before { content: "◀◀ "; }
.insert[data-tape="recording"] { cursor: progress; }
.insert[data-tape="recording"]::before { content: "● "; color: var(--red); text-shadow: 0 0 8px var(--red); }
.insert[data-tape="recorded"]::before { content: "■ "; }
.cursor { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* dragging a file over the page */
.release { position: fixed; inset: 0; z-index: 45; display: none; place-items: center; background: rgba(5, 5, 5, 0.86);
  font-size: 64px; text-transform: uppercase; pointer-events: none; }
body.dragging .release { display: grid; }

.meter { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 14px; margin-top: 26px; }
#progress-fill { letter-spacing: -0.05em; }
#progress-text { text-transform: uppercase; white-space: nowrap; }

.msg.ok { color: var(--white); }
.msg.warn { color: var(--amber); }
.msg.err { color: var(--red); }

.eject { display: inline-block; margin-top: 22px; padding: 6px 14px; background: var(--white); color: var(--black);
  font-size: 34px; text-transform: uppercase; text-decoration: none; text-shadow: none; }
.eject::before { content: "⏏ "; }
.eject:hover { background: var(--white); color: var(--black); animation: blink 1s steps(1) infinite; }

.log { margin-top: 18px; color: var(--dim); }
.log summary { cursor: pointer; text-transform: uppercase; }
.log pre { margin: 8px 0 0; font: 18px/1.3 var(--osd); white-space: pre-wrap; }

ol, ul { margin: 0; padding-left: 0; list-style: none; }
ol { counter-reset: n; }
ol li { counter-increment: n; position: relative; padding-left: 44px; margin-bottom: 10px; }
ol li::before { content: counter(n) "."; position: absolute; left: 0; color: var(--dim); }
ul li { margin-bottom: 4px; }

/* credits and footer: small print */
.credits { margin-top: 88px; color: var(--dim); font-size: 15px; line-height: 1.25; text-shadow: none; }
.credits h2 { margin-bottom: 6px; font-size: 15px; letter-spacing: 0.08em; }
.credits li { margin-bottom: 1px; }
footer { margin-top: 22px; font-size: 15px; text-shadow: none; }

@media (max-width: 560px) {
  body { font-size: 21px; }
  .osd { font-size: 28px; padding: 12px 16px; }
  main { padding-top: 96px; }
  h1 { font-size: 64px; }
  .insert { font-size: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor, .eject:hover { animation: none; }
}
