:root {
    --bg-main: #0a0a0a;
    --bg-card: #18181c;
    --text-primary: #ededed;
    --text-muted: hsla(0, 0%, 93%, .72);
    --border-nav: hsla(0, 0%, 100%, .16);
    --border-divider: hsla(0, 0%, 100%, .12);
    --gradient: linear-gradient(135deg, #8A2BE2 0%, #C77DFF 100%);
    --accent: #A855F7;
    --accent-2: #7C3AED;
    --radius: 16px;
    --maxw: 1360px;
}

*,
:after,
:before {
    box-sizing: border-box;
    border: 0 solid #e5e7eb;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    background: var(--bg-main);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    font-family: "Inter", system-ui, sans-serif;
    line-height: 1.6;
    /* ГАРАНТИЯ ОТСУТСТВИЯ ГОРИЗОНТАЛЬНОЙ ПРОКРУТКИ */
    overflow-x: hidden; 
    min-height: 100vh;
}

/* =================================================================== */
/* === ОСНОВНЫЕ СТИЛИ (без изменений) === */
/* =================================================================== */

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-main);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-logo {
    width: 120px;
    height: auto;
    animation: preloaderFadeIn 1.5s ease-out;
}

.preloader-text {
    font-weight: 800;
    font-size: 2rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text; 
    animation: preloaderFadeIn 1.5s ease-out;
}

#site-content {
    opacity: 0;
    transition: opacity 1s ease-in-out 0.5s;
}

#site-content.visible {
    opacity: 1;
}

@keyframes preloaderFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-element {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-element.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- ИСПРАВЛЕНО: Глобальный контейнер .wrap --- */
.wrap {
    max-width: 1200px;
    margin: 0 auto;
    /* УБРАН padding 0 24px, чтобы избежать конфликтов на мобильных. */
    padding: 0;
}
/* --- ИСПРАВЛЕНО: Секции теперь содержат горизонтальный padding --- */
section {
    padding: 80px 24px; /* Горизонтальный отступ теперь тут */
    overflow: hidden; /* Дополнительная защита от сдвигов */
}

h1, h2, h3, h4 {
    font-weight: 800;
    line-height: 1.1;
}

h1 {
    font-size: clamp(40px, 5vw, 60px);
    margin: 0 0 12px;
}

h1 p, h1 P {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: clamp(30px, 4vw, 44px);
    margin-bottom: 20px;
    text-align: center;
}

/* --- КРИТИЧЕСКОЕ ИСПРАВЛЕНИЕ: HEADER (ФИКСАЦИЯ) --- */
header {
    position: fixed; /* ИЗМЕНЕНО: sticky -> fixed */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000; /* Высокий Z-индекс */
    padding: 0;
    margin-top: 0;
    background: var(--bg-main); /* Назначаем фон для фиксации */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); /* Добавляем тень для отделения */
}

/* --- ИСПРАВЛЕНО: NAV (УПРОЩЕНИЕ ДЛЯ ФИКСАЦИИ) --- */
.nav {
    max-width: var(--maxw);
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    /* УДАЛЕНИЕ сложных десктопных стилей для чистой фиксации */
    border: none; 
    background: transparent; 
    backdrop-filter: none;
    height: 60px;
    padding: 0 24px;
    border-radius: 0; /* Убираем radius, т.к. header fixed */
    box-shadow: none;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    height: 40px;
    width: auto;
}

.brand-name {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.desktop-nav {
    display: flex;
    align-items: center;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 10px;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    padding: 8px 16px;
    transition: all 0.3s;
    flex-shrink: 0;
}

nav a:hover {
    color: var(--text-primary);
    outline: 1px solid hsla(0, 0%, 100%, .24);
    border-radius: 100px;
    background: radial-gradient(68.55% 125% at 50% 141.52%, hsla(0, 0%, 100%, .3) 0, hsla(0, 0%, 4%, 0) 100%);
}

.nav-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn, a.btn {
    cursor: pointer;
    padding: 12px 24px;
    border-radius: 100px;
    background: var(--text-primary);
    color: var(--bg-main);
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    border: none;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    display: inline-block;
}

.btn:hover, a.btn:hover {
    box-shadow: 7px 5px 56px -14px #fff;
    transform: scale(1.02);
}

.ghost, a.ghost {
    background: transparent;
    border: 1px solid var(--text-muted);
    padding: 12px 24px;
    border-radius: 100px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 16px;
    line-height: 24px;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    display: inline-block;
}

.ghost:hover, a.ghost:hover {
    color: white;
    border-color: white;
}

/* --- ИСПРАВЛЕНО: HERO (ДОБАВЛЕН ОТСТУП СВЕРХУ) --- */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    /* КЛЮЧЕВОЕ ИСПРАВЛЕНИЕ: компенсируем фиксированный header */
    padding-top: 100px; 
    padding-bottom: 80px;
}

.hero-content {
    max-width: 800px;
    width: 100%;
    margin-bottom: 50px;
}

.lead {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 1.125rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-row {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 30px;
    justify-content: center;
}

.stats {
    display: flex;
    gap: 30px;
    align-items: center;
    color: var(--text-muted);
    font-weight: 500;
    justify-content: center;
    margin-top: 25px;
}

.pill {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    font-weight: 600;
    color: var(--accent);
    display: inline-block;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.phone {
    border-radius: 28px;
    padding: 16px;
    background: var(--bg-card);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    border: 1px solid var(--border-nav);
    max-width: 400px;
    margin: 0 auto;
}

.phone .screen {
    height: 560px;
    background: var(--bg-main);
    border-radius: 20px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid var(--border-divider);
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 20px;
}

.feature-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border-divider);
    transition: border-color 0.3s, transform 0.3s;
    display: flex;
    flex-direction: column;
}

.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
}

.highlighted-card {
    border-color: var(--accent) !important;
}

.price {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 16px 0;
}

.service-list {
    list-style: none;
    padding-left: 0;
    margin: 16px 0;
    text-align: left;
}

.service-list li {
    padding-left: 24px;
    position: relative;
    margin-bottom: 8px;
}

.service-list li::before {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
}

.service-list li.included {
    color: var(--text-primary);
}
.service-list li.included::before {
    content: '✓';
    color: var(--accent);
}

.service-list li.excluded {
    color: #555;
    text-decoration: line-through;
}
.service-list li.excluded::before {
    content: '–';
    color: #555;
}

.numbers {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    padding: 30px 0;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-divider);
}

.num {
    text-align: center;
}

.contact-section {
    padding: 40px;
    border-radius: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
}

.form-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-divider);
    padding: 12px 18px;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    transition: border-color 0.2s;
    width: 100%;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.success-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #18181c;
    color: var(--text-primary);
    padding: 32px;
    border-radius: 16px;
    border: 1px solid var(--accent);
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.5);
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.5;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
    z-index: 10;
}

.success-popup.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

#contactForm.submitted {
    filter: blur(5px);
    transition: filter 0.4s ease;
}

footer {
    margin-top: 80px;
    padding: 48px 0;
    border-top: 1px solid var(--border-divider);
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    font-size: 0.9rem;
}

/* =================================================================== */
/* ==== НАЧАЛО БЛОКА ДЛЯ МОБИЛЬНОЙ АДАПТАЦИИ (ЧЕТКИЙ КОД) ==== */
/* =================================================================== */

.menu-toggle {
    display: none; 
}
.mobile-menu {
    display: none; 
}

@media (max-width: 1080px) {
    .wrap {
        max-width: 900px;
    }
}

@media (max-width: 768px) {
    
    /* 1. Общие исправления и центрирование */
    section {
        padding: 40px 15px; /* Вертикальный отступ меньше, ГОРИЗОНТАЛЬНЫЙ отступ здесь */
    }
    
    .wrap {
        padding: 0; /* Контейнер .wrap НЕ должен иметь горизонтального отступа */
    }
    
    h1 { 
        font-size: 2.2rem; 
    }
    h2 { 
        font-size: 1.8rem; 
    }

    /* 2. Навигация и хедер */
    header {
        /* FIXED уже установлен выше, здесь его стиль на мобильных не меняем */
        box-shadow: 0 1px 5px rgba(0, 0, 0, 0.6);
    }
    
    .nav {
        max-width: 100%; 
        height: 50px; /* Уменьшаем высоту */
        padding: 0 15px; /* Уменьшаем горизонтальный padding */
    }
    
    .brand-logo {
        height: 30px; /* Уменьшаем логотип */
    }
    .brand-name {
        font-size: 1rem; /* Уменьшаем название */
    }
    
    .desktop-nav,
    .nav-right {
        display: none; /* Скрываем все десктопные элементы */
    }
    
    .menu-toggle {
        display: flex; /* Показываем гамбургер */
        /* ... стили гамбургера из вашего кода ... */
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 24px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1001;
    }
    /* Стили для анимации гамбургера */
    .menu-toggle span {
        width: 30px;
        height: 3px;
        background: var(--text-primary);
        border-radius: 10px;
        transition: all 0.3s ease-in-out;
    }
    .menu-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(7px, 7px); }
    .menu-toggle.open span:nth-child(2) { opacity: 0; }
    .menu-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(7px, -7px); }

    /* 3. Hero-секция и кнопки (Устранение кривизны) */
    .hero {
        padding-top: 60px; /* Компенсация высоты fixed header (50px + небольшой запас) */
        padding-bottom: 40px;
    }

    .cta-row {
        flex-direction: column; 
        align-items: stretch; /* Кнопки растягиваются по ширине */
        gap: 12px;
    }
    .btn, a.btn, .ghost, a.ghost {
        width: 100%; 
        text-align: center;
        padding: 14px 24px;
    }
    
    /* Статистика */
    .stats {
        flex-direction: column; 
        gap: 20px;
        align-items: flex-start; /* Выравнивание влево */
        margin-top: 30px;
    }
    .num {
        text-align: left;
    }
    
    /* 4. Карточки и другие секции (Центрирование) */
    .features {
        grid-template-columns: 1fr; /* Вертикальный стек */
        gap: 16px; /* Чуть меньше зазор */
    }
    
    .numbers {
        flex-direction: column;
        gap: 30px;
        /* margin-left: -15px; margin-right: -15px; для растягивания на всю ширину wrap */
    }
    
    .phone {
        max-width: 350px;
    }
    .phone .screen {
        height: 450px;
    }
    
    /* 5. Футер */
    footer {
        margin-top: 40px;
        padding: 30px 15px;
    }
}