.almas-bg-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background-color: #eef2fb;
    background-image:
        radial-gradient(ellipse 60% 45% at 8% -5%, rgba(91, 140, 255, 0.14), transparent 70%),
        radial-gradient(ellipse 45% 40% at 100% 28%, rgba(139, 92, 246, 0.10), transparent 70%),
        radial-gradient(ellipse 55% 42% at 50% 112%, rgba(34, 211, 238, 0.11), transparent 70%);
    transition: background-color 0.5s ease;
    contain: strict;
}

body.dark-mode .almas-bg-wrapper {
    background-color: #0b1220;
    background-image:
        radial-gradient(ellipse 60% 45% at 8% -5%, rgba(91, 140, 255, 0.15), transparent 70%),
        radial-gradient(ellipse 45% 40% at 100% 28%, rgba(139, 92, 246, 0.11), transparent 70%),
        radial-gradient(ellipse 55% 42% at 50% 112%, rgba(34, 211, 238, 0.10), transparent 70%);
}

.almas-bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(16, 42, 92, 0.09) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 42, 92, 0.09) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 70% 85% at 50% 45%, #000 35%, transparent 100%);
    mask-image: radial-gradient(ellipse 70% 85% at 50% 45%, #000 35%, transparent 100%);
    z-index: 0;
}

body.dark-mode .almas-bg-grid {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
}

@supports not ((mask-image: radial-gradient(#000, transparent)) or (-webkit-mask-image: radial-gradient(#000, transparent))) {
    .almas-bg-grid {
        opacity: 0.5;
    }
}

.almas-bg-orb {
    position: absolute;
    border-radius: 50%;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    z-index: 1;
}

.almas-bg-orb-1 {
    top: -180px;
    left: -140px;
    width: 680px;
    height: 680px;
    background: radial-gradient(circle at center, rgba(91, 140, 255, 0.13), rgba(91, 140, 255, 0) 70%);
    animation: almasOrbFloat1 18s ease-in-out infinite alternate;
}

.almas-bg-orb-2 {
    top: 26%;
    right: -220px;
    width: 560px;
    height: 560px;
    background: radial-gradient(circle at center, rgba(139, 92, 246, 0.09), rgba(139, 92, 246, 0) 70%);
    animation: almasOrbFloat2 16s ease-in-out -5s infinite alternate;
}

.almas-bg-orb-3 {
    bottom: -160px;
    left: 24%;
    width: 480px;
    height: 480px;
    background: radial-gradient(circle at center, rgba(34, 211, 238, 0.10), rgba(34, 211, 238, 0) 70%);
    animation: almasOrbFloat3 17s ease-in-out -9s infinite alternate;
}

body.dark-mode .almas-bg-orb-1 { background: radial-gradient(circle at center, rgba(91, 140, 255, 0.16), rgba(91, 140, 255, 0) 70%); }
body.dark-mode .almas-bg-orb-2 { background: radial-gradient(circle at center, rgba(139, 92, 246, 0.11), rgba(139, 92, 246, 0) 70%); }
body.dark-mode .almas-bg-orb-3 { background: radial-gradient(circle at center, rgba(34, 211, 238, 0.09), rgba(34, 211, 238, 0) 70%); }

@keyframes almasOrbFloat1 {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(70px, 50px, 0) scale(1.08); }
    100% { transform: translate3d(20px, -30px, 0) scale(0.96); }
}

@keyframes almasOrbFloat2 {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(-60px, 40px, 0) scale(1.1); }
    100% { transform: translate3d(-20px, -25px, 0) scale(0.95); }
}

@keyframes almasOrbFloat3 {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(50px, -45px, 0) scale(1.06); }
    100% { transform: translate3d(-30px, -15px, 0) scale(0.97); }
}

@media (max-width: 768px) {
    .almas-bg-wrapper {
        background-image:
            radial-gradient(ellipse 95% 38% at 10% -5%, rgba(91, 140, 255, 0.13), transparent 70%),
            radial-gradient(ellipse 70% 32% at 100% 22%, rgba(139, 92, 246, 0.09), transparent 70%),
            radial-gradient(ellipse 85% 34% at 50% 112%, rgba(34, 211, 238, 0.10), transparent 70%);
    }

    body.dark-mode .almas-bg-wrapper {
        background-image:
            radial-gradient(ellipse 95% 38% at 10% -5%, rgba(91, 140, 255, 0.14), transparent 70%),
            radial-gradient(ellipse 70% 32% at 100% 22%, rgba(139, 92, 246, 0.09), transparent 70%),
            radial-gradient(ellipse 85% 34% at 50% 112%, rgba(34, 211, 238, 0.08), transparent 70%);
    }

    .almas-bg-grid { background-size: 44px 44px; }

    .almas-bg-orb { animation: none; }
    .almas-bg-orb-1 { width: 380px; height: 380px; top: -140px; left: -110px; }
    .almas-bg-orb-2 { width: 320px; height: 320px; top: 24%; right: -140px; }
    .almas-bg-orb-3 { width: 280px; height: 280px; bottom: -120px; left: 16%; }
}

@media (prefers-reduced-motion: reduce) {
    .almas-bg-orb { animation: none; }
}