/* ============ Anveshan Gaon — the village carries the site ============ */

:root {
  --ghee: #e2b34a;
  --ink-cream: #f3eee3;
  --earth: #2a2318;
  --glass-bg: rgba(28, 24, 18, 0.48);
  --glass-border: rgba(255, 236, 200, 0.14);
  --glass-hi: inset 0 1px 0 rgba(255, 245, 220, 0.12);
  --glass-blur: blur(22px) saturate(1.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
html { height: 100dvh; }
body {
  font-family: "IBM Plex Sans", "Noto Sans Devanagari", -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
  height: 100dvh;
  background: #1c1812;
  overscroll-behavior: none;
  touch-action: manipulation;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }

#stage { position: fixed; inset: 0; overflow: hidden; }
#stage img,
#stage .art-video {
  position: absolute;
  user-select: none; -webkit-user-drag: none;
}
#stage .art-video {
  display: block;
  object-fit: fill;
  pointer-events: none;
  /* Keep poster/frame visible under night crossfade */
  z-index: 1;
}
#art-day { z-index: 0; }
#art-night { z-index: 2; }
#art-day,
#art-day-video { transition: opacity 1.75s cubic-bezier(.42, 0, .2, 1) .12s; }
#art-night { transition: opacity 1.45s cubic-bezier(.42, 0, .2, 1); }
#art-night { opacity: 0; }
body.night #art-night { opacity: 1; }
body.night #art-day,
body.night #art-day-video { opacity: 0; }
body.birds #stage img { animation: leaf-sway 3.2s ease-in-out infinite; }
@keyframes leaf-sway {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(0.5px); }
}

#grain {
  position: fixed; inset: -100px; z-index: 6;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.08;
  mix-blend-mode: overlay;
  animation: grain-drift 0.9s steps(4) infinite;
}
@keyframes grain-drift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-34px, 22px); }
  50% { transform: translate(18px, -41px); }
  75% { transform: translate(-47px, -14px); }
  100% { transform: translate(0, 0); }
}

.hotspot {
  position: absolute; z-index: 4; border-radius: 18px;
  -webkit-tap-highlight-color: transparent;
}
#hot-cowbell::before {
  content: ""; position: absolute; inset: -6px; border-radius: 24px;
  background: radial-gradient(closest-side, rgba(255, 214, 120, 0.3), transparent 75%);
  opacity: 0; transition: opacity 0.3s;
}
#hot-cowbell:hover::before, #hot-cowbell:active::before, #hot-cowbell:focus-visible::before { opacity: 1; }
.hotspot:focus-visible { outline: 2px solid rgba(255, 214, 120, 0.65); outline-offset: 4px; }
#hot-cowbell::after,
#hot-bilona::after,
#hot-birds::after {
  content: attr(data-label);
  position: absolute; left: 50%; bottom: calc(100% + 6px);
  transform: translateX(-50%);
  background: var(--glass-bg); color: var(--ink-cream);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  font-size: 12px; font-weight: 600; white-space: nowrap;
  padding: 5px 11px; border-radius: 999px;
  opacity: 0; transition: opacity 0.25s; pointer-events: none;
}
#hot-cowbell:hover::after, #hot-cowbell:active::after, #hot-cowbell:focus-visible::after,
#hot-bilona:hover::after, #hot-bilona:active::after, #hot-bilona:focus-visible::after,
#hot-birds:hover::after, #hot-birds:active::after, #hot-birds:focus-visible::after { opacity: 1; }
#hot-birds.on { box-shadow: inset 0 0 40px rgba(180, 220, 140, 0.22); }

#stage.debug .hotspot { outline: 1.5px solid rgba(255, 80, 80, 0.75); }

header {
  position: fixed; z-index: 10;
  top: max(14px, env(safe-area-inset-top));
  left: 16px; right: 16px;
  display: flex; align-items: center; justify-content: flex-end;
  pointer-events: none;
}
header a, header button, #riders { pointer-events: auto; }

#riders {
  position: fixed;
  top: max(18px, calc(env(safe-area-inset-top) + 10px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 11;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px 8px 12px; border-radius: 999px;
  background: transparent;
  color: var(--ink-cream);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  flex: none;
}
#riders-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #8fd46a; flex: none;
  box-shadow: 0 0 0 0 rgba(143, 212, 106, 0.55);
  animation: livepulse 2.6s ease-out infinite;
}
@keyframes livepulse {
  0%   { box-shadow: 0 0 0 0 rgba(143, 212, 106, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(143, 212, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(143, 212, 106, 0); }
}
#riders-label {
  font-size: 14px; font-weight: 500; letter-spacing: 0.2px;
  white-space: nowrap; opacity: 0.72;
}
#riders-n {
  font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums;
  transition: opacity 0.35s;
}
#riders.shifting #riders-n { opacity: 0.25; }

#hero {
  position: fixed; z-index: 8;
  top: 14vh; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center;
  pointer-events: none;
  padding: 0 24px;
  color: var(--ink-cream);
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}
#brand-mark {
  font-family: "Fraunces", "Noto Sans Devanagari", Georgia, serif;
  font-weight: 650;
  font-size: clamp(42px, 11vw, 88px);
  letter-spacing: 0.02em;
  line-height: 1;
  margin: 0;
  text-align: center;
}
#brand-sub {
  font-family: "Fraunces", "Noto Sans Devanagari", Georgia, serif;
  font-size: clamp(18px, 4.2vw, 28px);
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.78;
  margin-top: 10px;
  text-align: center;
}

#links { display: flex; gap: 14px; align-items: center; }

#links a {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  color: var(--ink-cream); opacity: 0.72;
  text-decoration: none;
  filter: drop-shadow(0 1px 6px rgba(8, 10, 16, 0.6));
  transition: opacity 0.25s, transform 0.25s, color 0.25s;
}
#links a:hover { opacity: 1; transform: translateY(-1px); }
#link-shop:hover { color: var(--ghee); }
#link-spotify:hover { color: #1ed760; }
#link-ytmusic:hover { color: #ff6b6b; }
#links a:focus-visible {
  opacity: 1; outline: 2px solid rgba(244, 239, 226, 0.7);
  outline-offset: 3px; border-radius: 50%;
}

#daynight {
  position: relative; padding: 0;
  width: 46px; height: 46px; border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
#daynight:focus-visible { outline: 2px solid rgba(244, 239, 226, 0.7); outline-offset: 3px; }
.dn-halo {
  position: absolute; inset: -9px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 196, 80, 0.38), transparent 72%);
  opacity: 0.8; transition: opacity 1.4s cubic-bezier(.42, 0, .2, 1), background 1.4s cubic-bezier(.42, 0, .2, 1);
  animation: halo-breathe 5s ease-in-out infinite alternate;
}
body.night .dn-halo {
  background: radial-gradient(closest-side, rgba(146, 168, 255, 0.42), transparent 74%);
  opacity: 1;
}
@keyframes halo-breathe { from { transform: scale(1); } to { transform: scale(1.12); } }
.dn-glass {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(5px) saturate(1.2); -webkit-backdrop-filter: blur(5px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.35),
    inset 0 -6px 12px rgba(10, 12, 20, 0.25),
    0 4px 14px rgba(8, 10, 16, 0.35);
  transition: transform 0.9s cubic-bezier(.6,-0.15,.3,1.25);
}
#daynight:active .dn-glass { transform: scale(0.92); }
.dn-sun, .dn-moon {
  position: absolute; left: 50%; top: 50%;
  width: 22px; height: 22px; border-radius: 50%;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
  transition: opacity 1.15s cubic-bezier(.42, 0, .2, 1), transform 1.5s cubic-bezier(.42, 0, .2, 1);
}
.dn-sun {
  background:
    radial-gradient(circle at 34% 32%, #fff3c4 0%, #ffd864 42%, #f2a614 78%, #e08b00 100%);
  box-shadow: 0 0 10px rgba(255, 206, 84, 0.9), 0 0 22px rgba(255, 186, 40, 0.45);
}
.dn-moon {
  background:
    radial-gradient(circle 3.2px at 38% 34%, rgba(148, 140, 112, 0.55) 96%, transparent),
    radial-gradient(circle 2.1px at 62% 56%, rgba(148, 140, 112, 0.5) 96%, transparent),
    radial-gradient(circle 1.4px at 50% 74%, rgba(148, 140, 112, 0.45) 96%, transparent),
    radial-gradient(circle at 38% 32%, #fdf9e8 0%, #ece5c8 55%, #cfc7a5 100%);
  box-shadow: 0 0 10px rgba(240, 238, 214, 0.75), 0 0 24px rgba(178, 190, 255, 0.4);
  opacity: 0; transform: translate(-50%, -50%) rotate(-120deg) scale(0.55);
}
body.night .dn-sun { opacity: 0; transform: translate(-50%, -50%) rotate(120deg) scale(0.55); }
body.night .dn-moon { opacity: 1; transform: translate(-50%, -50%) rotate(0deg) scale(1); }

#playerdock {
  position: fixed; z-index: 10; left: 0; right: 0;
  bottom: calc(34px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 0 14px; pointer-events: none;
}

body.boarding #seekbox { opacity: 0.28; }
body.boarding #song-sub { opacity: 0.4; }
body.boarding #controls { opacity: 0.5; pointer-events: none; }
body.boarding #thumb { animation: thumbwait 1.6s ease-in-out infinite alternate; }
@keyframes thumbwait { from { opacity: 0.5; } to { opacity: 0.85; } }
#pill {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "thumb meta controls" "seek seek seek";
  align-items: center; gap: 6px 16px;
  width: min(680px, 100%);
  background: var(--glass-bg);
  color: var(--ink-cream);
  border: 1px solid var(--glass-border);
  border-radius: 34px; padding: 16px 24px 15px;
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-hi), 0 18px 50px rgba(4, 6, 12, 0.42);
}
#thumb-wrap {
  grid-area: thumb;
  position: relative;
  width: 54px; height: 54px;
  flex: none;
}
#thumb {
  width: 54px; height: 54px;
  border-radius: 50%; object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  animation: vinyl-spin 8s linear infinite paused;
}
body.rolling #thumb { animation-play-state: running; }
#thumb-wrap::after {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 10px; height: 10px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(12, 10, 8, 0.72);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
  pointer-events: none;
}
@keyframes vinyl-spin {
  to { transform: rotate(360deg); }
}
#meta { grid-area: meta; display: flex; flex-direction: column; min-width: 0; }
.title-scroll {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.title-scroll:not(.is-scrolling) {
  mask-image: none;
  -webkit-mask-image: none;
}
#song-title {
  display: inline-block;
  font-weight: 650; font-size: 16px; letter-spacing: 0.1px;
  white-space: nowrap;
}
.title-scroll:not(.is-scrolling) #song-title {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.title-scroll.is-scrolling #song-title {
  padding-left: 0;
  animation: title-marquee var(--marquee-duration, 12s) linear infinite;
}
@keyframes title-marquee {
  0% { transform: translateX(0); }
  15% { transform: translateX(0); }
  85% { transform: translateX(calc(-100% + var(--marquee-room, 100%))); }
  100% { transform: translateX(calc(-100% + var(--marquee-room, 100%))); }
}
#song-sub { font-size: 12.5px; opacity: 0.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

#controls { grid-area: controls; display: flex; gap: 4px; align-items: center; }
#controls button {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  color: var(--ink-cream); opacity: 0.85;
  transition: opacity 0.2s, transform 0.15s, background 0.2s;
}
#controls button:hover { opacity: 1; background: rgba(255, 255, 255, 0.08); }
#controls button:active { transform: scale(0.9); }
#controls button:focus-visible { opacity: 1; outline: 2px solid rgba(244, 239, 226, 0.7); outline-offset: 1px; }
#controls svg { width: 22px; height: 22px; }
#btn-play {
  width: 52px; height: 52px;
  background: var(--ink-cream); color: #1c1812;
  opacity: 1;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
#btn-play:hover { background: #fff; opacity: 1; transform: scale(1.05); }
#btn-play:active { transform: scale(0.95); }
#btn-play svg { width: 22px; height: 22px; }
#btn-play .icon-pause { display: none; }
body.rolling #btn-play .icon-play { display: none; }
body.rolling #btn-play .icon-pause { display: block; }

#seekbox {
  grid-area: seek; display: flex; align-items: center; gap: 10px;
  font-size: 11px; font-variant-numeric: tabular-nums; opacity: 0.6;
}
#seek {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 3px; border-radius: 2px;
  background: rgba(255, 255, 255, 0.22); outline: none;
}
#seek::-webkit-slider-thumb {
  -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%;
  background: var(--ink-cream); border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
#seek::-moz-range-thumb {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--ink-cream); border: none;
}

#credit {
  position: fixed; z-index: 10; left: 0; right: 0;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  text-align: center; font-size: 9.5px; color: #efe8d4; opacity: 0.5;
  text-shadow: 0 1px 4px rgba(6, 8, 14, 0.8);
  pointer-events: auto;
}
#credit a { color: inherit; font-weight: 700; pointer-events: auto; }

#yt-hide {
  position: fixed; bottom: 0; right: 0;
  width: 2px; height: 2px; opacity: 0.01; pointer-events: none; overflow: hidden;
}

@media (max-width: 640px) {
  #hero { top: 12vh; }
  #brand-mark { font-size: clamp(36px, 14vw, 56px); }
  #brand-sub { font-size: 16px; letter-spacing: 0.14em; }
  #riders { padding: 7px 14px 7px 10px; gap: 7px; }
  #riders-label, #riders-n { font-size: 13px; }
  #credit { font-size: 8.5px; }
  #pill { border-radius: 26px; padding: 11px 15px 10px; gap: 5px 12px; }
  #thumb-wrap, #thumb { width: 46px; height: 46px; }
  #thumb-wrap::after { width: 8px; height: 8px; }
  #song-title { font-size: 14.5px; }
  #controls button { width: 38px; height: 38px; }
  #btn-play { width: 46px; height: 46px; }
  #btn-play svg { width: 20px; height: 20px; }
  #links { gap: 10px; }
  .hotspot { min-width: 56px; min-height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  #grain, .dn-halo, body.birds #stage img, #riders-dot { animation: none; }
  #stage img, #stage .art-video, .dn-sun, .dn-moon, .dn-glass { transition-duration: 0.01s; }
  #art-day-video { display: none !important; }
  .title-scroll.is-scrolling #song-title { animation: none; }
  #thumb { animation: none; }
}
