/* Hubr 2.0: Netflix-Style Cinematic Intro System */

:root {
    --intro-bg: #050505;
    --hubr-neon: #BF00FF;
    --hubr-red: #FF0055;
    --white: #FFFFFF;
}

#cinematic-intro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--intro-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100000; /* Extremely high to overrule everything */
    overflow: hidden;
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), transform 1s ease-in-out;
}

#cinematic-intro.active, #cinematic-intro.intro-finished {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.1);
}

.intro-logo-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10002;
    pointer-events: none;
}

.intro-letter {
    font-size: clamp(80px, 12vw, 180px);
    font-weight: 900;
    color: var(--hubr-neon);
    font-family: 'Manrope', 'Inter', sans-serif;
    letter-spacing: -0.05em;
    position: relative;
    filter: drop-shadow(0 0 30px rgba(191, 0, 255, 0.5));
    opacity: 0;
    display: inline-block;
    user-select: none;
    /* Sequential triggering via l1-l4 classes */
    animation: n-logo-hit 1.2s cubic-bezier(0.8, 0, 0.2, 1) forwards;
}

.intro-letter.l1 { animation-delay: 0.5s; }
.intro-letter.l2 { animation-delay: 0.65s; }
.intro-letter.l3 { animation-delay: 0.8s; }
.intro-letter.l4 { animation-delay: 0.95s; }

.intro-enter-btn {
    position: absolute;
    bottom: 20%;
    padding: 15px 40px;
    background: rgba(191, 0, 255, 0.1);
    border: 1px solid var(--hubr-neon);
    color: white;
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    letter-spacing: 4px;
    border-radius: 4px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    z-index: 100010;
    pointer-events: all !important; /* Force pointer events */
    /* Appear after logo hit (0.5s delay + 1.2s anim = 1.7s) */
    animation: fadeIn 1s ease-out 1s both;
}

.intro-enter-btn:hover {
    background: var(--hubr-neon);
    box-shadow: 0 0 30px var(--hubr-neon);
}

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

@keyframes n-logo-hit {
    0% {
        transform: scale(0.6) perspective(1000px) rotateX(10deg);
        opacity: 0;
        filter: drop-shadow(0 0 0px var(--hubr-neon));
    }
    40% {
        transform: scale(1.1) perspective(1000px) rotateX(0deg);
        opacity: 1;
        filter: drop-shadow(0 0 50px var(--hubr-neon));
    }
    100% {
        transform: scale(1) perspective(1000px) rotateX(0deg);
        opacity: 1;
        filter: drop-shadow(0 0 20px var(--hubr-red));
        color: var(--hubr-red);
    }
}

/* Red Beam Effect */
.intro-beam {
    position: absolute;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, transparent, var(--hubr-red), transparent);
    animation: beam-sweep 2s infinite linear;
    opacity: 0.3;
}

@keyframes beam-sweep {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* Ta-dum Ripple */
.intro-ripple {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 1px solid var(--hubr-neon);
    border-radius: 50%;
    animation: ta-dum-ripple 1.5s ease-out forwards;
    opacity: 0;
}

@keyframes ta-dum-ripple {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 0; }
}

/* Audio-Sync Pulse Animations */
@keyframes audioPulse {
    0% { box-shadow: 0 0 0 0 rgba(57, 255, 20, 0.4); transform: scale(1); }
    50% { box-shadow: 0 0 20px 10px rgba(57, 255, 20, 0); transform: scale(1.05); }
    100% { box-shadow: 0 0 0 0 rgba(57, 255, 20, 0); transform: scale(1); }
}

@keyframes neonPulse {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.5) drop-shadow(0 0 10px var(--neon-purple)); }
    100% { filter: brightness(1); }
}

.audio-active {
    animation: audioPulse 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.neon-active {
    animation: neonPulse 0.5s ease-out;
}

/* Loaded State */
.intro-finished {
    opacity: 0;
    pointer-events: none;
}

/* Z-Engine Cinematic Processing Overlay */
#z-engine-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 5, 5, 0.95);
    z-index: 10000;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(20px);
    font-family: 'Manrope', sans-serif;
}

.z-scanline {
    position: absolute;
    width: 100%;
    height: 2px;
    background: rgba(191, 0, 255, 0.2);
    box-shadow: 0 0 15px var(--hubr-neon);
    animation: scanline-move 3s linear infinite;
    pointer-events: none;
}

@keyframes scanline-move {
    0% { top: -5%; }
    100% { top: 105%; }
}

.z-processing-text {
    font-size: 14px;
    font-weight: 800;
    color: var(--hubr-neon);
    letter-spacing: 4px;
    margin-bottom: 30px;
    text-transform: uppercase;
    animation: pulse-op 1s infinite alternate;
}

@keyframes pulse-op {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

.z-terminal-output {
    width: 80%;
    max-width: 600px;
    height: 120px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(191, 0, 255, 0.2);
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    overflow: hidden;
    margin-bottom: 40px;
}

/* Glitch Animation for AI Scan */
.glitch-layer {
    position: relative;
    animation: glitch-anim 0.2s infinite;
}

@keyframes glitch-anim {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}
