/* ==========================================================================
   Radio Las Vegas — public page
   Authored mobile-first: base rules are the 375px design, and the only media
   queries are min-width. Nothing is clawed back from a desktop layout.
   ========================================================================== */

:root {
  --ink: #0a1a3c;
  --ink-deep: #050d22;
  --vegas-red: #e4322b;
  --gold: #f2b33d;
  --mist: #c9d4e8;
  --white: #fff;

  --glass: rgba(12, 28, 62, 0.52);
  --glass-line: rgba(201, 212, 232, 0.16);
  --glass-line-strong: rgba(201, 212, 232, 0.28);

  --font-display: 'Bricolage Grotesque', 'Inter Tight', system-ui, sans-serif;
  --font-body: 'Inter Tight', system-ui, -apple-system, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* One fluid ramp; no per-breakpoint font-size overrides anywhere below. */
  --step-0: clamp(0.9rem, 0.86rem + 0.2vw, 1rem);
  --step-1: clamp(1.05rem, 0.98rem + 0.35vw, 1.25rem);
  --step-2: clamp(1.35rem, 1.15rem + 1vw, 2rem);

  --radius: 20px;
  --radius-sm: 12px;
  --gap: 1rem;

  /* Keeps the floating button clear of the iOS home indicator. */
  --fab-size: 56px;
  --fab-inset: calc(1rem + env(safe-area-inset-bottom, 0px));
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  color: var(--white);
  /* Always painted, so a missing bg.jpg degrades to this rather than to white. */
  background:
    radial-gradient(120% 80% at 50% 0%, #12306b 0%, transparent 60%),
    linear-gradient(180deg, var(--ink) 0%, var(--ink-deep) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

/* A class with `display` outranks the UA's [hidden] rule, which would leave
   JS-toggled elements (listener pill, volume slider) stuck visible. */
[hidden] { display: none !important; }

button { font: inherit; color: inherit; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: absolute; left: 50%; top: 0;
  transform: translate(-50%, -120%);
  z-index: 20; padding: 0.6rem 1rem;
  background: var(--white); color: var(--ink);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  text-decoration: none; font-weight: 600;
}
.skip:focus-visible { transform: translate(-50%, 0); }

:where(a, button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* --- background layers ---------------------------------------------------- */

.backdrop,
.scrim { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

.backdrop {
  z-index: -2;
  /* A CSS background fails silently, so an absent bg.jpg shows no broken icon. */
  background-image: url('/img/bg.jpg');
  background-size: cover;
  background-position: center;
}

/* Guarantees contrast over a photo we have never seen. */
.scrim {
  background:
    linear-gradient(180deg, rgba(5, 13, 34, 0.72) 0%, rgba(5, 13, 34, 0.55) 45%, rgba(5, 13, 34, 0.92) 100%);
}

/* --- layout --------------------------------------------------------------- */

.shell {
  flex: 1;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* --- player card ---------------------------------------------------------- */

.player {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(3, 8, 22, 0.45);
  padding: 1.25rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

@supports (backdrop-filter: blur(1px)) {
  .player { backdrop-filter: blur(18px) saturate(1.2); }
}

.player__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
}

.player__live,
.player__timer {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mist);
}

.player__live { display: inline-flex; align-items: center; gap: 0.5rem; }

.player__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--vegas-red);
  box-shadow: 0 0 0 0 rgba(228, 50, 43, 0.7);
}
.player[data-playing='true'] .player__dot { animation: pulse 2s ease-out infinite; }

@keyframes pulse {
  to { box-shadow: 0 0 0 10px rgba(228, 50, 43, 0); }
}

.player__timer { font-variant-numeric: tabular-nums; }

/* Station name is redundant beside the logo on a phone; it returns at 900px. */
.player__name { display: none; margin: 0; }

.player__identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

/* The locality tag lives inside the wordmark artwork, so the whole lockup
   scales as one unit instead of needing to wrap. */
.player__logo { width: auto; max-height: 78px; }

.player__freq {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

/* --- the signature -------------------------------------------------------- */

.wave {
  width: 100%;
  height: 56px;
  display: block;
  opacity: 0.9;
}

/* --- transport ------------------------------------------------------------ */

.player__transport {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.play {
  position: relative;
  width: 72px; height: 72px;
  border: 0; border-radius: 50%;
  background: var(--vegas-red);
  color: var(--white);
  cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 10px 26px rgba(228, 50, 43, 0.4);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.play:hover { transform: scale(1.05); }
.play:active { transform: scale(0.97); }

.play__icon { grid-area: 1 / 1; display: grid; place-items: center; }
/* The play glyph is optically left-heavy; nudge it back to centre. */
.play__icon--play { transform: translateX(2px); }

.play[data-state='paused'] .play__icon--pause,
.play[data-state='playing'] .play__icon--play,
.play[data-state='loading'] .play__icon--play,
.play[data-state='loading'] .play__icon--pause { visibility: hidden; }

.play__spinner {
  grid-area: 1 / 1;
  width: 28px; height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--white);
  border-radius: 50%;
  visibility: hidden;
}
.play[data-state='loading'] .play__spinner {
  visibility: visible;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(1turn); } }

.player__aux {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.ghost {
  width: 44px; height: 44px;      /* touch target floor */
  display: grid; place-items: center;
  border: 1px solid var(--glass-line);
  border-radius: 50%;
  background: transparent;
  color: var(--mist);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.ghost:hover { color: var(--white); border-color: var(--glass-line-strong); }

.ghost__on, .ghost__off { display: grid; place-items: center; }
.ghost[aria-pressed='false'] .ghost__off,
.ghost[aria-pressed='true'] .ghost__on { display: none; }
.ghost[aria-pressed='true'] { color: var(--vegas-red); }

.volume { display: flex; align-items: center; }

.volume__input {
  width: 120px;
  accent-color: var(--gold);
  cursor: pointer;
}

.listeners {
  display: inline-flex; align-items: center; gap: 0.45rem;
  margin: 0;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(201, 212, 232, 0.1);
  font-size: 0.78rem;
  color: var(--mist);
}
.listeners__label { letter-spacing: 0.04em; }

.player__status {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.8rem;
  color: var(--gold);
  text-align: center;
}
.player__status:empty { min-height: 0; }

/* --- nav ------------------------------------------------------------------ */

.nav { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 44px;
  padding: 0 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  color: var(--white);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.pill:hover { border-color: var(--glass-line-strong); }
.pill--active { background: var(--white); color: var(--ink); border-color: transparent; }
.pill--fb { color: var(--mist); }
.pill--fb:hover { color: var(--white); }

/* --- footer --------------------------------------------------------------- */

.foot {
  background: var(--ink-deep);
  border-top: 1px solid var(--glass-line);
  padding: 2rem 1rem;
  /* Reserve room so the floating button never sits on the contact details. */
  padding-bottom: calc(2rem + var(--fab-size) + var(--fab-inset));
}

.foot__inner {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.foot__logo { max-height: 56px; width: auto; }

.foot__tagline {
  margin: 0.6rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.foot__col { min-width: 0; }

.foot__head {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mist);
}

.foot__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }

.foot__link,
.foot__item {
  display: flex; align-items: flex-start; gap: 0.6rem;
  color: var(--white);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.foot__link:hover { color: var(--gold); }
.foot__item { color: var(--mist); }
.foot__link .icon,
.foot__item .icon { flex: none; margin-top: 0.15rem; }

.foot__social {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--glass-line);
  color: var(--mist);
}
.foot__social:hover { color: var(--white); border-color: var(--glass-line-strong); }

.foot__legal {
  max-width: 880px;
  margin: 1.75rem auto 0;
  font-size: 0.75rem;
  color: rgba(201, 212, 232, 0.6);
}

/* --- floating WhatsApp button --------------------------------------------- */

.fab {
  position: fixed;
  right: 1rem;
  bottom: var(--fab-inset);
  z-index: 10;
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: var(--fab-size);
  padding: 0 1.1rem;
  border-radius: 999px;
  background: #25d366;
  color: #06301a;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}
.fab:hover { background: #1fbe5a; }

/* --- 404 ------------------------------------------------------------------ */

.card--plain {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  padding: 2rem 1.25rem;
  text-align: center;
}
.notfound__title { font-family: var(--font-display); font-size: var(--step-2); margin: 0 0 0.5rem; }
.notfound__body { margin: 0 0 1.5rem; color: var(--mist); }

/* ==========================================================================
   600px — room to breathe; footer pairs up
   ========================================================================== */

@media (min-width: 600px) {
  .shell { padding: 2rem 1.5rem 3rem; gap: 1.5rem; }
  .player { padding: 1.75rem 1.75rem 2rem; }
  .player__logo { max-height: 96px; }
  .wave { height: 72px; }

  .foot__inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
  }
}

/* ==========================================================================
   900px — the same parts redistribute. Nothing appears, nothing hides.
   ========================================================================== */

@media (min-width: 900px) {
  .player__name {
    display: block;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--white);
  }

  /* Transport collapses to a single row once there is width for it. */
  .player__transport {
    flex-direction: row;
    justify-content: center;
    gap: 1.75rem;
  }
  .player__status {
    position: absolute;
    left: 0; right: 0;
    text-align: center;
  }
  .player { position: relative; padding-bottom: 2.75rem; }
  .player__status { bottom: 1rem; }

  .foot__inner { grid-template-columns: 1.1fr 1.4fr 0.6fr; }
}

/* ==========================================================================
   Reduced motion — the waveform still draws a resting line, but nothing moves.
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .play:hover { transform: none; }
}
