:root {
  --bg: #0b0a10;
  --surface: rgba(244, 241, 234, 0.06);
  --surface-strong: rgba(244, 241, 234, 0.1);
  --border: rgba(244, 241, 234, 0.14);
  --ink: #f4f1ea;
  --ink-soft: #a79e95;
  --accent: #e8935c;
  --accent-ink: #1a1208;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

/* ---------- shared chrome ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem clamp(1.25rem, 4vw, 3rem);
}

.wordmark {
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.wordmark::before {
  content: "◐ ";
  color: var(--accent);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.back-link:hover { color: var(--ink); }

/* ---------- hub ---------- */

.hub-hero {
  padding: 2rem clamp(1.25rem, 4vw, 3rem) 1rem;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.hub-hero h1 {
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  line-height: 1.05;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

.hub-hero p {
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

.station-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  padding: 2.5rem clamp(1.25rem, 4vw, 3rem) 4rem;
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
}

.station-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--border);
  isolation: isolate;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.3, 1), border-color 0.35s ease;
}

.station-card:hover,
.station-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(244, 241, 234, 0.3);
  outline: none;
}

.station-card canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.station-card .scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.55) 100%);
  z-index: -1;
}

.station-card .card-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.25rem;
}

.station-card .card-name {
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 0.2rem;
}

.station-card .card-tagline {
  font-size: 0.85rem;
  color: rgba(244, 241, 234, 0.85);
  margin: 0;
}

/* ---------- station deck ---------- */

.deck-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem clamp(1.25rem, 4vw, 3rem) 3rem;
}

.deck {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
}

.deck .eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.deck h1 {
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: clamp(1.75rem, 5vw, 2.4rem);
  margin: -1rem 0 0;
  text-wrap: balance;
}

.deck .tagline {
  color: var(--ink-soft);
  margin: -1rem 0 0;
  font-size: 0.95rem;
}

.play-btn {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
}

.play-btn:hover { transform: scale(1.05); }
.play-btn:active { transform: scale(0.97); }

.play-btn svg { width: 28px; height: 28px; }
.play-btn.playing svg.icon-play { display: none; }
.play-btn:not(.playing) svg.icon-pause { display: none; }

.status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e8615c;
  box-shadow: 0 0 0 0 rgba(232, 97, 92, 0.6);
  animation: pulse 2s infinite;
}

.deck.paused .live-dot { animation: none; opacity: 0.35; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(232, 97, 92, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(232, 97, 92, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 97, 92, 0); }
}

.volume-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.volume-row svg {
  width: 16px;
  height: 16px;
  color: var(--ink-soft);
  flex-shrink: 0;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: var(--border);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
  margin-top: -5px;
}

input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: none;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
}

input[type="range"]::-moz-range-track {
  height: 3px;
  border-radius: 999px;
  background: var(--border);
}

.source-link {
  font-size: 0.78rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.source-link:hover {
  color: var(--ink);
  border-color: var(--border);
}

.yt-mount {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 300px;
  height: 170px;
}

.empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  padding: 3rem 1.5rem;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .station-card, .play-btn { transition: none; }
  .live-dot { animation: none; }
}
