/* --- ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ И СТИЛИ --- */
:root {
    --bg-color: #121212;
    --card-bg: rgba(26, 26, 26, 0.75);
    --text-color: #E0E0E0;
    --text-secondary: #A0A0A0;
    --accent-color: #4ADBC8;
    --accent-hover: #59e4d1;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.2);
    --parallax-intensity: 300px;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Kumbh', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    font-weight: 400;
    overflow-x: hidden;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

body.no-scroll {
    overflow: hidden;
}

* {
    -webkit-tap-highlight-color: transparent !important;
}
/* --- ИНТЕРАКТИВНЫЙ ФОН --- */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: calc(100vh + var(--parallax-intensity));
    z-index: -1;
    background-color: var(--bg-color);
}

#particles-js > canvas {
    height: 100% !important;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover {
    color: var(--accent-hover);
}

.container {
    max-width: 1230px;
    padding: 0 15px;
    margin: 0 auto;
}

.container-big {
    max-width: 1820px;
    margin: 0 auto;
    padding: 0 15px;
}

/* --- ШАПКА --- */
.header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
}
.header__iner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 0;
}
.logo img { 
    width: 45px;
    height: auto;
}

.menu__list {
    display: flex;
    gap: 40px;
}
.menu__link {
    color: #E0E0E0;
    position: relative;
    padding-bottom: 5px;
}
.menu__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}
.menu__link:hover::after {
    width: 100%;
}

.header__workwith {
    padding: 12px 28px;
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--bg-color);
    border-radius: 50px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    transition: background-color 0.3s ease, transform 0.3s ease;
}
.header__workwith:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    color: var(--bg-color);
}

.menu-btn,
.menu__workwith {
    display: none;
}


/* --- ГЛАВНЫЙ ЭКРАН (HERO) --- */


/* 
   ============================================================
   === СТИЛИ ДЛЯ СТРЕЛКИ ПРОКРУТКИ ВНИЗ (ИСПРАВЛЕНО НА ШЕВРОН) ===
   ============================================================
*/

.hero__scroll-down {
    display: none; /* По умолчанию скрыта на десктопах */
    position: absolute;
    bottom: 30px; /* Отступ от нижнего края */
    left: 50%;
    transform: translateX(-50%);
    width: 40px;  /* Размеры контейнера для клика */
    height: 40px;
    cursor: pointer;
    /* Анимация пульсации для привлечения внимания */
    animation: bounce-arrow 2s infinite; 
}

/* 
  Рисуем саму стрелку (шеврон) с помощью псевдо-элемента ::after.
  Это "хак" с использованием border, который создает треугольник.
*/
.hero__scroll-down::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px; /* Ширина стрелки */
    height: 16px; /* Высота стрелки */
    border: solid var(--text-secondary);
    border-width: 0 3px 3px 0; /* Рисуем только правую и нижнюю рамки */
    transform: translate(-50%, -50%) rotate(45deg); /* Поворачиваем квадрат, чтобы получить стрелку */
    transition: border-color 0.3s ease;
}

.hero__scroll-down:hover::after {
    border-color: var(--accent-color); /* Меняем цвет при наведении */
}

/* Ключевые кадры для анимации "подпрыгивания" */
@keyframes bounce-arrow {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px); /* Подпрыгивание вверх */
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* Медиа-запрос, который покажет стрелку только на мобильных и планшетах */
@media (max-width: 991px) {
    .hero__scroll-down {
        display: block; /* Показываем стрелку */
    }
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    text-align: center;
    padding-top: 80px;
}

.hero__content {
    position: relative; /* Это нужно для позиционирования стрелки */
    /* Добавим небольшой отступ снизу, чтобы было место для стрелки */
    padding-bottom: 100px; 
}

/* --- ОБЩИЕ СТИЛИ СЕКЦИЙ --- */
.section-title {
    text-align: center;
    margin-bottom: 60px;
}
.section-title h2 {
    font-size: 42px;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 5px;
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
}
.section-title p {
    font-size: 16px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.section-title--left { text-align: left; }

.facts, .about-timeline, .portfolio, .contact {
    padding: 100px 0;
}

/* --- СЕКЦИЯ "ИНТЕРЕСЫ" (FACTS) --- */
.facts__grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}
.facts__item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 30px;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
}
.facts__item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--shadow-color);
}
.facts__item-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}
.facts__item-number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    color: var(--accent-color);
}
.facts__item-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
}
.facts__item-text {
    color: var(--text-secondary);
    font-size: 15px;
    text-align: justify;
    hyphens: auto;
}

/* --- СЕКЦИЯ "О КОМПАНИИ" (TIMELINE) --- */
.about-timeline__wrapper {
    max-width: 900px;
    margin: 0 auto;
}
.about-timeline__line {
    position: relative;
}
.about-timeline__line::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--border-color);
    z-index: 1;
}
.about-timeline__item {
    position: relative;
    padding: 25px;
    margin-bottom: 30px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.about-timeline__item:last-child {
    margin-bottom: 0;
}
.about-timeline__item-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}
.about-timeline__item-number {
    position: absolute;
    top: 25px;
    width: 36px;
    height: 36px;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    color: var(--accent-color);
    background-color: var(--bg-color);
    z-index: 2;
}
.about-timeline__item-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
}
.about-timeline__item-text {
    color: var(--text-secondary);

    /* ДОБАВЛЕНО: Выравнивание текста по ширине */
    text-align: justify; 
    
    /* ДОБАВЛЕНО: Включаем переносы для лучшего вида */
    hyphens: auto; 
}

/* 
   ===================================================================================
   === ИСПРАВЛЕНИЕ ДЛЯ ПОРТФОЛИО (убираем скачки, чиним отступы) ===
   ===================================================================================
*/
.portfolio__filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}
.portfolio__filter-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}
.portfolio__filter-btn:hover {
    color: var(--text-color);
    border-color: var(--accent-color);
}
.portfolio__filter-btn.active {
    background-color: var(--accent-color);
    color: var(--bg-color);
    border-color: var(--accent-color);
}
.portfolio__list {
    display: flex;
    flex-direction: column;
    /* Убрали gap, чтобы избежать проблем с "призрачными" отступами при фильтрации */
}
.portfolio__item {
    display: flex;
    align-items: center;
    gap: 5%;
    background-color: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    /* Задаем отступ вручную, чтобы он плавно анимировался */
    margin-bottom: 80px; 
    /* Указываем, какие свойства будем анимировать */
    transition: opacity 0.4s ease, 
                transform 0.4s ease, 
                max-height 0.4s ease, 
                margin-bottom 0.4s ease, 
                padding-top 0.4s ease, 
                padding-bottom 0.4s ease,
                border-width 0.4s ease;
}
.portfolio__item:hover {
    transform: scale(1.03);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.portfolio__item.hidden {
    opacity: 0;
    transform: scale(0.95);
    /* Используем max-height: 0 для плавной анимации схлопывания */
    max-height: 0; 
    /* Схлопываем все отступы и рамки */
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    overflow: hidden;
    pointer-events: none;
}
.portfolio__item-img {
    flex: 0 0 50%;
}
.portfolio__item-content {
    padding: 40px;
    transition: padding 0.4s ease;
}
.portfolio__item.hidden .portfolio__item-content {
    padding: 0;
}
.portfolio__item--reverse {
    flex-direction: row-reverse;
}
.portfolio__item-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-color);
}
.portfolio__item-text {
    color: var(--text-secondary);
    margin-bottom: 30px;
}
.portfolio__item-btn {
    display: inline-block;
    padding: 12px 28px;
    background-color: var(--accent-color);
    color: var(--bg-color);
    border-radius: 5px;
    font-weight: 700;
    font-size: 14px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}
.portfolio__item-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    color: var(--bg-color);
}

/* --- СЕКЦИЯ "КОНТАКТЫ" --- */
.contact__wrapper {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    background-color: var(--card-bg);
    padding: 50px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}
.contact__socials {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
}
.contact__social-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    transition: background-color 0.3s ease, transform 0.3s ease;
}
.contact__social-link:hover {
    background-color: var(--accent-color);
    transform: translateY(-5px);
}
.contact__social-link svg {
    width: 28px;
    height: 28px;
    fill: var(--text-secondary);
    transition: fill 0.3s ease;
}
.contact__social-link:hover svg {
    fill: var(--bg-color);
}
.contact__details {
    margin-top: 40px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
}
.contact__details p {
    margin: 0;
}
.contact__details a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}
.contact__details a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* --- Анимация заголовка при скролле --- */
.scrolled .title__company {
    transform: scale(0.9) translateY(-100px); 
    opacity: 0; 
}
.scrolled .title__accent {
    transform: translateY(-80px); 
    opacity: 0; 
}

/*--- СТИЛИ ДЛЯ АККОРДЕОНА  ---*/
.accordion-header {
    cursor: pointer;
    position: relative;
    padding-bottom: 10px;
}
.accordion-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}
.accordion-item:hover .accordion-header::after,
.accordion-item.active .accordion-header::after {
    width: 100%;
}
.accordion-content {
    overflow: hidden;
    transition: height 0.4s ease-out;
}
/* По умолчанию сворачиваем аккордеоны */
.accordion-content {
    height: 0;
}
/* 
   ============================================================
   === ИСПРАВЛЕНИЕ: всегда открытые карточки на десктопе ===
   ============================================================
*/
@media (min-width: 992px) {
    .facts .accordion-content {
        height: auto;
        overflow: visible;
    }
    .facts .accordion-header {
        cursor: default;
    }
    .facts .accordion-item:hover .accordion-header::after {
        width: 0;
    }
}

/* Анимация timeline при скролле */
.about-timeline__item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.about-timeline__item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === TIMELINE - МОБИЛЬНАЯ ВЕРСИЯ === */
@media (max-width: 991px) {
    .about-timeline__line {
        padding-left: 50px;
    }
    .about-timeline__line::before {
        left: 17px;
    }
    .about-timeline__item-number {
        left: -50px;
    }
}

/* === TIMELINE - ДЕСКТОПНАЯ ВЕРСИЯ (min-width: 992px) === */
@media (min-width: 1200px) {
    .about-timeline__wrapper {
        position: relative;
        min-height: 650px;
    }
    .about-timeline__line {
        padding-left: 0;
    }
    .about-timeline__line::before {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        left: 50%;
        width: 2px;
        background-color: var(--accent-color);
        transform: translateX(-50%);
        z-index: 1;
    }
    .about-timeline__item {
        position: absolute;
        width: calc(50% - 40px);
        margin-bottom: 0;
        z-index: 2;
    }
    .about-timeline__item:nth-child(odd) {
        left: 0;
    }
    .about-timeline__item:nth-child(odd) .about-timeline__item-header {
        flex-direction: row-reverse;
    }
    .about-timeline__item:nth-child(odd) .about-timeline__item-title {
        text-align: right;
    }
    .about-timeline__item:nth-child(odd) .about-timeline__item-text {
        text-align: left;
    }
    .about-timeline__item:nth-child(even) {
        left: calc(50% + 40px);
        text-align: left;
    }
    .about-timeline__item-number {
        position: absolute;
        top: 25px;
        z-index: 3;
        background-color: var(--bg-color);
    }
    .about-timeline__item:nth-child(odd) .about-timeline__item-number {
        right: -58px;
        left: auto;
    }
    .about-timeline__item:nth-child(even) .about-timeline__item-number {
        left: -58px;
        right: auto;
    }
     .about-timeline__item:nth-child(odd) .about-timeline__item-header {
        padding-right: 51px;
    }
    .about-timeline__item:nth-child(even) .about-timeline__item-header {
        padding-left: 51px;
    }
    .about-timeline__item:nth-child(1) { top: 0; }
    .about-timeline__item:nth-child(2) { top: 150px; }
    .about-timeline__item:nth-child(3) { top: 300px; }
    .about-timeline__item:nth-child(4) { top: 450px; }
    .about-timeline__item:nth-child(5) { top: 600px; } 
}

/* === АДАПТИВ ДЛЯ ВЫСОКИХ ЭКРАНОВ === */
@media (min-width: 1200px) {
    .about-timeline__item:nth-child(1) { top: 0; }
    .about-timeline__item:nth-child(2) { top: 180px; }
    .about-timeline__item:nth-child(3) { top: 360px; }
    .about-timeline__item:nth-child(4) { top: 540px; }
     .about-timeline__item:nth-child(5) { top: 720px; }
    
    .about-timeline__wrapper {
        min-height: 900px;
    }
}

/* --- АДАПТИВНОСТЬ --- */
@media (max-width: 1024px) {
    .title__company { font-size: 15vw; }
    .title__accent { font-size: 22px; }
    .facts__grid { grid-template-columns: repeat(2, 1fr); }
    .portfolio__item, .portfolio__item--reverse {
        flex-direction: column;
    }
    .portfolio__item-img {
        width: 100%;
        flex-basis: auto;
    }
}

@media (min-width: 1025px) {
    .facts__grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .facts__item {
        flex-basis: auto;
    }
    .facts__item:nth-child(3) {
        grid-column: span 2;
    }
}

@media (max-width: 1199px) {
    .header__workwith { display: none; }
    .menu-btn {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 22px;
        
        /* --- Стили для кросс-браузерной совместимости кнопки --- */
        padding: 0;
        background: transparent;
        border: none;
        cursor: pointer;
        
        /* --- Ключевые исправления для iOS --- */
        position: relative; /* Устанавливаем контекст для z-index */
        z-index: 101; /* Убеждаемся, что кнопка ВЫШЕ всех остальных элементов в шапке */
        -webkit-appearance: none; /* Сбрасывает стандартные стили iOS для кнопок */
        -webkit-tap-highlight-color: transparent; /* Убирает подсветку при нажатии */
    }
    .menu-btn span {
        width: 100%;
        height: 3px;
        background-color: var(--text-color);
        border-radius: 2px;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    .menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background-color: rgba(18, 18, 18, 0.95);
        backdrop-filter: blur(5px);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: left 0.4s ease-in-out;
        z-index: 100;
        padding: 20px;
    }
    .menu--open { left: 0; }
    .menu--open ~ .menu-btn span:nth-child(1) { 
        transform: translateY(9.5px) rotate(45deg);
    } 
    .menu--open ~ .menu-btn span:nth-child(2) { 
        opacity: 0;
    } 
    .menu--open ~ .menu-btn span:nth-child(3) { 
        transform: translateY(-9.5px) rotate(-45deg);
    } 
    .menu__workwith {
        display: inline-block;
        padding: 12px 28px;
        background-color: transparent;
        color: var(--text-color) !important;
        border: 2px solid var(--border-color);
        border-radius: 50px;
        font-family: 'Inter', sans-serif;
        font-weight: 700;
        transition: background-color 0.3s ease, transform 0.3s ease;
        margin-bottom: 40px;
        font-size: 18px;
    }
    .menu__workwith:hover {
        background-color: var(--accent-hover);
        border-color: var(--accent-color);
        color: var(--bg-color) !important;
        transform: translateY(-5px);
    }
    .menu__list {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
    .menu__link { font-size: 24px; }
}

@media (max-width: 768px) {
    .facts, .about-timeline, .portfolio, .contact { padding: 80px 0; }
    .section-title h2 { font-size: 36px; }
    .facts__grid { grid-template-columns: 1fr; }
    .contact__wrapper { padding: 40px 25px; }
}

@media (max-width: 576px) {
    .title__company { font-size: 18vw; }
    .title__accent { font-size: 18px; }
    .section-title { margin-bottom: 40px; }
    .section-title h2 { font-size: 32px; }
    .about-timeline__line { padding-left: 40px; }
    .about-timeline__item-number { left: -40px; }
    .about-timeline__item-title { font-size: 20px; }
    .contact__info-list { font-size: 16px; }
    .contact__socials { gap: 15px; }
    .contact__social-link { width: 50px; height: 50px; }
    .contact__social-link svg { width: 24px; height: 24px; }
}