/* =============================================================================
   ROADWAYS RADIO — MASTER STYLESHEET (v2, restrained)
   =============================================================================
   India's zero-cost, ad-free highway radio.

   DESIGN NOTES
   --------------------------------------------------------------------------
   v1 leaned on too many decorative Font Awesome icons (clouds, trees,
   milestones, badges) and it read cluttered. v2 strips that back:
   typography carries the page, color and glow carry the mood, and the
   ONLY icons left are functional — playback controls and the single bus
   that drives the highway strip as the page's one signature motion.

   Palette   asphalt #140f0a · asphalt-2 #1d1610 · sunset #e9612d
             marigold #f6b93b · cream #f6ecd9 · dhaba-red #b23a2e
   Type      Display : 'Baloo 2' — bold hand-painted Devanagari weight
             Body/UI : 'Poppins'
   Layout    Mobile-first. #app is a fixed 100dvh CSS Grid shell
             (header / scene / footer). Nothing scrolls — every section
             is sized with clamp() and height-based media queries take
             over on short screens.
   ============================================================================= */


/* =============================================================================
   1. RESET & BASE
   ============================================================================= */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}

img { display: block; max-width: 100%; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

h1, p { font: inherit; }

::selection {
  background: var(--marigold);
  color: var(--asphalt);
}


/* =============================================================================
   2. DESIGN TOKENS
   ============================================================================= */

:root {
  /* ---- color ---- */
  --asphalt:      #140f0a;
  --asphalt-2:    #1d1610;
  --sunset:       #e9612d;
  --marigold:     #f6b93b;
  --cream:        #f6ecd9;
  --dhaba-red:    #b23a2e;
  --dhaba-red-2:  #8f2c22;
  --live-green:   #3ddc84;
  --error-red:    #ff5c5c;

  --color-bg-line:    #f6ecd94a;
  --color-bg-line-2:  #f6ecd91f;
  --color-surface:    rgba(20, 15, 10, .4);
  --color-card-start: rgba(178, 58, 46, .92);
  --color-card-end:   rgba(20, 15, 10, .93);
  --color-focus-ring: #ffe1a3;

  /* a warm, quiet radial glow stands in for the old sky/cloud illustration */
  --grad-bg:   radial-gradient(ellipse 120% 60% at 50% 0%,
                 #3a2416 0%, #241810 42%, var(--asphalt) 78%);
  --grad-glow: radial-gradient(circle at 50% 0%,
                 rgba(246, 185, 59, .35) 0%, rgba(233, 97, 45, .18) 32%, transparent 70%);
  --grad-card: linear-gradient(120deg, var(--color-card-start), var(--color-card-end));
  --grad-road: linear-gradient(var(--asphalt-2), var(--asphalt));

  /* ---- typography ---- */
  --font-display: 'Baloo 2', cursive;
  --font-body:    'Poppins', system-ui, sans-serif;

  --fs-signboard: clamp(2.4rem, 13vw, 6rem);
  --fs-tagline:   clamp(.72rem, 2.6vw, .95rem);
  --fs-clock:     clamp(.78rem, 2.6vw, 1rem);
  --fs-pill:      clamp(.7rem, 2.4vw, .88rem);
  --fs-badge:     clamp(.62rem, 2.2vw, .78rem);
  --fs-title:     clamp(.85rem, 3vw, 1.02rem);
  --fs-subtitle:  clamp(.68rem, 2.4vw, .82rem);
  --fs-time:      clamp(.62rem, 2vw, .72rem);
  --fs-bus:       clamp(1.6rem, 5.6vw, 2.4rem);

  /* ---- spacing ---- */
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;

  /* ---- radii ---- */
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --radius-full: 999px;

  /* ---- shadows ---- */
  --shadow-card: 0 16px 44px rgba(0, 0, 0, .45);
  --shadow-text: 0 8px 20px rgba(0, 0, 0, .5);
  --shadow-btn:  0 6px 16px rgba(0, 0, 0, .35);

  /* ---- motion ---- */
  --ease-standard: cubic-bezier(.4, 0, .2, 1);
  --ease-spring:   cubic-bezier(.34, 1.56, .64, 1);
  --dur-fast: 120ms;
  --dur-med:  240ms;

  /* ---- safe-area ---- */
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
}


/* =============================================================================
   3. VIEWPORT SHELL — zero-scroll grid
   ============================================================================= */

body {
  background: var(--grad-bg);
  color: var(--cream);
}

#app {
  height: 100dvh;
  width: 100vw;
  max-width: 100vw;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  padding-top: var(--sat);
  padding-left: var(--sal);
  padding-right: var(--sar);
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-3);
  z-index: 999;
  background: var(--marigold);
  color: var(--asphalt);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
  transition: top var(--dur-med) var(--ease-standard);
}
.skip-link:focus { top: var(--space-3); }


/* =============================================================================
   4. HEADER — clock · live count · badge, one quiet row
   ============================================================================= */

.topbar {
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.clock {
  font-size: var(--fs-clock);
  font-weight: 600;
  letter-spacing: .02em;
  opacity: .9;
  white-space: nowrap;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-surface);
  border: 1px solid var(--color-bg-line);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--fs-pill);
  font-weight: 600;
  white-space: nowrap;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live-green);
  box-shadow: 0 0 6px var(--live-green);
  animation: pulseDot 2.2s ease-in-out infinite;
}

.free-badge {
  font-size: var(--fs-badge);
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--marigold);
  white-space: nowrap;
  order: 3;
  width: 100%;
  text-align: center;
  opacity: .9;
}


/* =============================================================================
   5. SCENE — quiet warm glow + the signboard, no illustration clutter
   ============================================================================= */

.scene {
  position: relative;
  z-index: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
  overflow: hidden;
}

.scene::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 18%;
  background: var(--grad-road);
  z-index: -1;
  pointer-events: none;
}

.glow {
  position: absolute;
  inset: 0 0 auto 0;
  height: 60%;
  background: var(--grad-glow);
  z-index: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
}

.signboard {
  font-family: var(--font-display);
  line-height: .94;
  color: var(--cream);
  text-shadow: var(--shadow-text);
}
.signboard__line {
  display: block;
  font-size: 100px;
  font-weight: 700;
}
.signboard__line + .signboard__line {
  color: var(--marigold);
}

.tagline {
  font-size: var(--fs-tagline);
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: .55;
}

/* ---- animated highway strip (the one signature element) ---- */
.highway {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 900px;
  height: clamp(30px, 7vh, 52px);
  margin-top: var(--space-2);
  overflow: hidden;
  flex-shrink: 0;
}

.highway .bus {
  position: absolute;
  bottom: 20%;
  left: -15%;
  font-size: var(--fs-bus);
  color: var(--cream);
  text-shadow: 0 6px 14px rgba(0, 0, 0, .5);
  animation: driveBy 10s linear infinite;
}

.road-lines {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: repeating-linear-gradient(
    90deg, var(--marigold) 0 30px, transparent 30px 64px
  );
  animation: dashMove 1s linear infinite;
}


/* =============================================================================
   6. PLAYER BAR
   ============================================================================= */

.player-bar {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 720px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--grad-card);
  border: 1px solid var(--color-bg-line);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  margin: var(--space-2) 0 calc(var(--space-3) + var(--sab));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
}

.art-wrap {
  position: relative;
  width: clamp(46px, 12vw, 64px);
  height: clamp(46px, 12vw, 64px);
  flex: none;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--asphalt-2);
}
.art-wrap img { width: 100%; height: 100%; object-fit: cover; }

.spinner {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  border: 3px solid transparent;
  border-top-color: var(--marigold);
  animation: spin 1.4s linear infinite;
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease-standard);
}
.spinner.active { opacity: 1; }

.meta { flex: 1; min-width: 0; }

.title {
  font-weight: 700;
  font-size: var(--fs-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subtitle {
  font-size: var(--fs-subtitle);
  opacity: .75;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seekwrap { margin-top: var(--space-2); }

.seek {
  height: 5px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-line);
  cursor: pointer;
  position: relative;
}
.seek:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 3px;
}

.seekFill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-sm);
  background: var(--marigold);
  transition: width var(--dur-fast) linear;
}

.time {
  font-size: var(--fs-time);
  opacity: .7;
  margin-top: var(--space-2);
  display: flex;
  gap: 6px;
}
.time__sep { opacity: .5; }

.controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: none;
}

.ctrl-btn {
  border-radius: var(--radius-full);
  color: var(--asphalt);
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-btn);
  transition: transform var(--dur-fast) var(--ease-spring),
              box-shadow var(--dur-fast) var(--ease-standard);
}
.ctrl-btn--sm {
  width: clamp(32px, 9vw, 40px);
  height: clamp(32px, 9vw, 40px);
  font-size: .85rem;
}
.ctrl-btn--lg {
  width: clamp(42px, 12vw, 52px);
  height: clamp(42px, 12vw, 52px);
  font-size: 1.05rem;
  background: var(--marigold);
}
.ctrl-btn:hover { transform: scale(1.08); }
.ctrl-btn:active { transform: scale(.92); }
.ctrl-btn:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 3px;
}

.yt-mount {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}


/* =============================================================================
   7. FOOTER
   ============================================================================= */

.foot {
  z-index: 5;
  text-align: center;
  font-size: clamp(.6rem, 2.2vw, .76rem);
  opacity: .55;
  padding: var(--space-1) var(--space-4) calc(var(--space-2) + var(--sab));
  line-height: 1.3;
}


/* =============================================================================
   8. STATE / UTILITY
   ============================================================================= */

.is-loading .title {
  color: transparent;
  border-radius: 4px;
  background: linear-gradient(90deg,
    var(--color-bg-line-2) 25%, var(--color-bg-line) 37%, var(--color-bg-line-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.6s ease infinite;
}
.is-error .title { color: var(--error-red); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* =============================================================================
   9. KEYFRAMES
   ============================================================================= */

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes pulseDot {
  0%, 100% { opacity: 1;  transform: scale(1); }
  50%      { opacity: .5; transform: scale(.85); }
}

@keyframes driveBy {
  0%   { left: -15%;  transform: scaleX(1);  }
  48%  { left: 100%;  transform: scaleX(1);  }
  50%  { left: 100%;  transform: scaleX(-1); }
  98%  { left: -15%;  transform: scaleX(-1); }
  100% { left: -15%;  transform: scaleX(1);  }
}

@keyframes dashMove {
  from { background-position: 0 0; }
  to   { background-position: -64px 0; }
}

@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}


/* =============================================================================
   10. RESPONSIVE — mobile-first
   ============================================================================= */

@media (min-width: 380px) {
  .topbar { padding: var(--space-3) var(--space-5); }
  .scene  { padding: 0 var(--space-5); }
}

@media (min-width: 600px) {
  .free-badge { order: 0; width: auto; }
  .topbar { flex-wrap: nowrap; }
}

@media (min-width: 768px) {
  .player-bar { padding: var(--space-4) var(--space-5); gap: var(--space-4); }
  .hero-content { gap: var(--space-3); }
}

@media (min-width: 1024px) {
  .scene { padding: 0 var(--space-6); }
  .signboard__line { font-size: clamp(3.6rem, 8vw, 6.6rem); }
}

@media (min-width: 1280px) {
  .scene, .topbar {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
  }
}

@media (min-width: 1536px) {
  :root { --fs-signboard: 7rem; }
}


/* =============================================================================
   11. HEIGHT-AWARE ADJUSTMENTS — zero scroll on short / landscape viewports
   ============================================================================= */

@media (max-height: 700px) {
  .hero-content { gap: 4px; }
  .tagline { display: none; }
  .signboard__line { font-size: 
  100px;}
  .highway { height: 28px; margin-top: var(--space-1); }
  .player-bar { padding: var(--space-2) var(--space-3); }
}

@media (max-height: 480px) and (orientation: landscape) {
  .topbar { padding: var(--space-1) var(--space-4); }
  .free-badge { display: none; }
  .tagline { display: none; }
  .signboard { line-height: .85; }
  .signboard__line { font-size: clamp(1.4rem, 6vh, 2.2rem); }
  .highway { height: 20px; margin-top: 2px; }
  .highway .bus { font-size: 1.2rem; }
  .player-bar { padding: var(--space-1) var(--space-3); margin: var(--space-1) 0; }
  .art-wrap { width: 38px; height: 38px; }
}

@media (min-height: 850px) and (max-width: 480px) {
  .hero-content { gap: var(--space-4); }
  .highway { height: 64px; }
}


/* =============================================================================
   12. ACCESSIBILITY & USER PREFERENCES
   ============================================================================= */

@media (prefers-reduced-motion: reduce) {
  .spinner, .dot, .highway .bus, .road-lines, .is-loading .title {
    animation: none !important;
  }
  .ctrl-btn, .seekFill { transition: none !important; }
}

@media (prefers-contrast: more) {
  :root { --color-bg-line: #f6ecd9; }
}

:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

@media (forced-colors: active) {
  .glow, .road-lines { forced-color-adjust: none; }
}


/* =============================================================================
   13. PRINT
   ============================================================================= */

@media print {
  .glow, .highway, .spinner { display: none; }
  body { background: #fff; color: #000; }
}