:root {
  color-scheme: dark;
  --room-bg: #110d0a;
  --room-wall: #1d1712;
  --parchment: #f4e6cb;
  --cream: #efe0c1;
  --cream-muted: #c9b796;
  --brass-hi: #e2c081;
  --brass-mid: #b28d4f;
  --brass-lo: #6c5126;
  --bakelite: #18120e;
  --serif: "Iowan Old Style", Baskerville, "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --dial-sans: "Gill Sans", "DIN Alternate", "Trebuchet MS", "Helvetica Neue", ui-sans-serif, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background-color: var(--room-bg);
  font-family: var(--serif);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-width: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--parchment);
  background:
    radial-gradient(ellipse 75% 48% at 50% 10%, rgba(112, 74, 36, .28) 0%, transparent 72%) no-repeat,
    radial-gradient(ellipse 90% 55% at 50% 62%, rgba(30, 44, 35, .52) 0%, transparent 76%) no-repeat,
    radial-gradient(circle at 50% 50%, #1c221d 0%, #12100d 62%, #0a0806 100%) no-repeat,
    var(--room-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Subtle dark photographic grain overlay via data-URI SVG noise */
.room-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

a { color: inherit; }
button, input { font: inherit; }
button { touch-action: manipulation; }

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2.5px solid #f7d996;
  outline-offset: 4px;
}

[hidden] { display: none !important; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Page Frame & Masthead ---------- */

.page {
  width: min(calc(100% - 2.4rem), 62rem);
  margin: 0 auto;
  padding: clamp(1.2rem, 3.2vh, 2.4rem) 0 clamp(1.2rem, 2.8vh, 2rem);
  position: relative;
  z-index: 1;
}

.masthead {
  text-align: center;
  margin: 0 auto clamp(1.1rem, 2.6vh, 1.75rem);
}

.masthead h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.95rem, 4.7vw, 3.65rem);
  line-height: 1.06;
  letter-spacing: .015em;
  color: #f6ead2;
  text-wrap: balance;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .55);
}

/* ---------- Tabletop Stage & Grounding ---------- */

.table-stage {
  position: relative;
  isolation: isolate;
}

.cabinet-feet {
  display: flex;
  justify-content: space-between;
  padding: 0 clamp(2.2rem, 8%, 5rem);
  position: relative;
  z-index: 2;
  margin-top: -1px;
}

.foot {
  width: clamp(3.4rem, 9%, 5.4rem);
  height: .78rem;
  border-radius: 0 0 .38rem .38rem;
  background:
    linear-gradient(180deg, #2b1a10 0%, #160c07 42%, #090503 100%);
  border: 1px solid rgba(154, 114, 68, .28);
  border-top: 0;
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, .85),
    0 .4rem .8rem rgba(0, 0, 0, .95);
}

.table-surface {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 1.9rem;
  margin: -.46rem 0 0;
  border-radius: .28rem;
  background:
    radial-gradient(ellipse 68% 85% at 50% 0%, rgba(164, 118, 66, .28) 0%, transparent 72%),
    linear-gradient(180deg, rgba(226, 184, 128, .24) 0%, rgba(72, 46, 26, .48) 12%, rgba(28, 17, 10, .62) 48%, rgba(10, 6, 3, 0) 100%),
    linear-gradient(90deg, #100905, #28190f 18%, #352114 50%, #28190f 82%, #100905);
  border-top: 1px solid rgba(214, 172, 114, .28);
  box-shadow:
    inset 0 .5rem 1rem rgba(0, 0, 0, .68);
  mask-image: linear-gradient(90deg, transparent 0%, black 6%, black 94%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 6%, black 94%, transparent 100%);
}

/* Warm tabletop pool illuminated when radio is playing */
.radio[data-state="playing"] ~ .table-surface {
  background:
    radial-gradient(ellipse 46% 120% at 62% 0%, rgba(246, 176, 72, .34) 0%, transparent 70%),
    radial-gradient(ellipse 70% 90% at 50% 0%, rgba(186, 134, 72, .3) 0%, transparent 72%),
    linear-gradient(180deg, rgba(242, 198, 134, .3) 0%, rgba(84, 52, 26, .52) 14%, rgba(28, 17, 10, .65) 50%, rgba(10, 6, 3, 0) 100%),
    linear-gradient(90deg, #100905, #2c1b10 18%, #3c2516 50%, #2c1b10 82%, #100905);
}

/* ---------- Outer Sculpted Walnut Cabinet ---------- */

.radio {
  position: relative;
  z-index: 2;
  padding: clamp(.72rem, 1.85vw, 1.3rem) clamp(.75rem, 1.9vw, 1.38rem) 0;
  border-radius: 1.55rem 1.55rem .52rem .52rem;
  border: 1px solid rgba(186, 135, 78, .38);
  border-bottom-color: rgba(34, 18, 9, .95);
  background:
    /* Satin top edge curved highlight + deep sculpted cabinet bevels */
    linear-gradient(180deg,
      rgba(255, 224, 175, .24) 0%,
      rgba(255, 210, 145, .05) 3.5%,
      rgba(0, 0, 0, 0) 14%,
      rgba(16, 8, 3, .28) 72%,
      rgba(10, 5, 2, .56) 100%),
    /* Side quarter-round pillar depth shading */
    linear-gradient(90deg,
      rgba(12, 6, 2, .52) 0%,
      rgba(255, 214, 160, .08) 1.8%,
      rgba(0, 0, 0, 0) 6%,
      rgba(0, 0, 0, 0) 94%,
      rgba(255, 214, 160, .06) 98.2%,
      rgba(10, 5, 2, .58) 100%),
    url("img/walnut.jpg?v=6") center / cover no-repeat,
    linear-gradient(165deg, #683b21, #462514 52%, #2c150a);
  box-shadow:
    0 24px 48px -10px rgba(0, 0, 0, .88),
    0 8px 18px rgba(0, 0, 0, .65),
    inset 0 2px 2px rgba(248, 206, 148, .28),
    inset 0 -3px 6px rgba(0, 0, 0, .72),
    inset 0 0 0 1px rgba(48, 24, 11, .7);
}

/* Soft ambient golden aura behind the cabinet while playing (kept strictly within box bounds to avoid mobile viewport zoom) */
.radio::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  box-shadow: 0 0 85px 28px rgba(235, 162, 62, .22);
  transition: opacity 1.1s ease;
}
.radio[data-state="loading"]::before { opacity: .45; }
.radio[data-state="playing"]::before { opacity: 1; }

.cabinet-rim {
  position: relative;
}

/* Recessed walnut-framed faceplate holding both speaker grille, dial and deck */
.bezel-deck {
  padding: clamp(.45rem, 1.05vw, .72rem);
  border-radius: .95rem .95rem .42rem .42rem;
  background:
    linear-gradient(180deg, rgba(14, 7, 3, .88), rgba(24, 15, 9, .92) 45%, rgba(12, 7, 4, .96));
  border: 1px solid rgba(196, 150, 90, .28);
  box-shadow:
    inset 0 4px 12px rgba(0, 0, 0, .88),
    inset 0 0 0 2px rgba(96, 68, 34, .32),
    0 1px 0 rgba(238, 198, 134, .22);
}

/* Desktop/landscape horizontal tabletop face: left grille, right dial+program */
.chassis-face {
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.24fr);
  gap: clamp(.58rem, 1.35vw, 1rem);
  align-items: stretch;
}

/* ---------- Speaker Grille Aperture ---------- */

.speaker {
  position: relative;
  min-width: 0;
  min-height: 15.2rem;
  overflow: hidden;
  border-radius: .65rem .32rem .32rem .32rem;
  border: 1px solid #352315;
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 0 0 2px #100904,
    inset 0 10px 24px rgba(0, 0, 0, .85),
    inset 0 -8px 18px rgba(0, 0, 0, .78),
    0 1px 0 rgba(212, 168, 102, .22);
  isolation: isolate;
}

.speaker-cloth {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 68% 72% at 50% 50%, rgba(16, 10, 6, .08) 0%, rgba(8, 5, 2, .62) 82%, rgba(5, 3, 1, .86) 100%),
    url("img/grille.jpg?v=6") center / 260px 260px repeat,
    #261c12;
  filter: sepia(.12) contrast(1.06) brightness(.78);
}

/* Subtle acoustic dark baffle circle impression behind fabric (like real 6-inch speaker cone) */
.speaker-cavity {
  position: absolute;
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(4, 2, 1, .48) 0%, rgba(4, 2, 1, .35) 56%, transparent 72%);
  pointer-events: none;
}

/* Chamfered horizontal satin walnut louver bars floating over grille cloth */
.louvers {
  position: absolute;
  inset: 10% 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.louver {
  display: block;
  height: 10px;
  background:
    linear-gradient(180deg,
      rgba(232, 185, 126, .48) 0%,
      rgba(130, 82, 44, .18) 18%,
      rgba(0, 0, 0, .18) 58%,
      rgba(14, 7, 2, .92) 100%),
    url("img/walnut.jpg?v=6") center / cover no-repeat,
    #4c2b17;
  border-top: 1px solid rgba(226, 181, 118, .35);
  border-bottom: 1px solid #0e0602;
  box-shadow:
    0 5px 7px rgba(0, 0, 0, .72),
    0 1px 2px rgba(0, 0, 0, .88);
}

/* Compact stamped antique-brass crest medallion mounted across center louver */
.crest {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: .46rem 1.25rem .44rem;
  min-width: 8.6rem;
  border-radius: .28rem;
  background:
    linear-gradient(180deg,
      rgba(255, 229, 174, .22) 0%,
      rgba(24, 15, 7, .76) 14%,
      rgba(18, 11, 5, .86) 86%,
      rgba(10, 6, 2, .94) 100%),
    url("img/brass.jpg?v=6") center / cover no-repeat,
    #24160d;
  border: 1.5px solid #ad884b;
  box-shadow:
    inset 0 0 0 1px rgba(15, 9, 4, .85),
    inset 0 1px 0 rgba(250, 217, 152, .35),
    0 4px 10px rgba(0, 0, 0, .82),
    0 1px 0 rgba(235, 198, 128, .28);
}

.rivet {
  position: absolute;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: radial-gradient(circle at 35% 30%, #f1d39a, #6c4d24);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .85);
}
.rivet-l { left: .38rem; }
.rivet-r { right: .38rem; }

.crest-emblem {
  width: 4.9rem;
  height: auto;
  display: block;
  margin-bottom: .1rem;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .85));
}

.crest-title {
  font-family: var(--serif);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .24em;
  color: #e6c68a;
  line-height: 1.1;
  text-shadow: 0 1px 1px #000;
}

.crest-sub {
  font-family: var(--dial-sans);
  font-size: .46rem;
  font-weight: 600;
  letter-spacing: .2em;
  color: #bfa06b;
  margin-top: .14rem;
}

/* ---------- Dial Bay & Reverse-Painted Glass Slide-Rule Dial ---------- */

.dial-bay {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

/* Aged brushed brass escutcheon framing the glass window */
.dial-hood {
  padding: .42rem .5rem .48rem;
  border-radius: .38rem .65rem .3rem .3rem;
  background:
    linear-gradient(180deg,
      rgba(255, 232, 184, .18) 0%,
      rgba(56, 39, 17, .55) 14%,
      rgba(26, 18, 8, .75) 86%,
      rgba(10, 6, 2, .9) 100%),
    url("img/brass.jpg?v=6") center / cover no-repeat,
    #523d20;
  border: 1px solid #9d7a42;
  box-shadow:
    inset 0 1px 0 rgba(250, 224, 166, .45),
    inset 0 -1px 0 rgba(12, 7, 2, .85),
    0 2px 6px rgba(0, 0, 0, .75);
}

.telemetry-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .05rem .32rem .34rem;
  font-family: var(--dial-sans);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #f0d7a2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .9);
}

.pilot-wrap {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  min-width: 0;
  white-space: nowrap;
}

/* Faceted ruby glass pilot lamp jewel */
.pilot-jewel {
  width: .72rem;
  height: .72rem;
  border-radius: 50%;
  flex: none;
  background: radial-gradient(circle at 35% 30%, #7d2f22, #38120c 68%, #1d0805);
  border: 1.5px solid #9e7a43;
  box-shadow:
    inset 0 1px 2px rgba(255, 190, 140, .25),
    0 0 0 1px #0d0804;
  transition: background .45s ease, box-shadow .6s ease;
}

.radio[data-state="loading"] .pilot-jewel {
  background: radial-gradient(circle at 38% 35%, #ffe6a0, #d47b27 55%, #692c0a);
  box-shadow: 0 0 9px 2px rgba(232, 145, 52, .58), inset 0 0 2px #fff2c4;
}

.radio[data-state="playing"] .pilot-jewel {
  background: radial-gradient(circle at 38% 35%, #ffefe0, #ff6342 46%, #8e180c);
  box-shadow: 0 0 11px 3px rgba(255, 86, 48, .7), inset 0 0 3px #fff7db;
}

.radio[data-state="error"] .pilot-jewel {
  background: radial-gradient(circle at 38% 35%, #ffb8a8, #c22e22 52%, #500c08);
  box-shadow: 0 0 10px 2px rgba(215, 52, 36, .62);
  animation: pilot-warn 2.2s ease-in-out infinite;
}

@keyframes pilot-warn {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}

.lamp-text {
  color: #f1dab0;
}
.radio[data-state="error"] .lamp-text {
  color: #ffbca8;
}

/* Authentic 6E5 "Magic Eye" emerald phosphor tuning tube */
.magic-eye {
  position: relative;
  width: 1.18rem;
  height: 1.18rem;
  border-radius: 50%;
  flex: none;
  background: #0d120e;
  border: 1.5px solid #8a6c3a;
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, .92),
    0 1px 0 rgba(235, 200, 140, .25);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.eye-target {
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  background: conic-gradient(from 142deg, #1b281c 0deg 76deg, #253b27 76deg 360deg);
  transition: filter .65s ease, opacity .65s ease;
  opacity: .42;
}

.radio[data-state="loading"] .eye-target {
  opacity: .88;
  background: conic-gradient(from 154deg, #0b1c0e 0deg 52deg, #32bd68 58deg 354deg, #0b1c0e 354deg 360deg);
  box-shadow: inset 0 0 5px #34e07c;
  animation: eye-warm 1.6s ease-in-out infinite;
}

.radio[data-state="playing"] .eye-target {
  opacity: 1;
  background: conic-gradient(from 174deg, #081e0c 0deg 12deg, #5bf294 16deg 354deg, #081e0c 354deg 360deg);
  box-shadow: 0 0 8px rgba(72, 238, 134, .65);
}

.radio[data-state="error"] .eye-target {
  opacity: .55;
  background: conic-gradient(from 126deg, #0c140e 0deg 108deg, #2b6b42 114deg 354deg, #0c140e 354deg 360deg);
}

@keyframes eye-warm {
  0%, 100% { filter: brightness(.85); }
  50% { filter: brightness(1.18); }
}

.eye-cap {
  position: relative;
  width: .42rem;
  height: .42rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #3a352f, #110e0b 75%);
  border: 1px solid rgba(0, 0, 0, .8);
  z-index: 2;
}

.freq-badge {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
  color: #f2dab0;
  white-space: nowrap;
}

/* Reverse-painted glass slide-rule window */
.dial-glass {
  position: relative;
  width: 100%;
  max-width: 100%;
  border-radius: .22rem;
  overflow: hidden;
  border: 1.5px solid #120b05;
  background: linear-gradient(180deg, #150e08 0%, #1d140b 55%, #120c06 100%);
  box-shadow:
    inset 0 6px 14px rgba(0, 0, 0, .9),
    inset 0 -4px 10px rgba(0, 0, 0, .78),
    0 1px 0 rgba(246, 212, 146, .35);
  transition: box-shadow .85s ease, background .85s ease;
}

.radio[data-state="playing"] .dial-glass {
  background: linear-gradient(180deg, #2d1e0d 0%, #442b10 48%, #2a1a0b 100%);
  box-shadow:
    inset 0 0 22px rgba(255, 194, 86, .48),
    inset 0 4px 10px rgba(0, 0, 0, .55),
    0 0 18px rgba(242, 168, 60, .28),
    0 1px 0 rgba(255, 224, 152, .52);
}

/* Twin miniature #47 incandescent side pilot bulbs glowing sideways inside the glass */
.dial-bulbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .09;
  background:
    radial-gradient(ellipse 46% 140% at 3% 48%, rgba(255, 216, 124, .96) 0%, rgba(235, 158, 48, .66) 44%, transparent 86%),
    radial-gradient(ellipse 46% 140% at 97% 48%, rgba(255, 216, 124, .94) 0%, rgba(235, 158, 48, .62) 44%, transparent 86%),
    radial-gradient(ellipse 68% 95% at 50% 48%, rgba(255, 198, 94, .48) 0%, transparent 80%);
  transition: opacity .85s ease, filter .85s ease;
}

.radio[data-state="loading"] .dial-bulbs {
  opacity: .52;
  animation: filament-warm 1.8s ease-in-out infinite;
}

.radio[data-state="playing"] .dial-bulbs {
  opacity: 1;
}

.radio[data-state="error"] .dial-bulbs {
  opacity: .22;
  filter: hue-rotate(-14deg) saturate(.75);
}

@keyframes filament-warm {
  0%, 100% { opacity: .42; }
  50% { opacity: .7; }
}

.dial-svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
}

.scale-rule {
  stroke: rgba(235, 198, 126, .52);
  stroke-width: 1.5;
}
.scale-rule-dim {
  stroke: rgba(235, 198, 126, .2);
  stroke-width: 1;
}
.ticks-major {
  stroke: rgba(247, 214, 148, .68);
  stroke-width: 1.8;
}
.ticks-med {
  stroke: rgba(236, 198, 126, .48);
  stroke-width: 1.25;
}
.ticks-minor {
  stroke: rgba(220, 178, 108, .36);
  stroke-width: 1;
}

.dial-nums text {
  font-family: var(--dial-sans);
  font-size: 13.5px;
  font-weight: 700;
  fill: #bda270;
  text-anchor: middle;
  font-variant-numeric: tabular-nums;
  transition: fill .7s ease;
}

.dial-foot-l, .dial-foot-r, .dial-foot-c {
  font-family: var(--dial-sans);
  font-size: 8.8px;
  font-weight: 700;
  letter-spacing: 1.4px;
  fill: rgba(214, 180, 118, .66);
}
.dial-foot-r { text-anchor: end; }
.dial-foot-c {
  text-anchor: middle;
  fill: rgba(238, 120, 82, .72);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .8px;
}

.mark-1225 {
  fill: #d46542;
  opacity: .72;
}

.radio[data-state="playing"] .dial-nums text {
  fill: #fff1cc;
}
.radio[data-state="playing"] .scale-rule,
.radio[data-state="playing"] .ticks-major {
  stroke: #ffebba;
}
.radio[data-state="playing"] .ticks-med {
  stroke: rgba(255, 232, 174, .82);
}
.radio[data-state="playing"] .ticks-minor {
  stroke: rgba(255, 224, 152, .62);
}
.radio[data-state="playing"] .dial-foot-l,
.radio[data-state="playing"] .dial-foot-r {
  fill: rgba(255, 238, 194, .88);
}
.radio[data-state="playing"] .mark-1225,
.radio[data-state="playing"] .dial-foot-c {
  fill: #ffaa7c;
  opacity: 1;
}

/* Rail aligning precisely to SVG x = 28..572 out of 600 */
.dial-rail {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4.6667%;
  right: 4.6667%;
  z-index: 2;
  pointer-events: none;
}

/* Stationary copper-vermilion slide-rule pointer locked at 1225 KC (64.2857%) */
.needle {
  position: absolute;
  top: 49%;
  bottom: 20%;
  left: var(--tune, 64.2857%);
  width: 2.25px;
  transform: translateX(-50%);
  border-radius: 1px;
  background: linear-gradient(180deg, #cf4c31, #e05336 55%, #9c2414);
  box-shadow: 0 0 3px rgba(0, 0, 0, .85);
  transition: left .45s cubic-bezier(.22, .68, .28, 1), box-shadow .6s ease;
}

.needle::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 6px;
  height: 5px;
  transform: translateX(-50%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: linear-gradient(180deg, #ff996e, #d44226);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .85));
}

.radio[data-state="playing"] .needle {
  background: linear-gradient(180deg, #ff8157, #ff542d 50%, #e03718);
  box-shadow:
    0 0 9px rgba(255, 92, 46, .92),
    0 0 2px rgba(255, 224, 170, .9);
}

/* Curved reverse-painted glass specular sheen */
.dial-glare {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(112deg,
      rgba(255, 250, 232, .12) 0%,
      rgba(255, 250, 232, .05) 31%,
      rgba(255, 250, 232, 0) 32.5%,
      rgba(255, 250, 232, 0) 100%),
    linear-gradient(180deg, rgba(255, 245, 220, .09) 0%, transparent 18%, transparent 86%, rgba(0, 0, 0, .34) 100%);
}

/* ---------- Broadcast Program Window (Zero Vertical Shift!) ---------- */

.program-window {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: .75rem 1rem .7rem;
  border-radius: .28rem;
  background:
    radial-gradient(ellipse 90% 80% at 50% 0%, rgba(214, 168, 92, .08), transparent 70%),
    linear-gradient(180deg, #1b1610 0%, #14100b 100%);
  border: 1px solid rgba(176, 138, 78, .38);
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, .82),
    0 1px 0 rgba(218, 178, 114, .18);
}

.program-meta {
  display: flex;
  align-items: center;
  gap: .46rem;
  margin-bottom: .32rem;
}

.meta-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
  background: #b79455;
  transition: background .3s ease;
}

.now-meta {
  font-family: var(--dial-sans);
  font-size: .69rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #dec088;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Subtle period tag tints for Breaking News / Weather / Sponsor / On Air */
.radio[data-kind="news"] .meta-dot {
  background: #eb6a4d;
  box-shadow: 0 0 6px rgba(235, 106, 77, .7);
}
.radio[data-kind="news"] .now-meta { color: #f6b39b; }
.radio[data-kind="weather"] .meta-dot {
  background: #8cc4d9;
  box-shadow: 0 0 5px rgba(140, 196, 217, .6);
}
.radio[data-kind="weather"] .now-meta { color: #b7dde9; }
.radio[data-kind="commercial"] .meta-dot { background: #e8b85c; }
.radio[data-kind="commercial"] .now-meta { color: #f1cf88; }

.track-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.36rem, 2.55vw, 1.98rem);
  line-height: 1.15;
  letter-spacing: -.005em;
  color: #f6ebd4;
  min-height: 2.35em;
  display: flex;
  align-items: center;
  text-wrap: balance;
  overflow-wrap: break-word;
  word-break: normal;
}

.status {
  margin: .34rem 0 0;
  min-height: 1.45em;
  font-family: var(--dial-sans);
  font-size: .8rem;
  font-weight: 500;
  line-height: 1.38;
  color: #d6c29d;
  transition: color .25s ease;
}

.radio[data-state="playing"] .status {
  color: #c1af8d;
}
.radio[data-state="error"] .status {
  color: #ffcfb8;
}

/* ---------- Brushed Brass Trim Separator ---------- */

.brass-trim {
  height: 5px;
  margin: clamp(.48rem, 1.1vw, .72rem) -.15rem;
  border-radius: 2px;
  background:
    linear-gradient(180deg,
      rgba(255, 238, 190, .58) 0%,
      rgba(176, 134, 66, .88) 45%,
      rgba(72, 48, 18, .96) 100%),
    url("img/brass.jpg?v=6") center / cover no-repeat;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, .85),
    0 -1px 2px rgba(0, 0, 0, .65);
}

/* ---------- Lower Always-Visible Tactile Control Valance ---------- */

.control-deck {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem clamp(1rem, 3vw, 2.2rem);
  padding: .48rem clamp(.62rem, 1.5vw, 1.05rem) .44rem;
  border-radius: .34rem;
  background:
    linear-gradient(180deg, rgba(28, 17, 10, .92) 0%, rgba(16, 10, 6, .96) 100%);
  border: 1px solid rgba(146, 110, 60, .24);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .72);
}

.deck-caption {
  display: block;
  font-family: var(--dial-sans);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #d4b680;
  margin-bottom: .32rem;
}

.switch-bay {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Authentic Mechanical ON / OFF Bat-Handle Toggle Switch Button */
.toggle-unit {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  min-height: 3.45rem;
  padding: .34rem 1.02rem .34rem .62rem;
  border-radius: .42rem;
  border: 1.5px solid #9e7d45;
  color: #f6e7c8;
  cursor: pointer;
  background:
    linear-gradient(180deg,
      rgba(255, 228, 174, .18) 0%,
      rgba(44, 32, 19, .78) 10%,
      rgba(26, 18, 11, .92) 86%,
      rgba(12, 8, 4, .98) 100%),
    url("img/brass.jpg?v=6") center / cover no-repeat,
    #251a10;
  box-shadow:
    inset 0 1px 0 rgba(255, 229, 174, .34),
    inset 0 -2px 3px rgba(0, 0, 0, .7),
    0 3px 0 #090603,
    0 6px 14px rgba(0, 0, 0, .72);
  transition: filter .15s ease, transform .1s ease, box-shadow .15s ease, border-color .35s ease;
}

.toggle-unit:hover:not(:disabled) {
  filter: brightness(1.1);
  border-color: #cca55e;
}

.toggle-unit:active:not(:disabled) {
  transform: translateY(1.5px);
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, .75),
    0 1px 0 #090603,
    0 3px 7px rgba(0, 0, 0, .65);
}

.toggle-unit:disabled {
  opacity: .68;
  cursor: not-allowed;
}

.radio[data-state="playing"] .toggle-unit {
  border-color: #c89d52;
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 182, .45),
    inset 0 -2px 4px rgba(0, 0, 0, .75),
    0 0 14px rgba(235, 166, 68, .18),
    0 3px 0 #090603,
    0 6px 14px rgba(0, 0, 0, .72);
}

/* Tiny slotted flat-head mounting screws on left face of toggle switch plate */
.screw {
  position: absolute;
  left: .24rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e5c689, #694c24 80%);
  box-shadow: inset 0 0 1px #000, 0 1px 0 rgba(0, 0, 0, .85);
}
.screw::after {
  content: "";
  position: absolute;
  inset: 2.3px 0.5px;
  background: #271a0a;
  transform: rotate(-32deg);
}
.screw-t { top: .26rem; }
.screw-b { bottom: .26rem; }

/* Brass toggle mounting well with unobstructed ON / OFF stamping & chrome bat lever */
.lever-well {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 2.25rem;
  height: 3.15rem;
  padding: .2rem 0;
  margin-left: .26rem;
  border-radius: .24rem;
  background:
    linear-gradient(180deg, #181109, #0e0904 50%, #1a120a);
  border: 1px solid #8a6c39;
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, .92),
    0 1px 0 rgba(242, 206, 138, .28);
}

.pos {
  position: relative;
  z-index: 2;
  font-family: var(--dial-sans);
  font-size: .46rem;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1;
  color: #8f7752;
  transition: color .25s ease, text-shadow .25s ease;
}

.pos-off {
  color: #e6c68a;
}
.radio[data-state="playing"] .pos-on,
.toggle-unit[aria-pressed="true"] .pos-on {
  color: #ffe39e;
  text-shadow: 0 0 6px rgba(255, 196, 86, .85);
}
.toggle-unit[aria-pressed="true"] .pos-off {
  color: #705b3c;
}

/* Threaded brass hex bushing / collar centered strictly between ON and OFF */
.bushing {
  position: relative;
  width: 1.12rem;
  height: 1.12rem;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #d8b572, #765827 58%, #2e1f0d);
  border: 1px solid #d5b372;
  box-shadow:
    inset 0 0 0 2px rgba(28, 17, 7, .85),
    0 1px 3px rgba(0, 0, 0, .9);
  display: grid;
  place-items: center;
}

/* Sculpted chrome bat-handle lever: pivots clearly downward (OFF) or upward (ON) without covering labels */
.bat-lever {
  position: absolute;
  left: 50%;
  top: 50%;
  width: .46rem;
  height: .78rem;
  border-radius: .14rem .14rem .24rem .24rem;
  transform-origin: 50% 22%;
  transform: translate(-50%, -18%);
  background: linear-gradient(90deg, #524231 0%, #ede0cb 30%, #fffaf0 50%, #9b886e 76%, #3f3122 100%);
  box-shadow:
    inset 0 -3px 3px rgba(18, 11, 5, .58),
    inset 0 1px 2px rgba(255, 255, 255, .7),
    0 3px 4px rgba(0, 0, 0, .95);
  transition: transform .18s cubic-bezier(.3, 1.35, .45, 1), box-shadow .18s ease;
}

/* Flipped UP into ON position when power is engaged */
.toggle-unit[aria-pressed="true"] .bat-lever {
  transform-origin: 50% 78%;
  transform: translate(-50%, -82%);
  border-radius: .24rem .24rem .14rem .14rem;
  box-shadow:
    inset 0 3px 3px rgba(255, 245, 215, .85),
    inset 0 -2px 2px rgba(38, 24, 9, .5),
    0 -2px 4px rgba(0, 0, 0, .85);
}

.switch-readout {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-width: 7.45rem;
}

.switch-icons {
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  flex: none;
  background: radial-gradient(circle at 35% 30%, #e8c783, #a17739);
  color: #1f1409;
  box-shadow: inset 0 1px 0 rgba(255, 245, 214, .65), 0 1px 2px rgba(0, 0, 0, .8);
}

.switch-icons svg {
  width: .78rem;
  height: .78rem;
  fill: currentColor;
  display: block;
}

.play-label {
  font-family: var(--dial-sans);
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.1;
  color: #f6e6c4;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .9);
}

/* ---------- Rotary Bakelite Volume Knob + Accessible Slider ---------- */

.volume-bay {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 0;
}

.volume-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .65rem;
  width: 100%;
  margin-bottom: .24rem;
}

.volume-top .deck-caption {
  margin: 0;
}

.volume-readout {
  font-family: var(--mono);
  font-size: .67rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #e4c68e;
}

.volume-hw {
  display: flex;
  align-items: center;
  gap: .7rem;
}

.knob-assembly {
  position: relative;
  width: 3.45rem;
  height: 3.45rem;
  flex: none;
  display: grid;
  place-items: center;
}

.knob-scale {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  stroke: rgba(212, 178, 114, .65);
  stroke-width: 1.6;
  stroke-linecap: round;
  pointer-events: none;
}

.knob-assembly:has(#volume-knob[hidden]) {
  display: none;
}

/* Fluted scalloped dark Bakelite rotary knob driven by --knob-angle */
.rotary-knob {
  position: relative;
  width: 2.38rem;
  height: 2.38rem;
  border-radius: 50%;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transform: rotate(var(--knob-angle, 59.4deg));
  transition: transform .08s ease-out;
  background:
    repeating-conic-gradient(
      from 0deg,
      rgba(255, 224, 178, .12) 0deg 8deg,
      rgba(0, 0, 0, .58) 8deg 22.5deg
    ),
    radial-gradient(circle at 36% 28%, #473222, #1b1109 62%, #0a0603);
  border: 1px solid #7f5d32;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, .92),
    0 1px 0 rgba(255, 220, 160, .2),
    inset 0 0 0 2px rgba(10, 6, 3, .72);
  display: grid;
  place-items: center;
}

.rotary-knob:active {
  cursor: grabbing;
}

.knob-pip {
  position: absolute;
  top: 2px;
  left: 50%;
  width: 2.5px;
  height: .55rem;
  transform: translateX(-50%);
  border-radius: 1px;
  background: #ffe09a;
  box-shadow: 0 0 3px rgba(255, 214, 130, .65);
}

.knob-cap {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, #f1d39a, #a67c3e 55%, #5b3e19 100%);
  border: 1px solid rgba(30, 18, 8, .85);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .85);
}

.volume-slider-wrap {
  display: flex;
  flex-direction: column;
  width: 7.4rem;
  min-width: 0;
}

input[type="range"]#volume {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 1.85rem;
  margin: 0;
  background: transparent;
  cursor: pointer;
  --fill: 72%;
}

input[type="range"]#volume::-webkit-slider-runnable-track {
  height: .36rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #deb466 0 var(--fill), #3b2d1f var(--fill) 100%);
  border: 1px solid rgba(15, 9, 4, .88);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .85), 0 1px 0 rgba(214, 174, 108, .22);
}

input[type="range"]#volume::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 1.05rem;
  height: 1.05rem;
  margin-top: -.39rem;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 32%, #fff1ca, #c89d53 68%, #6c4d1f);
  border: 1px solid #35210e;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .88);
}

input[type="range"]#volume::-moz-range-track {
  height: .36rem;
  border-radius: 999px;
  background: #3b2d1f;
  border: 1px solid rgba(15, 9, 4, .88);
}

input[type="range"]#volume::-moz-range-progress {
  height: .36rem;
  border-radius: 999px;
  background: #deb466;
}

input[type="range"]#volume::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 32%, #fff1ca, #c89d53 68%, #6c4d1f);
  border: 1px solid #35210e;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .88);
}

.volume-marks {
  display: flex;
  justify-content: space-between;
  padding: 0 .18rem;
  margin-top: -.1rem;
  font-family: var(--mono);
  font-size: .56rem;
  color: #a68e68;
}

#system-volume {
  font-family: var(--dial-sans);
  font-size: .76rem;
  color: #dfc9a2;
  white-space: nowrap;
}

#volume[hidden] + .volume-marks {
  display: none;
}

/* ---------- Brass Bottom Nameplate ---------- */

.nameplate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .85rem;
  padding: .68rem .4rem .74rem;
}

.plate-line {
  flex: 1 1 3rem;
  max-width: 8rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 174, 108, .5), transparent);
}

.plate-text {
  font-family: var(--dial-sans);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .24em;
  color: #e6c68a;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .92);
  white-space: nowrap;
}

/* ---------- Footer & NoScript Notice ---------- */

.notice {
  margin: 1.2rem auto 0;
  max-width: 34rem;
  padding: .72rem 1rem;
  text-align: center;
  font-family: var(--dial-sans);
  font-size: .88rem;
  line-height: 1.5;
  color: #f0dcae;
  background: rgba(26, 17, 10, .88);
  border: 1px solid rgba(188, 148, 86, .4);
  border-radius: .42rem;
}

.colophon {
  margin-top: clamp(1rem, 2.4vh, 1.65rem);
  font-family: var(--dial-sans);
  font-size: .77rem;
  line-height: 1.5;
  letter-spacing: .02em;
  color: #b7a483;
  text-align: center;
  padding: 0 .5rem;
}

/* ---------- Portrait / Mobile Tabletop "Tombstone" Layout ---------- */

@media (max-width: 780px) {
  .page {
    width: min(calc(100% - 1.35rem), 34rem);
    padding: 1.15rem 0 1.4rem;
  }

  .masthead {
    margin-bottom: .95rem;
  }

  .radio {
    border-radius: 1.85rem 1.85rem .48rem .48rem;
    padding: .68rem .65rem 0;
  }

  .bezel-deck {
    border-radius: 1.25rem 1.25rem .36rem .36rem;
    padding: .46rem;
  }

  /* Upright tombstone silhouette: speaker crown on top, backlit dial & slip below */
  .chassis-face {
    grid-template-columns: minmax(0, 1fr);
    gap: .56rem;
  }

  .speaker {
    min-height: 7.4rem;
    border-radius: .92rem .92rem .28rem .28rem;
  }

  .speaker-cloth {
    background-size: 210px 210px;
  }

  .louvers {
    inset: 14% 0;
  }

  .louver {
    height: 7px;
  }

  .crest {
    padding: .34rem .98rem .3rem;
    min-width: 7.4rem;
  }

  .crest-emblem {
    width: 4rem;
  }

  .dial-hood {
    border-radius: .34rem;
  }

  .dial-glass {
    width: 100%;
    height: auto;
  }

  .program-window {
    padding: .68rem .8rem .64rem;
  }

  .track-title {
    font-size: clamp(1.32rem, 5.2vw, 1.72rem);
    min-height: 2.35em;
  }

  .control-deck {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .8rem;
    padding: .62rem .58rem .56rem;
  }

  .switch-bay {
    align-items: stretch;
  }

  .toggle-unit {
    width: 100%;
    justify-content: flex-start;
    min-height: 3.65rem;
  }

  .switch-readout {
    flex: 1 1 auto;
    justify-content: center;
    padding-right: 1.1rem;
  }

  .volume-bay {
    align-items: stretch;
  }

  .volume-hw {
    width: 100%;
  }

  .volume-slider-wrap {
    flex: 1 1 auto;
    width: auto;
  }

  .table-surface {
    margin: -.42rem 0 0;
    width: 100%;
  }
}

@media (max-width: 390px) {
  .telemetry-bar {
    font-size: .58rem;
    letter-spacing: .09em;
  }

  .freq-badge {
    font-size: .61rem;
  }

  .plate-text {
    font-size: .54rem;
    letter-spacing: .15em;
  }

  .knob-assembly {
    width: 2.95rem;
    height: 2.95rem;
  }

  .rotary-knob {
    width: 2.08rem;
    height: 2.08rem;
  }
}

/* Compact horizontal phone/tablet landscape comfort mode (e.g. 844×390) */
@media (max-height: 520px) and (min-width: 560px) {
  .page {
    width: min(calc(100% - 1.5rem), 54rem);
    padding: .5rem 0;
  }
  .masthead { margin-bottom: .4rem; }
  .masthead h1 { font-size: 1.55rem; }
  .radio { padding: .48rem .52rem 0; border-radius: 1rem 1rem .4rem .4rem; }
  .bezel-deck { padding: .35rem; }
  .chassis-face {
    grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr);
    gap: .48rem;
  }
  .speaker { min-height: 9.2rem; }
  .crest { padding: .28rem .8rem; min-width: 6.4rem; }
  .crest-emblem { width: 3.4rem; }
  .dial-hood { padding: .28rem .38rem .3rem; }
  .telemetry-bar { padding-bottom: .2rem; font-size: .58rem; }
  .program-window { padding: .4rem .68rem; }
  .track-title { font-size: 1.18rem; min-height: 1.4em; }
  .status { margin-top: .18rem; font-size: .72rem; }
  .brass-trim { margin: .34rem -.1rem; height: 3px; }
  .control-deck { padding: .28rem .42rem; }
  .deck-caption { margin-bottom: .14rem; font-size: .54rem; }
  .toggle-unit { min-height: 2.7rem; padding: .2rem .75rem .2rem .48rem; }
  .lever-well { height: 2.5rem; width: 1.95rem; }
  .bushing { width: .88rem; height: .88rem; }
  .bat-lever { width: .38rem; height: .56rem; }
  .knob-assembly { width: 2.55rem; height: 2.55rem; }
  .rotary-knob { width: 1.8rem; height: 1.8rem; }
  .nameplate { padding: .32rem .3rem .36rem; }
  .cabinet-feet, .table-surface { display: none; }
  .colophon { margin-top: .42rem; font-size: .68rem; }
}

@media (pointer: coarse) {
  input[type="range"]#volume { height: 2.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
