/* ==============================================================================
   TAYYAR QUANTUM TELEMETRY & MAGNETIC CURRENT FIELD (AMBIENT REACTOR)
   Multi-Layer Obsidian & Emerald Atmosphere • GPU-Composited 60 FPS
   ============================================================================== */

.ambient-reactor {
    --cursor-x: 50vw;
    --cursor-y: 38vh;
    --orb-shift-y: 0px;
    --orb-counter-y: 0px;
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background-color: #060b14;
    contain: strict;
}

/* Layer 1: Volumetric Emerald & Oceanic Teal Orbs */
.reactor-orb-layer {
    position: absolute;
    inset: -12%;
    pointer-events: none;
    transform: translate3d(0, var(--orb-shift-y), 0);
    will-change: transform;
}

.reactor-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(32px);
    opacity: 0.55;
    pointer-events: none;
    transform: translateZ(0);
}

.reactor-orb--emerald {
    width: min(640px, 68vw);
    height: min(640px, 68vw);
    inset-block-start: -8%;
    inset-inline-start: 12%;
    background: radial-gradient(circle at center,
            rgba(6, 182, 212, 0.18) 0%,
            rgba(34, 211, 238, 0.06) 46%,
            transparent 74%);
    animation: reactor-orb-drift-a 22s ease-in-out infinite alternate;
}

.reactor-orb--teal {
    width: min(580px, 62vw);
    height: min(580px, 62vw);
    inset-block-start: 36%;
    inset-inline-end: 6%;
    background: radial-gradient(circle at center,
            rgba(14, 165, 233, 0.15) 0%,
            rgba(2, 132, 199, 0.06) 48%,
            transparent 75%);
    transform: translate3d(0, var(--orb-counter-y), 0);
    animation: reactor-orb-drift-b 26s ease-in-out infinite alternate;
}

.reactor-orb--deep {
    width: min(720px, 75vw);
    height: min(520px, 58vw);
    inset-block-end: -10%;
    inset-inline-start: 28%;
    background: radial-gradient(ellipse at center,
            rgba(2, 132, 199, 0.14) 0%,
            rgba(34, 211, 238, 0.05) 50%,
            transparent 76%);
    animation: reactor-orb-drift-a 30s ease-in-out infinite alternate-reverse;
}

@keyframes reactor-orb-drift-a {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    100% {
        transform: translate3d(34px, 28px, 0) scale(1.07);
    }
}

@keyframes reactor-orb-drift-b {
    0% {
        transform: translate3d(0, var(--orb-counter-y), 0) scale(1.04);
    }

    100% {
        transform: translate3d(-38px, calc(var(--orb-counter-y) - 24px), 0) scale(0.96);
    }
}

/* Layer 2: Tactical Micro-Grid (Revealed via Cursor Radial Spotlight Mask) */
.reactor-micro-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(34, 211, 238, 0.14) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(14, 165, 233, 0.12) 1px, transparent 1px);
    background-size: 44px 44px;
    opacity: 0;
    transition: opacity 0.45s ease;
    pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
    .ambient-reactor.is-pointer-active .reactor-micro-grid {
        opacity: 1;
        mask-image: radial-gradient(260px circle at var(--cursor-x) var(--cursor-y),
                rgba(0, 0, 0, 0.95) 0%,
                rgba(0, 0, 0, 0.42) 45%,
                transparent 78%);
        -webkit-mask-image: radial-gradient(260px circle at var(--cursor-x) var(--cursor-y),
                rgba(0, 0, 0, 0.95) 0%,
                rgba(0, 0, 0, 0.42) 45%,
                transparent 78%);
    }
}

@media (pointer: coarse) {
    .reactor-micro-grid {
        opacity: 0.22;
        mask-image: radial-gradient(ellipse 70% 55% at 50% 40%,
                rgba(0, 0, 0, 0.65) 0%,
                transparent 75%);
        -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 40%,
                rgba(0, 0, 0, 0.65) 0%,
                transparent 75%);
    }

    .reactor-orb-layer {
        transform: none;
        will-change: auto;
    }

    .reactor-orb {
        animation: none;
        filter: blur(16px);
    }
}

/* Layer 3: High-Speed Canvas 2D Fiber-Optic Currents & Telemetry Particles */
.ambient-reactor-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

/* Z-Index Elevation Guarantee for All Foreground Sections */
main,
.site-footer {
    position: relative;
    z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
    .reactor-orb {
        animation: none;
    }

    .reactor-micro-grid {
        display: none;
    }
}