/* ==========================================================
   MUFLIKHUN.ID
   MOMENTUM UNIVERSE STARFIELD V1

   Real luminous star atmosphere.
   Desktop + mobile.
   ========================================================== */


/* ==========================================================
   UNIVERSE SPACE BACKGROUND
   ========================================================== */

.universe-v5 {
    position: relative !important;

    isolation: isolate;

    background:
        radial-gradient(
            ellipse at 18% 33%,
            rgba(16,77,112,.12),
            transparent 31%
        ),

        radial-gradient(
            ellipse at 82% 68%,
            rgba(20,64,105,.10),
            transparent 29%
        ),

        radial-gradient(
            ellipse at 50% 52%,
            rgba(11,44,68,.13),
            transparent 43%
        ),

        linear-gradient(
            180deg,
            #020d16 0%,
            #01101b 47%,
            #020c15 100%
        )
        !important;
}


/*
 * Existing dot-pattern is removed.
 * Stars will be genuine positioned luminous elements.
 */
.universe-v5 .universe-stars {
    position: absolute !important;

    z-index: 0 !important;

    inset: 0 !important;

    width: 100% !important;
    height: 100% !important;

    overflow: hidden !important;

    pointer-events: none !important;

    background: none !important;

    opacity: 1 !important;
}


/*
 * Universe content always stays above stars.
 */
.universe-v5 > *:not(.universe-stars) {
    position: relative;

    z-index: 2;
}


/* ==========================================================
   STAR
   ========================================================== */

.universe-space-star {
    position: absolute;

    z-index: 1;

    display: block;

    width:
        var(--us-size);

    height:
        var(--us-size);

    border-radius: 50%;

    background:
        rgba(241,249,255,.98);

    opacity:
        var(--us-opacity);

    box-shadow:
        0 0 3px
        rgba(226,246,255,.98),

        0 0 8px
        rgba(167,222,255,.80),

        0 0 18px
        rgba(85,174,231,.38);

    animation:
        muflikhun-universe-twinkle
        var(--us-duration)
        ease-in-out
        var(--us-delay)
        infinite;

    transform-origin: center;
}


/* Gold stars tie the space field into Living Universe identity. */

.universe-space-star.is-gold {
    background:
        #ffe4a3;

    box-shadow:
        0 0 3px
        rgba(255,236,183,.98),

        0 0 9px
        rgba(239,193,98,.82),

        0 0 20px
        rgba(207,143,42,.38);
}


/* ==========================================================
   BRIGHT STARS — CROSS FLARE
   ========================================================== */

.universe-space-star.is-bright::before,
.universe-space-star.is-bright::after {
    content: "";

    position: absolute;

    left: 50%;
    top: 50%;

    transform:
        translate(-50%,-50%);

    pointer-events: none;

    border-radius: 999px;
}

.universe-space-star.is-bright::before {
    width:
        calc(
            var(--us-size) * 7
        );

    height:
        .6px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(213,240,255,.48),
            rgba(255,255,255,.90),
            rgba(213,240,255,.48),
            transparent
        );
}

.universe-space-star.is-bright::after {
    width:
        .6px;

    height:
        calc(
            var(--us-size) * 7
        );

    background:
        linear-gradient(
            180deg,
            transparent,
            rgba(213,240,255,.40),
            rgba(255,255,255,.84),
            rgba(213,240,255,.40),
            transparent
        );
}


/* ==========================================================
   STAR ANIMATION
   ========================================================== */

@keyframes
muflikhun-universe-twinkle {

    0%,
    100% {
        opacity:
            calc(
                var(--us-opacity) * .34
            );

        transform:
            scale(.76);
    }

    28% {
        opacity:
            calc(
                var(--us-opacity) * .57
            );
    }

    54% {
        opacity:
            var(--us-opacity);

        transform:
            scale(1.18);
    }

    71% {
        opacity:
            calc(
                var(--us-opacity) * .66
            );

        transform:
            scale(.91);
    }

}


/* ==========================================================
   SUBTLE SPACE HAZE
   ========================================================== */

.universe-v5 .universe-stars::before {
    content: "";

    position: absolute;

    inset:
        9% -12%
        4%;

    background:
        radial-gradient(
            ellipse at 26% 43%,
            rgba(49,136,190,.07),
            transparent 32%
        ),

        radial-gradient(
            ellipse at 72% 54%,
            rgba(35,101,154,.06),
            transparent 36%
        );

    filter:
        blur(30px);

    pointer-events: none;
}


/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width:760px) {

    .universe-v5 {
        background:
            radial-gradient(
                ellipse at 22% 32%,
                rgba(17,83,120,.14),
                transparent 30%
            ),

            radial-gradient(
                ellipse at 81% 67%,
                rgba(19,66,108,.11),
                transparent 32%
            ),

            linear-gradient(
                180deg,
                #020d17,
                #01101b 52%,
                #020c15
            )
            !important;
    }

    .universe-space-star.is-bright::before {
        width:
            calc(
                var(--us-size) * 5
            );
    }

    .universe-space-star.is-bright::after {
        height:
            calc(
                var(--us-size) * 5
            );
    }

}


/* ==========================================================
   REDUCED MOTION
   ========================================================== */

@media
(
    prefers-reduced-motion:
    reduce
) {

    .universe-space-star {
        animation:
            none !important;
    }

}
