/* ============================================================
   ПАНЕЛЬ УПРАВЛЕНИЯ (Глобальные настройки сайта)
   ============================================================ */
:root {
    /* ЦВЕТА */
    --c-text: #777777;
    /* Цвет обычного текста (средний серый) */
    --c-dark: #333333;
    /* Цвет заголовков и важных надписей (темно-серый) */
    --c-active: #000000;
    /* Цвет активного пункта меню (черный) */
    --c-red: #cc4646;
    /* Цвет ссылки Telegram и полоски загрузки (красный) */
    --c-divider: #777777;
    /* Цвет разделительных линий с крестиком */

    /* ШРИФТЫ (Используем 4 основных размера из техзадания) */
    /* РАЗМЕР 1: Самый крупный. clamp делает его гибким: от 35px на мобильных до 75px на десктопе */
    --fs-1: clamp(35px, 8vw, 75px);

    /* РАЗМЕР 2: Средний. Для логотипа и основных заголовков секций (УЮТ, ПРОЕКТЫ и т.д.) */
    --fs-2: 21px;

    /* РАЗМЕР 3: Мелкий. Для меню, основного текста и контактов */
    --fs-3: 15px;

    /* РАЗМЕР 4: Очень мелкий. Для подписи "DESIGN STUDIO" под логотипом */
    --fs-4: 10px;

    /* ОТСТУПЫ И РАЗМЕРЫ (vh - это % от высоты экрана, vw - от ширины) */
    --gap-section: 8vh;
    /* Расстояние между большими смысловыми блоками */
    --gap-block: 4vh;
    /* Расстояние внутри блоков (например, от текста до линии) */
    --header-h: 70px;
    /* Фиксированная высота верхней шапки */
    --hero-h: 85vh;
    /* Высота главного слайдера на весь экран */

    /* Дополнительный отступ после слайдера */
    --gap-after-slider: 8vh;
}

/* ============================================================
   БАЗОВЫЕ СТИЛИ (Фундамент браузера)
   ============================================================ */
* {
    margin: 0;
    /* Обнуляем внешние отступы */
    padding: 0;
    /* Обнуляем внутренние отступы */
    box-sizing: border-box;
    /* Правильный расчет размеров блоков */
}

html {
    scroll-behavior: smooth;
    /* Плавная прокрутка */
}

body {
    font-family: 'Montserrat', sans-serif;
    /* Основной шрифт */
    color: var(--c-text);
    line-height: 1.6;
    background: #fff;
    -webkit-font-smoothing: antialiased;
    /* Четкость шрифтов */
}

/* Глобальный принудительный цвет для всех текстовых элементов */
body,
p,
h1,
h2,
h3,
a,
div {
    color: #333333;
    /* Единый темно-серый цвет текста */
}

/* ============================================================
   ШАПКА (HEADER)
   ============================================================ */
header {
    position: fixed;
    /* Зафиксирована сверху */
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-h);
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    z-index: 1000;
}

.logo {
    cursor: pointer;
    text-decoration: none;
}

.logo h1 {
    font-size: 20px;
    color: var(--c-active);
    font-weight: 400;
    letter-spacing: 3px;
    line-height: 1;
    text-transform: none;
    /* Для корректного SLONiMO */
}

.logo p {
    font-size: var(--fs-4);
    color: #999;
    letter-spacing: 1px;
    text-transform: uppercase;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
}

nav ul li a {
    text-decoration: none;
    color: var(--c-text);
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: 0.3s;
}

/* Активная страница в меню */
.active-page {
    color: var(--c-active) !important;
    font-weight: 600 !important;
}

/* ============================================================
   ГЛАВНЫЙ СЛАЙДЕР (HERO)
   ============================================================ */
.hero {
    position: relative;
    height: var(--hero-h);
    margin-top: var(--header-h);
    margin-bottom: var(--gap-after-slider);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
}

.slide-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: opacity 1.5s ease-in-out;
    opacity: 0;
    z-index: 1;
}

.slide-layer.active {
    opacity: 1 !important;
    z-index: 2;
}

/* Анимация медленного движения фото */
.ken-burns {
    animation: kb 20s infinite alternate linear;
}

@keyframes kb {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.1);
    }
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    pointer-events: none;
    width: 90%;
}

.hero-content h2 {
    font-size: var(--fs-1);
    color: #fff !important;
    font-weight: 300;
    letter-spacing: 8px;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
}

/* Стрелки слайдера */
.s-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 30px;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 20px;
    z-index: 30;
    user-select: none;
}

.s-prev {
    left: 10px;
}

.s-next {
    right: 10px;
}

/* Миниатюры */
.thumbnails {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 20;
}

.thumb {
    width: 65px;
    height: 45px;
    background-size: cover;
    border: 1px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    opacity: 0.7;
    transition: 0.3s;
}

.thumb.active {
    opacity: 1;
    border-color: #fff;
}

/* ============================================================
   ИНФО-БЛОКИ (Главная страница)
   ============================================================ */
.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: var(--gap-block) auto;
    width: 160px;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--c-divider);
    opacity: 0.3;
}

.divider span {
    margin: 0 15px;
    color: var(--c-divider);
    font-size: 14px;
}

.info-section {
    display: flex;
    align-items: center;
    gap: 5vw;
    padding: var(--gap-block) 10%;
}

.info-section.reverse {
    flex-direction: row-reverse;
}

.info-img {
    flex: 1;
    max-width: 50%;
}

.info-img img {
    width: 100%;
    display: block;
    object-fit: cover;
}

.info-text {
    flex: 1;
    text-align: center;
}

.info-text h3 {
    font-size: var(--fs-2);
    font-weight: 500;
    /* Жирность заголовка */
    margin-bottom: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.info-text p {
    text-align: justify;
}

/* ============================================================
   КОНТАКТЫ (Идеальное выравнивание)
   ============================================================ */
.contacts-section {
    padding: var(--gap-section) 10%;
}

.contacts-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 60px;
    max-width: 1100px;
    margin: 0 auto;
    align-items: start;
}

.contacts-photo img {
    width: 100%;
    display: block;
    filter: grayscale(10%);
}

.contacts-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.contacts-content h2 {
    font-size: var(--fs-2);
    font-weight: 500;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin: 0;
    line-height: 1;
}

.contacts-content .divider {
    margin: 20px auto;
}

.studio-name {
    font-size: var(--fs-2);
    font-weight: 500;
    margin-bottom: 30px;
}

.contacts-bio-text {
    text-align: justify;
    width: 100%;
    margin-bottom: 20px;
}

.contacts-info-row {
    width: 100%;
    text-align: left;
    margin-bottom: 5px;
}

.tg-link {
    color: var(--c-red) !important;
    text-decoration: none;
    font-weight: 500;
}

/* ============================================================
   ПРОЕКТЫ (ВОЗВРАЩЕНО К СОСТОЯНИЮ ИЗ СКРИНШОТА)
   ============================================================ */
.p-intro {
    padding-top: 100px;
    /* Умеренный отступ от меню */
    padding-bottom: 10px;
    text-align: center;
    /* ВСЁ В ЦЕНТРЕ, КАК НА СКРИНЕ */
    max-width: 100%;
    margin: 0 auto;
}

.p-intro h3 {
    font-size: var(--fs-2);
    font-weight: 500;
    /* Жирный заголовок "НАШИ ПРОЕКТЫ" */
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.p-intro p {
    text-align: center;
    /* ТЕКСТ ПО ЦЕНТРУ, КАК НА СКРИНЕ */
    line-height: 1.8;
    max-width: 90%;
    /* Позволяет тексту занимать до 90% ширины экрана */
    max-width: 1500px;
    margin: 0 auto;
}

/* Сетка фотографий */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 0 10% 5vh;
    margin-top: 5vh;
    /* Зазор между текстом и сеткой */
}

.p-item {
    aspect-ratio: 3/2;
    overflow: hidden;
    cursor: pointer;
}

/* Эффект увеличения при наведении */
.p-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.p-item:hover img {
    transform: scale(1.08);
}

/* LIGHTBOX (Просмотрщик) */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: 0.5s;
}

#lightbox.active {
    display: block;
    opacity: 1;
}

.lb-blur-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(40px) brightness(0.6);
    transform: scale(1.1);
    transition: background-image 1s;
    z-index: 2001;
}

.lb-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: opacity 1s;
    opacity: 0;
    z-index: 2005;
}

.lb-layer.visible {
    opacity: 1;
}

.lb-arrow {
    position: absolute;
    top: 0;
    height: 100%;
    width: 12%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px;
    color: rgba(255, 255, 255, 0.4);
    z-index: 2150;
    cursor: pointer;
    transition: 0.3s;
}

.lb-arrow:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.lb-prev {
    left: 0;
}

.lb-next {
    right: 0;
}

#lb-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--c-red);
    width: 0%;
    z-index: 2100;
}

.lb-close {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 40px;
    color: #fff;
    z-index: 2200;
    cursor: pointer;
}

/* ============================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ (Для планшетов и телефонов)
   ============================================================ */
@media (max-width: 900px) {
    header {
        flex-direction: column;
        height: auto;
        padding: 10px 0;
    }

    .logo {
        margin-bottom: 5px;
    }

    nav ul {
        gap: 15px;
    }

    nav ul li a {
        font-size: 11px;
    }

    .hero {
        margin-top: 100px;
        height: 75vh;
        min-height: 300px;
    }

    .info-section {
        flex-direction: column !important;
        padding: 4vh 8%;
        gap: 2vh;
    }

    .info-img {
        max-width: 100%;
        order: 2;
    }

    .info-text {
        order: 1;
        width: 100%;
    }

    .contacts-layout {
        grid-template-columns: 1fr;
        gap: 2vh;
    }

    .contacts-photo {
        order: 1;
        width: 80%;
        margin: 0 auto 20px;
    }

    .contacts-content {
        order: 2;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
}

footer {
    background: #333;
    color: #fff !important;
    text-align: center;
    padding: 15px 0;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: none;
}