/* Background music player — left edge. */
.vl-audio {
  position: fixed;
  left: clamp(0.75rem, 2vw, 1.5rem);
  bottom: clamp(0.75rem, 3vh, 1.75rem);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: rgba(11, 11, 13, 0.78);
  border: 1px solid rgba(210, 172, 95, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #d2ac5f;
}
.vl-audio audio { display: none; }

.vl-audio__btn {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.2s ease, color 0.2s ease;
}
.vl-audio__btn:hover { background: rgba(210, 172, 95, 0.14); }
.vl-audio__btn:focus-visible { outline: 2px solid #d2ac5f; outline-offset: 2px; }
.vl-audio__btn svg { width: 1.15rem; height: 1.15rem; display: block; }

.vl-audio__toggle { background: #d2ac5f; color: #0b0b0d; }
.vl-audio__toggle:hover { background: #e2bf77; }

/* Play / pause icon swap */
.vl-audio .i-pause, .vl-audio.is-playing .i-play { display: none; }
.vl-audio.is-playing .i-pause { display: block; }
/* Speaker / muted icon swap */
.vl-audio .i-muted, .vl-audio.is-muted .i-sound { display: none; }
.vl-audio.is-muted .i-muted { display: block; }

/* The speaker and volume only exist once the song is playing. */
.vl-audio__speaker { display: none; }
.vl-audio.is-playing .vl-audio__speaker { display: grid; }

.vl-audio__volume-wrap {
  width: 0;
  overflow: hidden;
  opacity: 0;
  transition: width 0.3s ease, opacity 0.2s ease, margin 0.3s ease;
}
.vl-audio.is-playing.is-open .vl-audio__volume-wrap { width: 6.5rem; opacity: 1; margin-right: 0.55rem; }

/* Collapsed while playing: only the speaker remains. */
.vl-audio.is-playing:not(.is-open) .vl-audio__toggle { display: none; }
.vl-audio.is-playing:not(.is-open) .vl-audio__speaker { background: rgba(210, 172, 95, 0.12); }

.vl-audio__volume {
  --fill: 50%;
  -webkit-appearance: none;
  appearance: none;
  width: 6.5rem;
  height: 4px;
  margin: 0;
  border-radius: 999px;
  background: linear-gradient(to right, #d2ac5f var(--fill), rgba(255, 255, 255, 0.18) var(--fill));
  cursor: pointer;
  display: block;
}
.vl-audio__volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: #f4e7c8; border: 2px solid #d2ac5f;
}
.vl-audio__volume::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: #f4e7c8; border: 2px solid #d2ac5f;
}

/* A gentle pulse on the speaker while music plays and the panel is folded. */
.vl-audio.is-playing:not(.is-open):not(.is-muted) .vl-audio__speaker { animation: vl-audio-pulse 2.4s ease-in-out infinite; }
@keyframes vl-audio-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(210, 172, 95, 0.35); }
  50%      { box-shadow: 0 0 0 6px rgba(210, 172, 95, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .vl-audio * { animation: none !important; transition: none !important; }
}
@media print { .vl-audio { display: none; } }

/* ------------------------------------------------------------------
   Music-reactive accents. Only active while the song plays; the
   --music-level (0–1) and --music-beat values come from bg-audio.js.
   ------------------------------------------------------------------ */
:root { --music-level: 0; --music-beat: 0; }

html.is-music-on .vl-display em {
  text-shadow: 0 0 calc(4px + var(--music-level) * 16px) rgba(210, 172, 95, calc(0.08 + var(--music-level) * 0.3));
}
html.is-music-on .vl-btn--gold {
  box-shadow: 0 0 calc(var(--music-beat) * 26px) rgba(210, 172, 95, calc(var(--music-beat) * 0.55));
}
html.is-music-on .vl-eyebrow::before {
  transform: scaleX(calc(1 + var(--music-level) * 0.8));
  transform-origin: left center;
}
html.is-music-on .custom-logo,
html.is-music-on .vl-logo img {
  filter: drop-shadow(0 0 calc(var(--music-beat) * 12px) rgba(210, 172, 95, calc(var(--music-beat) * 0.6)));
}
html.is-music-on .vl-audio {
  border-color: rgba(210, 172, 95, calc(0.35 + var(--music-beat) * 0.5));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 calc(var(--music-beat) * 22px) rgba(210, 172, 95, calc(var(--music-beat) * 0.45));
}
@media (prefers-reduced-motion: reduce) {
  html.is-music-on .vl-display em,
  html.is-music-on .vl-btn--gold,
  html.is-music-on .vl-eyebrow::before,
  html.is-music-on .custom-logo,
  html.is-music-on .vl-logo img { text-shadow: none; box-shadow: none; transform: none; filter: none; }
}
