:root {
  --navy: #0f2744;
  --navy-2: #173a63;
  --orange: #f7954c;
  --blue: #00adef;
  --link: #0077a6;
  --paper: #ffffff;
  --mist: #f1f6fa;
  --ink: #16202b;
  --ink-soft: #55606d;
  --sky: #e3f4fc;
  --display: "Archivo", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --body: "Public Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --measure: 68ch;
  --gutter: max(clamp(1rem, 4vw, 3rem), calc((100% - 72rem) / 2));
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font: 400 1.0625rem/1.6 var(--body);
  color: var(--ink);
  background: var(--paper);
}

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

h2 {
  font: 700 clamp(1.5rem, 1.2rem + 1.2vw, 2rem)/1.15 var(--display);
  font-stretch: 85%;
  margin: 0 0 1rem;
}

/* ---- Masthead ---- */
.masthead {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem 2rem;
  padding: 0.75rem var(--gutter);
  background: var(--paper);
  border-bottom: 4px solid var(--blue);
}
.wordmark { display: inline-flex; flex-direction: column; align-items: center; text-decoration: none; }
.wordmark img { display: block; height: clamp(62px, 9vw, 100px); width: auto; }
.tagline {
  margin-top: 0.3rem;
  font: 600 clamp(0.8rem, 0.7rem + 0.4vw, 1rem)/1 var(--body);
  color: var(--ink);
  white-space: nowrap;
}
.masthead nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.masthead nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.masthead nav a:hover { color: var(--link); text-decoration: underline; }

/* ---- On air ---- */
.onair {
  background: linear-gradient(var(--navy), var(--navy-2));
  color: var(--sky);
  padding: clamp(1.5rem, 4vw, 3rem) var(--gutter) clamp(2.5rem, 6vw, 4.5rem);
}

.dial {
  position: relative;
  height: 5.5rem;
  margin: 0 0 2.5rem;
  border-radius: 6px;
  background: #0a1b30;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 173, 239, 0.35);
  overflow: hidden;
}
.dial-scale { position: absolute; inset: 0.9rem 2rem 0.9rem; }
.dial-scale .tick {
  position: absolute; top: 0; width: 1px; height: 0.6rem;
  background: rgba(227, 244, 252, 0.35);
}
.dial-scale .tick.mid { height: 0.9rem; background: rgba(227, 244, 252, 0.55); }
.dial-scale .tick.major { height: 1.3rem; width: 2px; background: var(--blue); }
.dial-scale .num {
  position: absolute; bottom: 0; transform: translateX(-50%);
  font: 600 0.9rem/1 var(--display); font-stretch: 75%;
  color: rgba(227, 244, 252, 0.7);
  font-variant-numeric: tabular-nums;
}
.dial-needle {
  position: absolute; top: 0.4rem; bottom: 0.4rem; left: 12%;
  width: 3px; border-radius: 2px;
  background: #f7954c;
  transition: left 1.6s cubic-bezier(.2,.7,.2,1), box-shadow 0.6s;
}
.is-playing .dial-needle { left: 58%; box-shadow: 0 0 14px 3px rgba(247, 149, 76, 0.6); }
@media (prefers-reduced-motion: reduce) { .dial-needle { transition: none; } }

.onair-body {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem clamp(1.25rem, 3vw, 2.5rem);
}

.play {
  width: clamp(4.5rem, 10vw, 6rem); aspect-ratio: 1;
  border: 0; border-radius: 50%;
  background: var(--orange); color: var(--navy);
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.play:hover { background: #f9a86a; }
.play svg { width: 45%; height: 45%; fill: currentColor; }
.play .icon-stop, .is-playing .play .icon-play { display: none; }
.is-playing .play .icon-stop { display: block; }

.nowplaying { min-width: 0; }
.np-status {
  margin: 0 0 0.35rem;
  font: 600 1rem/1.3 var(--body);
  color: rgba(227, 244, 252, 0.75);
}
.is-playing .np-status { color: var(--blue); }
.np-title {
  margin: 0;
  font: 800 clamp(2rem, 1.2rem + 3.6vw, 4rem)/1.02 var(--display);
  font-stretch: 85%;
  color: #fff;
  overflow-wrap: anywhere;
}
.np-artist {
  margin: 0.4rem 0 0;
  font: 500 clamp(1.15rem, 1rem + 0.8vw, 1.6rem)/1.2 var(--display);
  font-stretch: 90%;
  color: var(--sky);
}

.volume { display: grid; gap: 0.3rem; font-size: 0.85rem; color: rgba(227, 244, 252, 0.75); }
.volume input { width: 9rem; accent-color: var(--orange); }

.onair-note {
  max-width: var(--measure); margin: 1.5rem 0 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--orange);
  background: rgba(0, 0, 0, 0.2);
}

@media (max-width: 40rem) {
  .onair-body { grid-template-columns: auto 1fr; }
  .volume { grid-column: 1 / -1; }
  .volume input { width: 100%; }
  .dial { height: 4.5rem; }
  .dial-scale { inset-inline: 1rem; }
  .dial-scale .num:nth-child(even) { display: none; }
}

/* ---- Content sections ---- */
.recent, .listen, .about {
  padding: clamp(2rem, 5vw, 3.5rem) var(--gutter) 0;
}
.listen p, .about p { max-width: var(--measure); }

.recent-list { list-style: none; margin: 0; padding: 0; max-width: 52rem; }
.recent-list li {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid #dde5ec;
}
.recent-list time {
  grid-row: span 2;
  font-size: 0.9rem; color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  padding-top: 0.15rem;
}
.r-title { font-weight: 600; }
.r-artist { color: var(--ink-soft); font-size: 0.95rem; }
.recent-empty { color: var(--ink-soft); }

.listen-links { margin: 1.25rem 0 0; display: grid; gap: 1.25rem; }
.listen-links dt { font-weight: 600; }
.listen-links dd { margin: 0.25rem 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.listen-links code {
  font-size: 0.95rem; padding: 0.25rem 0.5rem;
  background: var(--mist); border-radius: 4px;
  overflow-wrap: anywhere;
}
.copy {
  font: 600 0.9rem var(--body);
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--link); border-radius: 4px;
  background: transparent; color: var(--link);
  cursor: pointer;
}
.copy:hover { background: var(--link); color: #fff; }

/* ---- Footer ---- */
.site-footer {
  margin-top: clamp(3rem, 7vw, 5rem);
  background: var(--mist);
  padding: 1.5rem var(--gutter);
  border-top: 4px solid var(--orange);
  font-size: 0.9rem; color: var(--ink-soft);
}
.site-footer p { margin: 0.2rem 0; }
