@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400;500&family=Space+Grotesk:wght@400;500;600&display=swap");

:root {
  --ink: #10182d;
  --night: #07101d;
  --night-2: #101d31;
  --cream: #f3eedf;
  --paper: #e9e1cd;
  --orange: #ff6b35;
  --orange-bright: #ff8b55;
  --lime: #d9f99d;
  --cyan: #94e9df;
  --muted: #9aa6ad;
  --mono: "DM Mono", "Courier New", monospace;
  --display: "Space Grotesk", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--cream);
  background:
    radial-gradient(circle at 72% 12%, rgba(55, 91, 112, 0.32), transparent 27rem),
    linear-gradient(180deg, #07101d 0%, #101a2b 55%, #0a111d 100%);
  font-family: var(--display);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.34;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

#sky {
  position: fixed;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
}

.aurora {
  position: fixed;
  z-index: -2;
  width: 42vw;
  height: 42vw;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  opacity: 0.1;
  animation: drift 14s ease-in-out infinite alternate;
}

.aurora-one {
  top: 20vh;
  left: -25vw;
  background: var(--cyan);
}

.aurora-two {
  right: -28vw;
  top: 55vh;
  background: var(--orange);
  animation-delay: -7s;
}

@keyframes drift {
  to { transform: translate3d(8vw, -4vh, 0) scale(1.15); }
}

.site-header {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 30px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(243, 238, 223, 0.16);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--cream);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
}

.wordmark-star {
  color: var(--orange);
  font-size: 18px;
  animation: twinkle 2.4s ease-in-out infinite;
}

@keyframes twinkle {
  50% { transform: rotate(22deg) scale(0.75); opacity: 0.55; }
}

.on-air {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #87939c;
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.15em;
}

.on-air-light {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #52606b;
  transition: 300ms ease;
}

body.is-powered .on-air { color: var(--orange-bright); }
body.is-powered .on-air-light {
  background: var(--orange);
  box-shadow: 0 0 14px var(--orange);
  animation: pulse 1.4s ease-in-out infinite;
}

body.is-streaming .on-air-light {
  background: var(--lime);
  box-shadow: 0 0 14px var(--lime);
}

body.is-streaming .on-air { color: var(--lime); }
body.is-buffering .on-air-light { animation-duration: 0.55s; }

@keyframes pulse { 50% { opacity: 0.45; } }

main {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.intro {
  min-height: 590px;
  padding: 105px 0 75px;
  position: relative;
}

.intro::after {
  content: "⌁";
  position: absolute;
  right: 3%;
  top: 125px;
  color: rgba(243, 238, 223, 0.05);
  font: 300 clamp(160px, 23vw, 320px)/1 var(--mono);
  transform: rotate(-12deg);
  pointer-events: none;
}

.eyebrow,
.control-label,
.serial {
  margin: 0;
  font: 500 10px/1.3 var(--mono);
  letter-spacing: 0.16em;
}

.eyebrow {
  color: var(--orange-bright);
}

.intro h1 {
  max-width: 880px;
  margin: 22px 0 24px;
  font-size: clamp(60px, 9.3vw, 130px);
  font-weight: 400;
  line-height: 0.84;
  letter-spacing: -0.07em;
}

.intro h1 em {
  color: var(--orange);
  font-family: Georgia, serif;
  font-weight: 400;
}

.lede {
  margin: 0 0 36px;
  color: #a8b0b1;
  font: 300 13px/1.7 var(--mono);
}

.begin-button {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 210px;
  padding: 16px 18px;
  border: 1px solid rgba(243, 238, 223, 0.38);
  border-radius: 1px;
  background: transparent;
  cursor: pointer;
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.12em;
  transition: color 220ms ease, border-color 220ms ease, background 220ms ease;
}

.begin-button:hover {
  color: var(--ink);
  border-color: var(--orange);
  background: var(--orange);
}

.button-arrow { font-size: 18px; }

.radio-shell {
  position: relative;
  isolation: isolate;
  width: min(940px, 100%);
  margin: 0 auto 150px;
  padding: 56px 70px 48px;
  color: var(--ink);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.62);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.5), transparent 32%),
    var(--paper);
  box-shadow:
    0 42px 80px rgba(0, 0, 0, 0.4),
    0 8px 0 #bdb39d,
    inset 0 0 0 2px rgba(42, 43, 45, 0.07);
}

.radio-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)' opacity='.18'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  pointer-events: none;
}

.screw {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid #968d7b;
  background: #c9bfaa;
  box-shadow: inset 1px 1px 2px rgba(255,255,255,0.8);
}

.screw::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 1px;
  left: 2px;
  top: 5px;
  background: #776f61;
  transform: rotate(-28deg);
}

.screw-tl { top: 20px; left: 20px; }
.screw-tr { top: 20px; right: 20px; }
.screw-bl { bottom: 20px; left: 20px; }
.screw-br { bottom: 20px; right: 20px; }

.radio-topline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 30px;
}

.serial { color: #625f57; }

.radio-topline h2 {
  margin: 7px 0 0;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.battery {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid #767368;
}

.battery span {
  width: 5px;
  height: 11px;
  background: var(--orange);
}

.display-panel {
  position: relative;
  min-height: 270px;
  padding: 26px 28px;
  overflow: hidden;
  color: var(--lime);
  border: 5px solid #202735;
  border-radius: 7px;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 30% 30%, #1e3544, #08141e 70%);
  box-shadow: inset 0 0 40px rgba(0,0,0,0.72), 0 2px 1px rgba(255,255,255,0.7);
}

.display-panel::after {
  content: "";
  position: absolute;
  inset: -100% 0;
  background: linear-gradient(transparent 45%, rgba(217,249,157,0.04) 50%, transparent 55%);
  animation: scan 7s linear infinite;
  pointer-events: none;
}

@keyframes scan { to { transform: translateY(50%); } }

.display-head {
  display: flex;
  justify-content: space-between;
  color: #698b81;
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.17em;
}

.frequency-row {
  display: flex;
  align-items: baseline;
  gap: 13px;
  margin-top: 6px;
}

.frequency {
  text-shadow: 0 0 16px rgba(217,249,157,0.22);
  font: 300 clamp(68px, 10vw, 105px)/0.95 var(--mono);
  letter-spacing: -0.1em;
}

.unit {
  color: #6e8c82;
  font: 400 10px/1 var(--mono);
}

.signal-meter {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 24px;
  margin: 14px 0 20px;
}

.signal-meter span {
  width: 8px;
  height: calc(5px + (var(--bar, 1) * 2px));
  opacity: 0.12;
  background: var(--lime);
  transition: opacity 160ms ease, box-shadow 160ms ease;
}

.signal-meter span:nth-child(1), .signal-meter span:nth-child(10) { --bar: 1; }
.signal-meter span:nth-child(2), .signal-meter span:nth-child(9) { --bar: 2; }
.signal-meter span:nth-child(3), .signal-meter span:nth-child(8) { --bar: 3; }
.signal-meter span:nth-child(4), .signal-meter span:nth-child(7) { --bar: 4; }
.signal-meter span:nth-child(5), .signal-meter span:nth-child(6) { --bar: 5; }
.signal-meter span.lit { opacity: 0.92; box-shadow: 0 0 9px rgba(217,249,157,0.35); }

.transmission {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 34px;
  color: #a8c0ae;
  font: 400 11px/1.55 var(--mono);
  letter-spacing: 0.05em;
}

.transmission p { margin: 0; }
.prompt { color: var(--orange-bright); }
.cursor {
  flex: 0 0 auto;
  width: 7px;
  height: 13px;
  margin-top: 1px;
  background: var(--lime);
  animation: blink 0.9s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.controls {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 75px;
  padding: 48px 15px 30px;
}

.control-label {
  display: block;
  color: #716c60;
  margin-bottom: 16px;
}

.dial-stage {
  position: relative;
  width: 250px;
  height: 250px;
  display: grid;
  place-items: center;
}

.dial-orbit {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(16,24,45,0.2);
  border-radius: 50%;
  background: repeating-conic-gradient(from -135deg, rgba(16,24,45,0.5) 0 1deg, transparent 1deg 9deg);
  -webkit-mask: radial-gradient(circle, transparent 0 81%, #000 82%);
  mask: radial-gradient(circle, transparent 0 81%, #000 82%);
}

.dial {
  --rotation: -7deg;
  position: relative;
  width: 170px;
  height: 170px;
  border: 1px solid #545148;
  border-radius: 50%;
  color: var(--ink);
  background:
    repeating-radial-gradient(circle at 40% 38%, transparent 0 3px, rgba(255,255,255,0.025) 4px 5px),
    radial-gradient(circle at 37% 30%, #52555b, #232830 62%, #171b21);
  box-shadow:
    0 15px 20px rgba(30,29,25,0.28),
    0 4px 0 #14181e,
    inset 2px 3px 3px rgba(255,255,255,0.19);
  cursor: grab;
  touch-action: none;
  transform: rotate(var(--rotation));
}

.dial:active { cursor: grabbing; }

.dial::after {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
}

.dial-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #a9aa9f;
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.14em;
  transform: rotate(calc(var(--rotation) * -1));
}

.dial-marker {
  position: absolute;
  top: 14px;
  left: calc(50% - 2px);
  width: 4px;
  height: 23px;
  border-radius: 4px;
  background: var(--orange);
  box-shadow: 0 0 7px rgba(255,107,53,0.35);
}

.dial-note {
  position: absolute;
  color: #625e55;
  font: 400 9px/1 var(--mono);
}
.note-a { left: 4px; bottom: 39px; }
.note-b { right: -1px; bottom: 39px; }

.microcopy {
  width: 250px;
  margin: 11px 0 0;
  color: #8a8477;
  text-align: center;
  font: 400 8px/1 var(--mono);
  letter-spacing: 0.13em;
}

.side-controls {
  display: flex;
  flex-direction: column;
  gap: 33px;
  padding-top: 2px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.toggle-track {
  width: 55px;
  height: 26px;
  padding: 3px;
  border-radius: 20px;
  background: #6d706f;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.45);
  transition: background 200ms ease;
}

.toggle-knob {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #dad5c8;
  box-shadow: 0 2px 3px rgba(0,0,0,0.35);
  transition: transform 240ms cubic-bezier(.2,.9,.3,1.2);
}

.toggle[aria-pressed="true"] .toggle-track { background: var(--orange); }
.toggle[aria-pressed="true"] .toggle-knob { transform: translateX(29px); }

.toggle-copy {
  color: #69665e;
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.1em;
}

.volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #777267;
  font-size: 10px;
}

input[type="range"] {
  width: min(190px, 100%);
  height: 3px;
  appearance: none;
  border-radius: 2px;
  background: linear-gradient(to right, var(--orange) 0 34%, #aaa394 34% 100%);
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  appearance: none;
  border: 2px solid #3a3b3a;
  border-radius: 50%;
  background: var(--paper);
}

input[type="range"]::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: 2px solid #3a3b3a;
  border-radius: 50%;
  background: var(--paper);
}

.capture-button {
  width: 100%;
  padding: 15px 14px;
  color: var(--cream);
  border: 0;
  border-radius: 2px;
  background: var(--ink);
  cursor: pointer;
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.11em;
  transition: transform 170ms ease, background 170ms ease, opacity 170ms ease;
}

.capture-button:not(:disabled):hover { transform: translateY(-2px); background: var(--orange); }
.capture-button:disabled { opacity: 0.32; cursor: not-allowed; }
.capture-icon { margin-right: 8px; font-size: 14px; }

.station-scale {
  padding-top: 26px;
  border-top: 1px solid rgba(16,24,45,0.17);
}

.scale-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 15px;
  border-bottom: 1px solid #69665e;
}

.scale-line span {
  width: 1px;
  height: calc(4px + (var(--i) % 4) * 2px);
  background: #69665e;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: #777167;
  font: 400 8px/1 var(--mono);
}

.field-log {
  width: min(940px, 100%);
  margin: 0 auto 130px;
}

.log-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(243,238,223,0.18);
}

.log-heading h2 {
  margin: 8px 0 0;
  font-size: 42px;
  font-weight: 400;
  letter-spacing: -0.05em;
}

.log-heading > p {
  margin: 0;
  color: #7e898e;
  font: 400 9px/1 var(--mono);
  letter-spacing: 0.12em;
}

.log-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding-top: 23px;
}

.empty-log {
  grid-column: 1 / -1;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: #69767d;
  border: 1px dashed rgba(243,238,223,0.18);
  font: 300 11px/1.6 var(--mono);
}

.empty-symbol { font-size: 38px; color: rgba(255,107,53,0.48); }

.log-card {
  position: relative;
  min-height: 190px;
  padding: 22px;
  overflow: hidden;
  color: var(--ink);
  border-radius: 2px;
  background: var(--card-color, var(--cream));
  box-shadow: 0 14px 28px rgba(0,0,0,0.14);
  animation: cardIn 420ms cubic-bezier(.2,.8,.25,1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) rotate(-1deg); }
}

.log-card::after {
  content: attr(data-mark);
  position: absolute;
  right: -7px;
  bottom: -29px;
  color: rgba(16,24,45,0.08);
  font: 400 105px/1 var(--mono);
  transform: rotate(-10deg);
}

.card-top {
  display: flex;
  justify-content: space-between;
  color: #6e6b62;
  font: 500 8px/1 var(--mono);
  letter-spacing: 0.1em;
}

.log-card h3 {
  margin: 25px 0 10px;
  font: 500 14px/1.2 var(--mono);
  letter-spacing: -0.04em;
}

.log-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  font: 400 10px/1.55 var(--mono);
}

.station-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border: 0;
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, outline-color 180ms ease;
}

.station-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 19px 34px rgba(0,0,0,0.22);
}

.station-card.is-selected {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

.station-card strong {
  position: relative;
  z-index: 1;
  display: block;
  margin: 24px 0 5px;
  font: 500 16px/1.2 var(--mono);
  letter-spacing: -0.05em;
}

.card-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.card-live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #75746c;
}

.station-card.is-playing .card-live { color: #c24720; }
.station-card.is-playing .card-live i {
  background: var(--orange);
  box-shadow: 0 0 8px var(--orange);
  animation: pulse 1.4s ease-in-out infinite;
}

.station-genre {
  position: relative;
  z-index: 1;
  color: #716d64;
  font: 500 8px/1.3 var(--mono);
  letter-spacing: 0.08em;
}

.station-description {
  position: relative;
  z-index: 1;
  display: block;
  flex: 1;
  margin-top: 14px;
  font: 400 10px/1.5 var(--mono);
}

.station-location {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid rgba(16,24,45,0.17);
  color: #716d64;
  font: 500 8px/1 var(--mono);
  letter-spacing: 0.06em;
}

footer {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 25px 0 36px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(243,238,223,0.16);
  color: #64727a;
  font: 400 8px/1 var(--mono);
  letter-spacing: 0.13em;
}

footer p { margin: 0; }
footer button {
  padding: 0;
  color: #64727a;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
}

.toast {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 28px;
  padding: 13px 18px;
  color: var(--ink);
  border-radius: 2px;
  background: var(--lime);
  box-shadow: 0 12px 35px rgba(0,0,0,0.35);
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.13em;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

.noscript {
  position: fixed;
  inset: auto 20px 20px;
  z-index: 20;
  padding: 15px;
  color: var(--ink);
  background: var(--orange);
  text-align: center;
}

@media (max-width: 780px) {
  .site-header,
  main,
  footer { width: min(100% - 32px, 620px); }
  .intro { min-height: 530px; padding-top: 85px; }
  .intro h1 { font-size: clamp(55px, 17vw, 90px); }
  .intro::after { display: none; }
  .radio-shell { padding: 48px 28px 38px; margin-bottom: 100px; }
  .controls { grid-template-columns: 1fr; gap: 45px; padding-left: 0; padding-right: 0; }
  .tuner-wrap { display: flex; flex-direction: column; align-items: center; }
  .tuner-wrap .control-label { align-self: flex-start; }
  .side-controls { display: grid; grid-template-columns: 1fr 1fr; }
  .capture-button { grid-column: 1 / -1; }
  .log-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  .site-header { padding-top: 22px; }
  .intro { min-height: 500px; padding-top: 70px; }
  .intro h1 { margin-top: 18px; line-height: 0.88; }
  .radio-shell { width: calc(100% + 16px); margin-left: -8px; padding: 43px 20px 32px; border-radius: 13px; }
  .radio-topline h2 { font-size: 20px; }
  .battery { display: none; }
  .display-panel { min-height: 255px; padding: 23px 18px; }
  .frequency { font-size: clamp(57px, 18vw, 78px); }
  .unit { font-size: 8px; }
  .controls { gap: 35px; }
  .side-controls { grid-template-columns: 1fr; }
  .capture-button { grid-column: auto; }
  .log-grid { grid-template-columns: 1fr; }
  .log-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  footer { gap: 20px; line-height: 1.5; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
