/* Band Plan — transistor radio faceplate */

:root {
  --enamel: #9FCBB8;
  --enamel-deep: #86B7A2;
  --chrome: #C9CDD0;
  --chrome-hi: #EEF0F1;
  --grille: #23262A;
  --grille-2: #30343A;
  --glass: #F3EBD3;
  --needle: #E0452B;
  --eye: #3E7D5A;
  --ink: #16191C;
  --ink-soft: #3A4146;

  --f-display: "Unbounded", "Arial Black", sans-serif;
  --f-body: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "Martian Mono", ui-monospace, "Courier New", monospace;

  --dial-h: 118px;
  --grille-w: 168px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--dial-h) + 16px); }

body {
  margin: 0;
  background: var(--enamel);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1.075rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--needle); }
:focus-visible { outline: 3px solid var(--needle); outline-offset: 3px; }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 50;
  background: var(--glass); padding: 8px 12px; font-family: var(--f-mono); font-size: .8rem;
}
.skip:focus { left: 8px; }

/* ---------- Dial (signature) ---------- */

.dial {
  position: sticky; top: 0; z-index: 20;
  background: var(--grille);
  color: var(--glass);
  border-bottom: 3px solid var(--chrome);
  box-shadow: 0 1px 0 var(--chrome-hi) inset, 0 6px 18px rgba(22, 25, 28, .18);
}

.dial__bar {
  max-width: 1240px; margin: 0 auto;
  display: flex; align-items: center; gap: 18px;
  padding: 10px 20px 8px;
}

.brand {
  font-family: var(--f-display); font-weight: 600; font-size: .95rem;
  letter-spacing: .02em; color: var(--glass); text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px;
}
.brand:hover { color: var(--chrome-hi); }

.eye {
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #7FC79D, var(--eye) 55%, #1E3D2C);
  box-shadow: 0 0 8px rgba(127, 199, 157, .7);
  transition: opacity .25s, box-shadow .25s;
}
.dial.is-static .eye { opacity: .35; box-shadow: none; }

.dial__links { margin-left: auto; display: flex; gap: 18px; font-family: var(--f-mono); font-size: .72rem; }
.dial__links a { color: var(--chrome); text-decoration: none; }
.dial__links a:hover, .dial__links a[aria-current="page"] { color: var(--glass); text-decoration: underline; }

.dial__glass {
  position: relative;
  max-width: 1200px; margin: 0 auto 12px;
  height: 64px;
  background: var(--glass);
  border: 2px solid var(--chrome);
  border-radius: 4px;
  box-shadow: inset 0 2px 6px rgba(22, 25, 28, .35);
  overflow: hidden;
  margin-inline: 20px;
}
@media (min-width: 1240px) { .dial__glass { margin-inline: auto; } }

.dial__scale { position: absolute; left: 4%; top: 0; width: 92%; height: 100%; }

.dial__nums {
  position: absolute; left: 0; right: 0; top: 2px;
  display: flex; justify-content: space-between; padding: 0 3.4%;
  font-family: var(--f-mono); font-size: 9px; color: var(--ink-soft);
}
.dial__nums em { font-style: normal; color: var(--needle); }

.dial__bands {
  position: absolute; left: 0; right: 0; bottom: 4px;
  display: flex; justify-content: space-between;
  padding: 0 4%;
  font-family: var(--f-mono); font-size: .66rem; letter-spacing: .03em;
}
.dial__bands a {
  color: var(--ink-soft); text-decoration: none; white-space: nowrap;
  padding: 2px 4px;
}
.dial__bands a b { font-weight: 500; color: var(--needle); margin-right: 4px; }
.dial__bands a.is-tuned { color: var(--ink); background: rgba(62, 125, 90, .14); }

.needle {
  position: absolute; top: 0; bottom: 0; width: 2px;
  left: calc(4% + var(--p, 0) * 92%);
  background: var(--needle);
  box-shadow: 0 0 0 1px rgba(224, 69, 43, .15);
  transition: left .12s linear;
  pointer-events: none;
}
.needle::before {
  content: ""; position: absolute; top: -1px; left: -5px;
  border: 6px solid transparent; border-top: 8px solid var(--needle);
}

.dial__glass::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='64'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .09 0 0 0 0 .1 0 0 0 0 .11 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='180' height='64' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0; transition: opacity .2s;
}
.dial.is-static .dial__glass::after { opacity: .28; animation: hiss .35s steps(3) infinite; }

@keyframes hiss {
  0% { background-position: 0 0; }
  50% { background-position: -60px 12px; }
  100% { background-position: 40px -8px; }
}

/* ---------- Receiver body: grille + content ---------- */

.set {
  max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: var(--grille-w) minmax(0, 1fr);
  gap: 0;
}

.grille {
  position: sticky; top: var(--dial-h);
  height: calc(100vh - var(--dial-h));
  background-color: var(--grille);
  background-image: radial-gradient(circle, var(--grille-2) 0 2.4px, transparent 2.9px);
  background-size: 11px 11px;
  border-right: 3px solid var(--chrome);
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 24px;
}
.grille__label {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--f-mono); font-size: .7rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--chrome); background: var(--grille); padding: 10px 4px;
}

.content { padding: 0 clamp(20px, 5vw, 72px) 40px; min-width: 0; }

.band { padding: clamp(56px, 8vw, 104px) 0 clamp(40px, 6vw, 72px); border-bottom: 2px solid var(--chrome); position: relative; }
.band:last-of-type { border-bottom: 0; }

.tag {
  font-family: var(--f-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 18px;
}
.tag b { color: var(--needle); font-weight: 500; margin-right: 8px; }

h1, h2, h3 { font-family: var(--f-display); font-weight: 600; letter-spacing: -.01em; line-height: 1.12; margin: 0; }
h1 { font-size: clamp(2rem, 4.6vw, 3.6rem); max-width: 17ch; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); max-width: 22ch; margin-bottom: 20px; }
h3 { font-size: 1.05rem; font-weight: 600; }

.lede { max-width: 58ch; font-size: 1.18rem; color: var(--ink); margin: 28px 0 0; }
.body { max-width: 62ch; color: var(--ink-soft); }
.body p { margin: 0 0 1em; }

.textlink { display: inline-block; margin-top: 28px; font-family: var(--f-mono); font-size: .82rem; }

/* Tuning in: off-axis, with a frequency readout on the right edge */
.tuning { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: end; }
.readout {
  font-family: var(--f-display); font-weight: 400; font-size: clamp(3rem, 9vw, 7rem);
  color: var(--enamel-deep); line-height: .8; letter-spacing: -.04em; text-align: right;
  user-select: none;
}
.readout small { display: block; font-family: var(--f-mono); font-size: .7rem; letter-spacing: .12em; color: var(--ink-soft); margin-top: 10px; }

/* Week as a band */
.week { margin: 32px 0 0; background: var(--glass); border: 2px solid var(--chrome); padding: 18px 18px 12px; }
.week svg { display: block; width: 100%; height: auto; }
.week text { font-family: var(--f-mono); font-size: 9px; fill: var(--ink-soft); }
.week figcaption { font-size: .92rem; color: var(--ink-soft); margin-top: 12px; max-width: 70ch; }
.legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 10px; font-family: var(--f-mono); font-size: .7rem; color: var(--ink-soft); }
.legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -2px; border: 1px solid var(--ink-soft); }
.legend .l-static::before { background: repeating-linear-gradient(45deg, var(--ink-soft) 0 1px, transparent 1px 4px); }
.legend .l-clear::before { background: var(--eye); border-color: var(--eye); }
.legend .l-other::before { background: var(--chrome); }

/* Station log table */
.log-wrap { margin-top: 28px; overflow-x: auto; background: var(--glass); border: 2px solid var(--chrome); }
.log { width: 100%; border-collapse: collapse; min-width: 760px; font-size: .95rem; }
.log caption { text-align: left; padding: 14px 16px 0; font-family: var(--f-mono); font-size: .72rem; color: var(--ink-soft); }
.log th, .log td { text-align: left; vertical-align: top; padding: 14px 16px; border-bottom: 1px solid rgba(58, 65, 70, .2); }
.log thead th { font-family: var(--f-mono); font-weight: 500; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); border-bottom: 2px solid var(--ink); }
.log tbody th { font-family: var(--f-body); font-weight: 700; width: 20%; }
.log td.band-cell { font-family: var(--f-mono); font-size: .75rem; color: var(--needle); white-space: nowrap; }
.log tr:last-child th, .log tr:last-child td { border-bottom: 0; }

.meter { display: inline-flex; gap: 3px; align-items: flex-end; height: 16px; margin-right: 8px; vertical-align: -3px; }
.meter i { width: 4px; background: rgba(58, 65, 70, .22); }
.meter i:nth-child(1) { height: 5px; } .meter i:nth-child(2) { height: 8px; } .meter i:nth-child(3) { height: 11px; } .meter i:nth-child(4) { height: 14px; } .meter i:nth-child(5) { height: 16px; }
.meter[data-n="1"] i:nth-child(-n+1),
.meter[data-n="2"] i:nth-child(-n+2),
.meter[data-n="3"] i:nth-child(-n+3),
.meter[data-n="4"] i:nth-child(-n+4) { background: var(--needle); }
.noise-note { display: block; color: var(--ink-soft); font-size: .88rem; margin-top: 4px; }

/* Interference */
.bursts { list-style: none; margin: 28px 0 0; padding: 0; }
.burst { display: grid; grid-template-columns: 120px 90px minmax(0, 1fr); gap: 20px; align-items: start; padding: 20px 0; border-top: 1px dashed rgba(58, 65, 70, .45); }
.burst:last-child { border-bottom: 1px dashed rgba(58, 65, 70, .45); }
.burst__code { font-family: var(--f-mono); font-size: .75rem; letter-spacing: .1em; color: var(--needle); padding-top: 3px; }
.burst svg { width: 90px; height: 24px; stroke: var(--ink-soft); fill: none; stroke-width: 1.4; }
.burst h3 { margin-bottom: 6px; }
.burst p { margin: 0; color: var(--ink-soft); max-width: 60ch; }

/* Sign-off */
.signoff { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.callsign { font-family: var(--f-display); font-weight: 800; font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: .04em; line-height: 1; margin: 0 0 18px; }
.reading { list-style: none; padding: 0; margin: 0; border-top: 2px solid var(--ink); }
.reading li { border-bottom: 1px solid rgba(58, 65, 70, .3); }
.reading a { display: block; padding: 14px 0; text-decoration: none; }
.reading a span { display: block; font-family: var(--f-mono); font-size: .68rem; color: var(--ink-soft); margin-bottom: 4px; }
.reading a:hover strong { text-decoration: underline; }

/* ---------- Inner pages ---------- */

.page { max-width: 70ch; padding: clamp(48px, 7vw, 88px) 0 56px; }
.page h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); max-width: 20ch; margin-bottom: 14px; }
.page .meta { font-family: var(--f-mono); font-size: .72rem; color: var(--ink-soft); margin: 0 0 32px; }
.page h2 { font-size: 1.25rem; margin: 40px 0 12px; max-width: none; }
.page p, .page li { color: var(--ink-soft); }
.page ul, .page ol { padding-left: 1.2em; }
.page li { margin-bottom: .5em; }
.page .note { background: var(--glass); border-left: 4px solid var(--needle); padding: 14px 18px; color: var(--ink); }
.backlink { display: inline-block; margin-top: 32px; font-family: var(--f-mono); font-size: .8rem; }

/* ---------- Footer: frequency plate ---------- */

.plate {
  background: var(--grille); color: var(--chrome);
  border-top: 3px solid var(--chrome);
  font-family: var(--f-mono); font-size: .72rem;
}
.plate__in { max-width: 1240px; margin: 0 auto; padding: 28px 20px 36px; display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: baseline; }
.plate nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.plate a { color: var(--glass); text-decoration: none; }
.plate a:hover { text-decoration: underline; color: var(--glass); }
.plate p { margin: 0; flex-basis: 100%; color: var(--chrome); line-height: 1.7; max-width: 90ch; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  :root { --grille-w: 0px; }
  .set { display: block; }
  .grille {
    position: static; height: 14px; border-right: 0; border-bottom: 2px solid var(--chrome);
    padding: 0; background-size: 9px 9px;
  }
  .grille__label { display: none; }
  .tuning, .signoff { grid-template-columns: 1fr; }
  .readout { text-align: left; }
  .burst { grid-template-columns: 1fr; gap: 8px; }
  .burst svg { display: none; }
  .dial__bands { overflow-x: auto; gap: 14px; justify-content: flex-start; scrollbar-width: none; }
  .dial__bands::-webkit-scrollbar { display: none; }
}

@media (max-width: 560px) {
  :root { --dial-h: 112px; }
  .dial__links { gap: 12px; }
  .dial__links .hide-sm { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .needle, .eye, .dial__glass::after { transition: none; }
  .dial.is-static .dial__glass::after { animation: none; opacity: .12; }
  html { scroll-behavior: auto; }
}
