/* ============================================================
   yStream — design system
   Tokens, type and motion per "yStream Brand Kit · V1".
   Accent is signal only: LIVE dot, play button, progress,
   focus rings, link underlines, logo bars. Never a panel fill.
   ============================================================ */

:root {
  --accent:      #7db8ff;
  --accent-hi:   #a8ceff;
  --on-accent:   #050d18;
  --ground:      #080a0d;
  --panel:       #0b0e12;
  --footer:      #050709;
  --line:        #1f2733;
  --line-soft:   #151a22;
  --text:        #e6ebe8;
  --text-2:      #a8b0ba;
  --dim:         #8b96a5;
  --faint:       #5a6675;

  --sans: 'Archivo', 'Heebo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  /* The one clock — overwritten by the player from the live song's BPM.
     Defaults are 105 BPM / energy 0.62 / camelot 4 (the design's baseline). */
  --beat:    0.571s;
  --beat2:   1.143s;
  --beat4:   2.286s;
  --key-hue: 0deg;
  --glow-a:  0.22;

  --pad-x: clamp(20px, 6vw, 120px);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration-color: rgb(125 184 255 / 0.4); }
a:hover { color: var(--accent-hi); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1, h2, h3 { letter-spacing: -0.02em; font-weight: 800; margin: 0; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--on-accent);
  padding: 10px 16px; font-weight: 700; text-decoration: none;
  transition: top .15s;
}
.skip-link:focus { top: 12px; color: var(--on-accent); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ---------- motion ---------- */

@keyframes ysPulse {
  0%   { transform: scale(1);    opacity: .55; }
  30%  { transform: scale(1.06); opacity: .9;  }
  100% { transform: scale(1);    opacity: .55; }
}
@keyframes ysRing {
  0%   { transform: scale(.6);  opacity: .5; }
  100% { transform: scale(1.6); opacity: 0;  }
}
@keyframes ysBar {
  0%   { transform: scaleY(.25); }
  50%  { transform: scaleY(1);   }
  100% { transform: scaleY(.25); }
}
@keyframes ysDot {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; }
}
@keyframes ysCue {
  0%, 100% { transform: translateY(0); opacity: .5; }
  50%      { transform: translateY(6px); opacity: 1; }
}

/* ---------- logo ---------- */

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo:hover { color: var(--text); }

.logo-bars {
  display: flex; align-items: flex-end; gap: 3px; height: 20px; flex: none;
}
.logo-bars span {
  width: 4px; background: var(--accent); border-radius: 2px;
  transform-origin: bottom;
  animation: ysBar var(--beat2) ease-in-out infinite;
}
.logo-bars span:nth-child(1) { height: 10px; }
.logo-bars span:nth-child(2) { height: 20px; animation-delay: -0.25s; }
.logo-bars span:nth-child(3) { height: 14px; animation-delay: -0.5s; }

.logo-word { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }

/* ============================================================
   HERO — the radio
   ============================================================ */

.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: var(--ground);
  display: flex;
  flex-direction: column;
}

.hero-bg { position: absolute; inset: 0; pointer-events: none; }

.hero-bg > .layer {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  filter: hue-rotate(var(--key-hue));
}

.glow {
  width: min(1100px, 180vmax); aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgb(125 184 255 / var(--glow-a)) 0%,
    rgb(125 184 255 / 0.05) 38%,
    transparent 66%);
  animation: ysPulse var(--beat) ease-in-out infinite;
}

.ring {
  width: min(560px, 96vmin); aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgb(125 184 255 / 0.35);
  animation: ysRing var(--beat4) linear infinite;
}
.ring.ring-2 {
  border-color: rgb(125 184 255 / 0.2);
  animation-delay: calc(var(--beat2) * -1);
}

.vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 120%,
    rgb(5 8 7 / 0) 40%, rgb(5 8 7 / 0.7) 100%);
}

.hero-top {
  position: relative;
  display: flex; justify-content: space-between; align-items: center;
  padding: 28px var(--pad-x);
  gap: 16px;
}

.live-flag {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.14em;
  color: var(--text);
}
.live-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgb(125 184 255 / 0.9);
  animation: ysDot var(--beat2) ease-in-out infinite;
  flex: none;
}
/* Station off air / feed stale */
body[data-live="false"] .live-dot {
  background: var(--faint); box-shadow: none; animation: none;
}
body[data-live="false"] .live-flag { color: var(--dim); }

.hero-main {
  position: relative;
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: clamp(18px, 2.6vh, 26px);
  padding: 8px var(--pad-x) 0;
  text-align: center;
}

.art {
  width: clamp(180px, min(64vw, 34vh), 340px);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  box-shadow: 0 30px 70px rgb(0 0 0 / 0.6);
  background:
    repeating-linear-gradient(45deg, #12161c 0 10px, #0e1116 10px 20px);
  flex: none;
  overflow: hidden;
}
.art img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  /* covers swap on the segue, so cross-fade rather than snap */
  transition: opacity .35s ease;
}
.art img.swapping { opacity: 0; }

.np-title {
  font-size: clamp(24px, 5.2vw, 34px);
  font-weight: 700; line-height: 1.2;
  margin: 0;
  overflow-wrap: anywhere;
}
.np-artist {
  font-size: clamp(15px, 3.4vw, 18px);
  color: var(--dim); margin: 6px 0 0;
  overflow-wrap: anywhere;
}

.play {
  width: clamp(76px, 18vw, 92px); aspect-ratio: 1;
  border-radius: 50%; border: none;
  background: var(--accent);
  display: grid; place-items: center;
  cursor: pointer; flex: none;
  box-shadow: 0 0 0 10px rgb(125 184 255 / 0.12), 0 12px 40px rgb(125 184 255 / 0.35);
  transition: transform .15s ease, background .15s ease;
  padding: 0;
}
.play:hover { transform: scale(1.05); background: var(--accent-hi); }
.play:active { transform: scale(.98); }
.play svg { width: 38%; height: 38%; fill: var(--on-accent); }
.play .icon-pause { display: none; }
.play[data-state="playing"] .icon-play  { display: none; }
.play[data-state="playing"] .icon-pause { display: block; }
.play[data-state="loading"] { animation: ysDot 1s ease-in-out infinite; }

.next-up {
  font-family: var(--mono); font-size: 13px; color: var(--dim);
  margin: 0; max-width: 44ch;
}

.scroll-cue {
  position: relative;
  display: flex; justify-content: center;
  padding-bottom: 22px;
  font-family: var(--mono); font-size: 16px; color: var(--dim);
  animation: ysCue 2.2s ease-in-out infinite;
}

/* ============================================================
   SECTIONS
   ============================================================ */

section { padding: clamp(64px, 9vw, 100px) var(--pad-x); }
.section-panel { background: var(--panel); border-top: 1px solid var(--line-soft); }
.section-ground { background: var(--ground); border-top: 1px solid var(--line-soft); }

.claim {
  background: var(--panel);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  text-align: center;
}
.claim h2 {
  font-size: clamp(26px, 4.6vw, 44px);
  line-height: 1.15; max-width: 900px; margin: 0 auto;
}
.claim-figures {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px 24px;
  margin-top: clamp(36px, 5vw, 56px);
  font-family: var(--mono);
}
.claim-figures dt {
  font-size: clamp(22px, 3.4vw, 30px);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.claim-figures dd {
  font-size: 13px; color: var(--dim); margin: 6px 0 0;
}

h2.section-title {
  font-size: clamp(26px, 3.6vw, 36px);
  margin: 14px 0 0;
}

/* ---------- how it works: the signal path ---------- */

.steps {
  display: grid;
  grid-template-columns: 56px 1fr;
  column-gap: clamp(18px, 3vw, 36px);
  margin-top: clamp(40px, 6vw, 64px);
}
.step-rail { display: flex; flex-direction: column; align-items: center; }
.step-num {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--accent);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 13px; color: var(--accent);
  flex: none;
}
.step-line {
  width: 1px; flex: 1; min-height: 60px;
  background: linear-gradient(#26313f, var(--line-soft));
}
.step-body { padding-bottom: clamp(36px, 5vw, 56px); }
.step-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.step-head h3 { font-size: clamp(19px, 2.4vw, 22px); font-weight: 700; }
.step-tag {
  font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.18em; color: var(--faint);
}
.step-body p {
  max-width: 68ch; color: var(--text-2); line-height: 1.65;
  margin: 12px 0 0; text-wrap: pretty;
}

/* ---------- studio ---------- */

.studio-lede {
  max-width: 72ch; color: var(--text-2); line-height: 1.65;
  margin: 20px 0 clamp(32px, 5vw, 48px); text-wrap: pretty;
}
.studio-lede strong { color: var(--text); font-weight: 700; }

figure { margin: 0; }
.shot {
  border: 1px solid var(--line);
  background: repeating-linear-gradient(45deg, #12161c 0 10px, #0e1116 10px 20px);
  display: block; width: 100%; height: auto;
}
.shot-hero { aspect-ratio: 16 / 9; object-fit: cover; object-position: top left; }
figcaption { font-size: 14px; color: var(--dim); margin-top: 10px; }


/* ---------- contact ---------- */

.contact {
  background: var(--panel);
  border-top: 1px solid var(--line-soft);
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 80px);
}
.contact p { color: var(--text-2); line-height: 1.65; max-width: 46ch; text-wrap: pretty; }

form { display: flex; flex-direction: column; gap: 18px; }

.who { display: flex; gap: 10px; flex-wrap: wrap; }
.who input { position: absolute; opacity: 0; pointer-events: none; }
.who label {
  font-family: var(--mono); font-size: 12px; color: var(--dim);
  border: 1px solid var(--line); padding: 7px 14px; cursor: pointer;
  transition: color .12s, border-color .12s;
}
.who label:hover { color: var(--text-2); border-color: #2b3644; }
.who input:checked + label { color: var(--accent); border-color: var(--accent); }
.who input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

input[type="text"], input[type="email"], textarea {
  background: var(--ground);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 14px 16px;
  font-size: 15px;
  font-family: var(--sans);
  outline: none;
  border-radius: 0;
  width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
textarea { resize: vertical; min-height: 130px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(125 184 255 / 0.15);
}
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: #ff8f8f; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

button[type="submit"] {
  background: var(--accent); color: var(--on-accent);
  border: none; font-family: var(--sans); font-weight: 700; font-size: 15px;
  padding: 16px; cursor: pointer; transition: background .12s;
}
button[type="submit"]:hover:not(:disabled) { background: var(--accent-hi); }
button[type="submit"]:disabled { opacity: .55; cursor: default; }

.form-note { font-family: var(--mono); font-size: 13px; margin: 0; min-height: 1.4em; }
.form-note[data-kind="ok"]  { color: var(--accent); }
.form-note[data-kind="err"] { color: #ff8f8f; }

/* ---------- footer ---------- */

footer {
  padding: 26px var(--pad-x);
  background: var(--footer);
  border-top: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12px; color: var(--faint);
}
footer .logo-word { font-size: 15px; }
footer .logo-bars { height: 13px; }
footer .logo-bars span { width: 3px; }
footer .logo-bars span:nth-child(1) { height: 6px; }
footer .logo-bars span:nth-child(2) { height: 13px; }
footer .logo-bars span:nth-child(3) { height: 9px; }
.footer-links { display: flex; gap: 28px; flex-wrap: wrap; }
.footer-links a { color: var(--dim); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .contact { grid-template-columns: 1fr; }
  .claim-figures { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .steps { grid-template-columns: 44px 1fr; }
  .step-num { width: 36px; height: 36px; font-size: 12px; }
  .hero-top { padding: 20px var(--pad-x); }
  .logo-word { font-size: 19px; }
  .live-flag { font-size: 12px; }
  footer { justify-content: center; text-align: center; }
  .footer-links { gap: 20px; }
}

/* Short landscape phones: let the hero scroll rather than crush the player. */
@media (max-height: 620px) and (orientation: landscape) {
  .hero { min-height: auto; padding-bottom: 32px; }
  .hero-main { padding-top: 24px; }
  .scroll-cue { display: none; }
}

/* ============================================================
   REDUCED MOTION — the background holds a single static frame
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .glow { opacity: .75; }
  .ring { opacity: .28; transform: scale(1); }
  .ring.ring-2 { transform: scale(1.28); opacity: .16; }
  .scroll-cue { opacity: .6; }
}

/* ============================================================
   REQUEST A SONG (2026-08-18)
   ============================================================ */
.request-btn {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: transparent;
  border: 1px solid rgb(125 184 255 / 0.35);
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.request-btn:hover { color: var(--accent-hi); border-color: var(--accent); }

/* [hidden] must WIN over display:flex or the modal renders open on page load
   and close() can never hide it (live hit 2026-08-18) */
.req-overlay[hidden] { display: none !important; }

.req-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgb(4 6 8 / 0.82);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.req-modal {
  position: relative;
  width: min(460px, 100%);
  max-height: 86vh; overflow-y: auto;
  background: var(--panel);
  border: 1px solid rgb(125 184 255 / 0.18);
  border-radius: 12px;
  padding: 26px 26px 22px;
}
.req-modal h3 { margin: 4px 0 16px; font-size: 22px; }
.req-close {
  position: absolute; top: 12px; right: 12px;
  background: none; border: 0; color: var(--ink-dim, #8b96a5);
  font-size: 15px; cursor: pointer; padding: 6px;
}
.req-close:hover { color: var(--accent); }
.req-modal input[type="search"],
.req-modal input[type="text"],
.req-modal textarea {
  width: 100%; box-sizing: border-box;
  background: #10151c; color: inherit;
  border: 1px solid rgb(125 184 255 / 0.2);
  border-radius: 8px; padding: 10px 12px;
  font: inherit; margin: 4px 0 12px;
}
.req-modal label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; }
.req-hint { color: #8b96a5; font-size: 11px; float: right; }
.req-results { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; }
.req-results li + li { border-top: 1px solid rgb(125 184 255 / 0.08); }
.req-results button {
  width: 100%; text-align: start; background: none; border: 0;
  color: inherit; font: inherit; padding: 10px 6px; cursor: pointer;
  border-radius: 6px;
}
.req-results button:hover { background: rgb(125 184 255 / 0.08); color: var(--accent-hi); }
.req-empty { color: #8b96a5; padding: 10px 6px; font-size: 14px; }
.req-picked { font-weight: 600; margin: 4px 0 2px; }
.req-change {
  background: none; border: 0; color: var(--accent); cursor: pointer;
  font-family: var(--mono); font-size: 12px; padding: 0 0 14px;
}
.req-submit {
  width: 100%; margin-top: 4px;
  background: var(--accent); color: #050d18;
  border: 0; border-radius: 8px; padding: 12px;
  font: 600 15px var(--sans); cursor: pointer;
}
.req-submit:hover { background: var(--accent-hi); }
.req-submit:disabled { opacity: 0.6; cursor: default; }
.req-msg { min-height: 20px; margin: 12px 0 0; font-size: 14px; }
.req-msg.ok { color: #3fcf9a; }
.req-msg.err { color: #e8544a; }

/* ── LISTEN ANYWHERE ─────────────────────────────────────────────────────────
   The directory listings, generated from the submission tracker by
   marketing/directories/scripts/render_listen_on.py. A card only exists when
   that listing is genuinely reachable, so the grid grows on its own as
   submissions are approved - it must survive having 1 card or 15. */
.listen-lead {
  max-width: 60ch;
  color: var(--text-2);
  margin-top: 14px;
}
.listen-grid {
  margin-top: 34px;
  display: grid;
  gap: 12px;
  /* auto-fit, not auto-fill: with two listings the cards share the row rather
     than leaving ghost columns hanging off the right. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}
.listen-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.listen-card:hover,
.listen-card:focus-visible {
  border-color: var(--accent);
  background: #0e131a;
  transform: translateY(-2px);
}
.listen-name {
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.listen-where {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-2);
}
/* The direct stream is ours, not a third party's - mark it as the home option. */
.listen-direct { border-style: dashed; }
.listen-direct .listen-name { color: var(--accent); }

.listen-note {
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-2);
}

@media (prefers-reduced-motion: reduce) {
  .listen-card { transition: none; }
  .listen-card:hover, .listen-card:focus-visible { transform: none; }
}
