html.video-locked {
  overflow: hidden;
}

/* Hide lottie animations while the loader is active */
html.video-locked #hero-top-lottie,
html.video-locked #hero-center-lottie,
html.video-locked #hero-bottom-lottie {
  opacity: 0;
}

/* Override AEM rule: html body [aria-hidden=true]:not(.overlay, path) */
#video-section [aria-hidden='true'] {
  display: revert !important;
  visibility: revert !important;
}

/* PRELOAD OVERLAY */
#preload-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-heavy);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

#preload-overlay.hidden {
  display: none;
}

#preload-overlay .preload-content {
  color: var(--color-white);
  text-align: center;
  font-size: 18px;
}

#preload-overlay .preload-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--white-alpha-30);
  border-top-color: var(--color-white);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: video-spin 0.8s linear infinite;
}

@keyframes video-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Continue navigation button — visible only at the end of the video */
#video-section .continue-nav {
  display: none;
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: none;
  border: 2px solid var(--color-white);
  color: var(--white-alpha-92);
  font-size: 100%;
  font-weight: 400;
  text-shadow: 0 2px 10px var(--overlay-light);
  cursor: pointer;
  padding: 24px 32px;
  white-space: nowrap;
  z-index: 5;
  font-size: 26px;
}

/* @media (max-width: 480px) {
  html:not(.video-playing) #video-section .continue-nav {
    display: block;
  }
} */

/* VIDEO SECTION */
#video-section {
  height: 300vh; /* spazio di scroll */
}

#video-section .video-wrapper {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  background: var(--color-black);
  overflow: hidden;
}

#video-section video,
#video-section #end-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#hero-top-lottie,
#hero-center-lottie,
#hero-bottom-lottie {
  position: absolute;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

#hero-top-lottie {
  top: 0;
}

#hero-center-lottie {
  top: 0;
}

#hero-bottom-lottie {
  bottom: 0;
}

#hero-top-lottie svg,
#hero-center-lottie svg,
#hero-bottom-lottie svg {
  overflow: visible;
}

#video-section #hero-text-band {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 20%;
  display: block;
  padding: 0 5%;
  background: linear-gradient(
    0deg,
    var(--overlay-dark) 0%,
    var(--overlay-medium) 55%,
    transparent 100%
  );
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
  pointer-events: none;
}

#video-section #hero-text-band.visible {
  opacity: 1;
  transform: translateY(0);
}

#video-section .hero-caption {
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 7%;
  max-width: 40%;
  color: var(--white-alpha-92);
  font-size: 150%;
  line-height: 125%;
  font-weight: 400;
  text-shadow: 0 2px 10px var(--overlay-light);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}

#video-section .hero-caption.visible {
  opacity: 1;
  transform: translateY(0);
}

#video-section .hero-caption[data-pos='left'] {
  text-align: left;
}

#video-section .hero-caption[data-pos='right'] {
  margin-left: auto;
  left: auto;
  text-align: right;
}

/* COMPACT LAYOUT */
@media (max-width: 480px) {
  #video-section {
    height: 240vh;
  }

  #video-section #hero-text-band {
    height: 24%;
    padding: 0 6%;
  }

  #video-section .hero-caption {
    left: 6%;
    right: 6%;
    bottom: 6%;
    max-width: 100%;
    font-size: 120%;
    line-height: 135%;
  }
}
