/* =========================================
   1. БАЗОВЫЕ НАСТРОЙКИ
   ========================================= */
   /* --- Кастомный скроллбар --- */
/* Ширина всего скроллбара */
::-webkit-scrollbar {
    width: 10px;
}

/* Фон дорожки, по которой едет ползунок */
::-webkit-scrollbar-track {
    background: var(--bg-main);
}

/* Сам ползунок */
::-webkit-scrollbar-thumb {
    /* Создаем объем с помощью нескольких слоев градиента */
    background-image: 
        /* 1. Верхний яркий блик (как стекло) */
        linear-gradient(to bottom, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 15px),
        /* 2. Боковой объем (свет слева, тень справа) */
        linear-gradient(to right, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 20%, rgba(0, 0, 0, 0) 80%, rgba(0, 0, 0, 0.2) 100%),
        /* 3. Основной глубокий цвет (от синего к темно-синему) */
        linear-gradient(to bottom, #6366f1, #3730a3);
        
    border-radius: 20px; /* Округляем до состояния капсулы */
    border: 2px solid var(--bg-main); /* Прозрачная "рамка", чтобы ползунок не прилипал к краям */
    
    /* Внутреннее свечение для еще большего объема */
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.4); 
}

/* Ползунок при наведении */
::-webkit-scrollbar-thumb:hover {
    background-image: 
        linear-gradient(to bottom, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 20px),
        linear-gradient(to right, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 20%, rgba(0, 0, 0, 0) 80%, rgba(0, 0, 0, 0.3) 100%),
        linear-gradient(to bottom, #4f46e5, #312e81);
}

/* Для Firefox (у него более простая настройка) */
* {
    scrollbar-width: thin;
    scrollbar-color: #4f46e5 var(--bg-main);
}
/* --- Цветовые переменные для светлой и темной темы --- */
:root {
    --bg-main: #f9f9fc;
    --bg-secondary: #f3f4f6; /* Добавили фон для секции контактов */
    --text-main: #333333;
    --text-heading: #111827;
    --text-muted: #4b5563; /* Добавили приглушенный текст */
    --bg-header: rgba(255, 255, 255, 0.7);
    --bg-card: #ffffff;
    --bg-card-inner: #fdfdfd; /* Добавили фон для раскрытых проектов */
    --border-color: #eeeeee;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --bg-footer: #111827;
    --input-bg: #ffffff; /* Добавили фон полей ввода */
    --tag-bg: #e0e7ff;
    --tag-text: #4338ca;
}

[data-theme="dark"] {
    --bg-main: #121212;
    --bg-secondary: #1a1a1a; 
    --text-main: #d1d5db; 
    --text-heading: #ffffff;
    --text-muted: #9ca3af; 
    --bg-header: rgba(18, 18, 18, 0.8);
    --bg-card: #1e1e1e;
    --bg-card-inner: #252525;
    --border-color: #374151;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --bg-footer: #000000;
    --input-bg: #2a2a2a; 
    --tag-bg: rgba(79, 70, 229, 0.15); /* Полупрозрачный темно-синий фон */
    --tag-text: #818cf8; /* Приятный светло-синий цвет текста */
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-main);
    scroll-behavior: smooth; /* Плавная прокрутка страницы */
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* =========================================
   2. НАВИГАЦИЯ (ШАПКА)
   ========================================= */
header {
    background-color: var(--bg-header); /* Полупрозрачный белый */
    backdrop-filter: blur(10px); /* Эффект матового стекла */
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* Левая часть - 1 доля, Центр - по размеру контента, Правая часть - 1 доля */
    align-items: center;
    padding: 20px 50px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    justify-self: start; /* Строго прижимаем к левому краю */
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-heading);
    white-space: nowrap;
}

.nav-links {
    justify-self: center; /* Строго по центру экрана */
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #4f46e5;
}
.nav-controls {
    justify-self: end; /* Строго прижимаем к правому краю */
    display: flex;
    align-items: center;
}   

/* =========================================
   3. ГЛАВНЫЙ ЭКРАН (HERO)
   ========================================= */
.hero {
    text-align: center;
    padding: 120px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: var(--text-heading);
}

/* Делаем так, чтобы каждая часть заголовка была на своей строке */
.hero h1 span {
    display: block; 
}

/* Настройки для имени и фамилии */
.hero h1 span:last-child {
    color: #4f46e5; /* Синий акцент */
    white-space: nowrap; /* Запрещаем переносить фамилию на новую строку */
    margin-top: 10px; /* Небольшой отступ между "Hallo" и именем */
}

.hero p {
    font-size: 1.2rem;
    color: #6b7280;
    margin-bottom: 40px;
}

/* Кнопки */
.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 14px 28px;
    background-color: #4f46e5;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px solid #4f46e5;
}

.btn:hover {
    background-color: #4338ca;
    border-color: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-outline {
    background-color: transparent;
    color: #4f46e5;
}

.btn-outline:hover {
    background-color: rgba(79, 70, 229, 0.1);
    color: #4338ca;
}
[data-theme="dark"] .btn:hover {
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.4); /* Мягкое неоновое свечение */
}

/* =========================================
   4. ЗАГОЛОВКИ СЕКЦИЙ
   ========================================= */
.skills-section, .education-section, .projects-section {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: var(--text-heading);
}
/* Вспомогательный класс для подзаголовков */
.subtitle {
    font-size: 1rem;
    color: #6b7280;
    font-weight: 400;
}

/* =========================================
   5. НАВЫКИ (3D FLIP КАРТОЧКИ)
   ========================================= */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 10px;
}

/* Контейнер карточки дает 3D перспективу */
.skill-card {
    background-color: transparent;
    perspective: 1000px;
    height: 260px; /* Фиксированная высота, чтобы карточка не прыгала при перевороте */
    cursor: pointer;
}

/* Внутренний вращающийся блок */
.skill-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d;
}

/* Класс, который добавляет JS при клике */
.skill-card.flipped .skill-card-inner {
    transform: rotateY(180deg);
}

.skill-card-front, .skill-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden; /* Прячет "спину" при перевороте */
    border-radius: 15px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* Лицевая сторона */
.skill-card-front {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-heading);
}

.skill-card-front .icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

/* Обратная сторона */
.skill-card-back {
    background-color: #4f46e5; /* Синий цвет */
    color: #ffffff;
    transform: rotateY(180deg);
    border: 1px solid #4f46e5;
}

.skill-card-back h3 {
    margin-bottom: 15px;
    color: #ffffff;
    font-size: 1.3rem;
}

.skill-card-back p {
    color: #e0e7ff;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Эффект при наведении (легкий подъем) */
.skill-card:hover .skill-card-inner {
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.15);
}


/* =========================================
   6. ШКАЛА ОБУЧЕНИЯ (ACCORDION / EXPAND)
   ========================================= */
.timeline {
    position: relative;
    border-left: 4px solid #e5e7eb;
    margin: 40px auto;
    padding-left: 40px;
    margin-left: 20px;
    transition: all 0.4s ease;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
    background-color: var(--bg-card);
    padding: 20px 25px;
    border-radius: 12px;
    border-color: var(--border-color);
    border-color: var(--border-color);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1); /* Плавное раздвигание */
}

/* Интерактивная точка */
.timeline-item .dot {
    position: absolute;
    left: -52px;
    top: 25px;
    width: 20px;
    height: 20px;
    background-color: #4f46e5;
    border: 4px solid #f9f9fc;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #4f46e5;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timeline-item .dot:hover {
    transform: scale(1.5);
    background-color: #4338ca;
}

/* Скрытый текст с деталями */
.timeline-details {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.5s ease, margin-top 0.5s ease;
    color: #4b5563;
    line-height: 1.6;
}

/* --- СОСТОЯНИЕ: КОГДА ЭЛЕМЕНТ ОТКРЫТ (EXPANDED) --- */
.timeline-item.expanded {
    margin-top: 50px; /* Раздвигает соседей вверх */
    margin-bottom: 50px; /* Раздвигает соседей вниз */
    border-color: #4f46e5;
    box-shadow: 0 15px 35px rgba(79, 70, 229, 0.15);
    transform: scale(1.02); /* Слегка увеличивается */
}

.timeline-item.expanded .dot {
    background-color: #10b981; /* Точка становится зеленой при открытии */
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
    transform: scale(1.3);
}

.timeline-item.expanded .timeline-details {
    max-height: 300px; /* Раскрываем текст */
    opacity: 1;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #e5e7eb; /* Разделительная линия */
}

/* Затемняем остальные элементы, если один открыт */
.timeline.has-expanded .timeline-item:not(.expanded) {
    opacity: 0.4;
    transform: scale(0.98);
}

/* =========================================
   7. ПРОЕКТЫ
   ========================================= */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.project-card-simple {
    background-color: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-color);
    border-color: var(--border-color);
    transition: all 0.3s ease;
    overflow: hidden; /* Обрезает картинку по скругленным углам карточки */
    display: flex;
    flex-direction: column;
}

.project-card-simple:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.1);
    border-color: #4f46e5;
}

/* Стили для изображений проектов */
.project-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); /* Плавное движение */
    border-bottom: 1px solid var(--border-color);
}

/* Обертка для текста внутри карточки */
.project-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-content h3 {
    margin-bottom: 10px;
    color: var(--text-heading);
    font-size: 1.4rem;
}

/* Стили для тегов технологий */
.project-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.tag {
    background-color: var(--tag-bg); /* ИСПРАВЛЕНО */
    color: var(--tag-text);          /* ИСПРАВЛЕНО */
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease; /* Добавлена плавность */
}

.project-content p {
    color: #6b7280;
    margin-bottom: 20px;
    flex-grow: 1; /* Прижимает кнопку "Details" к низу, если текст разной длины */
}

.project-content a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.project-content a:hover {
    color: #3730a3;
}
/* --- Стили для широкой карточки Практики (comz) --- */
.interactive-card.wide-card {
    max-width: 930px; 
    flex-basis: 100%;  
    /* Отступы: 0 сверху, auto по бокам (центрирование), 30px снизу (расстояние до других карточек) */
    margin: 0 auto 30px auto; 
}
/* 2. Обертка для логотипа (вместо обычного фото) */
.logo-wrapper {
    height: 250px;
    width: 100%;
    background-color: #ffffff; /* Белый фон обязателен, чтобы логотип с черным текстом не "пропал" в темной теме */
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color); /* Линия отделения от текста, как в других карточках  */
    padding: 20px;
}

/* 3. Настройка самого SVG логотипа */
.project-logo {
    max-width: 80%;      /* Чтобы логотип не упирался в края */
    max-height: 160px;   /* Ограничиваем высоту для аккуратности */
    object-fit: contain; /* Сохраняет пропорции логотипа без искажений */
    transition: transform 0.4s ease; /* Плавный эффект при наведении  */
}

/* Эффект увеличения логотипа при наведении на всю карточку */
.interactive-card.wide-card:hover .project-logo {
    transform: scale(1.05);
}

/* 4. Адаптивность для мобильных телефонов */
@media (max-width: 768px) {
    .logo-wrapper {
        height: 180px; /* Уменьшаем высоту блока на смартфонах */
    }
    
    .project-logo {
        max-width: 90%;
        max-height: 120px;
    }
}/* --- Стили для мини-галереи внутри проектов --- */
.project-showcase {
    margin-top: 25px;
    padding: 20px;
    background-color: var(--bg-main); /* Легкое выделение на фоне карточки */
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.project-showcase h5 {
    color: #4f46e5;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.project-showcase p {
    font-size: 0.95rem;
    margin-bottom: 20px;
    color: var(--text-muted);
    line-height: 1.5;
}

.showcase-gallery {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap; /* Чтобы на телефонах фото переносились на новую строку */
}

.showcase-gallery img {
    width: calc(33.333% - 10px); /* Три фото в один ряд */
    min-width: 150px; /* Минимальная ширина для телефонов */
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 10px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.showcase-gallery img:hover {
    transform: scale(1.05); /* Легкое увеличение при наведении */
    box-shadow: 0 8px 15px rgba(79, 70, 229, 0.2); /* Синее свечение */
}

/* Адаптивность для телефонов */
@media (max-width: 768px) {
    .showcase-gallery img {
        width: 100%; /* На телефонах фото будут идти друг под другом */
    }
}


/* =========================================
   8. ПОДВАЛ (ФУТЕР)
   ========================================= */
footer {
    background-color: var(--bg-footer);
    color: #f9fafb;
    text-align: center;
    padding: 60px 20px;
    margin-top: 50px;
}

footer h2 {
    margin-bottom: 20px;
    font-size: 2rem;
}

footer p {
    margin-top: 10px;
    color: #9ca3af;
    font-size: 1.1rem;
}

footer a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #818cf8;
}

/* =========================================
   9. АДАПТИВНОСТЬ (ДЛЯ ТЕЛЕФОНОВ)
   ========================================= */
@media (max-width: 768px) {
    nav {
        display: flex;
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    /* Исправляем отступы шкалы на маленьких экранах */
    .timeline {
        margin-left: 10px;
        padding-left: 20px;
    }
    
    .timeline-item .dot {
        left: -32px;
    }
}
/* =========================================
   10. ВСТРОЕННОЕ РЕЗЮМЕ И СЕРТИФИКАТЫ
   ========================================= */
.cv-section {
    padding: 80px 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.cv-container {
    background-color: var(--bg-card);
    padding: 50px;
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-color);
    margin-bottom: 50px;
    border-top: 5px solid #4f46e5;
}

.cv-container h3 { font-size: 2rem; margin-bottom: 10px; }
.cv-container h4 { margin: 20px 0 10px 0; color: #4f46e5; }
.cv-container p, .cv-container ul { margin-bottom: 15px; color: #4b5563; }
.cv-container ul { padding-left: 20px; }
.cv-container hr { border: 0; height: 1px; background: #e5e7eb; margin: 20px 0; }

.cert-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Стили для реальных карточек сертификатов */
.cert-card-real {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    width: 220px;
    text-align: center;
    box-shadow: 0 4px 15px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.cert-card-real:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--shadow-color);
    border-color: #4f46e5;
}

.cert-card-real .icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.cert-card-real h4 {
    color: var(--text-heading);
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.cert-card-real p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 20px;
    flex-grow: 1; /* Чтобы кнопки всегда были на одном уровне снизу */
}

/* Компактная кнопка для карточек */
.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
    width: 100%;
}

/* =========================================
   11. ИНТЕРАКТИВНОСТЬ (КУРСОР)
   ========================================= */
.interactive { cursor: pointer; }
.interactive-dot .dot { cursor: pointer; }

/* =========================================
   12. МОДАЛЬНОЕ ОКНО (POPUP)
   ========================================= */
.modal {
    display: none; /* Скрыто по умолчанию */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6); /* Темный фон */
    backdrop-filter: blur(4px); /* Размытие фона за окном */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: #fff;
    padding: 40px;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    position: relative;
    transform: translateY(-50px);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.modal.show .modal-content {
    transform: translateY(0); /* Плавное выплывание */
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-btn:hover { color: #111827; }

#modal-title {
    color: #4f46e5;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

#modal-text {
    color: #4b5563;
    line-height: 1.7;
    font-size: 1.1rem;
}
/* Сетка для карточек в один ряд */
.projects-grid {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: flex-start; /* Важно: каждая карточка своей высоты */
}

/* Сама карточка */
.interactive-card {
    flex: 1;
    min-width: 320px;
    max-width: 450px;
    cursor: pointer;
    background: var(--bg-card); /* ИСПРАВЛЕНО: было #fff */
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.interactive-card:hover .project-image {
    transform: scale(1.08); /* Картинка увеличивается на 8% */
}

/* Текст-подсказка */
.click-hint {
    font-size: 0.85rem;
    color: #4f46e5;
    margin-top: 15px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Скрытый блок с анимацией */
.project-details-expand {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-card-inner); /* ИСПРАВЛЕНО: было #f9fafb */
}

.project-details-expand.open {
    max-height: 600px; /* Достаточно места для текста */
}

.expand-inner {
    padding: 0 25px 25px 25px;
    font-size: 0.95rem;
}

.expand-inner hr {
    border: none;
    border-top: 1px solid #eee;
    margin-bottom: 15px;
}

.expand-inner h4 {
    color: var(--text-heading); /* ИСПРАВЛЕНО: было #2d3748 */
    margin-bottom: 10px;
}

.expand-inner ul {
    list-style: none;
    padding: 0;
}

.expand-inner li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 15px;
}

.expand-inner li::before {
    content: "•";
    color: #4f46e5;
    position: absolute;
    left: 0;
}

/* Кнопка-ссылка */
.project-link-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 18px;
    background: #4f46e5;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.3s;
}

.project-link-btn:hover {
    background: #3730a3;
}
.projects-grid {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap; /* Для мобильных устройств */
}

.interactive-card {
    flex: 1;
    min-width: 320px;
    max-width: 450px;
    cursor: pointer;
    background: var(--bg-card); /* ИСПРАВЛЕНО */
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.interactive-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.click-hint {
    color: #4f46e5;
    font-size: 0.85rem;
    font-weight: bold;
    margin-top: 10px;
    text-transform: uppercase;
}

.project-details-expand {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-card-inner); /* ИСПРАВЛЕНО */
}

.project-details-expand.open {
    max-height: 800px; /* Достаточно места для текста */
}

.expand-inner {
    padding: 0 25px 25px 25px;
}

.project-link-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: #4f46e5;
    color: white !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
}
/* --- Секция Контактов --- */
.contact-section {
    padding: 100px 20px;
    background-color: var(--bg-secondary); /* ИСПРАВЛЕНО: было #f3f4f6 */
    transition: background-color 0.3s ease;
}   

.contact-container {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    background-color: var(--bg-card);
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 4px 15px var(--shadow-color);
    
}

.contact-info h2 {
    text-align: left;
    margin-bottom: 25px;
    color: #4f46e5;
}

.contact-info p {
    font-size: 1.1rem;
    color: var(--text-muted); /* ИСПРАВЛЕНО: было #4b5563 */
    margin-bottom: 30px;
}

.contact-details {
    list-style: none;
    padding: 0;
}

.contact-details li {
    margin-bottom: 15px;
    font-size: 1rem;
}

.contact-details a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
}

/* --- Стили формы --- */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-heading); /* ИСПРАВЛЕНО: было #1f2937 */
}

.form-group input, 
.form-group textarea {
    padding: 14px;
    border: 1px solid var(--border-color); /* ИСПРАВЛЕНО: было #d1d5db */
    background-color: var(--input-bg); /* ДОБАВЛЕНО */
    color: var(--text-main); /* ДОБАВЛЕНО */
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* --- Маленький футер --- */
.mini-footer {
    text-align: center;
    padding: 30px;
    background: #111827;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .contact-container {
        grid-template-columns: 1fr;
        padding: 30px;
    }
    .contact-info h2 {
        text-align: center;
    }
}

/* --- Кнопка "Наверх" с Мягкой Базой --- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px; /* Немного крупнее для объема */
    height: 60px;
    
    /* Базовый цвет кнопки - матовый, мягкий */
    background-color: #4f46e5;
    border: none;
    border-radius: 50%; /* Круглая форма для "пузырька" */
    
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;

    /* Очень мягкая, глубокая тень под всей кнопкой */
    box-shadow: 
        0 10px 25px -5px rgba(79, 70, 229, 0.4),
        0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    /* Состояние скрыто */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    
    /* Плавная, "резиновая" анимация */
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    
    /* Чтобы блики не вылезали за пределы */
    overflow: hidden; 
}

/* --- Тот самый 3D "Пузырек-Стрелка" с Бликами --- */
.back-to-top::after {
    content: "";
    width: 32px; /* Размер пузырька */
    height: 32px;
    
    /* Иконка стрелки (SVG) + Сложные градиенты для бликов */
    background-image: 
        /* 1. Верхний яркий блик (свет) */
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 25%),
        /* 2. Нижний мягкий блик (отсвет) */
        radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 30%),
        /* 3. Основной глянцевый градиент самого пузырька */
        linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.05) 100%),
        /* 4. Сама иконка стрелки (белая, встроенный SVG) */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M5 12l7-7 7 7'/%3E%3C/svg%3E");
    
    background-size: cover, cover, cover, 70%; /* Размеры для каждого слоя */
    background-position: center, center, center, center center;
    background-repeat: no-repeat;
    
    border-radius: 50%; /* Сам пузырек внутри тоже круглый */
    
    /* Внутренняя тень самого пузырька для объема */
    box-shadow: 
        inset 0 2px 3px rgba(255, 255, 255, 0.3),
        inset 0 -2px 5px rgba(0, 0, 0, 0.2),
        0 4px 8px rgba(0, 0, 0, 0.3);

    transition: all 0.3s ease;
}

/* --- Появление кнопки --- */
.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* --- Эффекты при наведении --- */
.back-to-top:hover {
    background-color: #4338ca; /* Чуть темнее фон кнопки */
    transform: translateY(-5px); /* Кнопка всплывает */
    box-shadow: 
        0 15px 30px -5px rgba(79, 70, 229, 0.6),
        0 10px 15px -6px rgba(0, 0, 0, 0.15);
}

/* Пузырек внутри при наведении "играет" на свету */
.back-to-top:hover::after {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 
        inset 0 3px 5px rgba(255, 255, 255, 0.5),
        inset 0 -3px 7px rgba(0, 0, 0, 0.2),
        0 6px 12px rgba(0, 0, 0, 0.4);
}

/* --- Эффект нажатия --- */
.back-to-top:active {
    transform: translateY(-2px) scale(0.95);
    transition: all 0.1s ease;
}

.back-to-top:active::after {
    transform: scale(0.9);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}
/* Базовый класс для скрытых элементов */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

/* Класс, который добавит JS при прокрутке */
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}
    /* --- Плавное появление (Scroll Reveal) --- */
/* Начальное состояние: невидимы и опущены на 50px вниз */
.skills-section, 
.education-section, 
.projects-section,
.cv-section,
.contact-section {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Состояние, когда скрипт замечает секцию на экране */
.skills-section.active, 
.education-section.active, 
.projects-section.active,
.cv-section.active,
.contact-section.active {
    opacity: 1;
    transform: translateY(0);
}
/* --- Переключатель языков (Language Toggle) --- */
.lang-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
}

.lang-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: #9ca3af; /* Серый цвет для неактивного языка */
    transition: color 0.3s ease;
}

.lang-label.active {
    color: #4f46e5; /* Синий для активного языка */
}

/* Стилизация самой "таблетки" */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #e5e7eb;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 34px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Состояние, когда выбран английский (рычажок вправо) */
input:checked + .slider {
    background-color: #4f46e5;
}
input:checked + .slider:before {
    transform: translateX(22px);
}
.footer-links {
    margin-top: 10px;
}
.footer-links a {
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.8rem;
    margin: 0 5px;
}
.footer-links a:hover {
    color: #4f46e5;
}