
/* Homepage hero video stage */
/* Hero container */
.hero-video-stage {
    position: relative;
    isolation: isolate;
    /* overflow: hidden; */
}

/* The video sits above the hero content */
/* Full-width video overlay */
.hero-video-overlay {
    position: absolute;
    top: 0;
    left: 50%;
    width: 100vw;
    height: 100%;
    transform: translateX(-50%);
    z-index: 999;

    overflow: hidden;
    background: #101820;
    opacity: 1;
    visibility: visible;
    pointer-events: none;

    transition:
        opacity 800ms ease,
        visibility 0s linear 800ms;
}

/* Fill the hero without distorting the video */
/* Video fills the overlay without distortion */
.hero-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* The hero remains underneath the video */
.hero-video-content {
    position: relative;
    z-index: 1;
}

/* Applied when playback ends or fails */
.hero-video-stage.is-video-finished
.hero-video-overlay {
    opacity: 0;
    visibility: hidden;
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    .hero-video-overlay {
        display: none !important;
    }
}

/* Avoid animating when the user requests reduced motion */
@media (prefers-reduced-motion: reduce) {
    .hero-video-stage .hero-video-overlay {
        transition: none;
    }
}

/* Subtle loading indicator */
.hero-video-overlay::after {
    content: "";
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 2px solid #ffffff;
    border-top-color: #ff003d;
    border-radius: 50%;
    animation: hero-video-spin 0.8s linear infinite;
    opacity: 1;
    transition: opacity 200ms ease;
    pointer-events: none;
}

.hero-video-stage.is-video-ready
.hero-video-overlay::after {
    opacity: 0;
    animation: none;
}

@keyframes hero-video-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-video-overlay::after {
        display: none;
        animation: none;
    }
}
