#preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 22px;
    background:
        radial-gradient(ellipse 60% 50% at 50% 42%, rgba(99, 102, 241, .16), transparent 70%),
        radial-gradient(ellipse 80% 60% at 50% 50%, transparent 55%, rgba(0, 0, 0, .55)),
        linear-gradient(#08080f, #08080f);
    background-size: cover;
    color: #fff;
    transition: opacity .5s ease;
    overflow: hidden;
}

#preloader::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 42px 42px;
    -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 30%, transparent 75%);
    mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 30%, transparent 75%);
    pointer-events: none;
}

#preloader.is-done {
    opacity: 0;
    pointer-events: none;
}

.preloader__stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preloader__ring,
.preloader__ring--spin {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid rgba(129, 140, 248, .45);
    pointer-events: none;
}

.preloader__ring--outer {
    width: 138px;
    height: 138px;
    animation: preloader-ring-pulse 2.2s ease-out infinite;
}

.preloader__ring--inner {
    width: 112px;
    height: 112px;
    border-style: dashed;
    animation: preloader-ring-spin 7s linear infinite;
}

.preloader__badge {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, .14),
        0 18px 50px rgba(99, 102, 241, .35),
        0 4px 14px rgba(0, 0, 0, .5);
    animation: preloader-badge-breathe 2.2s ease-in-out infinite;
}

.preloader__logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 14px;
}

.preloader__title {
    margin: 0;
    font-family: "Sora", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .01em;
    color: #eef0ff;
}

.preloader__title em {
    font-style: normal;
    background: linear-gradient(90deg, #818cf8, #c084fc, #818cf8);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: preloader-title-shimmer 3s linear infinite;
}

.preloader__bar {
    width: 240px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4);
}

.preloader__bar-fill {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #6366f1, #a855f7, #818cf8, #6366f1);
    background-size: 200% auto;
    animation: preloader-bar-slide 1.6s linear infinite;
}

@keyframes preloader-ring-pulse {
    0% {
        transform: scale(.72);
        opacity: 0;
    }
    25% {
        opacity: .9;
    }
    100% {
        transform: scale(1.15);
        opacity: 0;
    }
}

@keyframes preloader-ring-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes preloader-badge-breathe {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.035);
    }
}

@keyframes preloader-title-shimmer {
    to {
        background-position: -200% center;
    }
}

@keyframes preloader-bar-slide {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    #preloader *,
    #preloader *::before,
    #preloader *::after {
        animation: none !important;
    }
}
