/* ==========================================================================
   Suri Hero — Motion Graphic Ilustrado Editorial (HTML + CSS + SVG + JS)
   ========================================================================== */

/* Fondo editorial azul marino luminoso (alineado a la paleta Suri y la referencia) */
.hero {
    background:
        radial-gradient(ellipse 56% 60% at 74% 50%, rgba(39, 181, 154, 0.22), transparent 64%),
        radial-gradient(ellipse 58% 58% at 68% 42%, rgba(78, 108, 184, 0.34), transparent 68%),
        linear-gradient(135deg, #0d1830 0%, #142548 52%, #112242 100%);
}

.hero__stage {
    position: relative;
    min-height: 450px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

.illus-stage {
    position: relative;
    width: 100%;
    min-height: 450px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

/* Halo luminoso detrás de los personajes */
.illus-stage::before {
    content: "";
    position: absolute;
    width: 440px;
    height: 440px;
    top: 46%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(39, 181, 154, 0.2) 0%,
        rgba(78, 108, 184, 0.16) 44%,
        transparent 72%
    );
    pointer-events: none;
}

.illus-viewport {
    position: relative;
    width: 100%;
    height: 410px;
}

.illus-scene {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(12px) scale(0.97);
    pointer-events: none;
    transition:
        opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.illus-scene.is-active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.illus-svg {
    width: 100%;
    max-width: 540px;
    height: 410px;
    overflow: visible;
    filter: drop-shadow(0 22px 40px rgba(0, 0, 0, 0.45));
}

/* ==========================================================================
   Animaciones orgánicas con transform-box: fill-box (pivotes exactos)
   ========================================================================== */
.illus-scene .char-breathe,
.illus-scene .char-head,
.illus-scene .char-arm-l,
.illus-scene .char-arm-r,
.illus-scene .float-slow,
.illus-scene .float-delay,
.illus-scene .spark-twinkle,
.illus-scene .pop-card-1,
.illus-scene .pop-card-2,
.illus-scene .illus-bar,
.illus-scene .illus-wave,
.illus-scene .illus-doc-drift,
.illus-scene .bg-shape-drift,
.illus-scene .bg-shape-spin {
    transform-box: fill-box;
}

.illus-scene.is-active .bg-shape-drift {
    transform-origin: 50% 50%;
    animation: bgShapeDrift 6.5s ease-in-out infinite;
}

.illus-scene.is-active .bg-shape-spin {
    transform-origin: 50% 50%;
    animation: bgShapeSpin 26s linear infinite;
}

@keyframes bgShapeDrift {
    0%, 100% { transform: translate(0px, 0px) scale(1); }
    50% { transform: translate(4px, -6px) scale(1.025); }
}

@keyframes bgShapeSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.illus-scene.is-active .char-breathe {
    transform-origin: 50% 100%;
    animation: charBreathe 3.8s ease-in-out infinite;
}

.illus-scene.is-active .char-head {
    transform-origin: 50% 92%;
    animation: charHeadBob 3.8s ease-in-out infinite;
}

.illus-scene.is-active .char-arm-l {
    transform-origin: 20% 15%;
    animation: charArmLeft 3.2s ease-in-out infinite;
}

.illus-scene.is-active .char-arm-r {
    transform-origin: 14% 20%;
    animation: charArmRight 3s ease-in-out infinite;
}

.illus-scene.is-active .float-slow {
    transform-origin: 50% 50%;
    animation: illusFloat 3.8s ease-in-out infinite;
}

.illus-scene.is-active .float-delay {
    transform-origin: 50% 50%;
    animation: illusFloat 3.6s 0.6s ease-in-out infinite;
}

.illus-scene.is-active .spark-twinkle {
    transform-origin: 50% 50%;
    animation: sparkTwinkle 2.4s ease-in-out infinite;
}

.illus-scene.is-active .spark-twinkle--2 {
    animation-delay: 0.8s;
}

.illus-scene.is-active .pop-card-1 {
    transform-origin: 50% 50%;
    opacity: 0;
    animation: illusPopIn 0.55s 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.illus-scene.is-active .pop-card-2 {
    transform-origin: 50% 50%;
    opacity: 0;
    animation: illusPopIn 0.55s 1.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.illus-scene.is-active .illus-bar {
    transform-origin: 50% 100%;
    animation: illusBarGrow 0.85s 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.illus-scene.is-active .illus-bar--2 { animation-delay: 0.8s; }
.illus-scene.is-active .illus-bar--3 { animation-delay: 0.95s; }
.illus-scene.is-active .illus-bar--4 { animation-delay: 1.1s; }

.illus-scene.is-active .illus-wave {
    transform-origin: 50% 50%;
    animation: illusWave 1.3s ease-in-out infinite;
}

.illus-scene.is-active .illus-wave--2 { animation-delay: 0.2s; }
.illus-scene.is-active .illus-wave--3 { animation-delay: 0.4s; }

.illus-scene.is-active .illus-doc-drift {
    transform-origin: 50% 50%;
    animation: docDrift 3.4s ease-in-out infinite;
}

@keyframes charBreathe {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.012); }
}

@keyframes charHeadBob {
    0%, 100% { transform: rotate(0deg); }
    45% { transform: rotate(2.5deg); }
    78% { transform: rotate(-1.6deg); }
}

@keyframes charArmLeft {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-2.5deg); }
}

@keyframes charArmRight {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-3.5deg); }
}

@keyframes illusFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
}

@keyframes sparkTwinkle {
    0%, 100% { opacity: 0.45; transform: scale(0.86); }
    50% { opacity: 1; transform: scale(1.16); }
}

@keyframes illusPopIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes illusBarGrow {
    from { transform: scaleY(0.15); opacity: 0.45; }
    to { transform: scaleY(1); opacity: 1; }
}

@keyframes illusWave {
    0%, 100% { opacity: 0.4; transform: scaleY(0.55); }
    50% { opacity: 1; transform: scaleY(1.12); }
}

@keyframes docDrift {
    0%, 100% { transform: translate(0px, 0px) rotate(-3deg); }
    50% { transform: translate(8px, -9px) rotate(2deg); }
}

/* Indicador minimalista inferior de escenas */
.illus-controls {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}

.illus-pill {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(17, 18, 22, 0.65);
    color: #a1a1aa;
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 5px 13px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.illus-pill:hover {
    color: #f4f4f5;
    border-color: rgba(255, 255, 255, 0.22);
}

.illus-pill__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

.illus-pill.is-active {
    border-color: rgba(20, 184, 166, 0.48);
    background: rgba(20, 184, 166, 0.12);
    color: #f4f4f5;
}

.illus-pill.is-active .illus-pill__dot {
    background: #14b8a6;
    box-shadow: 0 0 8px rgba(20, 184, 166, 0.9);
}

/* Responsive */
@media (max-width: 980px) {
    .hero__grid {
        grid-template-columns: 1fr;
    }

    .hero__stage,
    .illus-stage {
        min-height: 390px;
        margin-top: 8px;
    }

    .illus-viewport,
    .illus-svg {
        height: 350px;
    }
}

@media (max-width: 600px) {
    .illus-viewport,
    .illus-svg {
        height: 300px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .char-breathe,
    .char-head,
    .char-arm-l,
    .char-arm-r,
    .float-slow,
    .float-delay,
    .spark-twinkle,
    .illus-bar,
    .illus-wave,
    .illus-doc-drift,
    .bg-shape-drift,
    .bg-shape-spin {
        animation: none !important;
    }

    .illus-scene.is-active .pop-card-1,
    .illus-scene.is-active .pop-card-2 {
        opacity: 1;
        animation: none !important;
    }
}
