/* ============================================
   Teranet - Hero Background Animation
   Circuit Board / Network Pattern
   ============================================ */

#hero {
    position: relative;
    overflow: hidden;
}

/* Floating glow orbs */
.hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: floatOrb 20s ease-in-out infinite;
}

.hero-glow--1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(
        circle,
        rgba(41, 182, 246, 0.3) 0%,
        transparent 70%
    );
    top: -20%;
    left: -10%;
    animation-delay: 0s;
}

.hero-glow--2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(
        circle,
        rgba(185, 134, 255, 0.25) 0%,
        transparent 70%
    );
    top: 20%;
    right: -10%;
    animation-delay: -5s;
}

.hero-glow--3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(
        circle,
        rgba(0, 212, 255, 0.2) 0%,
        transparent 70%
    );
    bottom: -10%;
    left: 30%;
    animation-delay: -10s;
}

@keyframes floatOrb {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -30px) scale(1.05);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }
    75% {
        transform: translate(-30px, -20px) scale(1.02);
    }
}

/* Circuit board lines */
.circuit-lines {
    position: absolute;
    inset: 0;
    opacity: 0.3;
    pointer-events: none;
}

.circuit-line {
    position: absolute;
    background: linear-gradient(
        90deg,
        rgba(41, 182, 246, 0.15) 0%,
        transparent 50%
    );
}

/* Animated nodes */
.network-node {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--electric-blue);
    border-radius: 50%;
    opacity: 0;
    box-shadow: 0 0 10px var(--electric-blue);
    animation: nodePulse 3s ease-in-out infinite;
}

.network-node::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(41, 182, 246, 0.4) 0%,
        transparent 60%
    );
    animation: nodePulseGlow 3s ease-in-out infinite;
    animation-delay: 0.5s;
}

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

@keyframes nodePulseGlow {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0);
    }
    50% {
        transform: translate(-50%, -50%) scale(2.5);
    }
}

/* Connecting lines animation */
.connection-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(41, 182, 246, 0.3) 50%,
        transparent 100%
    );
    opacity: 0;
    animation: lineDraw 1.5s ease-in-out infinite;
}

@keyframes lineDraw {
    0% {
        opacity: 0;
        transform: scaleX(0);
    }
    50% {
        opacity: 1;
        transform: scaleX(0.8);
    }
    100% {
        opacity: 0;
        transform: scaleX(0);
    }
}

/* Particle system */
.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--neon-blue);
    border-radius: 50%;
    opacity: 0;
    box-shadow: 0 0 15px var(--neon-blue);
    animation: particleFloat 4s ease-in-out infinite;
}

.particle::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(0, 212, 255, 0.6) 0%,
        transparent 60%
    );
    animation: particleGlow 2s ease-in-out infinite;
    animation-delay: 0.5s;
}

@keyframes particleFloat {
    0%, 100% {
        opacity: 0;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-100px);
    }
}

@keyframes particleGlow {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.8;
    }
}

/* Grid pattern overlay */
.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(41, 182, 246, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(41, 182, 246, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    opacity: 0.6;
}

/* Animated gradient sweep */
.gradient-sweep {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        transparent 0%,
        rgba(41, 182, 246, 0.1) 25%,
        rgba(185, 134, 255, 0.1) 50%,
        rgba(41, 182, 246, 0.1) 75%,
        transparent 100%
    );
    background-size: 200% 200%;
    animation: gradientSweep 15s ease infinite;
    pointer-events: none;
}

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

/* Holographic effect */
.holo-effect {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            ellipse at center,
            rgba(41, 182, 246, 0.05) 0%,
            transparent 60%
        ),
        linear-gradient(
            45deg,
            transparent 40%,
            rgba(41, 182, 246, 0.03) 50%,
            transparent 60%
        );
    pointer-events: none;
}

/* Scanlines */
.scanlines {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 2px,
            rgba(41, 182, 246, 0.02) 3px
        );
    pointer-events: none;
    opacity: 0.5;
}

/* Vignette */
.vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at center,
        transparent 50%,
        rgba(10, 22, 40, 0.5) 100%
    );
    pointer-events: none;
}

/* Breathing effect overlay */
.breathing-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at center,
        rgba(41, 182, 246, 0.05) 0%,
        transparent 50%
    );
    animation: breathe 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes breathe {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-glow--1 {
        width: 400px;
        height: 400px;
    }

    .hero-glow--2 {
        width: 350px;
        height: 350px;
    }

    .hero-glow--3 {
        width: 300px;
        height: 300px;
    }

    .grid-overlay {
        background-size: 30px 30px;
    }
}
