* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100vw;
    /* Запрещаем странице прокручиваться вбок и убираем невидимые вылеты */
    overflow-x: hidden;
    position: relative;
}

body {
    background-color: #050508;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

/* Холст для созвездий на фоне */
#space-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Главный экран */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 20px;
    z-index: 2;
}

.glow {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

/* Анимация перелива градиента */
@keyframes cosmicGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 24px;
    z-index: 2;
    
    /* ИЗМЕНЕНО: Новый трехцветный космический градиент увеличенного размера */
    background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 50%, #6366f1 100%);
    background-size: 200% 200%;
    
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    
    /* ИЗМЕНЕНО: Запуск анимации перелива */
    animation: cosmicGradient 6s ease infinite;
}

.hero p {
    font-size: 1.35rem;
    color: #94a3b8;
    max-width: 650px;
    margin-bottom: 40px;
    z-index: 2;
    opacity: 0;
    line-height: 1.6;
}

.cta-btn {
    padding: 18px 42px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(90deg, #4f46e5, #6366f1);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    z-index: 2;
    transition: transform 0.3s cubic-bezier(0.2, 1, 0.2, 1), box-shadow 0.3s ease;
    opacity: 0;
}

.cta-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 30px rgba(79, 70, 229, 0.4);
}

/* Общие контейнеры секций */
.section-container {
    padding: 120px 20px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

.section-container h2 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 60px;
    
    /* ИЗМЕНЕНО: Градиент для заголовков секций */
    background: linear-gradient(135deg, #ffffff 0%, #818cf8 50%, #c084fc 100%);
    background-size: 200% 200%;
    
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    
    /* ИЗМЕНЕНО: Запуск анимации перелива */
    animation: cosmicGradient 6s ease infinite;
}

/* Сетка Услуг */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.card {
    background: rgba(17, 17, 25, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 40px 30px;
    border-radius: 24px;
    text-align: left;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.2, 1, 0.2, 1), border-color 0.4s ease, box-shadow 0.4s ease;
    cursor: pointer;
    opacity: 0;
}

.card:hover {
    transform: translateY(-8px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.08);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.08), transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.card:hover::before {
    opacity: 1;
}

.card-icon {
    font-size: 2.2rem;
    margin-bottom: 24px;
    background: rgba(99, 102, 241, 0.1);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.card h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #ffffff;
    font-weight: 700;
}

.card p {
    font-size: 0.95rem;
    color: #94a3b8;
    line-height: 1.6;
}

.card a {
    color: #a5b4fc;
    text-decoration: none;
    font-weight: 600;
}

/* Сетка Портфолио */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.portfolio-item {
    background: rgba(20, 20, 30, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.02);
    padding: 25px;
    border-radius: 16px;
    text-align: left;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
    opacity: 0;
}

.portfolio-item:hover {
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.2);
    transform: scale(1.03);
}

.portfolio-item span {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #6366f1;
    display: block;
    margin-bottom: 8px;
}

.portfolio-item h4 {
    font-size: 1.15rem;
    color: #ffffff;
    font-weight: 600;
}

/* Скрываем стандартный курсор на всем сайте */
html,
body,
a,
button,
.card,
.portfolio-item {
    cursor: none !important;
}

/* Центральная точка курсора */
.custom-cursor-dot {
    width: 8px;
    height: 8px;
    background-color: #a5b4fc;
    border-radius: 50px;
    position: fixed;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
}

/* Внешний светящийся контур созвездия */
.custom-cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.03);
    border-radius: 50px;
    position: fixed;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9998;
    /* Плавное изменение размеров при hover-эффектах */
    transition: width 0.3s ease, height 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

/* Состояние курсора при наведении на интерактивные элементы */
.custom-cursor-outline.hovered {
    width: 65px;
    height: 65px;
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.8);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

/* Контейнер для туманностей Ориона */
.nebula-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    /* Под звездами */
    overflow: hidden;
    pointer-events: none;
    opacity: 0.7;
    mix-blend-mode: screen;
    /* Включаем аппаратное ускорение для всего контейнера */
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Общие настройки для реалистичного газа */
.nebula {
    position: absolute;
    border-radius: 60% 40% 70% 30% / 50% 60% 40% 50%;
    will-change: transform, border-radius;
    /* Сглаживание краев на уровне рендеринга видеокарты */
    transform: translateZ(0);
    filter: url(#cosmic-blur);
}

/* Центральное ядро Туманности Ориона (Розово-фиолетовый взрыв) */
.nebula-purple {
    width: 75vw;
    /* Используем проценты от экрана для точности */
    height: 75vw;
    /* Увеличиваем количество точек градиента для более мягкого перехода без ступеней */
    background: radial-gradient(circle at 45% 45%,
            rgba(236, 72, 153, 0.28) 0%,
            rgba(167, 139, 250, 0.18) 35%,
            rgba(79, 70, 229, 0.08) 60%,
            rgba(0, 0, 0, 0) 80%);
    top: -10%;
    left: -10%;
    animation: nebulaMorph 40s infinite alternate ease-in-out;
}

/* Бирюзово-синие рукава туманности */
.nebula-blue {
    width: 85vw;
    height: 85vw;
    background: radial-gradient(circle at 55% 55%,
            rgba(6, 182, 212, 0.24) 0%,
            rgba(59, 130, 246, 0.14) 40%,
            rgba(30, 27, 75, 0.05) 65%,
            rgba(0, 0, 0, 0) 85%);
    bottom: -15%;
    right: -15%;
    animation: nebulaMorphReverse 50s infinite alternate ease-in-out;
}

/* Анимация деформации (Morphing) с оптимизированными свойствами */
@keyframes nebulaMorph {
    0% {
        transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
        border-radius: 60% 40% 70% 30% / 50% 60% 40% 50%;
    }

    50% {
        transform: translate3d(40px, 20px, 0) scale(1.08) rotate(45deg);
        border-radius: 45% 55% 50% 50% / 45% 45% 55% 55%;
    }

    100% {
        transform: translate3d(-20px, 30px, 0) scale(0.95) rotate(90deg);
        border-radius: 65% 35% 55% 45% / 55% 50% 45% 55%;
    }
}

@keyframes nebulaMorphReverse {
    0% {
        transform: translate3d(0, 0, 0) scale(0.95) rotate(90deg);
        border-radius: 45% 55% 50% 50% / 45% 45% 55% 55%;
    }

    50% {
        transform: translate3d(-30px, -20px, 0) scale(1.1) rotate(135deg);
        border-radius: 60% 40% 70% 30% / 50% 60% 40% 50%;
    }

    100% {
        transform: translate3d(15px, -10px, 0) scale(1) rotate(180deg);
        border-radius: 50% 50% 45% 55% / 50% 45% 55% 50%;
    }
}

/* Конце Ориона */






/* Контейнер кнопок связи */
.contact-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* Общие стили космических кнопок */
.space-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 32px;
    border-radius: 16px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    background: rgba(17, 17, 25, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.2, 1, 0.2, 1);
    opacity: 0;
    /* Для анимации скролла */
}

.space-btn .btn-icon {
    font-size: 1.8rem;
    transition: transform 0.3s ease;
}

.space-btn .btn-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.space-btn .btn-text span {
    font-size: 0.8rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.space-btn .btn-text strong {
    font-size: 1.2rem;
    color: #ffffff;
    font-weight: 700;
}

/* Специфика для Telegram (Синее неоновое свечение) */
.tg-btn:hover {
    border-color: #3b82f6;
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.3);
    transform: translateY(-5px);
}

.tg-btn:hover .btn-icon {
    transform: translate(4px, -4px) scale(1.1);
    /* Эффект взлетающего самолетика */
}

/* Специфика для Max (Фиолетовое неоновое свечение) */
.max-btn:hover {
    border-color: #8b5cf6;
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.3);
    transform: translateY(-5px);
}

.max-btn:hover .btn-icon {
    transform: translateY(-4px) rotate(-15deg);
    /* Эффект покачивания ракеты */
}

/* Добавляем скрытие дефолтного курсора и для новых кнопок связи */
.space-btn {
    cursor: none !important;
}

/* Сетка преимуществ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    margin-top: 20px;
}

/* Элемент преимущества */
.feature-item {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0) 100%);
    border-left: 2px solid rgba(99, 102, 241, 0.2);
    padding: 35px;
    border-radius: 0 24px 24px 0;
    text-align: left;
    transition: all 0.4s ease;
    opacity: 0;
    /* Для анимации скролла */
}

/* Эффект при наведении */
.feature-item:hover {
    background: rgba(99, 102, 241, 0.03);
    border-left-color: #6366f1;
    transform: translateX(8px);
}

/* Космический бейдж с номером */
.feature-badge {
    font-size: 0.9rem;
    font-weight: 700;
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.1);
    padding: 6px 14px;
    border-radius: 50px;
    display: inline-block;
    margin-bottom: 24px;
    letter-spacing: 1px;
}

.feature-item h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: #ffffff;
}

.feature-item p {
    font-size: 1rem;
    color: #94a3b8;
    line-height: 1.6;
}

/* Скрываем дефолтный курсор для новых карточек */
.feature-item {
    cursor: none !important;
}







/* Контейнер статистики */
.stats-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px 0;
    opacity: 0;
    /* ВОЗВРАЩАЕМ: Изначально скрыт, скрипт сам его проявит при скролле */
}

/* Круговой радар */
.radar-circle {
    position: relative;
    width: 280px;
    height: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: none !important;
}

.radar-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    /* Разворачиваем, чтобы анимация шла сверху */
}

/* Заднее блеклое кольцо */
.radar-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.03);
    stroke-width: 6;
}

/* Переднее светящееся кольцо */
.radar-progress {
    fill: none;
    stroke: linear-gradient(135deg, #6366f1, #a855f7);
    /* Зададим цвет ниже через скрипт/CSS */
    stroke: #6366f1;
    stroke-width: 6;
    stroke-linecap: round;
    /* Длина окружности (2 * PI * r) где r=90 => ~565.4 */
    stroke-dasharray: 565.4;
    stroke-dashoffset: 565.4;
    /* Изначально кольцо пустое */
}

/* Контент внутри радара */
.radar-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.counter-prefix {
    font-size: 1.5rem;
    color: #a5b4fc;
    font-weight: 700;
    margin-bottom: -10px;
}

.radar-content h2.counter-number {
    font-size: 4.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ffffff 60%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    padding: 0;
    line-height: 1;
    opacity: 1 !important;
    /* Перебиваем дефолтный h2 */
}

.counter-label {
    font-size: 0.9rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 10px;
    font-weight: 600;
}

/* Пульсирующий световой эффект вокруг всего радара при наведении */
.radar-circle:hover .radar-progress {
    stroke: #8b5cf6;
    filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.6));
    transition: stroke 0.3s, filter 0.3s;
}











/* Контейнер летающей тарелки */
#ufo-container {
    position: fixed;
    top: -100px;
    left: -150px;
    /* Изначально прячется далеко за экраном слева */
    width: 100px;
    height: 60px;
    z-index: 999;
    /* Летает поверх всего контента сайта, под курсором */
    pointer-events: auto;
    /* Чтобы тарелка реагировала на мышь */
    will-change: transform;
    filter: drop-shadow(0 0 15px rgba(99, 102, 241, 0.6));
    cursor: none !important;
}

.ufo-svg {
    width: 100%;
    height: 100%;
}

/* Мигание огней тарелки */
.ufo-light {
    animation: ufoBlink 0.6s infinite alternate ease-in-out;
}

/* Поочередное мигание огней */
.ufo-light:nth-child(odd) {
    animation-delay: 0.3s;
}

@keyframes ufoBlink {
    0% {
        opacity: 0.3;
        fill: #ef4444;
    }

    100% {
        opacity: 1;
        fill: #38bdf8;
    }
}













/* Стили для фиксированной космической шапки */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    /* Парит поверх всего контента и НЛО */
    background: rgba(5, 5, 8, 0.4);
    backdrop-filter: blur(12px);
    /* Эффект матового стекла */
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding: 15px 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Блок логотипа */
.logo-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-svg {
    width: 48px;
    /* Оптимальный размер для геометрии */
    height: auto;
    display: block;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #ffffff 40%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.brand-slogan {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

/* Правая часть: Телефон */
.header-phone {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #ffffff;
    font-weight: 600;
    font-size: 1.05rem;
    padding: 10px 20px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    cursor: none !important;
    /* Отключаем дефолтную мышь */
}

.phone-icon {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

/* Эффект наведения на телефон */
.header-phone:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.header-phone:hover .phone-icon {
    transform: rotate(15deg) scale(1.1);
    /* Легкое покачивание трубки */
}

/* Адаптивность для мобильных */
@media (max-width: 500px) {
    .brand-slogan {
        display: none;
        /* Прячем слоган на совсем мелких экранах, чтобы не теснился */
    }

    .header-phone span {
        display: none;
        /* Оставляем только иконку телефона на смартфонах */
    }

    .header-phone {
        padding: 10px;
    }
}



/* Контейнер контактов в шапке */
.header-contacts {
    display: flex;
    align-items: center;
    gap: 12px;
    /* Расстояние между телефоном и мессенджерами */
}

/* Иконки мессенджеров в шапке */
.header-messenger {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    /* Убрали серый фон, так как у иконок теперь своя яркая основа */
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.2, 1, 0.2, 1);
    overflow: hidden;
    /* Чтобы градиенты скругления не вылезали за рамку */
    cursor: none !important;
}

.messenger-icon {
    width: 100%;
    height: 100%;
    display: block;
    transition: transform 0.3s ease;
}

/* Специфические ховер-эффекты для оригинальных иконок */
.tg-head-btn:hover {
    border-color: #2aabee;
    box-shadow: 0 0 15px rgba(42, 171, 238, 0.4);
    transform: translateY(-2px);
}

.max-head-btn:hover {
    border-color: #53e;
    box-shadow: 0 0 15px rgba(83, 23, 238, 0.4);
    transform: translateY(-2px);
}

.header-messenger:hover .messenger-icon {
    transform: scale(1.08);
    /* Приятное легкое увеличение иконки внутри кольца */
}



/* Общая фоновая подложка с увеличенным запасом под параллакс (для ПК) */
.space-background-wrapper {
    position: fixed;
    top: -15vh;
    /* Запас сверху */
    left: 0;
    width: 100%;
    height: 150vh;
    /* УВЕЛИЧИЛИ со 130vh до 150vh: теперь запаса хватит до самого дна сайта */
    z-index: 0;
    pointer-events: none;
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

/* Настройки для холста и туманностей внутри контейнера */
.nebula-container,
#space-canvas {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}









/* ==========================================================================
   ПОЛНАЯ АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ И ПЛАНШЕТОВ
   ========================================================================== */

@media (max-width: 768px) {

    /* 1. Настройка общих контейнеров и секций */
    .section-container {
        padding: 60px 16px;
        /* Уменьшаем огромные отступы сверху и снизу */
        text-align: center;
        width: 100%;
    }

    /* Выравниваем заголовки секций по центру и уменьшаем размер */
    .section-container h2 {
        font-size: 2rem !important;
        margin-bottom: 40px !important;
        text-align: center !important;
        width: 100%;
    }

    .hero {
        height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        position: relative;
        padding: 20px;
        padding-top: 100px;
        /* ДОБАВИЛИ: Отталкивает заголовок вниз, чтобы он не залезал под шапку */
        z-index: 2;
    }

    .hero h1 {
        font-size: 2.4rem !important;
        /* Уменьшаем главный заголовок, чтобы не переносился по одной букве */
        line-height: 1.2;
        margin-bottom: 16px;
        text-align: center;
    }

    .hero p {
        font-size: 1rem !important;
        margin-bottom: 30px;
        text-align: center;
    }

    .cta-btn {
        padding: 14px 32px;
        font-size: 0.95rem;
    }

    /* 3. Блок преимуществ */
    .features-grid {
        grid-template-columns: 1fr !important;
        /* Перестраиваем в 1 колонку */
        gap: 20px;
    }

    .feature-item {
        border-left: none;
        border-bottom: 2px solid rgba(99, 102, 241, 0.2);
        border-radius: 0 0 16px 16px;
        padding: 25px 20px;
        text-align: center;
        /* Центрируем текст преимуществ */
    }

    .feature-item:hover {
        transform: translateY(-4px);
        /* На мобильных сдвиг вправо заменяем на сдвиг вверх */
    }

    .feature-badge {
        margin-bottom: 16px;
    }

    /* 4. Блок услуг */
    .services-grid {
        grid-template-columns: 1fr !important;
        /* Перестраиваем в 1 колонку */
        gap: 20px;
    }

    /* Убедимся, что сетки и контейнеры не имеют фиксированной ширины */
    .services-grid,
    .features-grid,
    .portfolio-grid {
        width: 100% !important;
        max-width: 100% !important;
    }

    .card {
        padding: 30px 20px;
        text-align: center;
        /* Центрируем тексты услуг */
        display: flex;
        flex-direction: column;
        align-items: center;
        /* Центрируем иконку внутри */
    }

    .card-icon {
        margin-bottom: 16px;
    }

    /* 5. Блок круговой статистики на смартфонах */
    .radar-circle {
        width: 240px;
        /* Немного уменьшаем радар, чтобы он аккуратно сидел на экране */
        height: 240px;
    }

    .radar-content h2.counter-number {
        font-size: 3.2rem !important;
        /* Чуть уменьшили размер цифр */
    }

    /* ИСПРАВЛЕНО: Защита текста от вылезания за пределы кольца радара */
    .counter-label {
        font-size: 0.75rem !important;
        /* Уменьшаем шрифт надписи на мобильных */
        max-width: 140px;
        /* Ограничиваем ширину текстового блока внутри круга */
        line-height: 1.3;
        white-space: normal;
        /* Разрешаем тексту переноситься на новую строку */
        text-align: center;
        margin-top: 6px;
    }

    /* 6. Блок портфолио (Проекты) */
    .portfolio-grid {
        grid-template-columns: 1fr !important;
        /* На смартфонах проекты идут строго друг за другом */
        gap: 15px;
    }

    .portfolio-item {
        padding: 20px;
        text-align: center;
        /* Центрируем названия ваших проектов */
    }

    /* 7. Нижний блок связи */
    #contact-sec .contact-subtitle {
        margin: -25px auto 35px auto !important;
        font-size: 0.95rem !important;
        text-align: center;
        opacity: 1 !important;
        /* Гарантируем видимость */
    }

    .contact-buttons {
        flex-direction: column;
        /* Кнопки Telegram и Max встают друг под друга */
        gap: 15px;
        width: 100%;
        max-width: 340px;
        margin: 0 auto;
    }

    .space-btn {
        width: 100%;
        /* Кнопки растягиваются на всю доступную ширину */
        justify-content: center;
        /* Центрируем контент внутри кнопок */
        padding: 14px 24px;
    }

    .space-background-wrapper {
        top: 0 !important;
        height: 100vh !important;
        /* На смартфонах возвращаем строгий размер экрана */
    }

    .nebula-container,
    #space-canvas {
        position: fixed !important;
        /* Жестко фиксируем фон на мобильных */
        height: 100vh !important;
    }

    /* Жестко фиксируем фоновые слои на смартфонах, запрещая им резаться и двигаться */
    .space-background-wrapper,
    .nebula-container,
    #space-canvas {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        transform: none !important;
        /* Убираем любые 3D сдвиги */
    }

    /* ПОЛНОСТЬЮ ОТКЛЮЧАЕМ И ПРЯЧЕМ КАСТОМНЫЙ КУРСОР НА ТАЧ-ЭКРАНАХ */
    .custom-cursor-dot,
    .custom-cursor-outline {
        display: none !important;
        pointer-events: none !important;
    }

    /* ВОЗВРАЩАЕМ СТАНДАРТНЫЙ СИСТЕМНЫЙ КУРСОР ДЛЯ ВСЕХ ЭЛЕМЕНТОВ НА МОБИЛЬНЫХ */
    html, body, a, button, .card, .portfolio-item, .space-btn, .feature-item, .radar-circle {
        cursor: auto !important;
    }
    
    /* 1. Убеждаемся, что контейнер шапки работает в режиме flex */
    .header-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    /* 2. Задаем правильный визуальный порядок элементов для мобильных экранов */
    .logo-block {
        order: 1;
        /* Логотип всегда самый первый (слева) */
    }

    .header-contacts {
        order: 2;
        /* Контакты (телефон, мессенджеры) идут следом по центру */
        margin-left: auto;
        /* Мягко прижимает контакты вправо к бургеру */
        margin-right: 15px;
        /* Небольшой аккуратный отступ перед иконкой бургера */
    }

    .site-navigation {
        order: 3;
        /* Бургер становится финальным элементом (справа) */
        display: flex;
        /* Гарантируем видимость */
    }
}

/* Дополнительная микро-правка для совсем маленьких экранов (iPhone SE и т.д.) */
@media (max-width: 380px) {
    .hero h1 {
        font-size: 2rem !important;
    }

    .section-container h2 {
        font-size: 1.75rem !important;
    }
}

.features-grid,
.services-grid,
.portfolio-grid {
    perspective: 1000px;
    /* Включает поддержку честного 3D-рендеринга для дочерних карточек */
}


/* ==========================================================================
   КОСМИЧЕСКОЕ АДАПТИВНОЕ МЕНЮ (Базовые стили для ПК)
   ========================================================================== */

.site-navigation {
    display: flex;
    align-items: center;
}

.nav-menu-list {
    display: flex;
    align-items: center;
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative; /* Возвращаем на место на ПК */
    right: 0;            /* Возвращаем на место на ПК */
    opacity: 1;
}

.nav-menu-link {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    /* ИЗМЕНЕНО: Добавили отрицание :not(.no-transition), чтобы transition не мешал GSAP анимировать stagger */
    transition: color 0.3s ease, text-shadow 0.3s ease;
    cursor: none !important;
    display: inline-block;
    opacity: 0;
}

/* Новый класс защиты, который временно отключает анимации браузера на старте */
.nav-menu-link.no-transition {
    transition: none !important;
}

.site-navigation.nav-hidden .nav-menu-list .nav-menu-link {
    opacity: 0 !important;
}

.nav-menu-link:hover {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(165, 180, 252, 0.6);
}

.nav-menu-list.menu-loading .nav-menu-link {
    opacity: 0;
}

.burger-menu-btn {
    display: none; /* Скрыта на ПК */
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    background: none;
    border: none;
    padding: 0;
    z-index: 1002;
    cursor: none !important;
}

.burger-bar {
    width: 100%;
    height: 2px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, background-color 0.3s ease;
}

/* ==========================================================================
   МОБИЛЬНАЯ АДАПТИВНОСТЬ МЕНЮ (До 768px)
   ========================================================================== */

@media (max-width: 768px) {
    .burger-menu-btn {
        display: flex;
    }

    .burger-menu-btn.active .burger-bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .burger-menu-btn.active .burger-bar:nth-child(2) {
        opacity: 0;
    }
    .burger-menu-btn.active .burger-bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-menu-list {
        position: fixed; /* На мобильных вырываем из потока */
        top: 0;
        right: -100%;    /* Прячем за экран только на мобильных */
        width: 100vw;
        height: 100vh;
        background: rgba(5, 5, 8, 0.96);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        gap: 40px;
        z-index: 1001;
        opacity: 0;
    }

    .nav-menu-link {
        font-size: 1.5rem;
        font-weight: 600;
        color: #ffffff;
    }
}