:root {
    --nav-h: 80px;
    --bg-dark: #000000;
    --bg-anthracite: #1a1a1a;
    --white: #ffffff;
    --pt-serif: "PT Serif", serif;
    --satoshi: 'Satoshi', sans-serif;
    --cubic: cubic-bezier(0.23, 1, 0.32, 1);
    --container-w: 1200px;
    --side-gutter: 25px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
}

body,
html {
    width: 100%;
    background-color: var(--bg-dark);
    color: var(--white);
    font-family: var(--satoshi);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== NAVIGATION ===== */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    z-index: 10000;
    display: flex;
    align-items: center;
    background-color: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
    width: 100%;
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 var(--side-gutter);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo img {
    height: 35px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 35px;
    list-style: none;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 500;
    opacity: 0.6;
    transition: 0.3s;
}

.nav-links a:hover {
    opacity: 1;
}


/* Состояние активной ссылки */
.nav-links a.active {
    opacity: 1;
    position: relative;
}

/* Линия под текстом */
.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    /* Расстояние от текста до линии */
    left: 0;
    width: 100%;
    height: 2px;
    /* Толщина линии */
    background-color: var(--white);
}

/* Burger Button */
.burger-btn {
    display: none;
    /* По умолчанию скрыт на десктопе */
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 10001;
    padding: 10px;
}

.burger-btn span {
    width: 28px;
    height: 2px;
    background-color: var(--white);
    transition: 0.4s var(--cubic);
}

/* Состояние крестика */
.burger-btn.is-active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.burger-btn.is-active span:nth-child(2) {
    opacity: 0;
}

.burger-btn.is-active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Мобильное меню */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background-color: var(--bg-dark);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    transition: right 0.6s var(--cubic);
}

.mobile-menu.is-active {
    right: 0;
}

.mobile-menu a {
    font-family: var(--pt-serif);
    font-size: 32px;
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(20px);
    transition: 0.4s var(--cubic);
}

/* Анимация появления ссылок в меню */
.mobile-menu.is-active a {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 991px) {
    .nav-links {
        display: none;
        /* Прячем обычные ссылки */
    }

    .burger-btn {
        display: flex;
        /* Показываем бургер */
    }
}

/* ===== COMPACT LUXURY FOOTER ===== */
.footer {
    background-color: var(--bg-anthracite);
    color: var(--white);
    padding: 60px 0 30px;
    /* Уменьшенные вертикальные отступы */
    font-family: var(--satoshi);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-container {
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 var(--side-gutter);
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
}

/* Левый блок */
.footer-logo {
    display: block;
    margin-bottom: 20px;
}

.footer-logo img {
    height: 40px;
    width: auto;
}

.footer-address {
    font-style: normal;
    font-size: 10px;
    line-height: 1.6;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.5;
    margin-bottom: 20px;
}

.footer-contacts-links {
    display: flex;
    gap: 20px;
    margin-bottom: 0;
}

.footer-link {
    color: var(--white);
    text-decoration: none;
    font-size: 11px;
    letter-spacing: 0.05em;
    opacity: 0.8;
    transition: opacity 0.3s var(--cubic);
}

.footer-link:hover {
    opacity: 1;
}

/* Правый блок (Навигация) */
.footer-nav-wrapper ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

.footer-nav-wrapper a {
    color: var(--white);
    text-decoration: none;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.6;
    transition: 0.3s var(--cubic);
}

.footer-nav-wrapper a:hover {
    opacity: 1;
}

/* Разделитель и Копирайт */
.footer-divider {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 20px;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Социальные иконки */
.footer-socials {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.footer-socials img {
    width: 16px;
    height: 16px;
    opacity: 0.5;
    transition: opacity 0.3s var(--cubic), transform 0.3s var(--cubic);
}

.footer-socials a:hover img {
    opacity: 1;
    transform: translateY(-2px);
}

/* Адаптив для мобилок */
@media (max-width: 768px) {
    .footer-top {
        flex-direction: column;
        gap: 40px;
    }

    .footer-nav-wrapper ul {
        flex-direction: column;
        gap: 12px;
    }

    .footer-contacts-links {
        flex-direction: column;
        gap: 10px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}



/* ===== STUFF SECTION =====*/
/* Базовые настройки */
.director-page {
    background: #111;
    color: #fff;
    font-family: inherit;
}

.director-hero {
    padding: var(--nav-h) var(--side-gutter) 0;
    max-width: var(--container-w);
    margin: 0 auto;
    /* Вычитаем высоту nav, чтобы секция не вылезала за экран */
    height: calc(100vh - var(--nav-h)); 
    display: flex;
    align-items: center; /* Центрирует всё содержимое по вертикали */
}

.director-name {
    font-size: clamp(40px, 8vw, 100px);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 60px;
}

.hero-flex-layout {
    display: flex;
    gap: 60px;
    align-items: center; /* ЭТО центрирует текст по середине высоты видео */
    width: 100%;
}

.main-video-wrapper {
    border:1px solid #f1f1f1;
    border-radius:24px;
    flex: 2;
    position: relative;
    height: 450px;
    background: #222;
}

.video-popup-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(15px);
    padding: 20px; /* Безопасная зона */
}

#videoFrameContainer {
    width: 100%;
    height: auto;
}

#videoFrameContainer video {
    display: block;
    width: auto;      /* Видео само определит ширину */
    height: auto;     /* И высоту */
    max-width: 100%;  /* Но не больше родителя */
    max-height: 85vh; /* Но не выше окна браузера */
    object-fit: contain; /* Сохраняет пропорции без обрезки */
}

.video-popup-overlay.active {
    display: flex;
}

/* Показываем надпись, только когда попап активен */
.video-popup-overlay.active #cursorClose {
    opacity: 1;
}

.popup-content {
    position: relative;
    width: auto;      /* Ширина зависит от контента */
    max-width: 90vw;  /* Не шире 90% экрана */
    height: auto;     /* Высота зависит от контента */
    max-height: 85vh; /* Не выше 85% экрана, чтобы осталось место для кнопки закрытия */
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-video-wrapper:hover .play-btn-hero {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
}

.content-video {
    border-radius: 24px;
    width: 100%;
    height: 100%;
    object-fit: cover; 
    display: block;
}

.video-overlay {
    border-radius:24px;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent);
}

/* Кнопка закрытия (стильный минимализм) */
.close-popup {
    position: absolute;
    top: -50px; 
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    transition: background 0.3s ease, transform 0.3s var(--cubic);
}

.close-popup:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

#cursorClose {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none; /* КРИТИЧНО: чтобы надпись не перехватывала клики */
    z-index: 20001;      /* Должен быть выше попапа */
    color: white;
    font-family: sans-serif;
    font-size: 12px;
    letter-spacing: 2px;
    font-weight: bold;
    text-transform: uppercase;
    opacity: 0;          /* По умолчанию скрыта */
    transition: opacity 0.3s ease;
}

/* Адаптивность для мобилок */
@media (max-width: 768px) {
    .video-popup-overlay {
        padding: 15px;
    }
    .popup-content {
        border-radius: 12px;
    }
    
    .popup-content {
        max-width: 100%; /* На телефоне используем всю ширину */
    }
    
    .close-popup {
        top: -45px; /* Кнопка над видео */
        right: 5px;
    }
}

.play-btn {
    position: absolute;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s, transform 0.2s;
    z-index: 10;
}

.play-btn-hero {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    opacity: 0.8;
    transition: transform 0.4s var(--cubic), opacity 0.3s ease;
}


.play-btn:hover {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.7);
}

/* Скрываем кнопку при воспроизведении */
.video-container.is-playing .play-btn {
    opacity: 0;
    pointer-events: none;
}

.hero-bio-short {
    flex: 1;
}

.hero-bio-short h1 {
    font-size: 42px;
    font-family: var(--pt-serif);
    margin-bottom: 15px;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-bio-short p {
    font-size: 16px;
    line-height: 1.6;
    opacity: 0.7;
    max-width: 380px; /* Чтобы текст не растягивался слишком широко */
}

.label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 3px;
    opacity: 0.4;
    margin-bottom: 20px;
}


.experience-section {
    padding: 100px 0; /* Добавим отступ сверху и снизу */
}

/* Mosaic Experience */
.experience-mosaic {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* Увеличиваем базовую высоту ячейки, чтобы сетка была массивнее */
    grid-auto-rows: 320px; 
    gap: 20px;
    padding: 0 var(--side-gutter);
    max-width: var(--container-w);
    margin: 0 auto;
}

.mosaic-item {
    background-size: cover;
    background-position: center;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    
    /* Делаем ч/б эффект более стильным (не 100% глухой) */
    filter: grayscale(0.8) contrast(1.1);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.mosaic-item:hover {
    filter: grayscale(0) contrast(1);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.02); /* Легкий зум всей карточки */
    z-index: 10;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}

.mosaic-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: inherit;
    background-size: cover;
    background-position: center;
    transition: transform 1.2s var(--cubic);
    z-index: -1;
}

.mosaic-item:hover::before {
    transform: scale(1.1);
}


.item-wide {
    grid-column: span 2;
}

.item-tall {
    grid-row: span 2; /* Теперь это будет реально мощный вертикальный блок (640px+) */
}

/* Инфо-плашка */
.item-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 2;
}

.item-info span {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Wavy Videos */
.wavy-showcase {
    padding: 100px var(--side-gutter);
}

.wavy-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    max-width: var(--container-w);
    margin: 0 auto;
}

.wavy-card {
    aspect-ratio: 1/1.2;
    clip-path: url(#wavyPath);
    /* Та самая маска из SVG */
    background: #222;
}

.wavy-video-content {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ===== STUFF / DIRECTOR PAGE MOBILE ADAPTIVE ===== */
@media (max-width: 768px) {
    /* 1. Hero Section */
    .director-hero {
        padding: 100px 15px 40px;
    }

    .director-name {
        font-size: 48px; /* Крупно, но в одну строку */
        letter-spacing: 0.1em;
        margin-bottom: 30px;
        text-align: center;
    }

    .hero-flex-layout {
        flex-direction: column; /* Видео над текстом */
        gap: 30px;
        align-items: center;
    }

    .main-video-wrapper {
        border-radius:24px;
        width: 100%;
        height: 300px; /* Фиксированная высота для мобильных */
        flex: none;
    }

    .hero-bio-short {
        text-align: center;
        padding: 0 10px;
    }

    /* 2. Experience Mosaic (Сетка фотографий) */
    .experience-section {
        padding: 40px 0;
    }

    .experience-mosaic {
        grid-template-columns: 1fr; /* Одна колонка для чистого фокуса на фото */
        grid-auto-rows: 450px; /* Высокие красивые карточки */
        gap: 15px;
        padding: 0 15px;
    }

    /* Сбрасываем спец-размеры для мобильных, чтобы все были в ряд */
    .item-wide, 
    .item-tall {
        grid-column: span 1;
        grid-row: span 1;
    }

    .mosaic-item {
        filter: grayscale(0) contrast(1); /* На мобилках лучше сразу в цвете */
    }

    /* 3. Bio Text */
    .full-bio {
        padding: 60px 20px;
    }

    .bio-content {
        max-width: 100%;
        text-align: center;
    }

    .bio-content p {
        font-size: 18px;
        line-height: 1.5;
    }

    /* 4. Wavy Showcase (Видео с маской) */
    .wavy-showcase {
        padding: 40px 15px;
    }

    .wavy-wrapper {
        grid-template-columns: 1fr; /* Видео одно под другим */
        gap: 30px;
    }

    .wavy-card {
        aspect-ratio: 1 / 1.1; /* Чуть менее вытянутые на мобилке */
    }

    /* 5. Video Popup (Корректировка под палец) */
    .popup-content {
        aspect-ratio: 9 / 16; /* Вертикальное видео на весь экран, если оно снято на телефон */
        max-height: 80vh;
    }

    /* Скрываем кастомный курсор "CLOSE" на тач-устройствах */
    #cursorClose {
        display: none !important;
    }

    .close-popup {
        top: -50px;
        right: 50%;
        transform: translateX(50%); /* Кнопка закрытия по центру над видео */
    }
}

/* Для совсем маленьких экранов (iPhone 5/SE) */
@media (max-width: 380px) {
    .director-name {
        font-size: 38px;
    }
    
    .experience-mosaic {
        grid-auto-rows: 350px;
    }
}