/* ag-entry-cinematic.css — secuencia "Cruzar el umbral" */

#ag-entry-cinematic {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
#ag-entry-cinematic.ag-cin-active {
    pointer-events: all;
    opacity: 1;
}

/* Vignette: oscurece progresivamente desde los bordes */
.ag-cin-vignette {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: radial-gradient(
        ellipse at center,
        rgba(13, 27, 42, 0)   0%,
        rgba(13, 27, 42, 0.5) 50%,
        rgba(13, 27, 42, 0.95) 100%
    );
    opacity: 0;
    transition: opacity 0.8s ease-in;
}
#ag-entry-cinematic.ag-cin-active .ag-cin-vignette {
    opacity: 1;
}

/* Stage: contenedor centrado del logo + texto.
   z-index 3 → SIEMPRE al frente, por encima del blur del iris. */
.ag-cin-stage {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.4rem;
    pointer-events: none;
}

/* Logo: aparece materializándose desde el centro */
.ag-cin-logo,
.ag-cin-logo-fallback {
    width: clamp(120px, 28vw, 240px);
    height: auto;
    max-height: 240px;
    object-fit: contain;
    transform: scale(0) rotate(-15deg);
    opacity: 0;
    filter: drop-shadow(0 0 0 rgba(244, 162, 97, 0));
    transition:
        transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.6s ease,
        filter 0.8s ease;
}
.ag-cin-logo-fallback {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, #F4A261, #E76F51);
}
#ag-entry-cinematic.ag-cin-revealed .ag-cin-logo,
#ag-entry-cinematic.ag-cin-revealed .ag-cin-logo-fallback {
    transform: scale(1) rotate(0deg);
    opacity: 1;
    filter: drop-shadow(0 0 32px rgba(244, 162, 97, 0.65));
    animation: ag-cin-logo-pulse 2.5s ease-in-out infinite 0.6s;
}
@keyframes ag-cin-logo-pulse {
    0%, 100% { filter: drop-shadow(0 0 28px rgba(244, 162, 97, 0.50)); }
    50%      { filter: drop-shadow(0 0 44px rgba(244, 162, 97, 0.80)); }
}

/* Bienvenida — texto */
.ag-cin-bienvenida {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.7s ease 0.1s, transform 0.7s ease 0.1s;
}
.ag-cin-greeting {
    font-family: 'Georgia', serif;
    font-size: 0.95rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.04em;
}
.ag-cin-name {
    font-family: 'Georgia', serif;
    font-size: clamp(1.5rem, 5vw, 2.4rem);
    font-weight: 600;
    color: #FFFFFF;
    letter-spacing: 0.02em;
    text-align: center;
    line-height: 1.15;
    text-shadow: 0 2px 16px rgba(244, 162, 97, 0.4);
}
#ag-entry-cinematic.ag-cin-welcomed .ag-cin-bienvenida {
    opacity: 1;
    transform: translateY(0);
}

/* Iris: blur radial que se expande desde el centro — efecto onírico
   en lugar de un wipe sólido. z-index 2 → entre vignette y stage,
   así el LOGO queda siempre nítido por encima del blur. */
.ag-cin-iris {
    position: absolute;
    inset: 0;
    z-index: 2;
    /* Tinte muy ligero para dar profundidad sin ocultar el contenido */
    background: linear-gradient(
        135deg,
        rgba(244, 162, 97, 0.14),
        rgba(13, 27, 42, 0.28)
    );
    backdrop-filter: blur(28px) saturate(1.05);
    -webkit-backdrop-filter: blur(28px) saturate(1.05);
    clip-path: circle(0% at 50% 50%);
    transition: clip-path 0.75s cubic-bezier(0.55, 0, 0.45, 1);
    pointer-events: none;
}
#ag-entry-cinematic.ag-cin-iris-out .ag-cin-iris {
    clip-path: circle(150% at 50% 50%);
}

/* Fallback si backdrop-filter no está soportado: tinte un poco más opaco */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .ag-cin-iris {
        background: linear-gradient(
            135deg,
            rgba(244, 162, 97, 0.55),
            rgba(13, 27, 42, 0.85)
        );
    }
}

/* Reduce motion: animación más rápida y simple */
@media (prefers-reduced-motion: reduce) {
    .ag-cin-vignette,
    .ag-cin-logo,
    .ag-cin-bienvenida,
    .ag-cin-iris {
        transition-duration: 0.3s !important;
        animation: none !important;
    }
}
