/* --- Variables & Fonts --- */
:root {
    --noir: #2b2b2b;
    --day: #efefef;
    --accent: #878787;
    --max-text-width: 53.75rem; 
    --max-img-width: 70rem; 
}

@font-face {
    font-family: 'GOSTTypeA';
    src: url('/fonts/GOSTTypeA.woff2') format('woff2'),
         url('/fonts/GOSTTypeA.woff') format('woff');
}

@font-face {
    font-family: 'OpenSans';
    src: url('/fonts/OpenSans-Regular.woff2') format('woff2'),
         url('/fonts/OpenSans-Regular.woff') format('woff');
}

@font-face {
    font-family: 'Pobeda';
    src: url('/fonts/Pobeda-Regular.woff2') format('woff2'),
         url('/fonts/Pobeda-Regular.woff') format('woff');
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'OpenSans', sans-serif;
    background-color: var(--day);
    color: var(--noir);
    overflow-x: hidden;
}

/* --- Header & Menu --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    z-index: 100;
    mix-blend-mode: difference;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    width: 100%;
}

.menu-toggle {
    width: 30px;
    height: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 110;
}

.menu-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--day);
    transition: all 0.3s ease;
}

.menu-toggle.active span {
    background-color: var(--noir);
}

.logo-header {
    margin-left: 20px;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    height: 48px;
    pointer-events: none;
}

.logo-header img {
    height: 48px;
    width: auto;
    transition: all 0.3s ease;
    cursor: pointer;
}

.logo-header img:hover {
    filter: invert(1);
}

.logo-header.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    cursor: pointer;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--day);
    z-index: 90;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.menu-overlay.open {
    opacity: 1;
    visibility: visible;
}

.menu-content {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.menu-link {
    font-family: 'GOSTTypeA', sans-serif;
    font-size: 2rem;
    color: var(--noir);
    text-decoration: none;
    margin: 10px 0;
    letter-spacing: 0.1em;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.menu-overlay.open .menu-link {
    transform: translateY(0);
    opacity: 1;
}

.menu-link:nth-child(1) { transition-delay: 0.1s; }
.menu-link:nth-child(2) { transition-delay: 0.2s; }
.menu-link:nth-child(3) { transition-delay: 0.3s; }
.menu-link:nth-child(4) { transition-delay: 0.4s; }

/* --- Main Layout (Landing Page) --- */
main {
    position: relative;
    width: 100%;
}

.landing-wrapper {
    width: 100%;
    position: relative;
}

.section {
    width: 100%;
    height: 12.5vh; 
    min-height: 80px; 
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* --- Лого (Блок 2 и 3) --- */
.section-2 {
    position: relative;
}

.main-logo {
    width: 100%;
    max-width: 11.25rem; 
    height: auto;
    opacity: 0;
    position: absolute;
    top: 50%; 
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.main-logo.animate {
    animation: fadeInLogo 1s ease forwards;
}

@keyframes fadeInLogo {
    0% { opacity: 0; transform: translate(-50%, -70%); }
    100% { opacity: 1; transform: translate(-50%, -50%); }
}

/* --- Блок 4: Кольцо --- */
.section-4 {
    justify-content: center; 
}

.loader-ring-svg {
    width: 44px;
    height: 44px;
    transform: rotate(-90deg);
    overflow: visible;
}

.loader-ring-circle {
    fill: transparent;
    stroke: var(--noir);
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-dasharray: 96;
    stroke-dashoffset: 96;
    opacity: 0.3;
    animation: fillCircle 1.5s ease-out forwards;
}

@keyframes fillCircle {
    to { stroke-dashoffset: 0; }
}

/* --- Блок 5: Заголовок --- */
.main-title {
    font-family: 'GOSTTypeA', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 2rem;
    margin: 0;
    text-align: center;
    font-weight: normal;
    color: var(--noir);
}

/* --- Блок 6: Текст --- */
.section-6 {
    align-items: flex-start; 
}

.text-container {
    max-width: var(--max-text-width);
    padding: 0 20px;
    font-size: 2rem; 
    line-height: 1.4;
    text-align: center;
    letter-spacing: 0.05em;
}

/* --- Блок 8: Стрелочка --- */
.section-8 {
    cursor: pointer;
}

.scroll-up-arrow {
    width: 30px;
    height: 15px;
    position: relative;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.scroll-up-arrow::before,
.scroll-up-arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 2px;
    height: 15px;
    background-color: var(--noir);
    transform-origin: bottom center;
}

.scroll-up-arrow::before {
    transform: translateX(-50%) rotate(60deg);
}

.scroll-up-arrow::after {
    transform: translateX(-50%) rotate(-60deg);
}

.section-8:hover .scroll-up-arrow {
    opacity: 1;
}
/* Конец стрелочки (исправлено) */

/* --- Temporary Images (Landing) --- */
.temp-pages {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.temp-img {
    width: 100%;
    max-width: var(--max-img-width);
    height: auto;
    display: block;
}

/* --- Capsules Page --- */
.capsules-container {
    max-width: 53.75rem;
    margin: 0 auto;
    padding: 80px 20px 40px;
}

.page-title {
    font-family: 'GOSTTypeA', sans-serif;
    font-size: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
    color: var(--noir);
    margin-bottom: 3rem;
    font-weight: normal;
}

.capsule-item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 3rem;
    text-decoration: none;
    color: var(--noir);
}

.capsule-image-wrap {
    width: 50%;
}

.capsule-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    filter: grayscale(100%);
    transition: all 0.3s ease;
}

.capsule-item:hover .capsule-image {
    filter: grayscale(0%);
}

.capsule-title-wrap {
    width: 50%;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    font-weight: normal;
}

.capsule-number {
    font-family: 'Pobeda', sans-serif;
    font-size: 8rem;
    line-height: 0.8;
    color: var(--noir);
    opacity: 0.1;
    margin-bottom: -20px;
    transition: opacity 0.3s ease;
    text-align: left;
    width: 100%;
}

.capsule-item:hover .capsule-number {
    opacity: 0.2;
}

.capsule-title {
    font-family: 'GOSTTypeA', sans-serif;
    font-size: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
    line-height: 1;
    transition: color 0.3s ease;
    position: relative;
    z-index: 2;
    font-weight: normal;
}

.capsule-item:hover .capsule-title {
    color: var(--accent);
}

/* --- Gallery Grid --- */
.capsule-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 3rem;
}

/* Стили для картинки внутри плашки */
.capsule-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    
    /* Добавляем эффект черно-белого */
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

/* При наведении на плашку - возвращаем цвет */
.gallery-item {
    cursor: pointer; /* Показываем, что можно кликнуть */
}

.gallery-item:hover img {
    filter: grayscale(0%);
}

/* =========================================
   АДАПТИВ (МОБИЛЬНЫЕ УСТРОЙСТВА)
========================================= */
@media (max-width: 768px) {
    
    /* --- Landing Page Adaptive --- */
    .landing-wrapper {
        height: calc(var(--vh, 1vh) * 100) !important;
        overflow: hidden !important;
    }

    .section {
        height: 12.5% !important; 
        min-height: 0 !important; 
    }

    .main-logo {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: translateY(-20px) !important;
        max-width: 6rem !important; 
        margin: 0 auto !important;
        opacity: 0 !important;
        transition: none !important; 
    }

    .main-logo.animate {
        opacity: 1 !important;
        transform: translateY(0) !important;
        transition: opacity 1s ease, transform 1s ease !important;
    }

    .main-title {
        font-size: 1.2rem !important;
        padding: 0 10px;
    }

    .loader-text {
        font-size: 1.2rem !important; 
    }

    .text-container {
        font-size: 1rem !important;
        position: relative !important;
        top: auto !important;
        max-width: 16rem !important;
        margin: 0 auto !important;
        line-height: 1.3 !important;
    }
    
    .section-6 {
        justify-content: center !important;
    }

    .scroll-up-arrow {
        width: 20px !important;
        height: 20px !important;
    }

    /* --- Capsules Page Adaptive --- */
    .page-title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }

    .capsules-container {
        padding: 60px 10px 40px 10px !important; 
        margin: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .capsule-item {
        align-items: flex-end !important;
        margin-bottom: 2rem !important;
        flex-wrap: nowrap !important;
    }

    .capsule-image-wrap {
        width: calc(50vw - 10px) !important; 
        padding: 0 !important;
        flex-shrink: 0 !important;
        box-sizing: border-box !important;
    }

    .capsule-title-wrap {
        width: calc(50vw - 25px) !important; 
        padding: 0 0 0 15px !important; 
        box-sizing: border-box !important;
        flex-shrink: 0 !important;
    }

    .capsule-number {
        font-size: 3.5rem !important; 
        margin-bottom: -10px !important;
    }

    .capsule-title {
        font-size: 1.1rem !important; 
    }
}

/* --- Lightbox Navigation --- */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    
    display: none; /* ВАЖНО: Скрыто по умолчанию! */
    
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.lightbox-overlay.active {
    display: flex; /* Показываем только когда есть класс active */
}

.lightbox-content {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

/* Кнопки управления */
.lightbox-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    color: white;
    border: none;
    padding: 20px;
    cursor: pointer;
    z-index: 10000;
    transition: background 0.3s;
    
    /* Стили для текстовых стрелок (< >) */
    font-size: 30px;
    line-height: 1;
    user-select: none;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.lightbox-close {
    top: 20px;
    right: 20px;
    transform: none;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* Крестик (X) - возвращаем стили */
.close-icon {
    position: relative;
    width: 20px;
    height: 20px;
    display: block;
}
.close-icon::before,
.close-icon::after {
    content: '';
    position: absolute;
    background-color: #fff;
    width: 2px;
    height: 20px;
    left: 9px;
}
.close-icon::before { transform: rotate(45deg); }
.close-icon::after { transform: rotate(-45deg); }
}

/* Адаптив для Lightbox */
@media (max-width: 768px) {
    .lightbox-btn {
        padding: 10px;
    }
    .arrow-icon::before, .arrow-icon::after, .close-icon::before, .close-icon::after {
        height: 12px;
    }
    .arrow-icon { width: 15px; height: 15px; }
    .close-icon { width: 15px; height: 15px; }
}
/* Стили для текста из редактора */
.capsule-text-content {
    /* Убрали text-align: center, теперь текст будет слева */
}

.capsule-text-content h1,
.capsule-text-content h2,
.capsule-text-content h3 {
    font-family: 'GOSTTypeA', sans-serif;
    text-transform: uppercase;
    text-align: center; /* Заголовки по центру */
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: normal;
    line-height: 1.3;
}

/* H2: на 20% меньше меню */
.capsule-text-content h2 {
    font-size: 1.6rem;
}

/* H3: еще на 20% меньше */
.capsule-text-content h3 {
    font-size: 1.28rem;
}

.capsule-text-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
    text-align: left; /* Текст по левому краю */
}

/* Go live — как "О нас", отдельные классы не нужны, 
   но можно добавить кастомные отступы если потребуется */
#golive .page-title {
    /* при необходимости переопределить */
}

/* === Frames Section === */
.frames-section { padding: 80px 0 40px; background: var(--day); }
.frames-container { max-width: var(--max-text-width); margin: 0 auto; padding: 0 20px; }
.frame-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 3rem; }
.frame-item { cursor: pointer; overflow: hidden; }
.frame-item img { width: 100%; height: auto; display: block; filter: grayscale(100%); transition: filter 0.3s ease; }
.frame-item:hover img { filter: grayscale(0%); }
.load-more-btn { display: block; margin: 3rem auto 0; padding: 12px 30px; font-family: 'GOSTTypeA', sans-serif; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.1em; background: transparent; border: 2px solid var(--noir); color: var(--noir); cursor: pointer; transition: all 0.3s; }
.load-more-btn:hover { background: var(--noir); color: var(--day); }
.load-more-btn:disabled { opacity: 0.5; cursor: default; }
@media (max-width: 768px) { .frame-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .frame-grid { grid-template-columns: 1fr; } }