

:root {
  --logo-top: 13vh;
  --logo-x: 0vw;
  --logo-size: clamp(2.5rem, 8.5vw, 7rem);

  --edge: clamp(1rem, 2.2vw, 1.75rem);
  --glass: rgba(255, 255, 255, 0.1);
  --glass-line: rgba(255, 255, 255, 0.2);
  --shadow-glass: 0 8px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  --text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);

  /* Baloo 2 Devanagari bhi support karta hai — "बुरी नज़र" wale text ke liye */
  --body: "Baloo 2", "Kohinoor Devanagari", "Nirmala UI", "Noto Sans Devanagari",
    ui-rounded, system-ui, sans-serif;
  --ui: ui-sans-serif, -apple-system, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;

  /* motion vocabulary */
  --swift: 140ms cubic-bezier(0.4, 0, 0.2, 1);
  --glide: 320ms cubic-bezier(0.4, 0, 0.2, 1);
  --settle: 620ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-settle: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

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

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  color: #fff;
  background: #0a1416;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ── Entrance animations ──────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }
@keyframes rise-left { from { opacity: 0; transform: translate3d(-16px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.topbar, .logo, .dock { animation: rise var(--settle) both; }
.topbar { animation-delay: 0.28s; }
.logo { animation-delay: 0.06s; }
.dock { animation-delay: 0.16s; }
.horns { animation: rise-left var(--settle) 0.34s both; }
.bg__layer.is-active { animation: fade 900ms ease both; }

/* ── Background (layered artwork, playlist pe crossfade) ──── */
.bg {
  position: fixed; inset: 0; z-index: -1;
  background-color: #0a1416;
}
.bg__layer {
  position: absolute; inset: 0;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center 30%;
  opacity: 0;
  transition: opacity 1.1s var(--ease-settle);
}
.bg__layer.is-active { opacity: 1; }
.bg__layer--1 { background-image: url("assets/images/bg-1.webp"); background-position: center 45%; }
/* .bg__layer--2 { background-image: url("assets/images/bg-2.svg"); background-position: center 30%; } */

/* YouTube iframe 1×1 box, hamesha hidden — sound source bas */
.yt-host {
  position: fixed; top: 0; left: 0;
  width: 1px; height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* white text ko bright artwork pe readable rakhta hai */
.bg__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.28) 0%,
    rgba(0, 0, 0, 0.06) 26%,
    rgba(0, 0, 0, 0.1) 58%,
    rgba(0, 0, 0, 0.48) 100%
  );
  pointer-events: none;
}

main {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: max(var(--edge), env(safe-area-inset-top)) var(--edge)
    max(var(--edge), env(safe-area-inset-bottom));
}

/* ── Top bar ──────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: max(1.15rem, env(safe-area-inset-top));
  left: var(--edge); right: var(--edge);
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  text-shadow: var(--text-shadow);
}

.clock {
  justify-self: start;
  font-family: var(--ui);
  font-size: 0.82rem; font-weight: 500;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.92);
}

.presence {
  justify-self: center;
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--ui);
  font-size: 0.82rem; font-weight: 500;
  letter-spacing: 0.01em; white-space: nowrap;
  color: rgba(255, 255, 255, 0.92);
}
.presence__dot {
  position: relative;
  width: 10px; height: 10px; flex: none; border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.9);
}
.presence__dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: #4ade80; opacity: 0.75;
  animation: ping 1.9s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.presence__count { font-variant-numeric: tabular-nums; }
.presence__label { font-weight: 400; color: rgba(255, 255, 255, 0.62); }

@keyframes ping { 75%, 100% { transform: scale(2.2); opacity: 0; } }

/* ── Horn rail (naav ki ghanti = लहर लहर) ──────────────── */
.horns {
  position: fixed;
  left: var(--edge);
  top: 50%;
  translate: 0 -50%;
  z-index: 20;
}
.horn {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.28rem 0.7rem 0.28rem 0.3rem;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  color: #fff;
  font-family: var(--body);
  cursor: pointer;
  transition: background var(--swift), transform var(--swift), border-color var(--swift);
}
.horn:hover { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.4); }
.horn:active { transform: scale(0.95); }
.horn.is-blaring { animation: honk 0.45s ease; }
.horn__icon {
  display: grid; place-items: center;
  width: 1.6rem; height: 1.6rem; flex: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.16); color: #fff;
}
.horn__icon svg { width: 15px; height: 15px; }
.horn.is-blaring .horn__icon { background: #fff; color: #111; }
.horn__text { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.horn__deva { font-size: 0.76rem; font-weight: 700; }
.horn__en { font-size: 0.58rem; font-weight: 600; letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.62); }

@keyframes honk {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px) rotate(-1.6deg); }
  50% { transform: translateX(5px) rotate(1.6deg); }
  75% { transform: translateX(-2px); }
}

.links { justify-self: end; display: flex; align-items: center; }
.link {
  display: grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 50%;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  transition: background var(--swift), transform var(--swift), color var(--swift);
}
.link:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.link:active { transform: scale(0.95); }

/* ── Wordmark ─────────────────────────────────────────────── */
.logo {
  margin: var(--logo-top) 0 0;
  translate: var(--logo-x) 0;
  display: flex; align-items: baseline; gap: 0.22em;
  font-family: var(--body);
  font-weight: 800;
  font-size: var(--logo-size);
  line-height: 1;
  letter-spacing: -0.01em;
  color: #fff;
  text-align: center;
  filter: drop-shadow(0 4px 24px rgba(0, 0, 0, 0.5));
  user-select: none;
}

/* logo ka shake — lahar bajne pe (jaisa naav mein hilta hai) */
@keyframes truck-shake {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  8% { transform: translate3d(-4px, 2px, 0) rotate(-1.1deg); }
  18% { transform: translate3d(4px, -2px, 0) rotate(0.9deg); }
  28% { transform: translate3d(-3px, 1px, 0) rotate(-0.75deg); }
  38% { transform: translate3d(3px, -1px, 0) rotate(0.6deg); }
  50% { transform: translate3d(-2px, 1px, 0) rotate(-0.45deg); }
  62% { transform: translate3d(2px, 0, 0) rotate(0.3deg); }
  74% { transform: translate3d(-1px, 0, 0) rotate(-0.18deg); }
  86% { transform: translate3d(1px, 0, 0) rotate(0.08deg); }
  100% { transform: none; }
}
.logo.is-shaking .logo__line { animation: truck-shake 720ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }

/* ── Footer credit — fixed at bottom ────────────────────────────────────────── */
.footer {
  position: fixed;
  bottom: max(0.5rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  margin: 0;
  text-align: center;
  font-family: var(--ui);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.5);
  text-shadow: var(--text-shadow);
  user-select: none;
}

/* ── Dock ─────────────────────────────────────────────────── */
.dock {
  position: relative;
  width: 100%;
  max-width: 30rem;
  margin-bottom: clamp(0.5rem, 7vh, 4.5rem);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

/* player pill — horizontal layout with disc on left */
.player {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.4rem 0.9rem 0.4rem 0.4rem;
    border-radius: 999px;
    border: 1px solid var(--glass-line);
    background: var(--glass);
    backdrop-filter: blur(28px) saturate(150%);
    -webkit-backdrop-filter: blur(28px) saturate(150%);
    box-shadow: var(--shadow-glass);
}

/* ghoomta naav ka chakra / compass (record ki jagah) */
.disc { position: relative; width: 3.75rem; height: 3.75rem; flex: none; }
.disc__ring {
  width: 100%; height: 100%;
  border-radius: 50%; overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  outline: 1px solid rgba(255, 255, 255, 0.2);
  outline-offset: -1px;
  background: #1a1a1a;
  animation: spin 6s linear infinite;
  animation-play-state: paused;
}
.player.is-playing .disc__ring { animation-play-state: running; }
.disc__art { width: 100%; height: 100%; object-fit: cover; display: block; }
.disc__placeholder {
  display: block;
  width: 100%; height: 100%;
  background: rgba(255, 255, 255, 0.06);
}
.disc__thumb { 
  position: absolute; inset: 0;
  width: 100%; height: 100%; 
  object-fit: cover; 
  border-radius: 50%;
}
.disc__hub {
  position: absolute; left: 50%; top: 50%;
  width: 0.5rem; height: 0.5rem;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}
@keyframes spin { to { transform: rotate(360deg); } }

.meta { 
  flex: 1; 
  min-width: 0; 
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* title + artist in top row */
.meta__header {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  min-width: 0;
}

/* title marquee — gaane ka naam scroll */
.meta__title {
  margin: 0;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.25;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.mq-wrap { display: inline-flex; animation: marquee var(--mq-dur, 12s) linear infinite; will-change: transform; }
.mq-wrap.static { animation: none; }
.mq { white-space: nowrap; padding-right: 3ch; font-weight: 700; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.meta__artist {
  margin: 0;
  font-size: 0.75rem; font-weight: 600; line-height: 1.25;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap; 
  flex-shrink: 0;
}

/* seek + time in one row */
.meta__seekrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* seek */
.seek {
  position: relative; 
  height: 10px; 
  flex: 1;
  cursor: pointer; 
  touch-action: none;
}
.seek__rail {
  position: absolute; inset-inline: 0; top: 50%; height: 4px;
  transform: translateY(-50%); border-radius: 999px; overflow: hidden;
  background: rgba(255, 255, 255, 0.2);
}
.seek__fill {
  height: 100%; width: 100%; border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  transform: scaleX(0); transform-origin: left center;
  will-change: transform;
}
.seek__knob {
  position: absolute; top: 50%; left: 0;
  width: 10px; height: 10px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity var(--swift);
  will-change: transform;
}
.seek:hover .seek__knob, .seek:focus-visible .seek__knob { opacity: 1; }

.time {
  margin: 0;
  font-size: 0.68rem; 
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  flex-shrink: 0;
}

/* controls — horizontal row on right side */
.controls { 
  display: flex; 
  align-items: center; 
  gap: 0.25rem; 
  flex: none; 
}
.btn {
  display: grid; place-items: center;
  width: 2rem; height: 2rem;
  border: none; border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: background var(--swift), color var(--swift), transform var(--swift);
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
.btn:active { transform: scale(0.92); }

.btn--play {
  width: 2.5rem; height: 2.5rem;
  background: #fff; color: #000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.btn--play svg { width: 18px; height: 18px; }

/* play/pause swap pure CSS se — .player.is-playing pe */
.i-pause, .player.is-playing .i-play { display: none; }
.player.is-playing .i-pause { display: block; }

.btn--play:hover { transform: scale(1.06); }
.btn--toggle.is-on { color: #fff; background: rgba(255, 255, 255, 0.2); }

/* ── Playlist popup ───────────────────────────────────────── */
.list {
  position: absolute;
  bottom: calc(100% + 0.7rem);
  left: 0; right: 0;
  z-index: 5;
  max-height: min(48dvh, 24rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 1.35rem;
  border: 1px solid var(--glass-line);
  background: rgba(20, 20, 22, 0.55);
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  box-shadow: var(--shadow-glass);

  opacity: 0; visibility: hidden;
  transform: translate3d(0, 10px, 0) scale(0.985);
  transform-origin: bottom center;
  transition: opacity var(--glide), transform var(--glide), visibility 0s linear 320ms;
}
.list.is-open {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity var(--glide), transform 420ms var(--ease-settle), visibility 0s;
}
.list { scrollbar-width: none; }
.list::-webkit-scrollbar { display: none; }

.list ol { margin: 0; padding: 0.4rem; list-style: none; counter-reset: t; }
.list li { counter-increment: t; }
.list button {
  width: 100%;
  display: flex; align-items: baseline; gap: 0.6rem;
  padding: 0.45rem 0.7rem;
  border: none; border-radius: 0.7rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--body);
  font-size: 0.86rem; font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.list button::before {
  content: counter(t);
  flex: none; width: 1.4rem;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.4);
}
.list button:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.list li.is-current button { background: rgba(255, 255, 255, 0.18); color: #fff; font-weight: 800; }
.list .t-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .t-artist { font-size: 0.74rem; font-weight: 600; color: rgba(255, 255, 255, 0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-dur { flex: none; font-size: 0.68rem; color: rgba(255, 255, 255, 0.4); font-variant-numeric: tabular-nums; }

/* ── Bumper slogans (Yatra One — naav pe likhe lines) ─────────── */
.bumper {
  width: 100%;
  margin: 0;
  padding: 0 0.5rem;
  text-align: center;
  user-select: none;
}
.bumper__text {
  font-family: "Yatra One", var(--body);
  font-size: clamp(1rem, 2.6vw, 1.28rem);
  font-weight: 400; line-height: 1.5;
  letter-spacing: 0.015em;
  text-align: center; text-wrap: balance;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: var(--text-shadow);
  transition: opacity 240ms ease;
}
.bumper__text.is-swapping { opacity: 0; }
.bumper__next {
  display: inline-flex; align-items: center; justify-content: center;
  vertical-align: -0.22em; margin-left: 0.4em;
  width: 1.4rem; height: 1.4rem; padding: 0;
  border: none; border-radius: 50%;
  background: transparent; color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: color var(--swift), background var(--swift), rotate 420ms var(--ease-settle);
}
.bumper__next:hover { color: #fff; background: rgba(255, 255, 255, 0.15); }
.bumper__next:active { rotate: 180deg; }

/* ── Intro / loading screen ───────────────────────────────── */
.intro {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.6rem;
  padding: 1.5rem;
  text-align: center;
  background: rgba(6, 12, 14, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.intro.hide { opacity: 0; visibility: hidden; pointer-events: none; }

.intro__wheel { width: 96px; height: 96px; animation: spin 1.4s linear infinite; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5)); }
.intro__wheel svg { width: 100%; height: 100%; }

.intro__curse {
  font-family: "Yatra One", var(--body);
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  color: #fff;
  text-shadow: var(--text-shadow);
  line-height: 1.3;
}
.intro__sub { font-size: 0.95rem; font-weight: 600; color: rgba(255, 255, 255, 0.85); }
.intro__loading {
  font-family: var(--ui);
  font-size: 0.78rem; font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  animation: ping-soft 1.2s steps(2) infinite;
}
@keyframes ping-soft { 50% { opacity: 0.4; } }

.intro__btn {
  margin-top: 0.6rem;
  padding: 0.8rem 1.6rem;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-family: var(--body);
  font-size: 0.95rem; font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-glass);
  transition: transform var(--swift);
}
.intro__btn:hover { transform: scale(1.05); }
.intro__btn:active { transform: scale(0.95); }

/* ── Small screens ────────────────────────────────────────── */
@media (max-width: 640px) {
  :root { --logo-top: 16vh; }
  .presence__label { display: none; }

  .horn { padding: 0.28rem 0.6rem 0.28rem 0.28rem; gap: 0.4rem; }
  .horn__icon { width: 1.5rem; height: 1.5rem; }
  .horn__deva { font-size: 0.72rem; }
  .horn__en { font-size: 0.56rem; }

  .player { 
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0.75rem; 
    border-radius: 1.5rem; 
    gap: 0.6rem; 
  }
  
  .disc { 
    width: 4rem; 
    height: 4rem; 
  }
  
  .meta {
    flex: 1;
    min-width: 0;
  }
  
  .meta__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  .meta__title {
    max-width: 100%;
  }
  
  .meta__artist {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .controls { 
    width: 100%; 
    justify-content: center; 
    gap: 0.4rem; 
  }

  .sndbar { flex-wrap: wrap; }
  .snd { padding: 0.32rem 0.7rem; font-size: 0.78rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .disc__ring, .presence__dot::after, .intro__wheel, .mq-wrap { animation: none !important; }
  .player.is-playing .disc { transform: none; }
}

/* ── Toast notification ───────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: 50;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  background: rgba(20, 20, 22, 0.85);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--glass-line);
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--ui);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease, transform 220ms ease;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
