/* ===== Portada con video (DonRoku) ===== */
.hero-video {
    position: relative;
    margin-top: -72px; /* sube detrás del menú fijo (anula el espacio de 72px de header.php) */
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    background: var(--dark, #0a0a1a);
    overflow: hidden;
    isolation: isolate;
}

.hero-video__media,
.hero-video__shade {
    position: absolute;
    inset: 0;
    z-index: -2;
}

.hero-video__media video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 68% 50%; /* si la pantalla recorta, se conserva el logo (lado derecho) */
}

/* Logo interactivo: capas encima del último cuadro del video (posición calculada en hero-video.js) */
.hero-final {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity .35s;
}

.hero-final.is-on {
    opacity: 1;
}

.hero-final__fondo,
.hero-logo__canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.hero-logo {
    position: absolute;
    will-change: transform;
}

/* Zona de los ojos dentro del logo (en % del logo original de 1254 px) */
.hero-eyes {
    position: absolute;
    left: 38.915%;
    top: 29.506%;
    width: 23.126%;
    height: 7.337%;
}

.hero-eyes img,
.hero-eyes__mover {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.hero-eyes__parche,
.hero-eyes__mover {
    will-change: transform;
}

.hero-eyes__mover {
    mix-blend-mode: plus-lighter; /* suma el brillo de los ojos sobre la cara */
}

@supports not (mix-blend-mode: plus-lighter) {
    .hero-eyes__mover { mix-blend-mode: screen; }
}

.hero-eyes__brillo {
    transform-origin: 50% 50%;
    transition: transform .09s ease-in;
}

.hero-eyes.is-blink .hero-eyes__brillo {
    transform: scaleY(.08);
}

/* Oscurece el lado del texto y funde el final con la siguiente sección */
.hero-video__shade {
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(10, 10, 26, .94) 0%, rgba(10, 10, 26, .80) 28%, rgba(10, 10, 26, .35) 48%, rgba(10, 10, 26, 0) 62%),
        linear-gradient(180deg, rgba(10, 10, 26, .55) 0%, rgba(10, 10, 26, 0) 18%, rgba(10, 10, 26, 0) 80%, var(--body-bg, #0f0f23) 100%);
}

.hero-video__content {
    padding-top: 110px;
    padding-bottom: 80px;
}

.hero-video__copy {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 560px;
}

.hero-video .hero-title {
    margin: 0;
    font-size: clamp(2.6rem, 4.2vw, 4rem);
    text-shadow: 0 2px 24px rgba(0, 0, 0, .5);
}

.hero-video .hero-title .highlight {
    font-size: 1.1em;
}

.hero-video .hero-title__sub {
    display: block;
    margin-top: .3em;
    font-size: .55em;
    font-weight: 700;
    color: #e9e5ff;
}

.hero-video .hero-subtitle {
    margin: 0;
    color: #cfd3ea;
}

.hero-video__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.hero-video__stats {
    display: flex;
    gap: 2.5rem;
    color: #fff;
}

.hero-video__stats > div {
    text-align: center;
}

/* Botón "Ver de nuevo": aparece cuando el video termina en el logo */
.hero-video__replay {
    position: absolute;
    right: 24px;
    bottom: 110px; /* arriba del botón flotante de WhatsApp */
    z-index: 2;
    display: inline-flex;
    align-items: center;
    padding: .45rem .9rem;
    border-radius: 999px;
    border: 1px solid rgba(168, 85, 247, .45);
    background: rgba(10, 10, 26, .55);
    color: #e9e5ff;
    font-size: .85rem;
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .4s, visibility .4s, background .2s;
}

.hero-video.is-ended .hero-video__replay {
    opacity: 1;
    visibility: visible;
}

.hero-video__replay:hover {
    background: rgba(108, 92, 231, .35);
}

.hero-video__replay:focus-visible {
    outline: 2px solid #a855f7;
    outline-offset: 2px;
}

/* Entrada suave del texto */
@media (prefers-reduced-motion: no-preference) {
    .hero-video__copy > * {
        animation: heroVideoIn .8s cubic-bezier(.2, .7, .2, 1) both;
    }
    .hero-video__copy > :nth-child(2) { animation-delay: .15s; }
    .hero-video__copy > :nth-child(3) { animation-delay: .3s; }
    .hero-video__copy > :nth-child(4) { animation-delay: .45s; }
}

@keyframes heroVideoIn {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}

/* ---- Celular y tablet vertical ---- */
@media (max-width: 991.98px) {
    .hero-video {
        display: block;
        min-height: 0;
    }

    /* El video ocupa la primera pantalla (mínimo 640px);
       el título y los botones van sobre su parte baja, arriba del botón flotante de WhatsApp */
    .hero-video__media,
    .hero-video__shade {
        bottom: auto;
        height: max(100vh, 640px);
        height: max(100svh, 640px);
    }

    /* En celulares bajitos se sube el video (hasta 60px) para que el logo no choque con el título;
       arriba del logo solo hay espacio oscuro, así que no se pierde nada */
    .hero-video__media {
        transform: translateY(calc(-1 * clamp(0px, 290px - max(100vh, 640px) * .377, 60px)));
        transform: translateY(calc(-1 * clamp(0px, 290px - max(100svh, 640px) * .377, 60px)));
    }

    .hero-video__media video {
        object-position: 50% 40%;
    }

    .hero-video__shade {
        background: linear-gradient(180deg, rgba(10, 10, 26, .5) 0%, rgba(10, 10, 26, 0) 14%, rgba(10, 10, 26, 0) 58%, rgba(10, 10, 26, .85) 80%, var(--body-bg, #0f0f23) 100%);
    }

    .hero-video__content {
        padding-top: calc(max(100vh, 640px) - 280px);
        padding-top: calc(max(100svh, 640px) - 280px);
        padding-bottom: 48px;
    }

    .hero-video__copy {
        max-width: none;
        gap: 1.1rem;
        align-items: center;
        text-align: center;
    }

    .hero-video .hero-title {
        font-size: 2rem;
    }

    /* Orden en celular: título, botones (sobre el video), y abajo el texto y los contadores */
    .hero-video__actions {
        order: 2;
        justify-content: center;
        gap: .75rem;
    }

    .hero-video__actions .btn {
        padding: .6rem 1.1rem !important;
        font-size: 1rem;
    }

    .hero-video .hero-subtitle {
        order: 3;
        margin-top: 1.5rem;
        font-size: 1.05rem;
    }

    .hero-video__stats {
        order: 4;
        gap: 1.75rem;
        justify-content: center;
    }

    /* "Ver de nuevo" como ícono redondo a la izquierda del título (no choca con el logo) */
    .hero-video__replay {
        top: calc(max(100vh, 640px) - 262px);
        top: calc(max(100svh, 640px) - 262px);
        left: 12px;
        right: auto;
        bottom: auto;
        width: 40px;
        height: 40px;
        padding: 0;
        justify-content: center;
    }

    .hero-video__replay i {
        margin: 0 !important;
    }

    .hero-video__replay span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}
