/* Atmospheric background for homepage only */
.home-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.home-bg__gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 55% at 15% 10%, rgba(7, 129, 215, 0.22), transparent 60%),
        radial-gradient(ellipse 55% 45% at 88% 20%, rgba(4, 99, 168, 0.16), transparent 55%),
        radial-gradient(ellipse 60% 50% at 70% 85%, rgba(7, 129, 215, 0.12), transparent 60%),
        linear-gradient(180deg, #050b14 0%, #03060c 45%, #05070d 100%);
}

.home-bg__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(126, 200, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(126, 200, 255, 0.035) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(circle at 50% 30%, black 15%, transparent 75%);
    opacity: 0.7;
}

.home-bg__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    will-change: transform, opacity;
}

.home-bg__glow--a {
    width: min(48vw, 520px);
    height: min(48vw, 520px);
    left: -10%;
    top: -8%;
    background: rgba(7, 129, 215, 0.4);
    animation: homeBgFloatA 14s ease-in-out infinite;
}

.home-bg__glow--b {
    width: min(38vw, 420px);
    height: min(38vw, 420px);
    right: -8%;
    top: 28%;
    background: rgba(4, 99, 168, 0.32);
    animation: homeBgFloatB 17s ease-in-out infinite;
}

.home-bg__glow--c {
    width: min(42vw, 460px);
    height: min(42vw, 460px);
    left: 35%;
    bottom: -18%;
    background: rgba(7, 129, 215, 0.18);
    animation: homeBgFloatA 20s ease-in-out infinite reverse;
}

@keyframes homeBgFloatA {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.85; }
    50% { transform: translate(24px, 30px) scale(1.08); opacity: 1; }
}

@keyframes homeBgFloatB {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.75; }
    50% { transform: translate(-20px, -26px) scale(1.06); opacity: 1; }
}

/* Keep page content above atmosphere, but never under the header */
body:has(.home-bg) > *:not(.home-bg):not(header),
.home-bg ~ *:not(header) {
    position: relative;
    z-index: 1;
}

body:has(.home-bg) > header,
.home-bg ~ header,
header.site-header {
    position: relative;
    z-index: 1000;
}

@media (max-width: 768px) {
    .home-bg__grid {
        opacity: 0.4;
        background-size: 48px 48px;
    }
}

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