/* ============ base ============ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { height: 100%; background: #120913; color: #f6ead6; }
body {
  min-height: 100dvh;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: transparent; border: 0; cursor: pointer; }

/* ============ stage ============ */
.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  /* dusk gradient fallback — shows through if a hero image is missing
     or still loading, so the page never has a "broken" moment. */
  background:
    radial-gradient(ellipse at 72% 78%, rgba(246, 182, 88, 0.18), transparent 60%),
    linear-gradient(180deg, #1a1130 0%, #5a2c3a 42%, #c66a3a 78%, #f4b45a 100%);
}
.stage.no-hero .scene { display: none; }
.stage.no-hero .vignette { opacity: 0.85; }
.scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  user-select: none;
  pointer-events: none;
  overflow: hidden;
}
.scene img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  animation: hero-fade 1.2s ease-out both;
}
@keyframes hero-fade {
  from { opacity: 0; transform: scale(1.03); }
  to   { opacity: 1; transform: scale(1); }
}

/* vignette overlays — darken top/bottom so chrome + radio card stay legible
   on bright images (Days 1, 3, 5). Middle stays untouched so the art breathes. */
.vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to bottom,
      rgba(12, 6, 12, 0.55) 0%,
      rgba(12, 6, 12, 0.15) 12%,
      rgba(12, 6, 12, 0)    28%,
      rgba(12, 6, 12, 0)    62%,
      rgba(12, 6, 12, 0.35) 84%,
      rgba(12, 6, 12, 0.75) 100%);
}
/* soft glow scrim behind the headline so it holds on any image */
.vignette::after {
  content: '';
  position: absolute;
  left: 50%; top: 46%;
  width: min(1100px, 90vw);
  height: min(560px, 60vh);
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center,
    rgba(12, 6, 12, 0.32) 0%,
    rgba(12, 6, 12, 0.14) 40%,
    rgba(12, 6, 12, 0) 72%);
  filter: blur(4px);
}

/* ============ top bar ============ */
.topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  color: #f6ead6;
  text-shadow: 0 1px 6px rgba(0,0,0,0.45);
}

.clock {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
.clock-colon { opacity: 0.7; }
#clock-ampm { margin-left: 6px; opacity: 0.75; font-size: 11px; text-transform: lowercase; }

.chip {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 999px;
  background: rgba(28, 18, 22, 0.42);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(246, 234, 214, 0.14);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  color: #f6ead6;
  white-space: nowrap;
}
.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.icon-btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: #f6ead6;
  background: rgba(28, 18, 22, 0.35);
  border: 1px solid rgba(246, 234, 214, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.icon-btn:hover { transform: translateY(-1px); background: rgba(246, 234, 214, 0.12); border-color: rgba(246, 234, 214, 0.28); }
.icon-btn:active { transform: translateY(0); }

/* ============ headline ============ */
.headline {
  position: absolute;
  z-index: 5;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  text-align: center;
  font-family: 'Yatra One', 'Tiro Devanagari Marathi', serif;
  font-weight: 400;
  color: #ffe6a8;
  line-height: 0.86;
  letter-spacing: -0.01em;
  text-shadow:
    0 2px 0 rgba(58, 26, 16, 0.4),
    0 8px 30px rgba(0, 0, 0, 0.45),
    0 0 60px rgba(255, 190, 100, 0.25);
  pointer-events: none;
  user-select: none;
  animation: headline-in 1.2s cubic-bezier(.2,.7,.2,1) both;
}
.headline-line {
  display: block;
  font-size: clamp(4.5rem, 15vw, 12rem);
}
.headline-line + .headline-line { margin-top: -0.06em; }
@keyframes headline-in {
  from { opacity: 0; transform: translate(-50%, -46%); filter: blur(6px); }
  to   { opacity: 1; transform: translate(-50%, -50%); filter: blur(0); }
}

/* ============ radio card ============ */
.radio {
  position: absolute;
  z-index: 15;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  width: min(460px, calc(100vw - 32px));
  padding: 12px 14px 14px;
  border-radius: 22px;
  background: rgba(24, 14, 20, 0.55);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(246, 234, 214, 0.14);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(246, 234, 214, 0.08);
  color: #f6ead6;
  animation: radio-in 1s 0.4s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes radio-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.radio-label {
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-align: center;
  padding: 4px 12px;
  margin: -2px auto 10px;
  width: fit-content;
  color: #f4d9a1;
  background: rgba(246, 234, 214, 0.08);
  border: 1px solid rgba(246, 234, 214, 0.14);
  border-radius: 999px;
}
.radio-body {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
}
.radio-art {
  width: 48px; height: 48px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
}
.radio-art svg { display: block; width: 100%; height: 100%; }
.radio-meta { min-width: 0; }
.radio-track {
  font-weight: 600;
  font-size: 14px;
  color: #ffe6a8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.radio-artist {
  font-size: 11.5px;
  color: rgba(246, 234, 214, 0.65);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}
.radio-controls { display: inline-flex; align-items: center; gap: 4px; }
.rc-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: #f6ead6;
  transition: background 0.18s ease, transform 0.12s ease;
}
.rc-btn:hover { background: rgba(246, 234, 214, 0.12); }
.rc-btn:active { transform: scale(0.94); }
.rc-play {
  width: 40px; height: 40px;
  background: rgba(246, 234, 214, 0.14);
  border: 1px solid rgba(246, 234, 214, 0.18);
}
.rc-play:hover { background: rgba(246, 234, 214, 0.22); }

.radio-seek { margin-top: 12px; }
.seek-bar {
  height: 3px;
  border-radius: 999px;
  background: rgba(246, 234, 214, 0.14);
  overflow: hidden;
}
.seek-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f4b45a, #ffd97a);
  border-radius: inherit;
  transition: width 0.3s linear;
}
.seek-times {
  display: flex; justify-content: space-between;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: rgba(246, 234, 214, 0.55);
  margin-top: 5px;
}

/* hidden yt frame that actually plays audio */
.yt-hidden {
  position: fixed;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
  left: -9999px; top: -9999px;
}
.yt-hidden iframe { width: 320px; height: 180px; border: 0; }

/* ============ about popover ============ */
.about[hidden] { display: none; }
.about {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
}
.about-scrim {
  position: absolute; inset: 0;
  background: rgba(12, 6, 12, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fade-in 0.25s ease;
}
.about-card {
  position: relative;
  z-index: 1;
  width: min(440px, calc(100vw - 32px));
  padding: 26px 26px 22px;
  border-radius: 22px;
  background: rgba(28, 18, 22, 0.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(246, 234, 214, 0.16);
  box-shadow: 0 30px 80px rgba(0,0,0,0.55);
  color: #f6ead6;
  animation: rise 0.35s cubic-bezier(.2,.7,.2,1);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.about-close {
  position: absolute; top: 10px; right: 12px;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 22px; line-height: 1;
  color: rgba(246, 234, 214, 0.75);
}
.about-close:hover { background: rgba(246, 234, 214, 0.1); color: #f6ead6; }
.about-eyebrow {
  font-size: 10.5px; letter-spacing: 0.22em;
  color: rgba(246, 234, 214, 0.55);
  margin-bottom: 6px;
}
.about-title {
  font-family: 'Yatra One', serif;
  font-weight: 400;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin: 0 0 14px;
  color: #ffe6a8;
  line-height: 1;
}
.about-body {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(246, 234, 214, 0.82);
  margin: 0 0 10px;
}
.about-small { font-size: 12px; color: rgba(246, 234, 214, 0.55); }
.about-small a { color: #f4b45a; border-bottom: 1px dotted rgba(244, 180, 90, 0.5); }
.about-small a:hover { color: #ffd97a; }

/* ============ responsive ============ */
@media (max-width: 640px) {
  .topbar {
    grid-template-columns: auto auto;
    grid-template-rows: auto auto;
    row-gap: 10px;
  }
  .clock { grid-row: 1; grid-column: 1; }
  .topbar-actions { grid-row: 1; grid-column: 2; justify-self: end; }
  .chip {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-self: center;
    font-size: 11.5px;
    padding: 6px 12px;
  }
  .headline { top: 40%; }
  .headline-line { font-size: clamp(4rem, 22vw, 8rem); }
  .radio { bottom: 20px; padding: 10px 12px 12px; }
  .radio-label { font-size: 9.5px; letter-spacing: 0.2em; }
  .radio-track { font-size: 13.5px; }
  .radio-artist { font-size: 11px; }
}

@media (max-height: 560px) {
  .headline { top: 42%; }
  .headline-line { font-size: clamp(3rem, 12vh, 6rem); }
  .radio { bottom: 12px; }
}

/* prefer-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .headline, .radio, .about-card { animation: none !important; }
  .seek-fill { transition: none; }
}
