/**
 * AMBIENT.CSS — gold music-note toggle button (bottom-right)
 */

#ddv-ambient-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  width: 48px;
  height: 48px;
  /* iOS safe-area padding */
  margin-bottom: env(safe-area-inset-bottom, 0);
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.45);
  background: rgba(10, 10, 10, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #d4af37;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 200ms ease,
              background 200ms ease,
              box-shadow 200ms ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

#ddv-ambient-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#ddv-ambient-toggle:hover {
  border-color: #d4af37;
  background: rgba(20, 17, 11, 0.92);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55), 0 0 12px rgba(212, 175, 55, 0.18);
}

#ddv-ambient-toggle:focus-visible {
  outline: 2px solid #d4af37;
  outline-offset: 3px;
}

#ddv-ambient-toggle.is-playing {
  border-color: #d4af37;
  background: rgba(40, 30, 12, 0.92);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45),
              0 0 18px rgba(212, 175, 55, 0.32);
  animation: ddv-ambient-pulse 3.2s ease-in-out infinite;
}

@keyframes ddv-ambient-pulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 14px rgba(212, 175, 55, 0.22); }
  50%      { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 22px rgba(212, 175, 55, 0.42); }
}

@media (prefers-reduced-motion: reduce) {
  #ddv-ambient-toggle,
  #ddv-ambient-toggle.is-playing {
    transition: none;
    animation: none;
  }
}

@media (max-width: 600px) {
  #ddv-ambient-toggle {
    right: 14px;
    bottom: 14px;
    width: 48px;
    height: 48px;
  }
  #ddv-ambient-toggle svg {
    width: 24px;
    height: 24px;
  }
}

/* When the bottom chrome bar is mounted, push the toggle above it */
body.ddv-has-chrome #ddv-ambient-toggle {
  bottom: calc(var(--ddv-chrome-h, 56px) + 14px);
}

@media (max-width: 600px) {
  body.ddv-has-chrome #ddv-ambient-toggle {
    bottom: calc(var(--ddv-chrome-h-mobile, 48px) + 12px);
  }
}

/* ============== HERO VIDEO BACKGROUND ============== */

.ddv-hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0.32;
  filter: saturate(0.85) contrast(1.05);
  pointer-events: none;
}

.ddv-hero-video-wrap {
  position: relative;
  overflow: hidden;
}

.ddv-hero-video-wrap > *:not(.ddv-hero-video):not(.ddv-hero-video-overlay) {
  position: relative;
  z-index: 2;
}

.ddv-hero-video-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at center, rgba(10, 10, 10, 0.35) 0%, rgba(10, 10, 10, 0.85) 100%),
    linear-gradient(180deg, rgba(10, 10, 10, 0.4) 0%, rgba(10, 10, 10, 0.65) 100%);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .ddv-hero-video {
    display: none;
  }
}
