.ambient {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.ambient-orb,
.ambient-grid {
    position: absolute;
    pointer-events: none;
}

.ambient::before,
.ambient::after {
    content: "";
    position: absolute;
    inset: -18%;
    pointer-events: none;
}

.ambient::before {
    background:
        linear-gradient(rgba(0, 199, 138, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 199, 138, 0.1) 1px, transparent 1px);
    background-size: 96px 96px;
    opacity: 0.38;
    transform-origin: center;
    animation: gridRotate 30s linear infinite;
}

.ambient::after {
    background:
        repeating-linear-gradient(0deg, transparent 0 16px, rgba(0, 199, 138, 0.08) 16px 17px),
        repeating-linear-gradient(90deg, transparent 0 16px, rgba(0, 199, 138, 0.08) 16px 17px);
    opacity: 0.32;
    animation: scanlineDrift 10s linear infinite;
}

.ambient-orb {
    border-radius: 999px;
    filter: blur(10px);
    opacity: 0.95;
}

.ambient-orb-a {
    top: 14%;
    left: 12%;
    width: 18px;
    height: 18px;
    background: radial-gradient(circle, rgba(0, 199, 138, 0.95), rgba(0, 199, 138, 0.1) 72%, transparent 100%);
    box-shadow: 0 0 32px rgba(0, 199, 138, 0.7);
    animation: nodeA 7s ease-in-out infinite alternate;
}

.ambient-orb-b {
    right: 14%;
    top: 24%;
    width: 16px;
    height: 16px;
    background: radial-gradient(circle, rgba(0, 199, 138, 0.92), rgba(0, 199, 138, 0.1) 72%, transparent 100%);
    box-shadow: 0 0 28px rgba(0, 199, 138, 0.62);
    animation: nodeB 9s ease-in-out infinite alternate;
}

.ambient-orb-c {
    left: 28%;
    bottom: 18%;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, rgba(0, 199, 138, 0.98), rgba(0, 199, 138, 0.1) 72%, transparent 100%);
    box-shadow: 0 0 36px rgba(0, 199, 138, 0.74);
    animation: nodeC 8s ease-in-out infinite alternate;
}

.ambient-grid {
    inset: -18%;
    background-image:
        linear-gradient(rgba(0, 199, 138, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 199, 138, 0.3) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.72;
    transform-origin: center;
    animation: gridShift 8s linear infinite, gridPulse 3.5s ease-in-out infinite alternate;
}

@keyframes gridShift {
    0% {
        transform: perspective(1100px) rotateX(72deg) translate3d(0, 0, 0) scale(1.08);
    }

    100% {
        transform: perspective(1100px) rotateX(72deg) translate3d(44px, 44px, 0) scale(1.16);
    }
}

@keyframes nodeA {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    100% {
        transform: translate3d(112px, 56px, 0) scale(1.45);
    }
}

@keyframes nodeB {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    100% {
        transform: translate3d(-120px, 84px, 0) scale(1.35);
    }
}

@keyframes nodeC {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    100% {
        transform: translate3d(88px, -98px, 0) scale(1.4);
    }
}

@keyframes gridPulse {
    0% {
        opacity: 0.4;
    }

    100% {
        opacity: 0.82;
    }
}

@keyframes gridRotate {
    0% {
        transform: rotate(0deg) scale(1);
    }

    100% {
        transform: rotate(8deg) scale(1.04);
    }
}

@keyframes scanlineDrift {
    0% {
        transform: translate3d(0, -120px, 0);
    }

    100% {
        transform: translate3d(120px, 120px, 0);
    }
}
