/**
 * Единый прелоадер Navorina — один CSS для всех страниц.
 * Типографика как у логотипа на главной (.navorina-logo) и в навигации (.nav-logo-text):
 *   Instrument Serif (или --font-serif, напр. Source Serif 4 для RU),
 *   font-weight 400, кегль 2× от логотипа (2 × --font-size-xl), line-height 1.2, letter-spacing 0, uppercase.
 * Разметка: см. snippets/site-loader.html
 * Перед этим файлом подключите Instrument / variables.css (если есть).
 * Важно: в ссылке Google Fonts для Instrument используйте &display=block (не swap) и при необходимости
 *   <link rel="preload" as="font" type="font/woff2" crossorigin href="…gstatic…/instrumentserif/…woff2"> —
 *   иначе браузер сначала рисует fallback (Georgia/system), потом подменяет шрифт (FOUT / «два шрифта»).
 */

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Как фон страницы: токены дизайн-системы или Tailwind --background */
    background: var(--color-bg-primary, var(--background, #1a1a1a));
    z-index: 99999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.loading.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    z-index: -1;
}

.loading-text {
    position: relative;
    margin: 0;
    text-align: center;
    width: auto;
    max-width: 100%;
    padding: 0 1rem;
    box-sizing: border-box;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.18em;
    min-height: 0;
    height: auto;
    line-height: 1.2;
}

.loading-text-words {
    display: inline-block;
    margin: 0;
    padding: 0;
    color: var(--color-text-primary, var(--foreground, #fff));
    font-family: var(--font-serif, 'Instrument Serif'), serif;
    font-style: normal;
    font-weight: var(--font-weight-normal, 400);
    font-size: calc(var(--font-size-xl, 18px) * 2);
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: uppercase;
    -webkit-font-smoothing: antialiased;
    filter: blur(0px);
    opacity: 0.95;
}

.loading-text-words:nth-child(1) {
    animation: nv-site-loader-blur 1.5s 0s infinite linear alternate;
}

.loading-text-words:nth-child(2) {
    animation: nv-site-loader-blur 1.5s 0.2s infinite linear alternate;
}

.loading-text-words:nth-child(3) {
    animation: nv-site-loader-blur 1.5s 0.4s infinite linear alternate;
}

.loading-text-words:nth-child(4) {
    animation: nv-site-loader-blur 1.5s 0.6s infinite linear alternate;
}

.loading-text-words:nth-child(5) {
    animation: nv-site-loader-blur 1.5s 0.8s infinite linear alternate;
}

.loading-text-words:nth-child(6) {
    animation: nv-site-loader-blur 1.5s 1s infinite linear alternate;
}

.loading-text-words:nth-child(7) {
    animation: nv-site-loader-blur 1.5s 1.2s infinite linear alternate;
}

.loading-text-words:nth-child(8) {
    animation: nv-site-loader-blur 1.5s 1.4s infinite linear alternate;
}

@keyframes nv-site-loader-blur {
    0% {
        filter: blur(0px);
    }
    100% {
        filter: blur(6px);
    }
}

@media (max-width: 768px) {
    .loading-text-words {
        font-size: clamp(30px, 8.4vw, 36px);
    }
}

@media (max-width: 480px) {
    .loading-text {
        padding: 0 0.75rem;
    }

    .loading-text-words {
        font-size: clamp(28px, 9vw, 34px);
    }
}
