/* READAUDIOTISTIA — calm shell, loud on-air card. Tokens first; components use tokens only. */
@font-face { font-family: "PT Serif"; src: local("PT Serif"), url(fonts/PT_Serif-Web-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PT Serif"; src: local("PT Serif Bold"), url(fonts/PT_Serif-Web-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "PT Serif"; src: local("PT Serif Italic"), url(fonts/PT_Serif-Web-Italic.woff2) format("woff2"); font-style: italic; font-display: swap; }
@font-face { font-family: "PT Sans Narrow"; src: local("PT Sans Narrow"), url(fonts/PT_Sans-Narrow-Web-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PT Sans Narrow"; src: local("PT Sans Narrow Bold"), url(fonts/PT_Sans-Narrow-Web-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --paper: #EFE5CF;
  --surface: #F7F0DF;
  --ink: #1C1A17;
  --ink-2: #4B443A;
  --line: #CDBF9F;
  --brick: #B5382C;
  --brick-ink: #9A2E24;
  --mustard: #D8A23A;
  --teal: #2F5D58;
  --focus: #2F5D58;

  --serif: "PT Serif", Georgia, "Times New Roman", serif;
  --sans: "PT Sans Narrow", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;

  --fs-xs: 13px; --fs-s: 15px; --fs-m: 17px; --fs-l: 20px; --fs-xl: 26px; --fs-xxl: 34px;
  --r-s: 4px; --r-m: 12px;
  --shadow-1: 0 1px 0 rgba(28, 26, 23, .12);
  --shadow-2: 0 10px 28px -14px rgba(28, 26, 23, .45);
  --t-fast: 160ms; --t-mid: 240ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --tabs-h: 64px;
  --pad: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 var(--fs-m)/1.5 var(--serif);
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom));
}
img { max-width: 100%; display: block; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--r-s); }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
.noscript { padding: var(--pad); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.top {
  display: flex; align-items: center; justify-content: space-between;
  height: 52px; padding: 0 var(--pad); border-bottom: 1px solid var(--line); background: var(--paper);
}
.wordmark { font: 700 var(--fs-l)/1 var(--sans); letter-spacing: .06em; color: var(--ink); text-decoration: none; }
.wordmark span { color: var(--brick); }
.lang {
  min-width: 44px; min-height: 44px; border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--r-s); font: 700 var(--fs-s)/1 var(--sans); letter-spacing: .08em; cursor: pointer;
}
.lang:hover { border-color: var(--ink); }

/* layout */
main { max-width: 760px; margin: 0 auto; padding: var(--pad); outline: none; }
.view > h1, .view > header h1 { font: 700 var(--fs-xs)/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); margin: 8px 0 12px; }
h2 { font: 700 var(--fs-xl)/1.2 var(--serif); margin: 0 0 8px; }
h3 { font: 700 var(--fs-s)/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin: 28px 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--ink-2); }
.meta { font: 400 var(--fs-s)/1.4 var(--sans); color: var(--ink-2); letter-spacing: .02em; }
.mono { font: 400 var(--fs-xs)/1.4 ui-monospace, "SF Mono", Menlo, monospace; color: var(--ink-2); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: var(--r-s); cursor: pointer; text-decoration: none;
  font: 700 var(--fs-m)/1 var(--sans); letter-spacing: .06em; text-transform: uppercase;
  border: 2px solid var(--ink); background: var(--ink); color: var(--paper);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.btn:hover { background: #000; border-color: #000; color: #fff; }
.btn.primary { background: var(--brick-ink); border-color: var(--brick-ink); color: #FFF8EA; }
.btn.primary:hover { background: #7E241C; border-color: #7E241C; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); min-height: 44px; padding: 0 14px; font-size: var(--fs-s); }
.btn.ghost:hover { border-color: var(--ink); background: var(--surface); }
.btn:disabled { background: var(--surface); border-color: var(--line); color: var(--ink-2); cursor: not-allowed; }
.btn[aria-busy="true"]::after { content: "…"; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }

/* stage (player) */
.stage { position: sticky; top: 0; z-index: 20; background: var(--ink); color: var(--paper); }
.screen { position: relative; max-width: 760px; margin: 0 auto; aspect-ratio: 16 / 9; max-height: 42vh; }
.yt, .yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.card-on-screen { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; background: var(--ink); }
.stage-bar { max-width: 760px; margin: 0 auto; display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 8px var(--pad); }
.stage-meta { font: 400 var(--fs-s)/1.3 var(--sans); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-actions { display: flex; gap: 8px; flex-shrink: 0; }
.stage .btn.ghost { color: var(--paper); border-color: #6E6658; }
.stage .btn.ghost:hover { border-color: var(--paper); background: #2A2721; }

/* on-air card: the one loud object */
.onair {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m);
  padding: 20px 20px 16px; box-shadow: var(--shadow-2); margin: 4px 0 16px;
}
.program { font: 700 var(--fs-xxl)/1.1 var(--serif); margin: 0 0 4px; }
.block-time { font: 400 var(--fs-s)/1.3 var(--sans); color: var(--ink-2); margin-bottom: 16px; }
.stamp {
  position: absolute; top: 14px; right: 14px; transform: rotate(-7deg);
  font: 700 var(--fs-s)/1 var(--sans); letter-spacing: .16em; text-transform: uppercase;
  color: var(--brick-ink); border: 3px double var(--brick-ink); padding: 6px 10px; border-radius: var(--r-s);
  background: transparent;
}
.stamp.live { color: #FFF8EA; background: var(--brick-ink); border-color: #FFF8EA; outline: 2px solid var(--brick-ink); }
.stamp.thunk { animation: thunk var(--t-mid) var(--ease); }
@keyframes thunk { from { transform: rotate(-7deg) scale(1.25); } to { transform: rotate(-7deg) scale(1); } }

.scene { margin: 0; }
.scene .book { font: 700 var(--fs-s)/1.3 var(--sans); letter-spacing: .04em; color: var(--teal); text-transform: uppercase; }
.scene blockquote { margin: 8px 0; font: italic 400 var(--fs-l)/1.4 var(--serif); }
.scene .music { font-weight: 700; }
.grade { display: inline-block; font: 700 var(--fs-xs)/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; padding: 4px 6px; border-radius: var(--r-s); border: 1px solid currentColor; color: var(--teal); vertical-align: 2px; margin-left: 6px; }
.grade.named, .grade.quoted { color: var(--brick-ink); }

/* jingle / lost cards on the screen: sticker energy, static (no loops) */
.sting { font: 700 clamp(28px, 8vw, 56px)/1 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--mustard); transform: rotate(-4deg); }
.sting small { display: block; margin-top: 12px; font: 400 var(--fs-m)/1.3 var(--serif); letter-spacing: 0; text-transform: none; color: var(--paper); transform: rotate(4deg); }
.lost-card { max-width: 32em; }
.lost-card .label { font: 700 var(--fs-s)/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--mustard); }
.lost-card blockquote { font: italic 400 var(--fs-l)/1.4 var(--serif); margin: 12px 0; color: var(--paper); }

/* lists */
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list li { border-bottom: 1px solid var(--line); }
.item {
  display: grid; grid-template-columns: 44px 1fr; gap: 12px; width: 100%; text-align: left; padding: 12px 4px;
  background: transparent; border: 0; cursor: pointer; min-height: 56px; color: var(--ink);
}
.item:hover { background: var(--surface); }
.item[aria-current="true"] { background: var(--surface); box-shadow: inset 4px 0 0 var(--brick-ink); }
.item .when, .item .num { font: 700 var(--fs-s)/1.3 var(--sans); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.item .what { font: 700 var(--fs-m)/1.35 var(--serif); }
.item .where { font: 400 var(--fs-s)/1.4 var(--sans); color: var(--ink-2); }
.item.static { cursor: default; }
.item.static:hover { background: transparent; }

/* shelf */
.shelf { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 600px) { .shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); } main { max-width: 980px; } }
.tile { display: block; text-decoration: none; color: var(--ink); }
.tile img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-s); box-shadow: var(--shadow-1); background: var(--surface); }
.tile:hover img { box-shadow: var(--shadow-2); }
.tile .name { font: 700 var(--fs-m)/1.25 var(--serif); margin-top: 8px; }
.tile .meta { margin-top: 2px; }
.pl-head { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: start; margin: 8px 0; }
.pl-head img { border-radius: var(--r-s); box-shadow: var(--shadow-1); }
.back { display: inline-flex; min-height: 44px; align-items: center; font: 700 var(--fs-s)/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; }

/* find */
.search label { display: block; font: 700 var(--fs-s)/1.3 var(--sans); letter-spacing: .04em; margin-bottom: 6px; }
.search .field { display: flex; gap: 8px; }
.search input {
  flex: 1; min-width: 0; min-height: 48px; padding: 0 14px; font: 400 var(--fs-m)/1 var(--serif);
  background: var(--surface); color: var(--ink); border: 2px solid var(--line); border-radius: var(--r-s);
}
.search input:hover { border-color: var(--ink-2); }
.search input:focus-visible { border-color: var(--focus); outline-offset: 0; }
.search input::placeholder { color: var(--ink-2); }
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.examples button { min-height: 44px; padding: 0 12px; border: 1px solid var(--line); background: transparent; border-radius: var(--r-s); font: 400 var(--fs-s)/1 var(--sans); cursor: pointer; color: var(--ink); }
.examples button:hover { border-color: var(--ink); background: var(--surface); }
.why { font: 400 var(--fs-xs)/1.3 var(--sans); color: var(--teal); letter-spacing: .04em; }
.notice { border-left: 4px solid var(--mustard); background: var(--surface); padding: 12px 14px; border-radius: var(--r-s); margin: 12px 0; }
.notice.error { border-left-color: var(--brick-ink); }
.skeleton { background: var(--surface); border-radius: var(--r-s); min-height: 56px; margin: 8px 0; }

/* tabs */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center;
  background: var(--paper); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  flex: 1; max-width: 180px; height: var(--tabs-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--ink-2); font: 700 var(--fs-s)/1 var(--sans); letter-spacing: .08em; text-transform: uppercase;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 3px 0 var(--brick-ink); }
.tab-ico { font-size: var(--fs-l); line-height: 1; }

.footer { margin: 40px 0 8px; }

/* radio (own audio stream) and credits */
.radio-box { margin: 20px 0; }
.radio-play { min-height: 64px; width: 100%; max-width: 420px; font-size: var(--fs-l); }
.radio-status { margin: 12px 0 0; font: 400 var(--fs-m)/1.4 var(--sans); min-height: 2.8em; overflow-wrap: anywhere; }
.view a.btn { text-decoration: none; }
.credits { margin-top: 12px; }
.credit { padding: 14px 4px; }
.credit .what { font: 700 var(--fs-m)/1.35 var(--serif); }
.credit .where { font: 400 var(--fs-s)/1.4 var(--sans); color: var(--ink-2); }
.credit-facts { margin: 8px 0 0; display: grid; gap: 2px; }
.credit-facts div { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 12px; align-items: center; }
.credit-facts dt { font: 700 var(--fs-xs)/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.credit-facts dd { margin: 0; font: 400 var(--fs-m)/1.3 var(--sans); overflow-wrap: anywhere; }
.credit-facts .artist { white-space: pre-line; }
.credit-facts a { display: inline-flex; align-items: center; min-height: 44px; }
.credit .mono { margin-top: 4px; overflow-wrap: anywhere; }

/* a card replaces the player while it shows; it is never drawn over a visible player */
.screen.has-card .yt { display: none; }
.card-on-screen { overflow: auto; }

/* TV mode: full viewport; the player keeps its own 16:9 box, all other elements sit in the head or band beside/below it */
.tv-head, .tv-band { display: none; }
body.tv { overflow: hidden; padding: 0; background: #0E0D0B; }
body.tv .stage {
  position: fixed; inset: 0; z-index: 100; height: 100dvh; display: grid; background: #0E0D0B; color: #FFFFFF;
  grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas: "head" "screen" "band";
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
body.tv .stage-bar { display: none; }
body.tv .screen { grid-area: screen; width: 100%; max-width: none; max-height: none; min-width: 200px; min-height: 200px; }
body.tv .card-on-screen { background: #1A1814; }
body.tv .tv-head { grid-area: head; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px var(--pad); min-height: 60px; }
body.tv .tv-band { grid-area: band; display: flex; flex-direction: column; gap: 12px; padding: 12px var(--pad) 16px; overflow-y: auto; min-height: 0; }

.bug { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bug-station { font: 700 var(--fs-s)/1.1 var(--sans); letter-spacing: .08em; color: var(--mustard); }
.bug-program { font: 700 var(--fs-m)/1.2 var(--sans); color: #FFFFFF; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-clock { font: 700 var(--fs-xl)/1 var(--sans); font-variant-numeric: tabular-nums; margin-left: auto; color: #FFFFFF; }
.tv-exit { min-width: 48px; min-height: 48px; background: #FFFFFF; border-color: #FFFFFF; color: #0E0D0B; }
.tv-exit:hover { background: #E6DFD0; border-color: #E6DFD0; color: #0E0D0B; }
body.tv :focus-visible { outline-color: var(--mustard); }

/* lower third: opacity fade only; space is always reserved so nothing jumps */
.lower-third {
  min-height: 9.5em; padding: 12px 16px; border-left: 6px solid var(--mustard); background: #1A1814;
  opacity: 0; visibility: hidden; transition: opacity 600ms var(--ease), visibility 0s linear 600ms;
}
.lower-third.on { opacity: 1; visibility: visible; transition-delay: 0s; }
.lt-title { font: 700 var(--fs-xl)/1.2 var(--serif); }
.lt-performer { font: 700 var(--fs-l)/1.3 var(--sans); color: var(--mustard); }
.lt-meta, .lt-book { font: 400 var(--fs-m)/1.35 var(--sans); color: #E6DFD0; margin-top: 4px; }
.lt-label { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: var(--fs-xs); color: #FFFFFF; }
.lt-scene { font: italic 400 var(--fs-s)/1.4 var(--serif); color: #E6DFD0; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.tv-play { min-height: 56px; width: 100%; }
.nownext { margin: 0; display: grid; gap: 8px; }
.nownext div { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 12px; align-items: baseline; border-top: 1px solid #4B443A; padding-top: 8px; }
.nownext dt { font: 700 var(--fs-xs)/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #E6DFD0; }
.nownext dd { margin: 0; font: 400 var(--fs-m)/1.3 var(--sans); color: #FFFFFF; overflow-wrap: anywhere; }

@media (orientation: landscape) {
  body.tv .stage {
    grid-template-columns: minmax(0, 1fr) clamp(300px, 32vw, 400px); grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "screen head" "screen band";
  }
  body.tv .screen { align-self: center; justify-self: center; width: min(100%, calc((100dvh - 8px) * 16 / 9)); }
}
@media (orientation: landscape) and (max-height: 480px) {
  .lt-title { font-size: var(--fs-l); }
  .lt-performer, .lt-meta, .lt-book { font-size: var(--fs-s); }
  .lt-scene { display: none; }
  .tv-clock { font-size: var(--fs-l); }
  .lower-third { min-height: 7em; padding: 8px 12px; }
  body.tv .tv-band { gap: 8px; padding-top: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
