/* ======================================
   COOL BACKGROUND ANIMATIONS
   Multi-layered animation system for landing page
   ====================================== */

/* Main animated background container */
.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: #000;
}

/* ===== LAYER 1: Gradient Flow ===== */
.gradient-flow {
    display: none;
    /* User requested pure black background */
    position: absolute;
    inset: 0;
    opacity: 0;
    /* ... preserved for reference but hidden ... */
}

/* ... keyframes ... */

/* ===== LAYER 2: Neon Grid Wave ===== */
#grid-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background: #000;
    /* Force black background on canvas container */
    transition: opacity 0.5s ease;
}

/* Add scan line effect - REMOVED */
.neon-grid-wave::before {
    display: none;
}

/* Add glow pulse effect - REMOVED */
.neon-grid-wave::after {
    display: none;
}

@keyframes gridWave {
    0% {
        background-position: 0 0, 0 0, 0 0, 0 0;
    }

    100% {
        background-position: 40px 40px, 40px 40px, 80px 80px, 80px 80px;
    }
}

@keyframes gridPulse {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }
}

@keyframes gridSkew {

    0%,
    100% {
        transform: perspective(500px) rotateX(0deg);
    }

    25% {
        transform: perspective(500px) rotateX(1deg);
    }

    50% {
        transform: perspective(500px) rotateX(0deg);
    }

    75% {
        transform: perspective(500px) rotateX(-1deg);
    }
}

@keyframes scanlines {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(4px);
    }
}

@keyframes glowPulse {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

/* ===== LAYER 3: Particles Container ===== */
.particles-container {
    position: absolute;
    inset: 0;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(198, 255, 0, 0.8) 0%, rgba(198, 255, 0, 0) 70%);
    filter: blur(2px);
    animation: particleFloat linear infinite;
    pointer-events: none;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0) scale(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100px) translateX(var(--drift)) scale(1);
        opacity: 0;
    }
}

/* ===== LAYER 4: Geometric Shapes ===== */
.geometric-shapes {
    position: absolute;
    inset: 0;
}

.geo-shape {
    position: absolute;
    border: 1px solid rgba(198, 255, 0, 0.3);
    background: transparent;
    animation: shapeFloat linear infinite;
    transform-style: preserve-3d;
}

.geo-shape.cube {
    width: 80px;
    height: 80px;
    border-radius: 4px;
}

.geo-shape.pyramid {
    width: 0;
    height: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 70px solid rgba(198, 255, 0, 0.15);
    background: transparent;
}

.geo-shape.circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid rgba(157, 78, 255, 0.3);
}

@keyframes shapeFloat {
    0% {
        transform:
            translateY(100vh) translateX(0) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    90% {
        opacity: 0.6;
    }

    100% {
        transform:
            translateY(-200px) translateX(var(--drift)) rotateX(360deg) rotateY(360deg) rotateZ(180deg);
        opacity: 0;
    }
}

/* ===== LAYER 5: Glow Orbs ===== */
.glow-orbs {
    position: absolute;
    inset: 0;
}

.glow-orb {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: orbPulse 8s ease-in-out infinite;
}

.glow-orb.orb-1 {
    background: radial-gradient(circle, #C6FF00 0%, transparent 70%);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.glow-orb.orb-2 {
    background: radial-gradient(circle, #9D4EFF 0%, transparent 70%);
    bottom: -100px;
    right: -100px;
    animation-delay: 2s;
}

.glow-orb.orb-3 {
    background: radial-gradient(circle, #00FFFF 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 4s;
}

@keyframes orbPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.15;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.25;
    }
}

/* Additional particle glow for extra effect */
.particle.glow {
    box-shadow:
        0 0 10px rgba(198, 255, 0, 0.6),
        0 0 20px rgba(198, 255, 0, 0.4),
        0 0 30px rgba(198, 255, 0, 0.2);
}

/* Performance optimization - use GPU acceleration */
.animated-background,
.gradient-flow,
.neon-grid-wave,
.particles-container,
.geometric-shapes,
.glow-orbs,
.particle,
.geo-shape,
.glow-orb {
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Mobile Optimizations - Reduce complexity on smaller screens */
@media (max-width: 768px) {
    .glow-orb {
        width: 250px;
        height: 250px;
        filter: blur(50px);
    }

    .geo-shape {
        display: none;
        /* Hide geometric shapes on mobile for performance */
    }

    .particle {
        filter: blur(1px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .animated-background * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}