/* WYEM: a gray Maxell XLII on a pale tabletop. The J-card is "now playing"; the pile of
   spines below is the broadcast history. */
:root {
  --desk: #ebeae6;
  --desk-2: #f7f6f3;
  --paper: #f4f2ec;
  --paper-line: #cfd0cb;
  --shell: #5c5d62;
  --shell-dark: #4a4b50;
  --shell-text: #f1efe9;
  --gold: #cdb67e;
  --ink: #26388c;
  --ink-soft: #5b67a3;
  --ink-black: #1f1f22;
  --print: #9a9893;
  --red: #c8352b;
  --text: #2f2e2c;
  --muted: #77736c;
  --hand: "Nanum Pen Script", "Bradley Hand", cursive;
  --narrow: "Archivo Narrow", "Arial Narrow", sans-serif;
  --line: 30px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--desk);
  color: var(--text);
  font-family: var(--narrow);
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; }

/* ---- Masthead ---------------------------------------------------------------- */

/* The page title is read by screen readers; the cassette carries the name visually. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* How many people are tuned in to the station right now. */
.listeners {
  display: inline-flex; align-items: center; padding: 7px 12px;
  border: 1px solid #d6d3cc; border-radius: 4px; background: var(--desk-2);
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.listeners:empty { display: none; }

.desk { max-width: 980px; margin: 0 auto; padding: 32px 20px 40px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 34px; }

/* ---- The player: each skin draws it (public/skins/<skin>.css) ------------------------- */

.player { --p: 0; /* 0..1 through the current track, set by app.js */ display: grid; justify-items: center; gap: 14px; }

/* ---- Handwriting ------------------------------------------------------------------ */

.ink { font-family: var(--hand); color: var(--ink); font-size: 27px; line-height: var(--line); }
.ink.muted, .tracks .muted { color: var(--ink-soft); }

/* ---- J-card -------------------------------------------------------------------------- */

.jcard {
  background: var(--paper); border-radius: 3px; overflow: hidden; border: 1px solid #d8d6cf;
  box-shadow: 0 1px 2px rgba(40, 36, 30, 0.12), 0 10px 24px rgba(40, 36, 30, 0.12);
  color: var(--ink);
}

.panels { display: grid; grid-template-columns: 1fr 1fr; }
.panel {
  position: relative; min-height: calc(var(--line) * 8); padding: 26px 26px 12px;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--line) - 1px), var(--paper-line) calc(var(--line) - 1px), var(--paper-line) var(--line));
  background-position: 0 25px;
}
.panel + .panel { border-left: 1px solid #dddcd6; }

.tracks { list-style: none; margin: 0; padding: 0; }
.tracks li { display: flex; gap: 10px; align-items: baseline; white-space: nowrap; }
.tracks li a { text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.tracks li a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.tracks li .mark { flex: none; margin-left: -2px; }
.tracks li .t { margin-left: auto; font-size: 22px; opacity: 0.7; }
.tracks li.done { opacity: 0.55; }
.tracks .muted { opacity: 0.6; }
/* The pen has one weight, so "bolder" means pressing harder: a stroke of the same ink. */
.tracks li.now { -webkit-text-stroke: 0.9px currentColor; paint-order: stroke fill; }
.tracks li.now .t { opacity: 1; }

.jcard .note { margin: 0; font-size: 24px; white-space: normal; }
.jcard .notes-h { margin: 0; font-weight: 400; font-size: 27px; }
.note a { text-decoration: none; }
.note a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.jcard .note.source { margin-top: 4px; padding-left: 18px; font-size: 21px; opacity: 0.7; }
.note.source:empty { display: none; }

.nr { font-size: 11px; letter-spacing: 0.08em; color: var(--print); line-height: 1.15; white-space: nowrap; }

/* Spine */
.spine { display: grid; grid-template-columns: 34px 1fr 34px; text-decoration: none; background: var(--paper); border-bottom: 2px solid #c9c8c2; }
.band {
  background: var(--shell); color: var(--shell-text); writing-mode: vertical-rl; transform: rotate(180deg);
  display: grid; place-items: center; font-family: "Archivo Black", sans-serif; font-size: 13px; letter-spacing: 0.02em; padding: 6px 0;
}
.band.xl { transform: none; font-family: "Antonio", sans-serif; font-size: 17px; letter-spacing: 0.04em; }
.spine-label { display: flex; align-items: center; gap: 1em; padding: 8px 18px; min-height: 78px; min-width: 0; font-size: 30px; line-height: 1.05; }
.spine-label .set { margin-left: auto; white-space: nowrap; }
.spine:hover .spine-main { text-decoration: underline; text-decoration-thickness: 1px; }

/* ---- The label, in blue ballpoint ---------------------------------------------------- */

.lbl { font-family: var(--hand); color: var(--ink); }
.spine-main, .tape-main { display: flex; align-items: center; gap: 0.8em; min-width: 0; white-space: nowrap; overflow: hidden; }
.lb-when { font-size: 1.45em; letter-spacing: 0.02em; white-space: nowrap; }
.lb-where { display: flex; flex-direction: column; align-items: center; font-size: 0.85em; line-height: 1.1; text-align: center; min-width: 0; }
.lb-where span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---- The pile of spines -------------------------------------------------------------- */

.stack h2 { margin: 0 0 14px; font-family: var(--narrow); font-weight: 500; font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.stack ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.stack li { transform: translateX(var(--dx, 0)) rotate(var(--rot, 0deg)); }
.stack li.empty { color: var(--muted); font-family: var(--hand); font-size: 26px; }
.tape {
  display: grid; grid-template-columns: 26px 1fr 26px; min-height: 52px; text-decoration: none;
  background: var(--shell); border-radius: 2px; box-shadow: 0 2px 3px rgba(40, 36, 30, 0.25);
}
.tape .band { font-size: 10px; padding: 3px 0; }
.tape .band.xl { font-size: 13px; }
.tape-label {
  background: var(--paper); margin: 5px 0; padding: 3px 14px; min-width: 0; font-size: 22px; line-height: 1.1;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main set" "songs songs"; align-items: center; column-gap: 14px;
}
.tape-main { grid-area: main; }
.tape-label .set { grid-area: set; white-space: nowrap; }
.tape-songs { grid-area: songs; font-size: 0.68em; opacity: 0.75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tape:hover .tape-main { text-decoration: underline; text-decoration-thickness: 1px; }

/* ---- What's playing: every station on the dial, a plain list in the footer ------------ */

.dial { flex-basis: 100%; padding-top: 18px; border-top: 1px solid rgba(0, 0, 0, 0.08); }
.dial h2 { margin: 0 0 8px; font-family: var(--narrow); font-weight: 500; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.dial-list { list-style: none; margin: 0; padding: 0; display: grid; }
.dial-card {
  display: grid; grid-template-columns: 52px 110px minmax(0, 1fr) auto; align-items: baseline; gap: 12px;
  padding: 6px 0; border-bottom: 1px solid rgba(0, 0, 0, 0.05); text-decoration: none; color: var(--muted);
  font-family: var(--narrow); font-size: 13px; letter-spacing: 0.02em;
}
.dial-call { font-weight: 500; letter-spacing: 0.08em; color: var(--text); white-space: nowrap; }
.dial-song { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.dial-show { color: var(--muted); }
.dial-count { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; }
a.dial-card:hover .dial-song { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a.dial-card:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.dial-card.here .dial-call::before { content: "● "; font-size: 0.7em; vertical-align: 0.15em; }

footer {
  max-width: 980px; margin: 0 auto; padding: 0 20px 40px; color: var(--muted); font-size: 12px; letter-spacing: 0.04em;
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
}
footer p { margin: 0; }
footer a { color: var(--ink); }
.powered { letter-spacing: 0.14em; text-transform: uppercase; }
.powered a { text-decoration: none; border-bottom: 1px solid currentColor; }

/* ---- Phones ---------------------------------------------------------------------------- */

@media (max-width: 720px) {
  :root { --line: 28px; }
  .desk { padding: 20px 16px 32px; gap: 26px; }
  .jcard .ink { font-size: 25px; }
  .panels { grid-template-columns: 1fr; }
  .panel { min-height: 0; padding: 22px 16px 10px; background-position: 0 21px; }
  .panel + .panel { border-left: 0; border-top: 1px solid #dddcd6; }
  .jcard .note { font-size: 21px; }
  .spine { grid-template-columns: 26px 1fr 26px; }
  .spine-label { padding: 8px 12px; font-size: 24px; }
  .spine-main { flex-wrap: wrap; gap: 2px 0.6em; white-space: normal; }
  .tape-label { padding: 2px 10px; column-gap: 10px; font-size: 19px; }
  .dial-card { grid-template-columns: 58px minmax(0, 1fr) auto; row-gap: 0; }
  .dial-band { display: none; }
}
