/* Современная цветовая палитра */
:root {
    --primary-color: #1b4332; /* Глубокий изумрудный */
    --secondary-color: #40916c; /* Насыщенный зеленый */
    --accent-color: #74c69d; /* Мягкий мятный */
    --bg-main: #e4ece6; /* Мягкий, спокойный серо-зеленый (вместо яркого белого) */
    --card-bg: #edf4f0; /* Приглушенный фон для карточек */
    --text-dark: #2a332e;
    --text-muted: #54665d;
    --glass-bg: rgba(228, 236, 230, 0.85); /* Стеклянная шапка в тон фону */
    --transition: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.7;
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 75vw;
    margin: 0 auto;
}

/* Эффект Глассморфизма для навигации */
.navbar {
    position: relative;
    flex: 0 0 auto;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--primary-color);
    padding: 0.8rem 0;
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.logo span {
    color: var(--secondary-color);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    transition: var(--transition);
}

/* Современное подчеркивание при наведении */
.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--secondary-color);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--secondary-color);
}

/* Hero Секция со сложным фоном */
.hero {
    padding: 6rem 0;
    display: flex;
    align-items: center;
    position: relative;
    /* Заменяем ссылку на локальный путь */
    background: linear-gradient(rgba(27, 67, 50, 0.75), rgba(64, 145, 108, 0.65)),
                url('../pic/banner1.jfif') center/cover no-repeat;
    background-attachment: fixed;
    overflow: hidden;
}

.hero-content {
    width: 100%;
}

.hero .hero-title {
    text-align: center;
    font-size: 3.5rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 4rem;
    letter-spacing: -1px;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.hero .about-text {
    text-align: left; /* Текст слева, фото справа */
    padding-left: 3rem; /* ДОБАВЛЕНО: отодвигаем весь блок с текстом от левого края */
}

.hero .about-text p {
    font-size: 1.2rem; /* Сделали текст крупнее (было 1.2rem) */
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 1rem;
    line-height: 1.8;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Текст на фоне картинки должен быть светлым для читаемости */
.hero h2 {
    font-size: 3.8rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); /* Тень для объема */
}

.hero p {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Кнопка на главном экране (сделаем ее чуть контрастнее) */
.hero .btn {
    margin-left: 1.5rem;
    background: #ffffff;
    color: var(--primary-color);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.hero .btn:hover {
    background: var(--accent-color);
    color: #ffffff;
    transform: translateY(-3px);
}

/* Фото на главном экране */
.hero .about-image {
    width: 100%;
    max-width: 400px; /* Увеличили ширину (было 360px) */
    height: auto;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: block;
    margin: 0 auto;
}

/* Адаптивность мобильных устройств для нового экрана */
@media (max-width: 768px) {
    .hero .hero-title {
        font-size: 2.2rem;
        margin-bottom: 2rem;
    }

    .hero .about-text {
        text-align: center; /* На телефоне лучше центрировать */
        margin-bottom: 2rem;
    }
}

/* Декоративный круг на фоне */
.hero::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -5%;
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    z-index: -1;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero h2 {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Современная кнопка с тенями */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: #ffffff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 10px 20px rgba(64, 145, 108, 0.25);
    transition: var(--transition);
    border: none;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(64, 145, 108, 0.4);
}

/* Секции */
.section {
    padding: 3rem 0; /* Было 6rem 0, теперь везде компактно */
}

h2 {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 2rem; /* Было 3.5rem, теперь везде одинаковый аккуратный отступ */
    font-weight: 700;
}

/* Чередование фонов для секций */
.bg-alternate {
    /* Более глубокий зеленовато-серый оттенок для контраста с секцией "Обо мне" */
    background-color: #d5e0d8;
    border-top: 1px solid rgba(255, 255, 255, 0.5); /* Легкий блик на границе */
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

/* Чтобы карточки на темном фоне выделялись лучше, можно добавить им белую ауру */
.bg-alternate .card {
    box-shadow: 0 15px 35px rgba(27, 67, 50, 0.08);
}

/* Карточки исследований - Neumorphism / Soft UI */
.cards-grid {
    display: grid;
    /* Устанавливаем ровно 3 колонки одинаковой ширины */
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

/* Адаптивность для планшетов (2 колонки) */
@media (max-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Адаптивность для телефонов (1 колонка) */
@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    transition: var(--transition);
    border: 1px solid rgba(116, 198, 157, 0.15);
    position: relative;
    overflow: hidden;
}

/* Акцентная полоса сверху карточки */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--secondary-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition);
}

.card:hover::before {
    transform: scaleX(1);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(64, 145, 108, 0.12);
}

.card h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.card p {
    color: var(--text-muted);
}

/* Обо мне Grid */
.about-grid {
    display: grid;
    /* ИЗМЕНЕНО: 1.6fr (текст) и 1fr (фото) — это примерно пропорция 62/38 */
    grid-template-columns: 2fr 1fr;
    align-items: center;
}

.about-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.about-image {
    width: 100%;
    max-width: 450px;
    height: auto;
    aspect-ratio: 4 / 5; /* Делает фото слегка вытянутым по вертикали (портретный формат) */
    object-fit: cover; /* Изображение будет красиво заполнять форму без искажений */
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(27, 67, 50, 0.15); /* Мягкая глубокая тень */
    transition: var(--transition);
}

.about-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(27, 67, 50, 0.2);
}

/* Подвал */
footer {
    background: var(--primary-color);
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    padding: 3rem 0;
}

/* --- АНИМАЦИИ --- */
.fade-in {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s cubic-bezier(0.25, 0.8, 0.25, 1), transform 1s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}


/* --- Карусель Достижений --- */
.carousel-container {
    width: 100%;
    padding: 1rem 0 0 0;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    gap: 2rem;
    padding: 2rem 5% 2rem 5%;

    /* ИЗМЕНЕНО: Скрываем нативный скролл и запрещаем браузеру горизонтальные жесты */
    overflow-x: hidden;
    touch-action: pan-y;

    position: relative;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Скрываем кастомный скроллбар для WebKit */
.carousel-track::-webkit-scrollbar {
    display: none;
}

.cert-card {
    flex: 0 0 320px;
    height: 452px; /* Увеличили высоту для точного соответствия пропорции А4 (320 * 1.41) */
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 1px solid rgba(116, 198, 157, 0.2);
}

.cert-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(27, 67, 50, 0.15);
}

.cert-image {
    flex: 0 0 100%;
    height: 100%;
    transition: flex 0.6s ease;
    background-color: var(--bg-main);
}

.cert-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Теперь сертификат гарантированно влезает целиком вместе с рамками */
    object-position: center;
    background-color: #ffffff; /* Делаем подложку белой, как лист бумаги */
    padding: 0.6rem; /* Добавляем "воздух" вокруг документа, чтобы он смотрелся аккуратнее */
    box-sizing: border-box;
}

.cert-info {
    flex: 0 0 0;
    opacity: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    transition: all 0.5s ease;
    background: var(--card-bg);
}

/* --- Состояние "Открыто" --- */
.cert-card.expanded {
    flex: 0 0 750px; /* Расширяем карточку */
    cursor: default;
}

.cert-card.expanded .cert-image {
    flex: 0 0 45%; /* Картинка сдвигается и занимает 45% */
}

.cert-card.expanded .cert-info {
    flex: 1;
    opacity: 1;
    padding: 2.5rem;
    background-color: var(--primary-color); /* Темный изумрудный фон */
    border-left: 2px solid rgba(255, 255, 255, 0.1); /* Легкий разделитель между фото и текстом */
}

.cert-card.expanded .cert-info h3 {
    color: var(--accent-color); /* Мятный цвет для заголовка */
    margin-bottom: 1rem;
    font-size: 1.6rem;
}

.cert-card.expanded .cert-info p {
    color: rgba(255, 255, 255, 0.9); /* Почти белый текст описания */
    line-height: 1.7;
}

/* Адаптивность карусели для телефонов */
@media (max-width: 768px) {
    .cert-card {
        flex: 0 0 280px;
        height: 395px; /* Пропорция А4 для ширины 280px */
    }

    .cert-card.expanded {
        flex: 0 0 85vw;
        flex-direction: column;
        height: auto;
        min-height: 550px;
    }

    .cert-card.expanded .cert-image {
        flex: 0 0 350px; /* Увеличили область под фото на мобильных, чтобы документ не был слишком мелким */
    }

    .cert-card.expanded .cert-info {
        border-left: none;
        border-top: 2px solid rgba(255, 255, 255, 0.1);
    }
}

.carousel-container {
    width: 100%;
    padding: 0 0 2rem 0; /* Уменьшаем нижний отступ контейнера */
    overflow: hidden;
}

/* --- Секция Партнеров (Разбросанный холст) --- */
.partners-canvas {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 3rem 2rem;
    padding: 0.5rem 0 1rem 0; /* Убрали лишний внутренний воздух (было 3rem 0) */
}

.partner-logo {
    display: block;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* По умолчанию делаем логотипы приглушенными и черно-белыми */
    filter: grayscale(100%) opacity(0.5);
    cursor: pointer;
    text-decoration: none;
}

.partner-logo img {
    max-width: 200px;
    max-height: 100px;
    object-fit: contain; /* Логотип впишется без искажений */
    transition: transform 0.5s ease;
}

/* Эффект органичного разброса по вертикали */
.partner-logo:nth-child(even) {
    transform: translateY(25px);
}
.partner-logo:nth-child(3n) {
    transform: translateY(-20px);
}
.partner-logo:nth-child(5n) {
    transform: translateY(15px);
}

/* Ховер эффект: возвращаем цвета, поднимаем вверх, добавляем мягкое свечение по контуру */
.partner-logo:hover,
.partner-logo:nth-child(even):hover,
.partner-logo:nth-child(3n):hover,
.partner-logo:nth-child(5n):hover {
    filter: grayscale(0%) opacity(1) drop-shadow(0 15px 25px rgba(64, 145, 108, 0.4));
    transform: translateY(-10px) scale(1.08);
    z-index: 10;
}

/* Адаптивность для телефонов */
@media (max-width: 768px) {
    .partners-canvas {
        gap: 2.5rem;
        padding: 1rem 0;
    }

    .partner-logo img {
        max-width: 140px;
        max-height: 80px;
    }

    /* Убираем сильный разброс на узких экранах, чтобы сетка была аккуратной */
    .partner-logo:nth-child(n) {
        transform: translateY(0);
    }

    .partner-logo:hover,
    .partner-logo:nth-child(n):hover {
        transform: translateY(-5px) scale(1.05);
    }
}

/* --- Секция Контактов --- */
.contact-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    background: #ffffff; /* Светлая карточка на фоне bg-alternate */
    padding: 3.5rem;
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(27, 67, 50, 0.08);
    border: 1px solid rgba(116, 198, 157, 0.2);
}

.contact-info h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.contact-info p {
    margin-bottom: 2rem;
    color: var(--text-muted);
}

.contact-details p {
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.contact-details a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.contact-details a:hover {
    color: var(--primary-color);
}

/* Форма обратной связи */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(116, 198, 157, 0.3);
    background: var(--bg-main); /* Легкий зеленоватый фон для полей */
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-dark);
    transition: var(--transition);
    outline: none;
    resize: none; /* Запрещаем растягивать текстовое поле вручную */
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--secondary-color);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(116, 198, 157, 0.15); /* Эффект свечения при фокусе */
}

.contact-form .btn {
    cursor: pointer;
    width: fit-content;
    margin-top: 0.5rem;
}

/* Адаптивность контактов для мобильных устройств */
@media (max-width: 900px) {
    .contact-wrap {
        grid-template-columns: 1fr;
        gap: 0.2rem;
        padding: 1.2rem 2rem 2rem 2rem;
    }
}

/* Прижимаем футер к низу экрана и настраиваем скроллбар */
html, body {
    height: 100%;
    margin: 0;
    overflow: hidden; /* отключаем скролл на уровне вьюпорта */
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    /* overflow-x: hidden — убрано, оно больше не нужно */
}

footer {
    background: var(--primary-color);
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    padding: 3rem 0;
}

.pub-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-shrink: 0;
}

.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: var(--secondary-color);
    background: rgba(116, 198, 157, 0.12);
    border: 1px solid rgba(116, 198, 157, 0.35);
    text-decoration: none;
    transition: all 0.3s ease;
}

.icon-link:hover {
    background: var(--secondary-color);
    color: #ffffff;
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(64, 145, 108, 0.25);
}

/* На мобильных лучше перенести действия под текст */
@media (max-width: 640px) {
    .pub-item {
        flex-direction: column;
        align-items: flex-start !important;
    }
    .pub-actions {
        margin-top: 1rem;
        align-self: flex-end;
    }
}

.page-scroll {
    flex: 1;
    display: flex;           /* ← новое */
    flex-direction: column;  /* ← новое */
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    scrollbar-width: auto;
    scrollbar-color: var(--secondary-color) rgba(116, 198, 157, 0.15);
}

main {
    flex: 1; /* растягивает контент, выталкивая футер к низу .page-scroll */
}

.page-scroll::-webkit-scrollbar {
    width: 16px;
}
.page-scroll::-webkit-scrollbar-track {
    background: rgba(116, 198, 157, 0.15);
}
.page-scroll::-webkit-scrollbar-thumb {
    background-color: var(--secondary-color);
    border-radius: 12px;
    border: 4px solid var(--bg-main);
}
.page-scroll::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-color);
}

/* --- ИНТЕРАКТИВНОЕ ВЕРТИКАЛЬНОЕ ОКНО ПРОЕКТОВ --- */
.timeline-window-wrapper {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(116, 198, 157, 0.2);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.02);
    padding: 2rem 0; /* Добавили отступы для стрелочек */
}

/* Эффект плавного затухания карточек сверху и снизу */
.timeline-window-wrapper::before,
.timeline-window-wrapper::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 60px;
    z-index: 10;
    pointer-events: none;
}
.timeline-window-wrapper::before {
    top: 0;
    background: linear-gradient(to bottom, var(--bg-main), transparent);
}
.timeline-window-wrapper::after {
    bottom: 0;
    background: linear-gradient(to top, var(--bg-main), transparent);
}

/* Кнопки навигации (Стрелочки) */
.scroll-arrow {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-main);
    color: var(--primary-color);
    border: 1px solid rgba(116, 198, 157, 0.3);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.scroll-arrow:hover {
    background: var(--secondary-color);
    color: #fff;
    transform: translateX(-50%) scale(1.1);
}
.up-arrow { top: 10px; }
.down-arrow { bottom: 10px; }
.scroll-arrow svg { width: 24px; height: 24px; }

.timeline-window {
    max-height: 700px;
    /* Меняем auto на hidden, чтобы убрать системный скроллбар и блокировать прокрутку колесиком */
    overflow-y: hidden;
    padding: 1rem 2rem 1rem 0;
    scroll-behavior: smooth;
    /* Скрываем скроллбар в Firefox и IE */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Скрываем скроллбар в WebKit (Chrome, Safari) */
.timeline-window::-webkit-scrollbar {
    display: none;
}

.timeline-vertical {
    position: relative;
    padding-left: 50px;
    margin-left: 1rem;
}

.timeline-vertical::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, var(--secondary-color), var(--accent-color));
    border-radius: 4px;
}

.timeline-v-item {
    position: relative;
    margin-bottom: 2.5rem;
    cursor: pointer;
    /* УДАЛИЛИ transform: translateX(10px) отсюда, чтобы точка не уезжала[cite: 16] */
}

.timeline-v-item:last-child {
    margin-bottom: 0;
}

.timeline-v-dot {
    position: absolute;
    left: -40px;
    top: 1.8rem;
    width: 20px;
    height: 20px;
    background: var(--bg-main);
    border: 4px solid var(--secondary-color);
    border-radius: 50%;
    z-index: 2;
    transition: var(--transition);
}

.timeline-v-item:hover .timeline-v-dot {
    background: var(--secondary-color);
    box-shadow: 0 0 15px rgba(64, 145, 108, 0.6);
    transform: scale(1.3);
}

.timeline-v-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    border: 1px solid rgba(116, 198, 157, 0.15);
    transition: var(--transition);
}

/* ДОБАВИЛИ transform сюда: теперь двигается только сама карточка, а точка стоит на месте[cite: 16] */
.timeline-v-item:hover .timeline-v-content {
    transform: translateX(10px);
    box-shadow: 0 15px 35px rgba(27, 67, 50, 0.12);
    background: #ffffff;
}

/* Шапка карточки */
.timeline-v-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(116, 198, 157, 0.2);
    padding-bottom: 1rem;
}

.timeline-v-year {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
}

.timeline-role {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
}
.role-executor { background: var(--secondary-color); }
.role-leader {
    background: #f4a261;
    box-shadow: 0 4px 10px rgba(244, 162, 97, 0.3);
}

.timeline-v-content p {
    color: var(--text-dark);
    line-height: 1.7;
    margin: 0;
    text-align: justify;
}

/* --- СТИЛИ ДЛЯ КНОПКИ МОБИЛЬНОГО МЕНЮ --- */
.mobile-menu-btn {
    margin-left: auto;
    display: none; /* Скрыта на компьютерах */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001; /* Поверх дропдауна */
}

.mobile-menu-btn span {
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
    transition: var(--transition);
}

/* Анимация превращения гамбургера в крестик */
.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* --- СТИЛИ ДЛЯ НОВОГО ПОЛНОЭКРАННОГО ЛАЙТБОКСА --- */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;

    /* ИЗМЕНЕНО: Почти прозрачный фон и сильное размытие */
    background: rgba(27, 67, 50, 0.25);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px); /* Важно для работы на iPhone (Safari) */

    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox img {
    max-width: 95%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 12px;
    transform: scale(0.8);
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    background: #fff; /* Белая подложка под сертификат */
    padding: 1rem;
}

.lightbox.active img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 25px;
    color: white;
    font-size: 45px;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
    padding: 10px;
    z-index: 10000;
    transition: transform 0.3s;
}

.lightbox-close:hover {
    transform: scale(1.2) rotate(90deg);
}

/* Адаптивность для телефонов */
@media (max-width: 768px) {
    /* 1. Делаем шапку компактнее */
    .navbar {
        padding: 0.5rem 0;
    }
    .logo {
        font-size: 1.2rem;
    }

    .hero h2 {
        font-size: 2.2rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* 2. Показываем кнопку гамбургера */
    .mobile-menu-btn {
        display: flex !important;
    }

    /* 3. Превращаем меню в дропдаун (Выезжает сверху) */
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--glass-bg);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        flex-direction: column;
        align-items: center;
        gap: 0;
        /* Скрываем через высоту для красивой анимации */
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-out, padding 0.4s ease-out;
        box-shadow: 0 15px 30px rgba(0,0,0,0.1);
        border-bottom: 1px solid rgba(255,255,255,0.3);
    }

    /* Класс, который JS добавит при клике */
    .nav-links.active {
        max-height: 400px; /* Достаточно для всех ссылок */
        padding: 1rem 0;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links a {
        display: block;
        padding: 1rem;
        font-size: 1.1rem;
    }

    .nav-links a::after {
        display: none; /* Убираем нижнее подчеркивание при наведении на мобилках */
    }

    /* 1. Превращаем сетку во flex-контейнер и меняем порядок (картинка сверху) */
    .about-grid {
        display: flex;
        flex-direction: column-reverse;
        gap: 1.5rem; /* Отступ между фото и блоком текста */
    }

    /* 2. Уменьшаем размер фотографии в 2 раза */
    .hero .about-image {
        max-width: 200px;
    }

    /* 3. Уменьшаем размер текста и отступ до кнопки */
    .hero .about-text p {
        font-size: 1.05rem;
        margin-bottom: 1rem;
    }

    /* Убираем лишний внешний отступ у контейнера с текстом */
    .hero .about-text {
        text-align: center;
        margin-bottom: 0;
        padding-left: 0;
    }

    /* 1. СИЛЬНО УМЕНЬШАЕМ ВЕРТИКАЛЬНЫЕ ОТСТУПЫ */
    .hero {
        padding: 2.5rem 0; /* Было 6rem, делаем компактнее */
    }

    .section {
        padding: 2rem 0; /* Было 3rem */
    }

    /* 2. НАСТРАИВАЕМ СЕТКУ И ФОТО */
    .about-grid {
        display: flex;
        flex-direction: column-reverse;
        gap: 1.5rem;
    }

    .hero .about-image {
        max-width: 200px;
    }

    /* 3. ОТДАЛЯЕМ ТЕКСТ ОТ КРАЕВ И МЕНЯЕМ РАЗМЕР */
    .hero .about-text p {
        font-size: 1.05rem;
        margin-bottom: 1rem;
        padding: 0 1rem; /* ДОБАВЛЕНО: дополнительные отступы слева и справа */
    }

    /* 4. СЕКЦИЯ ОПЫТА И ЗАГОЛОВКИ */
    /* Уменьшаем общие заголовки секций */
    h2 {
        font-size: 1.46rem;
        margin-bottom: 1.5rem;
    }

    /* Делаем сетку логотипов плотнее (меньше расстояние между ними) */
    .partners-canvas {
        gap: 1.5rem 1rem;
        padding: 0.5rem 0;
    }

    /* Уменьшаем сами картинки компаний */
    .partner-logo img {
        max-width: 110px;
        max-height: 60px;
    }

    /* Снимаем серый фильтр на мобильных, делаем их сразу цветными */
    .partner-logo {
        filter: grayscale(0%) opacity(1) !important;
    }

    /* 5. НАУЧНЫЕ ПРОЕКТЫ (ТАЙМЛАЙН) */

    .timeline-window-wrapper {
        /* Принудительно делаем ширину равной ширине всего экрана */
        width: 100vw;
        max-height: 75vh;

        /* Сдвигаем блок влево, компенсируя отступ контейнера */
        margin-left: calc(-50vw + 50%);

        /* Убираем боковые рамки и скругления, так как блок теперь прилипает к краям экрана */
        border-radius: 0;
        border-left: none;
        border-right: none;

        padding: 0 0 1.5rem 0;
    }

    /* Полностью убираем правый отступ внутри окна, чтобы карточки прижались вправо */
    .timeline-window {
        padding: 1rem 0.5rem 1rem 0.2rem;
    }

    /* Придвигаем вертикальную линию максимально к левому краю (останется всего 20px) */
    .timeline-vertical {
        margin-left: 0;
        padding-left: 20px;
    }

    /* Сдвигаем саму полосу влево, чтобы она шла ровно по новому отступу */
    .timeline-vertical::before {
        left: 6px;
    }

    /* Настраиваем позицию кружка (-20px компенсирует padding-left карточки, чтобы центры совпали) */
    .timeline-v-dot {
        left: -20px;
        width: 16px;
        height: 16px;
        border-width: 3px;
        top: 1.1rem;
    }

    /* Делаем внутренние отступы самой карточки еще компактнее */
    .timeline-v-content {
        padding: 1rem;
    }

    /* Уменьшаем отступ между шапкой карточки и текстом */
    .timeline-v-header {
        margin-bottom: 0.75rem;
        padding-bottom: 0.75rem;
    }

    /* --- УМЕНЬШЕНИЕ ШРИФТОВ --- */
    .timeline-v-year {
        font-size: 1.1rem;
    }

    .timeline-role {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }

    .timeline-v-content p {
        font-size: 0.9rem;
    }

    /* 6. НАУЧНЫЕ ПУБЛИКАЦИИ (КАРТОЧКИ) */

    /* Уменьшаем расстояние между карточками (было 2.5rem) */
    .cards-grid {
        gap: 1rem;
    }

    /* Сильно сокращаем внутренние отступы (было 2.5rem) */
    .card {
        padding: 1.2rem 1.5rem;
        border-radius: 16px; /* Чуть уменьшаем скругление для компактного вида */
    }

    /* Уменьшаем заголовок и придвигаем к нему текст */
    .card h3 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }

    /* Делаем описание чуть мельче */
    .card p {
        font-size: 0.9rem;
    }

    .carousel-container {
        padding: 0;
    }

    #regalia {
        padding-bottom: 0;
    }

    #regalia h2 {
        margin-bottom: 0;
    }

    .carousel-track {
        padding: 1rem 5% 2rem 5%;
    }

    .contact-info h3 {
        text-align: center;
        color: var(--primary-color);
        font-size: 1.5rem;
        margin-bottom: 0.8rem; /* Оставляем 1rem как базовый шаг */
    }

    .contact-info p {
        margin-bottom: 0.2rem; /* Было 2rem, уменьшаем для равномерности */
        color: var(--text-muted);
    }

    .contact-details p {
        margin-bottom: 0.2rem; /* Было 1.2rem, приводим к общему шагу */
        font-size: 1.1rem;
        color: var(--text-dark);
    }
}