/* Full-screen background video with overlay + theater (unmute) mode */

body.has-video-bg {
  background-image: none;
}

.video-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #00356b;
}

.video-bg video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.video-bg__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(0, 53, 107, 0.72) 0%, rgba(0, 53, 107, 0.45) 45%, rgba(0, 53, 107, 0.78) 100%),
    rgba(0, 31, 63, 0.35);
  transition: opacity 0.5s ease;
  pointer-events: none;
}

/* Hide React app's duplicate background image */
body.has-video-bg #root > div > .fixed.inset-0.bg-brand-yale {
  display: none;
}

#root {
  position: relative;
  z-index: 10;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.video-unmute-toggle,
.video-theater-mute {
  position: fixed;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 9999px;
  background: rgba(0, 53, 107, 0.75);
  backdrop-filter: blur(8px);
  color: #fff;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, opacity 0.3s ease, visibility 0.3s ease;
}

.video-unmute-toggle {
  bottom: 1.25rem;
  right: 1.25rem;
}

.video-theater-mute {
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  z-index: 110;
  background: rgba(0, 0, 0, 0.65);
  border-color: rgba(255, 255, 255, 0.5);
  padding: 0.75rem 1.25rem;
  font-size: 0.7rem;
}

.video-unmute-toggle:hover,
.video-theater-mute:hover {
  background: rgba(0, 53, 107, 0.92);
  border-color: rgba(255, 255, 255, 0.65);
}

.video-theater-mute:hover {
  background: rgba(0, 0, 0, 0.82);
}

.video-unmute-toggle:active {
  transform: scale(0.97);
}

.video-theater-mute:active {
  transform: translateX(-50%) scale(0.97);
}

.video-unmute-toggle svg,
.video-theater-mute svg {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
}

/* Theater mode: hide site, unmute video */
body.video-theater-mode #root,
body.video-theater-mode .video-unmute-toggle,
body.video-theater-mode noscript {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

body.video-theater-mode .video-theater-mute {
  display: inline-flex;
}

body.video-theater-mode .video-bg {
  z-index: 100;
}

body.video-theater-mode .video-bg__overlay {
  opacity: 0;
}

body.video-theater-mode .video-bg video {
  object-fit: contain;
  background: #000;
}

@media (min-width: 640px) {
  .video-unmute-toggle {
    bottom: 1.75rem;
    right: 1.75rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.7rem;
  }

  .video-theater-mute {
    bottom: 2rem;
    padding: 0.85rem 1.5rem;
    font-size: 0.75rem;
  }
}

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

  .video-bg {
    background-image: url("/media/rally-hero-poster.jpg");
    background-size: cover;
    background-position: center;
  }

  .video-unmute-toggle {
    display: none;
  }
}
