/* ==========================================================================
   CINEMATIC HERO & SCROLLYTELLING STYLES (VISIBLE AHORA)
   Ecosistema Tecnológico Inmersivo - Three.js + GSAP ScrollTrigger
   ========================================================================== */

#cinematic-hero-stage {
    position: relative;
    width: 100%;
    margin-top: -72px;
    /* Se proyecta bajo el header glass para inmersión cinematográfica */
    min-height: 220vh;
    background-color: #010b12;
    background-image:
        radial-gradient(circle at 72% 48%, rgba(0, 105, 114, 0.24) 0%, rgba(0, 40, 58, 0.14) 32%, transparent 62%),
        radial-gradient(circle at 18% 55%, rgba(0, 51, 69, 0.22) 0%, transparent 55%),
        linear-gradient(180deg, #010b12 0%, #021420 55%, #010b12 100%);
    color: #ffffff;
    overflow: visible;
}

@media (max-width: 768px) {
    #cinematic-hero-stage {
        min-height: 150vh;
    }
}

/* Contenedor sticky para el viewport de 100vh */
.hero-sticky-viewport {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

/* Canvas WebGL acelerado por GPU */
#va-hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    outline: none;
    pointer-events: auto;
    touch-action: pan-y;
    /* Permite scroll táctil natural sin trabas */
}

/* Viñeta ambiental para fundir bordes y proteger contraste */
.hero-ambient-vignette {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, transparent 40%, rgba(0, 8, 15, 0.75) 100%);
}

.hero-bottom-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 140px;
    z-index: 12;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent 0%, #00080f 80%, #f8f9fc 100%);
}

/* Capa DOM Asimétrica estilo 3WAY.AI */
.hero-dom-layer {
    position: absolute;
    inset: 0;
    z-index: 25;
    pointer-events: none;
    display: flex;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 5rem 2rem 2rem 3rem;
}

.hero-story-container {
    position: relative;
    width: 100%;
    max-width: 580px;
    height: 420px;
    display: flex;
    align-items: center;
}

.story-step {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%) translateY(24px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.story-step.is-active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) translateY(0);
}

.story-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.9rem;
    border-radius: 9999px;
    background: rgba(0, 105, 114, 0.22);
    border: 1px solid rgba(0, 240, 255, 0.35);
    color: #00f0ff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
}

.story-heading {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: clamp(2.4rem, 4.2vw, 3.8rem);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -0.035em;
    color: #ffffff;
    margin-bottom: 1.25rem;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.7);
}

.story-heading-sm {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: clamp(1.9rem, 3.4vw, 2.7rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: #ffffff;
    margin-bottom: 1.25rem;
    text-shadow: 0 4px 25px rgba(0, 0, 0, 0.7);
}

.story-sub {
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 1.75rem;
    font-weight: 400;
    max-width: 520px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.story-list {
    list-style: none;
    padding: 0;
    margin: 1.25rem 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.story-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.15rem;
    color: #f1f5f9;
    font-weight: 500;
}

.story-list .bullet {
    color: #00f0ff;
    font-weight: 800;
    font-size: 1.25rem;
}

.story-scroll-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(0, 240, 255, 0.85);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    margin-top: 1.5rem;
}

.story-mouse {
    width: 20px;
    height: 30px;
    border: 2px solid rgba(0, 240, 255, 0.5);
    border-radius: 10px;
    position: relative;
    display: inline-block;
}

.story-mouse-wheel {
    width: 3px;
    height: 5px;
    background: #00f0ff;
    border-radius: 2px;
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll-wheel 1.8s ease-in-out infinite;
}

@media (max-width: 768px) {
    .hero-dom-layer {
        padding: 5rem 1.25rem 2rem 1.25rem;
        justify-content: flex-start;
        align-items: flex-start;
    }
    .hero-story-container {
        max-width: 100%;
        height: auto;
        min-height: 320px;
    }
    .story-step {
        top: 0;
        transform: translateY(15px);
    }
    .story-step.is-active {
        transform: translateY(0);
    }
    .story-heading {
        font-size: 2.15rem;
    }
    .story-heading-sm {
        font-size: 1.75rem;
    }
}

/* Tipografía de alta fidelidad */
.hero-pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 105, 114, 0.22);
    border: 1px solid rgba(0, 229, 255, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #00f0ff;
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.15);
}

.hero-headline {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: #ffffff;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
}

.text-gradient-cyan {
    background: linear-gradient(135deg, #00f0ff 0%, #00a2b8 60%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 16px rgba(0, 240, 255, 0.4));
}

.hero-subheadline {
    color: #e2e8f0;
    font-weight: 600;
    line-height: 1.5;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

/* Botones comerciales de alta conversión */
.hero-cta-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    background: #ff5500;
    color: #ffffff;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    padding: 0.95rem 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px -5px rgba(255, 85, 0, 0.5), 0 0 30px rgba(255, 85, 0, 0.25);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-cta-primary:hover {
    background: #e64a00;
    transform: translateY(-2px);
    box-shadow: 0 15px 35px -5px rgba(255, 85, 0, 0.6), 0 0 45px rgba(255, 85, 0, 0.35);
}

.hero-cta-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.95rem 1.75rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: all 0.25s ease;
    text-decoration: none;
}

.hero-cta-secondary:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(0, 240, 255, 0.5);
    color: #00f0ff;
    transform: translateY(-2px);
}

/* Indicador de Desplazamiento (Scroll hint) */
.hero-scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    z-index: 28;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.hero-scroll-mouse {
    width: 22px;
    height: 34px;
    border: 2px solid rgba(0, 240, 255, 0.5);
    border-radius: 12px;
    position: relative;
}

.hero-scroll-wheel {
    width: 3px;
    height: 6px;
    background: #00f0ff;
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll-wheel 1.8s ease-in-out infinite;
}

@keyframes scroll-wheel {
    0% {
        transform: translate(-50%, 0);
        opacity: 1;
    }

    80% {
        transform: translate(-50%, 12px);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, 0);
        opacity: 0;
    }
}

/* Banner de punchline durante el scrollytelling */
.hero-punchline-banner {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 26;
    pointer-events: none;
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    width: 90%;
    max-width: 600px;
}

.hero-punchline-banner.is-active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.punchline-badge {
    background: rgba(0, 26, 38, 0.85);
    border: 1px solid rgba(0, 229, 255, 0.35);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 0.75rem 1.75rem;
    border-radius: 9999px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(0, 229, 255, 0.2);
}

/* Fallback Estático para navegadores sin WebGL o con prefers-reduced-motion */
#hero-static-fallback {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 30;
    background: #00080f;
    align-items: center;
    justify-content: center;
}

.webgl-fallback #hero-static-fallback {
    display: flex;
}

.webgl-fallback #va-hero-canvas,
.webgl-fallback .hero-scroll-indicator {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {
    #hero-static-fallback {
        display: flex !important;
    }

    #va-hero-canvas,
    .hero-scroll-indicator {
        display: none !important;
    }
}

.fallback-image-wrap {
    position: relative;
    max-width: 900px;
    width: 100%;
    padding: 1rem;
    margin: 0 auto;
}

.fallback-image-wrap img {
    width: 100%;
    height: auto;
    border-radius: 1.5rem;
    border: 1px solid rgba(0, 229, 255, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 50px rgba(0, 229, 255, 0.25);
}

/* Barra de rendimiento en desarrollo (FPS Monitor - Solo activo con ?debug=true) */
#hero-perf-badge {
    display: none;
    position: absolute;
    top: 5rem;
    right: 1.5rem;
    z-index: 50;
    background: rgba(0, 15, 25, 0.85);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: #00f0ff;
    padding: 0.3rem 0.65rem;
    border-radius: 0.5rem;
    font-family: monospace;
    font-size: 0.7rem;
    pointer-events: none;
    opacity: 0.85;
}

#hero-perf-badge.is-visible {
    display: block;
}

/* ==========================================================================
   CÁPSULAS FLOTANTES DE TELEMETRÍA 3D (ESFERA GEODÉSICA NEURONAL)
   ========================================================================== */
.hero-telemetry-layer {
    position: absolute;
    inset: 0;
    z-index: 22;
    pointer-events: none;
    overflow: hidden;
}

.hero-telemetry-pill {
    position: absolute;
    top: 0;
    left: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 1.05rem 0.55rem 0.65rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, rgba(8, 28, 42, 0.78) 0%, rgba(2, 16, 26, 0.88) 100%);
    border: 1px solid rgba(0, 229, 255, 0.22);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow:
        0 14px 36px rgba(0, 0, 0, 0.55),
        0 0 24px rgba(0, 229, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
    font-family: "Inter", "Plus Jakarta Sans", sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
    text-decoration: none;
    pointer-events: auto;
    will-change: transform, opacity;
    opacity: 0;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, opacity 0.6s ease;
}

.hero-telemetry-pill.is-ready {
    opacity: 1;
}

.hero-telemetry-pill:hover {
    border-color: rgba(0, 240, 255, 0.55);
    background: linear-gradient(135deg, rgba(10, 38, 56, 0.92) 0%, rgba(4, 22, 34, 0.95) 100%);
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.65),
        0 0 32px rgba(0, 229, 255, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.pill-icon-wrap {
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pill-icon-wrap .material-symbols-outlined {
    font-size: 1rem;
    font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 20;
}

.pill-icon-amber {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.25);
}

.pill-icon-cyan {
    background: rgba(0, 229, 255, 0.15);
    color: #00e5ff;
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.25);
}

.pill-icon-orange {
    background: rgba(255, 85, 0, 0.18);
    color: #ff6b1a;
    box-shadow: 0 0 14px rgba(255, 85, 0, 0.3);
}

.pill-label {
    color: #f8fafc;
}

.pill-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 9999px;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    margin-left: 0.15rem;
    animation: pill-pulse 2s ease-in-out infinite;
}

@keyframes pill-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.8); }
}

.webgl-fallback .hero-telemetry-layer {
    display: none !important;
}

@media (max-width: 768px) {
    .hero-telemetry-pill {
        font-size: 0.7rem;
        padding: 0.38rem 0.75rem 0.38rem 0.45rem;
        gap: 0.4rem;
    }
    .pill-icon-wrap {
        width: 1.35rem;
        height: 1.35rem;
    }
    .pill-icon-wrap .material-symbols-outlined {
        font-size: 0.85rem;
    }
}