
/* =========================================
   PROBUILT SITE PRELOADER
========================================= */

:root {
    --loader-bg: #101713;
    --loader-text: #ffffff;
    --loader-accent: #c9a66b;
    --loader-muted: rgba(255, 255, 255, 0.55);
}

.site-loader {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    padding: 40px;
    overflow: hidden;
    color: var(--loader-text);
    background: var(--loader-bg);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.7s ease,
        visibility 0.7s ease;
}

html.site-loader-active .site-loader {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

html.site-loader-active {
    overflow: hidden;
}

.site-loader__inner {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 1320px;
    height: 100%;
    margin: 0 auto;
}

.site-loader__brand {
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-loader__logo {
    display: block;
    width: auto;
    max-width: min(360px, 70vw);
    max-height: 160px;
    object-fit: contain;
    opacity: 0;
    transform: translateY(24px);
}

.site-loader__name {
    color: #fff;
    font-size: clamp(30px, 6vw, 64px);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-align: center;
    text-transform: uppercase;
}

html.site-loader-active .site-loader__logo {
    animation: loaderLogoIn 0.9s 0.15s ease forwards;
}

.site-loader__bottom {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: 1fr 1.2fr auto;
    align-items: center;
    gap: 30px;
    padding-bottom: clamp(25px, 5vh, 60px);
}

.site-loader__label {
    color: var(--loader-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.18em;
}

.site-loader__progress {
    position: relative;
    width: 100%;
    height: 1px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.2);
}

.site-loader__progress-bar {
    display: block;
    width: 0;
    height: 100%;
    background: var(--loader-accent);
    transition: width 0.08s linear;
}

.site-loader__counter {
    display: flex;
    align-items: baseline;
    gap: 3px;
    min-width: 55px;
    color: #fff;
    font-size: 24px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.site-loader__percent {
    color: var(--loader-accent);
    font-size: 12px;
}

/* Loader exit */

html.site-loader-exit .site-loader {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

html.site-loader-done .site-loader {
    display: none;
}

/* Animations */

@keyframes loaderLogoIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */

@media (max-width: 767px) {
    .site-loader {
        padding: 24px;
    }

    .site-loader__logo {
        max-width: 75vw;
        max-height: 120px;
    }

    .site-loader__bottom {
        grid-template-columns: 1fr auto;
        gap: 18px;
        padding-bottom: 25px;
    }

    .site-loader__label {
        font-size: 9px;
    }

    .site-loader__progress {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .site-loader__counter {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        font-size: 21px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-loader,
    .site-loader__progress-bar {
        transition-duration: 0.01ms;
    }

    html.site-loader-active .site-loader__logo {
        animation-duration: 0.01ms;
        animation-delay: 0ms;
    }
}
