/* =======================================================
   0. НАСТРОЙКИ
   ======================================================= */
:root {
    --mobile-poster: url('../../preview/0.jpg'); 
}

/* =======================================================
   1. БАЗА
   ======================================================= */
html, body {
    margin: 0; padding: 0;
    background-color: #111;
    font-family: 'Manrope', sans-serif;
    color: white;
    width: 100%;
    height: 100%;
    overflow: hidden; /* На десктопе управляем скроллом через JS */
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background-color: #FF5E00; border-radius: 4px; }

.container {
    width: 100%; height: 100%;
    padding: 0 60px; /* Поля десктопа */
    box-sizing: border-box;
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
}

/* =======================================================
   2. ВИДЕО-СИСТЕМА (ДЕСКТОП)
   ======================================================= */
.video-container {
    position: fixed; 
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 100; 
    overflow: hidden;
    transition: all 1.2s cubic-bezier(0.77, 0, 0.175, 1);
    background-color: #000;
}

body.scrolled-state .video-container {
    top: auto; 
    left: 60px; 
    bottom: 60px;
    width: 40vw; 
    height: 35vh; 
    z-index: 10;
    border-radius: 12px;
}

/* Развертывание видео на десктопе */
body.expanded-state .video-container {
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    width: 100vw !important; height: 100vh !important;
    bottom: auto !important; right: auto !important;
    z-index: 5000 !important; 
    border-radius: 0 !important;
}

.bg-video {
    width: 100%; height: 100%; object-fit: cover;
    filter: brightness(0.6); transition: filter 1s ease;
}
body.scrolled-state .bg-video { filter: brightness(1); }

#videoClickArea { position: absolute; inset: 0; cursor: default; }

/* =======================================================
   3. КОНТЕНТ (ДЕСКТОП)
   ======================================================= */
.content-section {
    height: 100vh; width: 100%;
    padding-top: 50px; 
    display: flex; flex-direction: column; 
    position: absolute; top: 0; left: 0; 
    z-index: 2; opacity: 0; pointer-events: none;
    transition: opacity 1.5s ease 0.5s; 
}
body.scrolled-state .content-section { opacity: 1; pointer-events: auto; }

.header { display: flex; justify-content: space-between; align-items: flex-start; width: 100%; flex-shrink: 0; }

.logo { 
    font-size: clamp(3rem, 5vw, 4rem); 
    font-weight: 800; line-height: 1;
    text-transform: uppercase; margin-left: -4px;
    text-decoration: none; color: white;
    display: inline-block;
}
.logo span { 
    display: block; font-size: 0.26em; letter-spacing: 1.45em; 
    font-weight: 400; margin-top: 0.35em; margin-left: 0.2em;
    color: rgba(255,255,255,0.65); 
}

.nav { display: flex; gap: 40px; padding-top: 10px; }
.nav a { 
    color: white; 
    text-decoration: none; 
    font-weight: 600; 
    text-transform: uppercase; 
    font-size: 0.9rem; 
    letter-spacing: 1px; 
    white-space: nowrap;
    /* Плавный переход цвета (0.3 секунды) */
    transition: color 0.3s ease; 
}

/* Эффект при наведении */
.nav a:hover { 
    color: #FF5E00; /* Ваш фирменный оранжевый */
}

.info-block { 
    margin-top: 50px; max-width: 600px;
    flex-grow: 1; overflow-y: auto; padding-right: 10px;
}
.info-text { font-size: 1rem; line-height: 1.6; text-transform: uppercase; color: rgba(255,255,255,0.9); letter-spacing: 0.5px; }

.red-text { 
    color: #FF5E00; font-weight: 700; margin-top: 40px; 
    display: block; font-size: 1.25rem; line-height: 1.5; 
    position: relative; z-index: 200; pointer-events: all;
}
.red-text a { color: inherit; text-decoration: none; cursor: pointer; }

/* =======================================================
   4. UI ЭЛЕМЕНТЫ (КУРСОР / ПАНЕЛИ)
   ======================================================= */
.custom-cursor {
    position: fixed; top: 0; left: 0; width: 200px; height: 200px;
    pointer-events: none; z-index: 9999; transform: translate(-50%, -50%);
    display: flex; justify-content: center; align-items: center;
    opacity: 0; transition: opacity 0.3s ease;
    will-change: transform, top, left;
}
.cursor-backdrop {
    position: absolute; width: 100%; height: 100%;
    background-color: #FF5E00; border-radius: 50%;
    box-shadow: 0 0 50px 15px rgba(255, 94, 0, 0.5);
    z-index: 1; will-change: transform;
}
.cursor-text { position: relative; z-index: 2; color: white; text-transform: uppercase; font-weight: 600; font-size: 0.9rem; }
.custom-cursor.visible { opacity: 1; }

.skip-btn-container {
    position: fixed; bottom: 60px; left: 0; width: 100%;
    display: flex; justify-content: center; z-index: 1000;
}
.skip-btn {
    background-color: #FF5E00; color: white; padding: 15px 35px; border-radius: 50px;
    text-transform: uppercase; font-weight: 600; border: none; cursor: pointer;
}
/* ПАНЕЛЬ О НАС: ЦВЕТА И СТИЛИ */
.about-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 38%;
    height: 100%;
    z-index: 5000;
    background-color: rgba(17, 17, 17, 0.98);
    backdrop-filter: blur(20px);
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
}

.about-panel.open {
    transform: translateX(0);
}

.panel-content {
    padding: 80px 40px;
}

.close-btn {
    position: absolute;
    top: 30px;
    right: 30px;
    font-size: 2rem;
    cursor: pointer;
    color: #FF5E00;
    transition: transform 0.3s ease;
}

.close-btn:hover {
    transform: rotate(90deg);
    color: #ffffff;
}

.panel-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 30px;
    text-transform: uppercase;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 94, 0, 0.3);
    padding-bottom: 15px;
}

.panel-subtitle {
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 10px;
    text-transform: uppercase;
    color: #FF5E00;
}

.section-text {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.85);
}

.services-list {
    list-style: none;
    padding: 0;
}

.services-list li {
    margin-bottom: 12px;
    position: relative;
    padding-left: 20px;
    color: #ffffff;
}

.services-list li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: #FF5E00;
    font-weight: 800;
}

/* Распорка для скролла */
.scroll-spacer {
    height: 110vh;
    width: 100%;
    pointer-events: none;
    position: relative;
    z-index: -5;
}
.about-panel.open { transform: translateX(0); }
.panel-content { padding: 80px 40px; }
.close-btn { position: absolute; top: 30px; right: 30px; font-size: 2rem; cursor: pointer; color: #FF5E00; }

.scroll-spacer { height: 110vh; width: 100%; pointer-events: none; position: relative; z-index: -5; }

/* =======================================================
   5. АДАПТАЦИЯ НОУТБУКОВ / 150% (ДЕСКТОП)
   ======================================================= */
@media (min-width: 1025px) and (max-height: 840px) {
    .container { padding: 0 40px; }
    body.scrolled-state .video-container { left: 40px; bottom: 40px; width: 30vw; height: 30vh; min-width: 300px; }
    .info-block { margin-top: 20px; max-height: calc(100vh - 30vh - 180px); overflow-y: auto; }
}

/* =======================================================
   6. ГЛАВНЫЙ ФИКС: МОБИЛЬНЫЕ (PORTRAIT & LANDSCAPE)
   ======================================================= */
@media (max-width: 1024px) {
    /* ОТКЛЮЧАЕМ ВСЕ ЖЕСТКИЕ ВЫСОТЫ */
    html, body {
        height: auto !important;
        min-height: 100% !important;
        overflow-y: auto !important; /* Разрешаем нормальный скролл */
        overflow-x: hidden;
        display: flex !important;
        flex-direction: column !important;
    }

    /* Контент идет первым */
    .content-section { 
        position: relative !important; 
        height: auto !important; 
        min-height: auto !important;
        top: 0 !important;
        padding-top: 30px; 
        opacity: 1 !important; 
        pointer-events: auto !important; 
        order: 1; /* Верх */
    }

    .container { 
        padding: 0 20px !important; /* Единые поля для всей мобилки */
        height: auto !important; 
        display: flex !important;
        flex-direction: column !important;
    }

    .logo { font-size: 2.2rem; }
    .logo span { margin-top: 0.2em; letter-spacing: 1.1em; }
    .nav { gap: 15px; padding-top: 5px; }
    .nav a { font-size: 0.75rem; }

    .info-block { 
        margin-top: 25px; 
        max-width: 100% !important; 
        overflow: visible !important; /* Никаких внутренних скроллов */
        padding-right: 0;
    }
    .info-text { font-size: 0.9rem; line-height: 1.5; }
    .red-text { margin-top: 25px; font-size: 1.1rem; padding-bottom: 20px; }
    
    /* ПРЯЧЕМ ДЕСКТОПНЫЕ ЭЛЕМЕНТЫ */
    .bg-video, .skip-btn-container, .custom-cursor, .scroll-spacer { display: none !important; }

    /* КАРТИНКА (ВНИЗУ, ВЫРОВНЕНА ПО ПОЛЯМ) */
    body.scrolled-state .video-container {
        position: relative !important;
        top: auto !important; 
        left: 0 !important; 
        bottom: 0 !important;
        /* Ширина 100% внутри контейнера с padding 20px даст идеальное выравнивание */
        width: 100% !important; 
        height: 250px !important; 
        min-height: 200px;
        background-image: var(--mobile-poster);
        background-size: cover; 
        background-position: center;
        border-radius: 12px;
        margin: 10px 0 40px 0 !important; /* Отступы: 10 сверху, 40 снизу */
        order: 2; /* Всегда под текстом */
        filter: brightness(1);
    }
    
    /* Доп. фикс для О НАС на мобилках */
    .about-panel { width: 100%; }
}

/* Специально для ОЧЕНЬ низких экранов (горизонтальный телефон) */
@media (max-width: 1024px) and (max-height: 500px) {
    body.scrolled-state .video-container {
        height: 300px !important; /* Чтобы картинка не была слишком мелкой */
    }
}