/* FullDial — Tuner world. Graphite panels, amber phosphor, ticked rulers. */
:root {
  --ground: #0C0E11;
  --panel: #14181D;
  --panel-raise: #191E24;
  --seam: #1F252C;
  --seam-strong: #333B45;
  --ink: #E9E4D8;
  --ink-dim: #A49E90;      /* warm-tinted secondary, never gray */
  --ink-faint: #8B8677;
  --amber: #FFB000;
  --amber-deep: #C8770A;
  --amber-ghost: rgba(255, 176, 0, 0.09);
  --ease-inst: cubic-bezier(.3, 0, .2, 1);
}

* { box-sizing: border-box; }
html { scrollbar-color: var(--seam-strong) var(--ground); }
body {
  margin: 0;
  background:
    radial-gradient(120% 60% at 50% -10%, #12161B 0%, var(--ground) 55%);
  color: var(--ink);
  font: 400 16px/1.6 Archivo, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--amber); color: #14100A; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 2px; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: var(--seam-strong); border-radius: 5px; }
::-webkit-scrollbar-track { background: var(--ground); }

main { max-width: 820px; margin: 0 auto; padding: 0 16px 4rem; }
a { color: var(--ink); text-decoration-color: var(--amber-deep); text-underline-offset: 3px; }
a:hover { color: var(--amber); }

/* ---- header ---- */
.site-head {
  max-width: 820px; margin: 0 auto; padding: 18px 16px 10px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: "Big Shoulders", sans-serif; font-weight: 800; font-size: 1.5rem;
  letter-spacing: .04em; text-transform: uppercase; text-decoration: none;
}
.brand svg { transform: translateY(3px); }
.brand em { font-style: normal; color: var(--amber); }
.head-note {
  margin: 0; font-family: "Azeret Mono", monospace; font-size: .72rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint);
}
@media (max-width: 560px) { .head-note { display: none; } }

/* ---- masthead ---- */
.masthead { padding: 1.6rem 0 0.5rem; }
h1 {
  margin: 0;
  font-family: "Big Shoulders", sans-serif; font-weight: 650;
  font-size: clamp(2.7rem, 8.5vw, 5.2rem);
  line-height: .95; letter-spacing: .015em; text-transform: uppercase;
  text-wrap: balance;
}
.h1-sub { color: var(--ink-faint); font-weight: 500; }
.q-head { margin-top: 1.6rem; }
a.listen { text-decoration: none; }
.mast-meta {
  margin: .8rem 0 0; font-family: "Azeret Mono", monospace;
  font-size: .82rem; letter-spacing: .06em; color: var(--ink-dim);
}
.mast-meta a { color: var(--ink-dim); }
.mast-meta a:hover { color: var(--amber); }

/* ---- dial ---- */
/* Amber is live signal; --sig is the station's genre hue: what the machine
   is tuned to. Pointer, frequency readouts, and cards carry --sig. */
.dial { width: 100%; height: auto; display: block; margin: .9rem 0 1.2rem; overflow: visible; }
.dial-num {
  font: 500 17px "Azeret Mono", monospace; fill: var(--ink-faint);
  letter-spacing: .05em;
}
.dial-freq {
  font: 500 21px "Azeret Mono", monospace; fill: var(--sig, var(--amber));
  letter-spacing: .04em;
}
.dial-pointer {
  animation: dial-sweep 1.5s var(--ease-inst) both;
  filter: drop-shadow(0 0 7px color-mix(in srgb, var(--sig, var(--amber)) 55%, transparent));
}
@keyframes dial-sweep {
  from { transform: translateX(calc(-1 * var(--px) + 40px)); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .dial-pointer { animation: none; }
  .lamp { animation: none; }
}

/* ---- station faceplate: the card identity, mounted on the page ---- */
.plate {
  background: linear-gradient(180deg, var(--panel-raise), var(--panel));
  border: 1px solid var(--sig-deep, var(--seam-strong)); border-radius: 10px;
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .04);
  padding: 1.35rem 1.5rem .8rem; margin: 1.2rem 0 1.4rem;
}
.plate .masthead { padding: 0; }
.plate .dial { margin: 1rem 0 .1rem; }
@media (max-width: 560px) { .plate { padding: 1rem 1rem .6rem; } }

/* ---- now playing panel ---- */
.now {
  background: linear-gradient(180deg, var(--panel-raise), var(--panel));
  border: 1px solid var(--seam-strong);
  border-radius: 10px;
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .04);
  padding: 1.1rem 1.25rem 1.25rem;
  margin: 0 0 1.4rem;
}
.now-head { display: flex; align-items: center; gap: .6rem; }
.lamp {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 1px 6px 1px rgba(255, 176, 0, .55);
  animation: lamp-breathe 4s var(--ease-inst) infinite;
}
@keyframes lamp-breathe {
  0%, 100% { opacity: 1; } 50% { opacity: .45; }
}
.legend {
  font-family: "Azeret Mono", monospace; font-size: .72rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim);
}
.now-time { margin-left: auto; color: var(--amber); text-shadow: 0 0 14px rgba(255, 176, 0, .4); }
.now-track { margin: .8rem 0 1rem; display: flex; flex-direction: column; gap: .3rem; }
.now-title {
  font-family: "Big Shoulders", sans-serif; font-weight: 650;
  font-size: clamp(1.8rem, 5.4vw, 3rem); line-height: 1.12; letter-spacing: .01em;
  text-wrap: balance;
  perspective: 640px;
}
/* the departure board: JS rebuilds the logged title as flap cells */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.bc {
  display: inline-block; position: relative;
  min-width: .58em; text-align: center; line-height: 1.18;
  padding: .02em .07em; margin: 0 .05em .1em 0;
  background: linear-gradient(180deg, var(--panel-raise) 0 47%, #0E1116 53%, var(--panel) 100%);
  border: 1px solid var(--seam-strong); border-radius: 3px;
  backface-visibility: hidden; transform-origin: 50% 50%;
}
/* the final character sets the cell's width from frame one; the spinning
   glyph rides an overlay so nothing resizes mid-flip */
.bcw { visibility: hidden; }
.bcg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.bc::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  background: rgba(0, 0, 0, .55); box-shadow: 0 1px 0 rgba(255, 255, 255, .035);
}
.bs { display: inline-block; width: .42em; }
.bw { display: inline-block; white-space: nowrap; }  /* words never break mid-flap */
.bc.flip { animation: flap-in .3s var(--ease-inst) both; }
@keyframes flap-in { from { transform: rotateX(-90deg); } to { transform: rotateX(0); } }
/* unresolved cells flutter through glyphs until their random settle time */
.bc.spin { animation: flap-cycle .18s linear infinite; }
@keyframes flap-cycle {
  0% { transform: rotateX(0); }
  49% { transform: rotateX(-86deg); }
  50% { transform: rotateX(86deg); }
  100% { transform: rotateX(0); }
}
@media (prefers-reduced-motion: reduce) { .bc.flip, .bc.spin { animation: none; } }
.now-artist { font-size: 1.05rem; color: var(--ink-dim); font-weight: 500; }
.now-actions { display: flex; align-items: center; gap: .9rem; border-top: 1px solid var(--seam); padding-top: 1rem; }
.listen {
  display: inline-flex; align-items: center; gap: .55rem;
  font: 600 .95rem Archivo, sans-serif; letter-spacing: .02em;
  color: #14100A; background: var(--amber);
  border: 0; border-radius: 999px; padding: .6rem 1.15rem .6rem .9rem;
  cursor: pointer;
  transition: background .2s var(--ease-inst), transform .2s var(--ease-inst);
}
.listen:hover { background: #FFC13D; }
.listen:active { transform: scale(.97); }
.listen.on { background: var(--ink); }
.listen.err { background: var(--seam-strong); color: var(--ink-dim); cursor: default; }
.listen-icon { display: inline-flex; }
.listen-note { letter-spacing: .08em; }

/* ---- answer prose ---- */
.answer { max-width: 68ch; color: var(--ink); margin: 0 0 1.6rem; }
.answer strong { color: var(--amber); font-weight: 600; }

/* ---- sections ---- */
h2 {
  font-family: "Big Shoulders", sans-serif; font-weight: 650; font-size: 1.6rem;
  letter-spacing: .04em; text-transform: uppercase;
  margin: 2.6rem 0 .9rem;
}
section > p, .top-songs { max-width: 68ch; color: var(--ink-dim); }
.top-songs strong { color: var(--ink); font-weight: 500; }

/* ---- history table ---- */
.history { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.history th {
  text-align: left; font-family: "Azeret Mono", monospace; font-weight: 400;
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  color: var(--ink-faint); padding: 0 .8rem .5rem 0; border-bottom: 1px solid var(--seam-strong);
}
.history td { padding: .55rem .8rem .55rem 0; border-bottom: 1px solid var(--seam); vertical-align: baseline; }
.history tr:hover td { background: var(--amber-ghost); }
.day-row td { padding: 1.4rem 0 .4rem; border-bottom: 1px solid var(--seam-strong); }
.day-row h3 {
  margin: 0; font-family: "Azeret Mono", monospace; font-size: .74rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--amber-deep); font-weight: 500;
}
.day-row:hover td { background: transparent; }
.t-time { font-family: "Azeret Mono", monospace; font-size: .8rem; color: var(--ink-dim); white-space: nowrap; width: 6ch; }
.t-artist { font-weight: 600; width: 38%; }
.t-title { color: var(--ink-dim); }
@media (max-width: 560px) {
  .history, .history tbody, .history tr { display: block; }
  .history thead { display: none; }
  .history tr { border-bottom: 1px solid var(--seam); padding: .55rem 0; }
  .history td { display: inline; border: 0; padding: 0; }
  .history tr:hover td { background: transparent; }
  .t-time { display: block; margin-bottom: .1rem; }
  .t-artist { width: auto; }
  .t-artist::after { content: " — "; color: var(--ink-faint); font-weight: 400; }
  .day-row { border-bottom: 1px solid var(--seam-strong) !important; }
}

/* ---- VU bars ---- */
.vu { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.vu li { display: grid; grid-template-columns: minmax(110px, 200px) 1fr 4ch; align-items: center; gap: .9rem; }
.vu-name { font-weight: 600; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vu-track { display: inline-block; vertical-align: middle; height: 14px; border: 1px solid var(--seam-strong); border-radius: 3px; padding: 2px; background: var(--panel); }
.vu-bar {
  display: block; height: 100%; width: var(--w); border-radius: 1px;
  background: repeating-linear-gradient(90deg, var(--amber) 0 6px, transparent 6px 9px);
  animation: vu-rise 0.9s var(--ease-inst) both;
}
@keyframes vu-rise { from { width: 0; } to { width: var(--w); } }
.vu-n { font-family: "Azeret Mono", monospace; font-size: .8rem; color: var(--ink-dim); text-align: right; }

/* ---- nearby / directory lists ---- */
.nearby ul, .state-group ul { list-style: none; margin: 0; padding: 0; }
.nearby li a, .state-group li a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: .55rem 0; border-bottom: 1px solid var(--seam); text-decoration: none;
  transition: transform .2s var(--ease-inst);
}
.nearby li a:hover, .state-group li a:hover { transform: translateX(.4rem); }
.nb-name { font-weight: 600; }
.nb-state { font-family: "Azeret Mono", monospace; font-size: .72rem; color: var(--ink-faint); font-weight: 400; }
.nb-freq { font-family: "Azeret Mono", monospace; font-size: .78rem; color: var(--ink-dim); white-space: nowrap; }

/* ---- the rack: generated faceplate tiles (no scraped artwork, ever) ---- */
.rack {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .7rem; margin: 0 0 1.8rem; padding: 0; list-style: none;
}
.face {
  display: flex; flex-direction: column; gap: .32rem;
  background: linear-gradient(180deg, var(--panel-raise), var(--panel));
  border: 1px solid var(--sig-deep, var(--seam-strong)); border-radius: 8px;
  padding: .7rem .75rem .55rem; text-decoration: none;
  transition: border-color .2s var(--ease-inst);
}
.face:hover { border-color: var(--sig, var(--amber)); }
.face:hover .face-name { color: var(--sig, var(--amber)); }
.face-top { display: flex; align-items: center; gap: .45rem; min-height: 12px; }
.face-tick { flex: none; width: 9px; height: 9px; background: var(--sig, var(--amber)); }
.face-genre {
  font-family: "Azeret Mono", monospace; font-size: .58rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--sig, var(--amber));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.face-name {
  font-family: "Big Shoulders", sans-serif; font-weight: 650; font-size: 1.12rem;
  line-height: 1.06; letter-spacing: .02em; text-transform: uppercase; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.12em; transition: color .2s var(--ease-inst);
}
.face-freq { font-family: "Azeret Mono", monospace; font-size: .74rem; font-weight: 500; color: var(--sig, var(--amber)); }
.face-ruler {
  position: relative; height: 9px; margin-top: .15rem;
  border-top: 1px solid var(--seam-strong);
  background: repeating-linear-gradient(90deg, var(--seam-strong) 0 1px, transparent 1px 12px);
  background-position: 0 2px; background-size: auto 5px; background-repeat: repeat-x;
}
/* the NET band: a divider sets off the internet end of the miniature dial */
.face-ruler::before {
  content: ""; position: absolute; left: 87%; top: -2px; width: 1px; height: 8px;
  background: var(--seam-strong);
}
.face-pin { position: absolute; top: -3px; width: 3px; height: 12px; background: var(--sig, var(--amber)); }

/* genre chip in the masthead meta line */
.mast-genre { color: var(--sig, var(--amber)); white-space: nowrap; }
.mast-genre .face-tick { display: inline-block; vertical-align: baseline; margin-right: .4rem; }

/* the monitoring console holds past the fold on wide screens */
@media (min-width: 1000px) {
  .log-panel {
    background: linear-gradient(180deg, var(--panel-raise), var(--panel));
    border: 1px solid var(--seam-strong); border-radius: 10px;
    box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .04);
    padding: 1.5rem 1.75rem .6rem; margin-top: 2.2rem;
  }
  .log-panel h2 { margin-top: 0; }
}

/* ---- index ---- */
.index-mast h1 { font-size: clamp(3rem, 10vw, 6rem); }
.ticker { list-style: none; margin: 0; padding: 0; }
.ticker li a {
  display: grid; grid-template-columns: minmax(120px, 220px) 1fr auto;
  gap: 1rem; align-items: baseline;
  padding: .7rem 0; border-bottom: 1px solid var(--seam); text-decoration: none;
}
.ticker li a:hover .tk-station { color: var(--amber); }
.tk-station { font-family: "Big Shoulders", sans-serif; font-weight: 650; font-size: 1.15rem; letter-spacing: .03em; text-transform: uppercase; }
.tk-song { color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-time { font-family: "Azeret Mono", monospace; font-size: .78rem; color: var(--ink-faint); white-space: nowrap; }
@media (max-width: 560px) {
  .ticker li a { grid-template-columns: 1fr auto; }
  .tk-song { grid-column: 1 / -1; }
}
.directory { columns: 2; column-gap: 2.5rem; }
.state-group { break-inside: avoid; margin-bottom: 1.6rem; }
.state-group h3 {
  margin: 0 0 .3rem; font-family: "Azeret Mono", monospace; font-size: .74rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--amber-deep); font-weight: 500;
}
@media (max-width: 640px) { .directory { columns: 1; } }

/* ---- docked mini player (shows while playing, once the panel scrolls away) ---- */
.mini {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; align-items: center; gap: .8rem;
  max-width: 820px; margin: 0 auto;
  padding: .7rem calc(16px + env(safe-area-inset-left)) calc(.7rem + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, var(--panel-raise), var(--panel));
  border: 1px solid var(--seam-strong); border-bottom: 0;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 -14px 30px -18px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .04);
  transform: translateY(110%);
  transition: transform .3s var(--ease-inst);
}
.mini.mini-on { transform: translateY(0); }
.mini[hidden] { display: flex; }  /* hidden attr kept for no-JS; JS drives .mini-on */
.mini-meta { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: .05rem; flex: 1; }
.mini-song { font-family: "Big Shoulders", sans-serif; font-weight: 650; font-size: 1.15rem; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-sub { font-size: .82rem; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-stop {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  color: #14100A; background: var(--amber); border: 0; cursor: pointer;
  transition: background .2s var(--ease-inst), transform .2s var(--ease-inst);
}
.mini-stop:hover { background: #FFC13D; }
.mini-stop:active { transform: scale(.94); }

/* ---- footer ---- */
.site-foot { max-width: 820px; margin: 3rem auto 0; padding: 0 16px 2.5rem; }
.foot-dial {
  height: 10px; margin-bottom: 1.4rem;
  background: repeating-linear-gradient(90deg, var(--seam-strong) 0 2px, transparent 2px 24px);
  border-top: 1px solid var(--seam-strong);
}
.site-foot p { color: var(--ink-dim); max-width: 68ch; margin: .4rem 0; }
.site-foot strong { color: var(--ink); }
.foot-meta { font-family: "Azeret Mono", monospace; font-size: .74rem; letter-spacing: .06em; color: var(--ink-faint); }
.foot-meta a { color: var(--ink-dim); }
