@font-face {
  font-family: 'Space Grotesk';
  src: url('./station-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}
:root {
  color-scheme: dark;
  font-family: 'Space Grotesk', system-ui, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #070910;
  color: #edf3ff;
}
* { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; }
a { color: inherit; }
button, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #adf3ff; outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.stage {
  --channel: #9deeff;
  --secondary: #c985ff;
  --shadow-hue: #8523a9;
  --field-offset: 0%;
  --pointer-x: 67%;
  --pointer-y: 30%;
  position: relative;
  isolation: isolate;
  overflow: clip;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 84px 26px 58px;
  background: radial-gradient(ellipse at 49% 55%, #161c34, #0a0c17 62%, #06070d);
}
.stage[data-channel=lab] { --channel: #d0afff; --secondary: #ff8c68; --shadow-hue: #a13162; }
.stage[data-channel=notes] { --channel: #ffafd4; --secondary: #75d2ff; --shadow-hue: #3b37a0; }
.stage[data-channel=about] { --channel: #ffcf90; --secondary: #8df8cf; --shadow-hue: #147768; }
.field { position: absolute; z-index: -2; inset: -9%; pointer-events: none; color: var(--channel); transition: color .9s, opacity .55s; }
.field::before, .field::after { content: ''; position: absolute; inset: 0; }
.field::before {
  background:
    radial-gradient(ellipse at var(--pointer-x) var(--pointer-y), color-mix(in srgb, currentColor 33%, transparent), transparent 34%),
    radial-gradient(ellipse at 15% 71%, color-mix(in srgb, var(--secondary) 32%, transparent), transparent 37%),
    radial-gradient(ellipse at 69% 102%, var(--shadow-hue), transparent 48%);
  transform: translateX(var(--field-offset));
  transition: transform .75s ease-out;
}
.field::after {
  background: radial-gradient(circle, #d3e5ff 0 .7px, transparent 1.6px) 51px 23px / 183px 157px, radial-gradient(circle, #ae9cff 0 1px, transparent 2px) 6px 56px / 299px 233px;
  mask-image: radial-gradient(ellipse, #000 8%, transparent 67%);
  opacity: .32;
}
.field svg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .62; animation: carrier 16s ease-in-out infinite alternate; }
.stage[data-signal=searching] .field { opacity: .55; }
@keyframes carrier { from { transform: translate(-1.2%, -1%) scale(.97); } to { transform: translate(1%, 1.3%) scale(1.05); } }
.field-secondary { stop-color: var(--secondary); }
.carrier-trace { stroke: var(--secondary); stroke-width: 1.8; stroke-linecap: round; stroke-dasharray: 8 92; animation: trace 15s linear infinite; }
.carrier-trace-offset { stroke: currentColor; stroke-dasharray: 4 96; animation-duration: 19s; animation-delay: -7s; }
@keyframes trace { to { stroke-dashoffset: -100; } }
.ripples { position: absolute; z-index: -1; inset: 0; pointer-events: none; }
.ripple {
  position: absolute;
  left: var(--ripple-x);
  top: var(--ripple-y);
  width: min(94vmin, 760px);
  aspect-ratio: 1;
  border: 1px solid var(--channel);
  border-radius: 50%;
  box-shadow: 0 0 28px color-mix(in srgb, var(--channel) 48%, transparent), inset 0 0 40px color-mix(in srgb, var(--secondary) 22%, transparent);
  animation: transmission 1.35s cubic-bezier(.14,.62,.35,1) both;
}
.ripple::before, .ripple::after { content: ''; position: absolute; border: 1px solid var(--secondary); border-radius: inherit; }
.ripple::before { inset: 11%; opacity: .6; }
.ripple::after { inset: 24%; opacity: .4; }
@keyframes transmission {
  from { transform: translate(-50%, -50%) scale(.06); opacity: .88; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

.radio { width: min(910px, 100%); position: relative; isolation: isolate; }
.aerial {
  position: absolute;
  z-index: -1;
  top: -9px;
  right: 9.5%;
  width: 52%;
  height: 8px;
  border-radius: 7px;
  transform: rotate(8deg);
  transform-origin: right center;
  background: linear-gradient(#232b44, #94a4c0 29%, #e6efff 43%, #536587 64%, #18213a);
  box-shadow: 0 0 10px #b0c4fc36, 0 8px 12px #060912;
}
.aerial::before { content: ''; position: absolute; inset: 1px 56% 1px 2px; background: linear-gradient(#5d769f, #cfdef9 43%, #33415d); border-radius: 4px; }
.aerial::after { content: ''; position: absolute; right: 0; top: -4px; width: 22px; height: 17px; border: 1px solid #6b7894; border-radius: 7px; background: linear-gradient(#4a5770, #1b2338 70%); }
.cabinet {
  position: relative;
  padding: clamp(10px, 2.1vw, 25px);
  border: 1px solid transparent;
  border-radius: clamp(16px, 3vw, 31px);
  background: linear-gradient(150deg, #303b57, #191f31 38%, #13182a 69%, #26324a) padding-box, linear-gradient(145deg, #b2c6e7, #596987 19%, #232e46 54%, #806bb1 100%) border-box;
  box-shadow: inset 0 1px 0 #c5d5ff2b, inset 0 -5px 7px #0b1028, 0 8px 0 -1px #0b0e1b, 0 12px 0 -2px #151a31, 0 32px 58px #040611c9, 0 55px 115px #040512cc;
}
.cabinet::after { content: ''; position: absolute; inset: auto 10% -8px; height: 1px; background: linear-gradient(90deg, transparent, #b3a8ff91, transparent); pointer-events: none; }
.nameplate { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: clamp(10px, 1.7vw, 19px); }
.badge { display: inline-flex; align-items: baseline; gap: .45em; margin: 0; color: #f1f6ff; font-size: clamp(13px, 2.5vw, 29px); font-weight: 700; line-height: 1; letter-spacing: -.055em; }
.badge span { color: var(--channel); font-size: .62em; font-weight: 600; letter-spacing: .08em; transition: color .5s; }
.model { display: flex; align-items: center; gap: .7em; color: #b5c3dc; font-size: clamp(8px, 1.16vw, 12px); font-weight: 600; letter-spacing: .14em; white-space: nowrap; }
.model i { width: 12px; height: 1px; background: #8a9bbb; }
.face { display: grid; grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr); gap: clamp(8px, 1.65vw, 19px); }
.grille {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: clamp(205px, 27vw, 326px);
  border: 1px solid #090e20;
  border-radius: clamp(9px, 1.4vw, 16px);
  background: radial-gradient(ellipse at 42% 46%, #29364f, #101629 69%);
  box-shadow: inset 0 7px 21px #050715, 0 1px #8296bd69;
}
.grille::before { content: ''; position: absolute; z-index: -1; inset: 0; background: repeating-linear-gradient(0deg, #070b18f0 0 2px, #4b5c7a70 2px 3px, transparent 3px 6px); box-shadow: inset 0 0 32px 8px #070a17b0; }
.grille::after { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(145deg, #9fc8f332, transparent 39%, #100e290d 76%, #685dbe19); pointer-events: none; }
.speaker { position: absolute; z-index: -2; width: 88%; aspect-ratio: 1; left: 50%; top: 50%; transform: translate(-50%, -50%); border: 1px solid #566788; border-radius: 50%; background: radial-gradient(circle at 47% 43%, #3a4a65 0, #28364d 18%, #151f34 19% 22%, #354664 24%, #141e34 60%, #0c1329 63% 69%, #283a58 72%, #10162b 74%); box-shadow: 0 0 25px #050615; }
.speaker-mark { position: absolute; bottom: 9%; left: 10%; width: 26px; height: 9px; background: repeating-linear-gradient(120deg, #adc2e8 0 2px, transparent 3px 7px); opacity: .55; }

.panel { min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: clamp(9px, 1.6vw, 17px); }
.glass {
  --position: 3.902%;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: clamp(5px, 1.2vw, 12px);
  padding: clamp(10px, 1.9vw, 23px);
  border: 1px solid #394b70;
  border-radius: clamp(9px, 1.4vw, 16px);
  background: radial-gradient(ellipse at 19% 0%, color-mix(in srgb, var(--channel) 16%, #0c1427), #0a1124 58%, #070b19);
  box-shadow: inset 0 0 15px #040511, 0 2px 3px #080c1b;
  color: var(--channel);
  transition: color .45s;
}
.glass::before { content: ''; position: absolute; z-index: -1; pointer-events: none; inset: 0; border-radius: inherit; background: linear-gradient(152deg, #c5d7ff16, #d9ecff06 31%, transparent 31.4%), repeating-linear-gradient(0deg, #93b9ff07 0 1px, transparent 1px 3px); }
.glass-readout { min-width: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lock { display: flex; align-items: baseline; gap: clamp(3px, 1vw, 10px); font-size: clamp(31px, 6.2vw, 76px); line-height: .92; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -.08em; text-shadow: 0 0 22px color-mix(in srgb, currentColor 28%, transparent); }
.unit { color: #b8c9e3; font-size: clamp(8px, 1.3vw, 13px); letter-spacing: .015em; }
.station { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; text-align: right; font-size: clamp(9px, 1.3vw, 14px); font-weight: 600; letter-spacing: .06em; }
.station i { flex: 0 0 auto; width: 6px; height: 6px; border: 1px solid currentColor; border-radius: 50%; background: currentColor; box-shadow: 0 0 11px currentColor; }
.glass[data-locked=false] .station { color: #a7b7d6; }
.glass[data-locked=false] .station i { background: transparent; box-shadow: none; }
.frequency-scale { position: relative; margin: 0 13px; padding-top: 25px; }
.scale-numbers { position: absolute; inset: 5px 0 auto; font-size: clamp(9px, 1.45vw, 16px); font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; color: #cedcf5; }
.scale-numbers span { position: absolute; left: var(--mark); transform: translateX(-50%); }
.ticks { height: clamp(19px, 3.15vw, 36px); border-block: 1px solid #62799a63; background: repeating-linear-gradient(to right, #a0b6d680 0 1px, transparent 1px calc(100% / 41)) top / 100% 44% no-repeat, repeating-linear-gradient(to right, #c1d8fab0 0 1px, transparent 1px calc(100% / 10.25)) top / 100% 85% no-repeat; }
.needle { position: absolute; top: 22px; bottom: 21px; left: var(--position); width: 2px; transform: translateX(-50%); border-radius: 1px; background: #ff9b82; box-shadow: 0 0 10px #ff735cd9; pointer-events: none; }
.scale-input { appearance: none; position: absolute; top: 16px; left: -7px; width: calc(100% + 14px); height: calc(100% - 36px); margin: 0; background: transparent; cursor: ew-resize; }
.scale-input::-webkit-slider-thumb { appearance: none; width: 14px; height: 34px; background: transparent; }
.scale-input::-moz-range-thumb { width: 14px; height: 34px; border: 0; background: transparent; }
.station-marks { position: relative; height: 23px; }
.station-marks button { position: absolute; top: -2px; left: var(--mark); display: grid; place-items: center; width: 27px; height: 27px; padding: 0; transform: translateX(-50%); background: transparent; border: 0; border-radius: 3px; cursor: pointer; color: #a6b9d8; }
.station-marks button::before { content: ''; width: 5px; height: 5px; transform: rotate(45deg); background: currentColor; }
.station-marks button:hover, .station-marks button[aria-pressed=true] { color: var(--channel); }
.station-marks button[aria-pressed=true]::before { box-shadow: 0 0 9px currentColor; }

.controls { display: flex; justify-content: space-between; align-items: end; gap: 8px; padding: 0 2px; }
.switches { display: flex; gap: clamp(6px, 1.7vw, 17px); align-items: end; }
.switch-set, .knob-group { display: grid; gap: 6px; justify-items: center; color: #c2d0ea; }
.switch-set > span, .knob-label { font-size: clamp(9px, 1.1vw, 12px); line-height: 1.1; font-weight: 600; letter-spacing: .11em; }
.switch { display: grid; place-items: center; width: clamp(44px, 5.4vw, 62px); height: clamp(44px, 4.4vw, 51px); padding: 0; border: 1px solid #546485; border-radius: 8px; background: linear-gradient(153deg, #3a4663, #202b44 72%); color: #dceaff; box-shadow: inset 0 1px #90a4ce77, 0 3px 1px #0d142a; cursor: pointer; }
.switch:hover, .switch[aria-pressed=true] { color: var(--channel); border-color: #859bc8; }
#sound[aria-pressed=true] { box-shadow: inset 0 1px #a9d6f488, 0 0 11px color-mix(in srgb, var(--channel) 40%, transparent); }
.switch:active { transform: translateY(2px); box-shadow: inset 0 1px #90a4ce77, 0 1px 1px #0d142a; }
.switch:disabled { opacity: .53; cursor: default; }
.switch > span { font-size: 24px; line-height: 1; }
.switch svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.dial { --angle: -124.46deg; display: grid; place-items: center; width: clamp(67px, 9vw, 115px); aspect-ratio: 1; border: 1px solid #687d9f; border-radius: 50%; background: #151c32; box-shadow: 0 1px #98b0d775, inset 0 2px 6px #060914; cursor: grab; touch-action: none; user-select: none; }
.dial:active { cursor: grabbing; }
.dial-wheel { position: relative; display: grid; justify-items: center; width: 94%; aspect-ratio: 1; border: 1px solid #11192f; border-radius: 50%; transform: rotate(var(--angle)); background: repeating-conic-gradient(#1b253e 0deg 2deg, #7085ab 2.5deg 3.6deg); box-shadow: 0 3px 4px #030716; pointer-events: none; }
.dial-wheel::before { content: ''; position: absolute; inset: 10%; border: 1px solid #657b9c; border-radius: 50%; background: repeating-radial-gradient(circle, #dce9ff0a 0 1px, transparent 1px 3px), conic-gradient(from -40deg, #5f749c, #283650, #1b243e, #5a6c92, #273653, #5f749c); box-shadow: 0 2px 4px #080c20; }
.dial-wheel i { position: absolute; top: 11%; width: 3px; height: 18%; border-radius: 2px; background: var(--channel); box-shadow: 0 0 9px color-mix(in srgb, var(--channel) 64%, transparent); transition: background .45s; }

#program { width: min(450px, calc(100% - 36px)); padding: 29px; border: 1px solid #58739c; border-radius: 14px; background: #151e34; color: #edf3ff; box-shadow: 0 19px 80px #010310b5; }
#program::backdrop { background: #060915bc; }
#program h2 { margin: 5px 0 10px; font-size: 32px; line-height: 1.15; letter-spacing: -.04em; }
#program p { margin: 0; line-height: 1.7; }
.program-frequency { color: #9deeff; font-size: 14px; font-weight: 600; letter-spacing: .08em; }
.close { position: absolute; right: 11px; top: 11px; width: 44px; height: 44px; border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 24px; }
.program-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 15px; color: #9deeff; text-underline-offset: 4px; }

@media (max-width: 640px) {
  .stage { padding-inline: 14px; }
  .face { grid-template-columns: minmax(0, .66fr) minmax(0, 1.34fr); }
  .grille { min-height: 0; }
  .grille::before { background-size: 100% 4px; }
  .speaker { width: 98%; }
  .speaker-mark { width: 19px; height: 6px; }
  .glass { padding: 8px 7px; }
  .frequency-scale { margin-inline: 10px; padding-top: 20px; }
  .needle { top: 18px; bottom: 17px; }
  .scale-numbers { font-size: 9px; }
  .scale-numbers span:nth-child(even):not(:last-child) { display: none; }
  .station { letter-spacing: 0; }
}
@media (max-width: 380px) {
  .stage { padding-inline: 11px; }
  .face { gap: 6px; }
  .model { letter-spacing: .09em; }
  .controls { gap: 4px; }
  .switches { gap: 4px; }
  .switch { width: 39px; }
  .dial { width: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  .field svg, .carrier-trace { animation: none; }
  .ripples { display: none; }
  .field, .field::before, .glass, .badge span, .dial-wheel i { transition: none; }
  .field::before { transform: none; }
}
