/* 
   AMTIOG Tech - Premium Background Animation System 
   Inspired by High-End Tech Aesthetics (Nano-Banana style)
*/

/* Container */

#bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    /* Changed from -1 to 0 to sit inside hero correctly */
    pointer-events: none;
    background: transparent;
    /* Remove solid color to allow global layers */
}

/* Layer 1: Floating Gradient Orbs */
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    /* Heavy blur for soft atmospheric look */
    opacity: 0.4;
    animation: floatOrb 20s infinite ease-in-out alternate;
    will-change: transform, opacity;
}

.bg-orb-1 {
    top: -10%;
    left: 20%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(225, 6, 0, 0.15), transparent 70%);

    animation-duration: 25s;
}

.bg-orb-2 {
    bottom: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(225, 6, 0, 0.06), transparent 70%);

    /* Darker depth orb */
    animation-duration: 30s;
    animation-delay: -5s;
    opacity: 0.6;
}

.bg-orb-3 {
    top: 40%;
    left: 40%;
    width: 30vw;
    height: 30vw;
    background: radial-gradient(circle, rgba(225, 6, 0, 0.08), transparent 60%);
    animation-duration: 18s;
    animation-delay: -10s;
}

@keyframes floatOrb {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
}

/* Layer 2: Subtle Grid (Moving) */
.bg-grid {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    transform: perspective(500px) rotateX(20deg) rotateY(10deg) rotateZ(-5deg);
    opacity: 0.8;
    animation: panGrid 60s infinite linear;
    mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
}

@keyframes panGrid {
    0% {
        transform: perspective(500px) rotateX(20deg) rotateY(10deg) rotateZ(-5deg) translateY(0);
    }

    100% {
        transform: perspective(500px) rotateX(20deg) rotateY(10deg) rotateZ(-5deg) translateY(-60px);
    }

    /* Loop one tile size */
}

/* Layer 3: Particles (JS Injected usually, but here CSS mostly) */
.bg-particle {
    position: absolute;
    background: white;
    border-radius: 50%;
    width: 2px;
    height: 2px;
    opacity: 0;
    animation: driftParticle linear infinite;
}

@keyframes driftParticle {
    0% {
        transform: translateY(0);
        opacity: 0;
    }

    20% {
        opacity: 0.5;
    }

    80% {
        opacity: 0.5;
    }

    100% {
        transform: translateY(-110vh);
        opacity: 0;
    }
}

/* Layer 4: Noise Texture */
.bg-noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    pointer-events: none;
    z-index: 5;
    /* Above orbs, behind content */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .bg-orb {
        filter: blur(60px);
        opacity: 0.3;
        animation: none;
    }

    /* Disable heavy blur calculation animation */
    .bg-grid {
        animation: none;
    }

    .bg-particle {
        display: none;
    }
}