/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(212, 175, 55, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 70%, rgba(139, 90, 43, 0.10) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 50%, rgba(47, 68, 40, 0.6) 0%, transparent 80%),
        linear-gradient(160deg, #0d1611 0%, #111a0e 40%, #0a1209 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
    overflow: hidden;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Центральный блок */
.loading-center {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

/* Заголовок */
.loading-title {
    font-family: 'Open', cursive;
    font-size: 4rem;
    font-weight: normal;
    color: var(--secondary-color);
    display: flex;
    z-index: 100;
    position: relative;
    letter-spacing: 0.04em;
    text-shadow: 0 2px 40px rgba(212, 175, 55, 0.18);
}

.loading-title span {
    opacity: 0;
    transform: translateY(24px);
    animation: letterFadeIn 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.loading-title .space {
    width: 1.1rem;
}

.loading-title span:nth-child(1)  { animation-delay: 0.05s; }
.loading-title span:nth-child(2)  { animation-delay: 0.10s; }
.loading-title span:nth-child(3)  { animation-delay: 0.14s; }
.loading-title span:nth-child(4)  { animation-delay: 0.18s; }
.loading-title span:nth-child(5)  { animation-delay: 0.22s; }
.loading-title span:nth-child(6)  { animation-delay: 0.26s; }
.loading-title span:nth-child(7)  { animation-delay: 0.30s; }
.loading-title span:nth-child(8)  { animation-delay: 0.34s; }
.loading-title span:nth-child(10) { animation-delay: 0.40s; }
.loading-title span:nth-child(11) { animation-delay: 0.44s; }
.loading-title span:nth-child(12) { animation-delay: 0.48s; }
.loading-title span:nth-child(13) { animation-delay: 0.52s; }
.loading-title span:nth-child(14) { animation-delay: 0.56s; }
.loading-title span:nth-child(15) { animation-delay: 0.60s; }
.loading-title span:nth-child(16) { animation-delay: 0.64s; }

.loading-title span:nth-child(1),
.loading-title span:nth-child(10) {
    color: var(--accent-gold);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
}

@keyframes letterFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Подзаголовок */
.loading-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    opacity: 0;
    animation: subtitleFade 0.8s ease-out 0.8s forwards;
}

@keyframes subtitleFade {
    to { opacity: 1; }
}

/* Прогресс */
.loading-progress-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
}

.progress-bar {
    width: 320px;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.loading-progress-indicator .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #d4af37, #8b5a2b, #d4af37);
    background-size: 200% 100%;
    width: 0%;
    transition: width 0.25s ease-out;
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.6);
    animation: progressShimmer 2s linear infinite;
}

@keyframes progressShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Текст статуса загрузки */
.loading-status-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
}

/* ======== КАРТОЧКИ-КАРТИНЫ ======== */
.floating-art-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.art-frame {
    position: absolute;
    border-radius: 12px; /* В стиле проекта — скругленные углы */
    overflow: hidden;
    /* Роскошная классическая багетная рама: сочетание дерева и золота */
    border: 3px solid rgba(22, 17, 9, 0.95); /* Глубокий благородный темный багет */
    outline: 1px solid rgba(212, 175, 55, 0.35); /* Внешняя тонкая золотая кайма */
    outline-offset: -1px;
    box-shadow:
        /* Профилирование рамы и внутреннее золочение (паспарту) */
        inset 0 0 0 1px rgba(212, 175, 55, 0.5),    /* Внутренний золотой ободок багета */
        inset 0 0 0 3px rgba(35, 27, 15, 0.9),       /* Рельефная тень профиля дерева */
        inset 0 0 0 5px rgba(212, 175, 55, 0.3),     /* Золотой штапик (паспарту) */
        inset 0 0 15px rgba(0, 0, 0, 0.8),           /* Глубокая тень рамы на живописный холст */
        /* Эффект парения в пространстве с теплым отсветом золота */
        0 15px 40px rgba(0, 0, 0, 0.65),
        0 5px 15px rgba(212, 175, 55, 0.12);
    animation: floatPainting 9s ease-in-out infinite;
    opacity: 0;
    will-change: transform, opacity;
}

.art-frame.loaded {
    animation: floatPainting 9s ease-in-out infinite;
}

/* Само «полотно» (чистое искусство без текста с легким текстурным наложением) */
.art-content {
    width: 100%;
    height: 100%;
    position: relative;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.45); /* Дополнительная глубина живописи */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ======== УНИКАЛЬНЫЕ НАСТОЯЩИЕ ЖИВОПИСНЫЕ КАРТИНЫ (ИЗ ПРОЕКТА) ДЛЯ КАЖДОЙ КАРТОЧКИ ======== */

.af-1 .art-content {
    background-image: url('/images/p-1767869953930.jpg'); /* Осенний день */
}

.af-2 .art-content {
    background-image: url('/images/p-1767870214093.jpg'); /* Весной повеяло */
}

.af-3 .art-content {
    background-image: url('/images/p-1767870600245.jpg'); /* Отдыхающие нивы */
}

.af-4 .art-content {
    background-image: url('/images/p-1767870870051.jpg'); /* Смертельный бой */
}

.af-5 .art-content {
    background-image: url('/images/p-1767871260044.jpg'); /* Февральское утро */
}

.af-6 .art-content {
    background-image: url('/images/p-1767872669883.jpg'); /* Красное вино */
}

.af-7 .art-content {
    background-image: url('/images/p-1767876079048.jpg'); /* Окрестности Владимира */
}

.af-8 .art-content {
    background-image: url('/images/p-1767880319168.jpg'); /* Весеннее солнце */
}

.af-9 .art-content {
    background-image: url('/images/p-1767881272122.jpg'); /* Вход в монастырь */
}

.af-10 .art-content {
    background-image: url('/images/p-1767881789807.jpg'); /* Голубые тени */
}

/* ======== РАЗМЕРЫ И ПОЗИЦИИ КАРТОЧЕК ======== */
.af-1  { width: 140px; height: 110px; left:  4%; top: 8%;  animation-delay: 0.0s; animation-duration: 10s; }
.af-2  { width: 100px; height: 130px; left: 18%; top: 65%; animation-delay: 0.7s; animation-duration: 8s; }
.af-3  { width: 160px; height: 120px; left: 30%; top: 5%;  animation-delay: 1.4s; animation-duration: 11s; }
.af-4  { width: 110px; height: 130px; left: 72%; top: 12%; animation-delay: 2.1s; animation-duration: 9s; }
.af-5  { width: 130px; height: 100px; left: 85%; top: 58%; animation-delay: 2.8s; animation-duration: 10s; }
.af-6  { width: 90px;  height: 115px; left: 5%;  top: 55%; animation-delay: 3.5s; animation-duration: 8.5s; }
.af-7  { width: 150px; height: 105px; left: 60%; top: 72%; animation-delay: 4.2s; animation-duration: 12s; }
.af-8  { width: 105px; height: 135px; left: 88%; top: 10%; animation-delay: 4.9s; animation-duration: 9s; }
.af-9  { width: 120px; height: 95px;  left: 42%; top: 78%; animation-delay: 5.6s; animation-duration: 10s; }
.af-10 { width: 135px; height: 105px; left: 14%; top: 15%; animation-delay: 6.3s; animation-duration: 11s; }

/* Анимация плавания */
@keyframes floatPainting {
    0% {
        opacity: 0;
        transform: translateY(20px) rotate(-1.5deg) scale(0.96);
    }
    8% {
        opacity: 0.75;
    }
    25% {
        transform: translateY(-12px) rotate(1deg) scale(1.02);
        opacity: 0.85;
    }
    50% {
        transform: translateY(-24px) rotate(0deg) scale(1.04);
        opacity: 0.9;
    }
    75% {
        transform: translateY(-10px) rotate(-1deg) scale(1.02);
        opacity: 0.8;
    }
    92% {
        opacity: 0.7;
    }
    100% {
        opacity: 0;
        transform: translateY(20px) rotate(1.5deg) scale(0.96);
    }
}

/* ======== МЕДИА-ЗАПРОСЫ ======== */
@media (max-width: 768px) {
    .loading-title { font-size: 2.5rem; }
    .progress-bar  { width: 260px; }
    .af-1  { width: 100px; height: 80px; }
    .af-2  { width: 75px;  height: 95px; }
    .af-3  { width: 115px; height: 88px; }
    .af-4  { width: 80px;  height: 100px; }
    .af-5  { width: 95px;  height: 75px; }
    .af-6  { width: 68px;  height: 86px; }
    .af-7  { width: 110px; height: 78px; }
    .af-8  { width: 78px;  height: 100px; }
    .af-9  { width: 90px;  height: 70px; }
    .af-10 { width: 100px; height: 78px; }
}

@media (max-width: 480px) {
    .loading-title { font-size: 1.8rem; flex-wrap: wrap; justify-content: center; gap: 0.15rem; }
    .loading-title .space { width: 0.4rem; }
    .progress-bar  { width: 200px; }
    .af-1  { width: 80px; height: 62px; }
    .af-2  { width: 60px; height: 78px; }
    .af-3  { width: 90px; height: 70px; }
    .af-4  { width: 65px; height: 82px; }
    .af-5  { width: 75px; height: 58px; }
    .af-6  { display: none; }
    .af-7  { width: 88px; height: 62px; }
    .af-8  { display: none; }
    .af-9  { width: 72px; height: 55px; }
    .af-10 { width: 80px; height: 62px; }
}
