/* =========================================
   Deep Ocean — Animated Background
   Cosmic gradient mesh with subtle floating shapes
   ========================================= */

/* Base cosmic background */
.mesh-bg,
body {
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 50% at 15% 20%, rgba(6, 182, 212, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 85% 75%, rgba(139, 92, 246, 0.03) 0%, transparent 55%),
        radial-gradient(ellipse 40% 35% at 50% 50%, rgba(6, 182, 212, 0.02) 0%, transparent 50%);
}

.dark body::before,
html.dark body::before {
    background:
        radial-gradient(ellipse 60% 50% at 15% 20%, rgba(6, 182, 212, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 85% 75%, rgba(139, 92, 246, 0.04) 0%, transparent 55%),
        radial-gradient(ellipse 40% 35% at 50% 50%, rgba(6, 182, 212, 0.03) 0%, transparent 50%);
}

/* Subtle grid pattern */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0;
    background-image:
        linear-gradient(rgba(6, 182, 212, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6, 182, 212, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

.dark body::after,
html.dark body::after {
    opacity: 1;
    background-image:
        linear-gradient(rgba(6, 182, 212, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6, 182, 212, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* Floating mesh shapes */
.mesh-shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    z-index: -1;
    animation: float-mesh 25s ease-in-out infinite;
    will-change: transform;
}

.mesh-shape-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.08), transparent 70%);
    top: -10%;
    right: -5%;
    animation-delay: 0s;
}

.mesh-shape-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.06), transparent 70%);
    bottom: -10%;
    left: -5%;
    animation-delay: -8s;
}

.mesh-shape-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.05), transparent 70%);
    top: 50%;
    left: 40%;
    animation-delay: -16s;
}

.dark .mesh-shape-1 {
    background: radial-gradient(circle, rgba(6, 182, 212, 0.1), transparent 70%);
}

.dark .mesh-shape-2 {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.07), transparent 70%);
}

.dark .mesh-shape-3 {
    background: radial-gradient(circle, rgba(34, 211, 238, 0.06), transparent 70%);
}

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

/* =========================================
   Mobile Optimizations
   ========================================= */
@media (max-width: 768px) {
    .mesh-shape {
        filter: blur(40px);
        animation-play-state: paused;
    }

    .mesh-shape-1 {
        width: 280px;
        height: 280px;
    }

    .mesh-shape-2 {
        width: 220px;
        height: 220px;
    }

    .mesh-shape-3 {
        display: none;
    }

    body::after {
        background-size: 40px 40px;
    }
}

/* Pause animations when tab is hidden */
.hidden-tab .mesh-shape {
    animation-play-state: paused;
}