/* Скрытие скроллбара во время прелоадера без подергивания */
html {
    scrollbar-gutter: stable; /* Резервируем место под скроллбар всегда */
}

html:has(.preloader) {
    overflow: hidden;
}

.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 1s ease-in-out;
}

.preloader.fade-out {
    opacity: 0;
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.preloader-logo-wrapper {
    position: relative;
    max-width: 300px;
    width: 80%;
    margin-bottom: 40px;
}

.preloader-logo {
    width: 100%;
    height: auto;
    display: block;
}

.preloader-logo-bw {
    filter: grayscale(100%) brightness(0.8);
}

.preloader-logo-color {
    position: absolute;
    top: 0;
    left: 0;
    filter: grayscale(0%) brightness(1);
    clip-path: inset(0 100% 0 0);
    animation: fillColor 2.5s cubic-bezier(0.33, 0.0, 0.2, 1) forwards;
}

.preloader-progress-bar {
    width: 300px;
    max-width: 80%;
    height: 4px;
    background: rgba(216, 181, 103, 0.2);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.preloader-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #d8b567, #f0d89a);
    width: 0%;
    animation: fillProgress 2.5s cubic-bezier(0.33, 0.0, 0.2, 1) forwards;
    box-shadow: 0 0 10px rgba(216, 181, 103, 0.5);
}

@keyframes fillProgress {
    0% {
        width: 0%;
    }
    30% {
        width: 25%;
    }
    70% {
        width: 75%;
    }
    100% {
        width: 100%;
    }
}

@keyframes fillColor {
    0% {
        clip-path: inset(0 100% 0 0);
    }
    30% {
        clip-path: inset(0 75% 0 0);
    }
    70% {
        clip-path: inset(0 25% 0 0);
    }
    100% {
        clip-path: inset(0 0% 0 0);
    }
}
