/* ==========================================================================
   ULTIMATE CINEMATIC STICKY SCROLL STORY WITH CHARACTER ANIMATIONS
   ========================================================================== */

/* SYSTEM 1: PERSISTENT BACKGROUND VIDEO ENGINE */
.video-background {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.video-background video,
.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    border: none;
    outline: none;
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

/* Crisp Radial Lighting Mask & High-Clarity Overlay */
.video-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: 
        radial-gradient(circle at 50% 50%, rgba(5, 11, 24, 0.18) 0%, rgba(5, 11, 24, 0.65) 75%, rgba(5, 11, 24, 0.92) 100%),
        linear-gradient(180deg, rgba(5, 11, 24, 0.45) 0%, rgba(5, 11, 24, 0.15) 40%, rgba(5, 11, 24, 0.75) 100%);
}

/* Canvas Particle Network Layer */
.hero-particle-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

/* Cyber HUD Corner Brackets */
.cyber-hud-corner {
    position: absolute;
    width: 32px;
    height: 32px;
    border: 2px solid #00c2ff;
    pointer-events: none;
    z-index: 4;
    box-shadow: 0 0 15px rgba(0, 194, 255, 0.6);
    animation: cornerHudPulse 4s ease-in-out infinite alternate;
}

.corner-tl { top: 90px; left: 24px; border-right: none; border-bottom: none; }
.corner-tr { top: 90px; right: 24px; border-left: none; border-bottom: none; }
.corner-bl { bottom: 24px; left: 24px; border-right: none; border-top: none; }
.corner-br { bottom: 24px; right: 24px; border-left: none; border-top: none; }

@keyframes cornerHudPulse {
    0% { opacity: 0.4; border-color: rgba(0, 194, 255, 0.4); transform: scale(0.95); }
    100% { opacity: 1; border-color: rgba(0, 255, 200, 0.9); transform: scale(1.05); }
}

/* Cyber Telemetry Status Bar */
.cyber-telemetry-bar {
    position: absolute;
    top: 92px;
    right: 70px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 5;
    pointer-events: none;
}

.cyber-telemetry-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(13, 22, 43, 0.7);
    border: 1px solid rgba(0, 194, 255, 0.3);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    font-weight: 700;
    color: #00c2ff;
    letter-spacing: 1px;
    backdrop-filter: blur(10px);
}

.telemetry-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00ffc8;
    box-shadow: 0 0 8px #00ffc8;
    animation: telemetryBlink 1.5s infinite;
}

@keyframes telemetryBlink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.2; transform: scale(0.6); }
}

/* Futuristic Floating Holographic Badges */
.hero-floating-badges-wrap {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
}

.hero-floating-badge {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    background: rgba(13, 22, 43, 0.78);
    border: 1px solid rgba(0, 194, 255, 0.45);
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 194, 255, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    pointer-events: auto;
    cursor: default;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
    animation: heroBadgeFloat 6s ease-in-out infinite alternate;
}

.hero-floating-badge:hover {
    transform: translateY(-8px) scale(1.06) !important;
    border-color: #00c2ff;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.75), 0 0 35px rgba(0, 194, 255, 0.6) !important;
}

.badge-top-right {
    top: 24%;
    right: 8%;
    animation-delay: 0s;
}

.badge-bottom-left {
    bottom: 22%;
    left: 6%;
    animation-delay: -2s;
}

.badge-bottom-right {
    bottom: 18%;
    right: 12%;
    animation-delay: -4s;
}

.hfb-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(0, 194, 255, 0.2), rgba(124, 77, 255, 0.25));
    border: 1px solid rgba(0, 194, 255, 0.4);
    color: #00c2ff;
    font-size: 1.1rem;
}

.hfb-text {
    display: flex;
    flex-direction: column;
}

.hfb-text strong {
    font-size: 0.92rem;
    color: #ffffff;
    font-family: var(--font-primary, 'Poppins', sans-serif);
}

.hfb-text span {
    font-size: 0.72rem;
    color: #a8b2d1;
    font-family: var(--font-secondary, 'Inter', sans-serif);
}

@keyframes heroBadgeFloat {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-14px) rotate(1deg); }
    100% { transform: translateY(6px) rotate(-1deg); }
}

@media (max-width: 992px) {
    .cyber-hud-corner, .cyber-telemetry-bar, .hero-floating-badges-wrap { display: none; }
}

/* Laser Scanner Beam & Cursor Light Aura */
.cyber-scanner-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 194, 255, 0.2) 20%, #00c2ff 50%, rgba(0, 194, 255, 0.2) 80%, transparent 100%);
    box-shadow: 0 0 15px #00c2ff, 0 0 30px rgba(0, 194, 255, 0.6);
    z-index: 3;
    pointer-events: none;
    animation: cyberScanSweep 7s ease-in-out infinite alternate;
}

@keyframes cyberScanSweep {
    0% { top: 0%; opacity: 0.2; }
    50% { opacity: 0.85; }
    100% { top: 100%; opacity: 0.2; }
}

.hero-cursor-aura {
    position: absolute;
    width: 450px;
    height: 450px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 194, 255, 0.16) 0%, rgba(10, 61, 255, 0.08) 40%, transparent 75%);
    pointer-events: none;
    z-index: 2;
    transform: translate(-50%, -50%);
    transition: opacity 0.5s ease, transform 0.1s ease-out;
    mix-blend-mode: screen;
}

/* Ambient Cyber Spotlight Glow */
.hero-glow-spotlight {
    position: absolute;
    top: 20%;
    left: 5%;
    width: 650px;
    height: 650px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 194, 255, 0.24) 0%, rgba(10, 61, 255, 0.12) 45%, transparent 75%);
    filter: blur(80px);
    pointer-events: none;
    z-index: 1;
    animation: ambientSpotlightGlow 6s ease-in-out infinite alternate;
}

@keyframes ambientSpotlightGlow {
    0% { transform: scale(1) translateY(0); opacity: 0.7; }
    100% { transform: scale(1.15) translateY(-20px); opacity: 1; }
}

/* SYSTEM 2: TALL CONTAINER + STICKY VIEWPORT STAGE ARCHITECTURE */
@media screen and (min-width: 993px) {
    .hero-section.story-container[data-cinematic-sticky="true"],
    .story-container[data-cinematic-sticky="true"] {
        height: 200vh !important;
        min-height: 200vh !important;
        position: relative !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        display: block !important;
    }

    .story-container[data-cinematic-sticky="true"] .story-stage {
        position: sticky !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        display: flex !important;
        align-items: center !important;
        overflow: hidden !important;
        z-index: 2 !important;
    }

    .story-viewport {
        position: relative;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        padding-top: 80px; /* Offset below fixed top navbar */
        box-sizing: border-box;
        z-index: 2;
    }

    .story-states-wrapper {
        position: relative;
        width: 100%;
        min-height: 420px;
        display: flex;
        align-items: center;
    }

    /* Discrete Story Content States - Shifted Lower for All Slides */
    .story-state {
        position: absolute;
        top: calc(50% + 85px);
        left: 0;
        width: 100%;
        max-width: 950px;
        opacity: 0;
        pointer-events: none;
        z-index: 1;
        transform: translateY(-44%);
        transition: opacity 0.22s ease-out,
                    transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
        will-change: opacity, transform;
    }

    .story-state .hero-title {
        font-size: clamp(2.4rem, 4.2vw, 3.8rem) !important;
        line-height: 1.18 !important;
        max-width: 1080px !important;
        margin-top: 0.25rem !important;
        margin-bottom: 1.1rem !important;
        word-break: break-word !important;
        background: transparent !important;
        -webkit-background-clip: initial !important;
        background-clip: initial !important;
        -webkit-text-fill-color: initial !important;
        color: inherit !important;
    }

    .story-state .hero-subtitle {
        max-width: 880px !important;
        font-size: clamp(1.15rem, 1.65vw, 1.5rem) !important;
        line-height: 1.5 !important;
        margin-bottom: 1.6rem !important;
    }

    .story-state.state-active {
        opacity: 1;
        pointer-events: auto;
        z-index: 10;
        transform: translateY(-50%);
    }

    .story-state.state-exit-up {
        opacity: 0;
        pointer-events: none;
        transform: translateY(-56%);
    }

    .story-state.state-exit-down {
        opacity: 0;
        pointer-events: none;
        transform: translateY(-44%);
    }

    /* Apple / Stripe-Style Masked Slide-Up Text Animation */
    .hero-title .word-mask {
        display: inline-block;
        overflow: hidden;
        vertical-align: bottom;
        padding-bottom: 0.08em;
    }

    .hero-title .word-inner {
        display: inline-block;
        transform: translate3d(0, 115%, 0) rotate(3deg);
        opacity: 0;
        background: linear-gradient(110deg, #ffffff 0%, #e2f1ff 40%, #00c2ff 75%, #ffffff 100%);
        background-size: 200% auto;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        filter: none !important;
        transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1),
                    opacity 0.45s ease-out;
        will-change: transform, opacity;
        backface-visibility: hidden;
        animation: textGradientSweep 5s ease-in-out infinite alternate;
    }

    /* Active Slide State - Ultra-Sleek Luxury Unclip & Slide Up */
    .story-state.state-active .hero-title .word-inner {
        transform: translate3d(0, 0%, 0) rotate(0deg);
        opacity: 1;
    }

    /* Down Scroll Exit Words */
    .story-state.state-exit-up .hero-title .word-inner {
        transform: translate3d(0, -115%, 0) rotate(-3deg);
        opacity: 0;
    }

    /* Up Scroll Exit Words */
    .story-state.state-exit-down .hero-title .word-inner {
        transform: translate3d(0, 115%, 0) rotate(3deg);
        opacity: 0;
    }

    @keyframes textGradientSweep {
        0% {
            background-position: 0% 50%;
        }
        100% {
            background-position: 100% 50%;
        }
    }

    /* Motion Graphic Cyber Badges Above Titles */
    .hero-cyber-badge {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        background: rgba(0, 194, 255, 0.08);
        border: 1px solid rgba(0, 194, 255, 0.3);
        padding: 6px 14px;
        border-radius: 20px;
        font-size: 0.74rem;
        font-weight: 700;
        letter-spacing: 1.8px;
        color: #00c2ff;
        text-transform: uppercase;
        margin-bottom: 0.9rem;
        backdrop-filter: blur(10px);
        box-shadow: 0 0 18px rgba(0, 194, 255, 0.2);
        opacity: 0;
        transform: translateY(12px);
        transition: opacity 0.22s ease-out, transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    .story-state.state-active .hero-cyber-badge {
        opacity: 1;
        transform: translateY(0);
    }

    .hero-cyber-badge .pulse-dot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background-color: #00c2ff;
        box-shadow: 0 0 10px #00c2ff;
        animation: badgeDotPulse 1.8s ease-in-out infinite alternate;
    }

    @keyframes badgeDotPulse {
        0% { opacity: 0.5; transform: scale(0.85); }
        100% { opacity: 1; transform: scale(1.3); box-shadow: 0 0 14px #00c2ff; }
    }

    /* Synchronized Subtitle */
    .story-state .hero-subtitle {
        opacity: 0;
        transform: translateY(12px);
        transition: opacity 0.22s ease-out 0ms, transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) 0ms;
    }

    .story-state.state-active .hero-subtitle {
        opacity: 1;
        transform: translateY(0);
    }

    .story-state .hero-actions {
        opacity: 0;
        transform: translateY(10px);
        transition: opacity 0.22s ease-out 0ms, transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) 0ms;
    }

    .story-state.state-active .hero-actions {
        opacity: 1;
        transform: translateY(0);
    }

    .story-state .futuristic-hud-bar {
        opacity: 0;
        transform: translateY(-12px);
        transition: opacity 0.22s ease-out 0ms, transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) 0ms;
    }

    .story-state.state-active .futuristic-hud-bar {
        opacity: 1;
        transform: translateY(0);
    }

    /* Animated Scroll To Know More Hint */
    .story-state .hero-scroll-hint {
        margin-top: 1.8rem;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        opacity: 0;
        transform: translateY(12px);
        transition: opacity 0.22s ease-out 0ms, transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) 0ms;
    }

    .story-state.state-active .hero-scroll-hint {
        opacity: 0.95;
        transform: translateY(0);
    }

    .hero-scroll-hint .hint-text {
        font-size: 0.76rem;
        font-weight: 600;
        letter-spacing: 2.5px;
        text-transform: uppercase;
        color: rgba(226, 232, 240, 0.8);
    }

    .hero-scroll-hint .hint-icon {
        font-size: 1.1rem;
        color: #00c2ff;
        filter: drop-shadow(0 0 8px rgba(0, 194, 255, 0.8));
        animation: scrollHintBounce 2s ease-in-out infinite;
    }

    @keyframes scrollHintBounce {
        0%, 100% {
            transform: translateY(0);
            opacity: 0.7;
        }
        50% {
            transform: translateY(7px);
            opacity: 1;
        }
    }
}

/* State Indicator Dots */
.cinematic-indicator-bar {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.indicator-dots {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(13, 22, 43, 0.5);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
}

.indicator-dots .indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.indicator-dots .indicator-dot.active {
    width: 22px;
    border-radius: 10px;
    background: #00c2ff;
    box-shadow: 0 0 10px rgba(0, 194, 255, 0.8);
}

/* Interactive Cyber Canvas Background */
.hero-cyber-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    opacity: 0.85;
}

/* Holographic Live Telemetry Widget (Right-aligned HUD Card) */
.hero-telemetry-widget {
    position: absolute;
    right: 4%;
    top: 52%;
    transform: translateY(-50%);
    z-index: 10;
    pointer-events: auto;
}

.telemetry-glass-card {
    width: 280px;
    padding: 1.2rem;
    background: linear-gradient(135deg, rgba(11, 22, 44, 0.75) 0%, rgba(5, 11, 24, 0.88) 100%);
    border: 1px solid rgba(0, 194, 255, 0.35);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 194, 255, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    transition: all 0.4s ease;
}

.telemetry-glass-card:hover {
    border-color: rgba(0, 194, 255, 0.7);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 45px rgba(0, 194, 255, 0.4);
    transform: translateY(-54%);
}

.telemetry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.telemetry-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #cbd5e1;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.glow-icon {
    color: #00c2ff;
    filter: drop-shadow(0 0 6px #00c2ff);
}

.telemetry-live-badge {
    font-size: 0.68rem;
    font-weight: 700;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 5px;
}

.telemetry-waveform-wrap {
    width: 100%;
    height: 40px;
    background: rgba(4, 9, 20, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(0, 194, 255, 0.15);
    overflow: hidden;
    margin-bottom: 1rem;
}

.telemetry-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 8px 10px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

.stat-val {
    font-size: 0.92rem;
    font-weight: 700;
}

.stat-lbl {
    font-size: 0.65rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.text-cyan { color: #00c2ff; }
.text-emerald { color: #10b981; }
.text-purple { color: #a855f7; }
.text-amber { color: #f59e0b; }

@media screen and (max-width: 1280px) {
    .hero-telemetry-widget {
        display: none !important;
    }
}

/* RESPONSIVE & ACCESSIBILITY OPTIMIZATIONS */
@media screen and (max-width: 992px) {
    .story-container[data-cinematic-sticky="true"] {
        height: auto !important;
        position: relative !important;
        padding: 130px 0 60px !important;
    }

    .story-stage {
        height: auto !important;
        position: relative !important;
        padding: 0 !important;
    }

    .story-viewport {
        position: relative !important;
    }

    .story-states-wrapper {
        min-height: auto !important;
    }

    .story-state {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        margin-bottom: 2rem;
    }

    .story-state .hero-title .char {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }

    .story-state .hero-subtitle,
    .story-state .hero-actions,
    .story-state .futuristic-hud-bar {
        opacity: 1 !important;
        transform: none !important;
    }

    .story-state:not(.state-active) {
        display: none !important;
    }

    .cinematic-indicator-bar {
        display: none !important;
    }

    .hero-cursor-aura {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .video-background video, .cyber-scanner-line, .hero-title, .futuristic-hud-bar, .hero-title .char {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }
}
