:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #2980b9;
    --light-gray: #f8f9fa;
    --medium-gray: #e9ecef;
    --dark-gray: #343a40;
    --text-color: #333;
    --text-light: #6c757d;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- Базовые стили для body --- */
body {
    font-family: 'Roboto', 'Open Sans', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #2c3e50;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-image 0.5s ease;
    /* Базовый фон */
    background-color: color-mix(in srgb, var(--primary-color) 90%, #003333 20%);
    background-image: radial-gradient(circle at 50px 50px,
    rgba(100, 255, 200, 0.04) 2px,
    transparent 4px);
    background-size: 100px 100px;
}

/* ===== УНИКАЛЬНЫЕ ФОНОВЫЕ ЭЛЕМЕНТЫ ===== */
/* Стили для страницы 3 (section3.html) - символы программирования */
body::before {
    content: "{ } [ ] ( ) < > / * + - = # & | { } [ ] ( ) < > / * + - = # & | { } [ ] ( ) < > / * + - = # & |";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    font-family: 'Courier New', monospace;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.05);
    white-space: nowrap;
    overflow: hidden;
    pointer-events: none;
    transform: rotate(-5deg) scale(1.5);
    line-height: 2;
    text-align: justify;
    padding: 20px;
    z-index: 1;
}

/* Стили для страницы 4 (section4.html) - HEX-коды */
body::after {
    content: "0x1F 0x2A 0x3B 0x4C 0x5D 0x6E 0x7F 0x8A 0x9B 0xAC";
    position: fixed;
    bottom: 0;
    right: 0;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.1);
    white-space: pre;
    opacity: 0.3;
    transform: rotate(180deg);
    pointer-events: none;
    z-index: 1;
}

html {
    scroll-behavior: smooth;
}

/* --- Заголовки (белые для читаемости на фоне) --- */
h1, h2, h3, .page-header h1, .experience-section h2, .project-title {
    color: #ffffff !important;
    /* Тень для лучшей читаемости (из файлов: section3.html, section4.html) */
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* Темные заголовки на белых карточках */
.project-card h3, .project-card .project-title,
.skill-category h4, .skill-category h3, .certification-section h3, .achievement-section h3 {
    color: var(--primary-color) !important;
    /* Убираем тень для темных заголовков на белом фоне (из файлов: section3.html, section4.html) */
    text-shadow: none;
}

/* --- Шапка сайта --- */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 0;
    width: 100%;
    z-index: 1002;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    max-width: 1400px;
    margin: 0 auto;
    height: 70px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1002;
}

.logo {
    height: 40px;
    width: auto;
    transition: var(--transition);
}

.logo-text {
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    font-family: 'Open Sans', sans-serif;
    white-space: nowrap;
    margin: 0;
}

.logo:hover {
    transform: scale(1.05);
}

/* --- Навигация --- */
nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-menu {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 25px;
    align-items: center;
}

.nav-menu li {
    margin: 0;
}

.nav-menu li a {
    color: white;
    text-decoration: none;
    font-weight: 700;
    padding: 25px 0;
    display: block;
    position: relative;
    transition: var(--transition);
    border-bottom: none;
    font-size: 0.95rem;
    white-space: nowrap;
}

.nav-menu li a::after {
    content: '';
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
}

.nav-menu li a:hover::after {
    width: 100%;
}

.nav-menu li a:hover {
    color: var(--secondary-color);
}

/* --- Мобильное меню --- */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    z-index: 1002;
    font-weight: 700;
    line-height: 1; /* Из файла section4.html */
}

.mobile-menu-toggle:focus {
    outline: none; /* Из файлов: section3.html, section4.html */
}

.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(3px);
}

.menu-overlay.active {
    display: block;
}

/* --- Основной контент --- */
main {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px 60px;
    width: 100%;
    position: relative;
    z-index: 2;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 20px;
}

.page-header h1 {
    font-size: 36px;
    margin-bottom: 10px;
    font-family: 'Open Sans', sans-serif;
    font-weight: bold;
    /* text-shadow объединен выше */
}

.page-description {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    max-width: 800px;
    margin: 0 auto;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); /* Из файлов: main.html, section2.html */
    /* Альтернатива с большей тенью из других файлов */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); /* Из файлов: section3.html, section4.html */
}

/* --- Секция профиля (УНИКАЛЬНО для главной) --- */
.profile-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    border-radius: var(--border-radius);
    padding: 40px;
    margin: 40px 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 40px;
    transition: var(--transition);
}

.profile-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.profile-image {
    flex-shrink: 0;
}

.profile-image img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    object-fit: cover;
}

.profile-image img:hover {
    transform: scale(1.03);
}

.profile-info {
    flex: 1;
}

.profile-info h1 {
    color: var(--primary-color) !important;
    margin-bottom: 10px;
}

.profile-info h3 {
    color: var(--accent-color) !important;
    margin-bottom: 15px;
}
/* --- Конец секции профиля --- */

/* --- Общие карточки и секции --- */
section {
    padding: 50px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
}

section:last-of-type {
    border-bottom: none;
}

section h2 {
    font-size: 2rem;
    color: #ffffff !important;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
    font-family: 'Open Sans', sans-serif;
    text-align: left;
}

.card {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    border-left: 4px solid var(--secondary-color);
    width: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

/* --- Образование (УНИКАЛЬНО для главной) --- */
.education-item {
    margin-bottom: 25px;
    padding-left: 20px;
    border-left: 3px solid var(--medium-gray);
}

.education-item:hover {
    border-left-color: var(--secondary-color);
}

.education-item:last-child {
    margin-bottom: 0;
}

.education-item h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}
/* --- Конец образования --- */

/* --- Навыки --- */
.skills-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px auto;
    width: 100%;
    justify-items: center;
}

.skill-category {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 350px;
    transition: var(--transition);
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.skill-category h4 {
    color: var(--primary-color) !important;
    margin-bottom: 15px;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--medium-gray);
    padding-bottom: 8px;
    text-align: left;
}

.skill-category ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.skill-category li {
    padding: 5px 0 5px 20px;
    position: relative;
    color: var(--text-color);
    text-align: left;
}

.skill-category li::before {
    content: "•";
    color: var(--secondary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}
/* --- Конец навыков --- */

/* ===== УНИКАЛЬНЫЙ БЛОК НАВЫКОВ ДЛЯ СТРАНИЦЫ 3 (section3.html) ===== */
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 30px auto;
    width: 100%;
    justify-content: center;
    align-items: stretch;
}

.skills-grid .skill-category {
    flex: 0 1 calc(25% - 15px);
    min-width: 250px;
    max-width: 300px;
}

.skills-grid .skill-category h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 20px;
    border-bottom: 2px solid var(--medium-gray);
    padding-bottom: 8px;
    text-align: center;
}

.skill-list {
    list-style: none;
}

.skill-list li {
    padding: 8px 0 8px 25px;
    position: relative;
    color: var(--text-color);
    text-align: left;
}

.skill-list li:before {
    content: "✓";
    color: var(--secondary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}
/* ===== КОНЕЦ УНИКАЛЬНОГО БЛОКА ===== */

/* --- Опыт работы (УНИКАЛЬНО для главной) --- */
.experience-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    margin: 25px 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    border-left: 4px solid var(--accent-color);
    transition: var(--transition);
    width: 100%;
}

.experience-card:hover {
    transform: translateX(5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.company-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.company-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
}

.dates {
    color: var(--text-light);
    font-size: 0.9rem;
    background: var(--light-gray);
    padding: 5px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.experience-card ul {
    list-style: none;
    margin: 15px 0;
    padding: 0;
}

.experience-card ul li {
    padding: 5px 0 5px 25px;
    position: relative;
    color: var(--text-color);
}

.experience-card ul li:before {
    content: "•";
    color: var(--primary-color);
    font-size: 20px;
    position: absolute;
    left: 0;
    top: 3px;
}

.experience-card a {
    color: var(--secondary-color);
    text-decoration: none;
}

.experience-card a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}
/* --- Конец опыта --- */

/* --- Портфолио ссылки (УНИКАЛЬНО для главной) --- */
.portfolio-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px auto;
    width: 100%;
    justify-items: center;
}

.portfolio-link {
    background: white;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 300px;
}

.portfolio-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, white 0%, #f8f9fa 100%);
}

.portfolio-link h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--primary-color) !important;
    text-align: left;
}

.portfolio-link p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-light);
    text-align: left;
}

.portfolio-link a {
    word-break: break-all;
    color: var(--secondary-color);
    text-decoration: none;
    display: inline-block;
    text-align: left;
}

.portfolio-link a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}
/* --- Конец портфолио ссылок --- */

/* --- Сертификаты (УНИКАЛЬНО для главной) --- */
.certificates {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px auto;
    width: 100%;
    justify-content: center;
}

.certificate-link {
    background: white;
    padding: 15px 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
    border: 1px solid var(--medium-gray);
    flex: 0 1 auto;
    min-width: 200px;
    max-width: calc(33.333% - 10px);
    text-align: center;
    color: var(--primary-color);
    font-weight: 500;
    white-space: normal;
    word-wrap: break-word;
    text-decoration: none;
    margin: 0;
}

.certificate-link:hover {
    background: var(--light-gray);
    border-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    color: var(--primary-color);
}
/* --- Конец сертификатов --- */

/* ===== СТИЛИ ДЛЯ СТРАНИЦ 2,3,4 ===== */
/* Эти классы используются для детальных страниц проектов */

/* Секция опыта (заголовок) */
.experience-section {
    margin-bottom: 60px;
}

.experience-section h2 {
    font-size: 28px;
    margin-bottom: 20px;
    font-family: 'Open Sans', sans-serif;
    font-weight: bold;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
}

/* Карточка проекта (для страниц 2,3,4) */
.project-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); /* Из файла section2.html */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); /* Из файлов: section3.html, section4.html */
    transition: var(--transition);
    border-left: 4px solid var(--secondary-color);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3); /* Из файла section2.html */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4); /* Из файлов: section3.html, section4.html */
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.project-title {
    font-size: 24px;
    margin: 0;
    font-family: 'Open Sans', sans-serif;
    font-weight: bold;
}

.project-period {
    color: var(--accent-color);
    font-style: italic;
    font-size: 14px;
    background: var(--light-gray);
    padding: 5px 15px;
    border-radius: 20px;
}

.project-description {
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
}

.project-description p {
    margin-bottom: 15px;
    color: var(--text-color);
}

.project-features {
    list-style: none;
    margin: 20px 0;
    padding: 0;
}

.project-features li {
    padding: 5px 0 5px 25px;
    position: relative;
    color: var(--text-color);
}

.project-features li:before {
    content: "•";
    color: var(--primary-color);
    font-size: 20px;
    position: absolute;
    left: 0;
    top: 3px;
}

/* Ссылка на проект (кнопка) */
.project-link {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--medium-gray);
}

.project-link a {
    display: inline-block;
    background-color: var(--secondary-color);
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
}

.project-link a:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    text-decoration: none;
}

.project-link a:active {
    transform: translateY(0);
}

/* Галерея изображений (для страниц 2,3,4) */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.gallery-item {
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); /* Из файла section2.html */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); /* Из файлов: section3.html, section4.html */
    display: flex;
    flex-direction: column;
    background: white;
}

.gallery-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: var(--transition);
    max-height: 400px;
    display: block;
}

.gallery-item:hover img {
    transform: scale(1.02);
}

.image-caption {
    padding: 15px;
    background: white;
    font-size: 14px;
    color: var(--text-light);
    text-align: center;
    border-top: 1px solid var(--medium-gray);
}

.single-image {
    grid-column: 1 / -1;
    max-width: 800px;
    margin: 0 auto;
}
/* ===== КОНЕЦ СТИЛЕЙ ДЛЯ СТРАНИЦ 2,3,4 ===== */

/* ===== УНИКАЛЬНЫЙ БАННЕР ДЛЯ СТРАНИЦЫ 4 (section4.html) ===== */
.hero-banner {
    width: 100%;
    overflow: hidden;
    border-radius: var(--border-radius);
    margin: 30px 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.hero-banner img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 400px;
    object-fit: cover;
}
/* ===== КОНЕЦ БАННЕРА ===== */

/* ===== УНИКАЛЬНАЯ СЕКЦИЯ СЕРТИФИКАЦИИ ДЛЯ СТРАНИЦЫ 2 (section2.html) ===== */
.certification-section {
    background: linear-gradient(135deg, var(--light-gray) 0%, #e8e8e8 100%);
    border-radius: var(--border-radius);
    padding: 40px;
    margin: 40px 0;
    border-left: 4px solid var(--secondary-color);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); /* Из файла section2.html */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); /* Из файлов: section3.html, section4.html */
}

.certification-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.certification-badge {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--box-shadow);
    font-size: 36px;
    color: var(--primary-color);
}
/* ===== КОНЕЦ СЕКЦИИ СЕРТИФИКАЦИИ ===== */

/* ===== УНИКАЛЬНАЯ СЕКЦИЯ ДОСТИЖЕНИЙ ДЛЯ СТРАНИЦЫ 4 (section4.html) ===== */
.achievement-section {
    background: linear-gradient(135deg, var(--light-gray) 0%, #e8e8e8 100%);
    border-radius: var(--border-radius);
    padding: 40px;
    margin: 40px 0;
    border-left: 4px solid var(--secondary-color);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.achievement-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.achievement-badge {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--box-shadow);
    font-size: 36px;
    color: var(--primary-color);
}
/* ===== КОНЕЦ СЕКЦИИ ДОСТИЖЕНИЙ ===== */

/* --- Подвал сайта --- */
footer {
    background: var(--primary-color);
    color: white;
    padding: 50px 0 30px;
    margin-top: 50px;
    width: 100%;
    position: relative;
    z-index: 2;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    color: white;
    margin-top: 0;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
    display: inline-block;
    font-weight: 600;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
}

.contact-info p {
    margin-bottom: 8px;
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
}

.copyright p {
    color: white !important;
    margin: 0;
}

/* --- Кнопки прокрутки --- */
.scroll-buttons {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scroll-button {
    background-color: var(--primary-color);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.scroll-button:hover {
    background-color: var(--secondary-color);
    transform: scale(1.1);
}

/* --- Общие ссылки --- */
a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* --- Анимация --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

/* --- Вспомогательные классы --- */
.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-30 {
    margin-bottom: 30px;
}

.mt-40 {
    margin-top: 40px;
}

.pt-40 {
    padding-top: 40px;
}

.pb-40 {
    padding-bottom: 40px;
}

.highlight {
    color: var(--accent-color);
    font-weight: bold;
}

#top, #bottom {
    position: absolute;
    visibility: hidden;
}

#top {
    top: 0;
}

#bottom {
    bottom: 0;
}

/* ========== МЕДИА-ЗАПРОСЫ ========== */

/* Планшеты (до 1024px) */
@media (max-width: 1024px) {
    .nav-menu {
        gap: 15px;
    }

    .nav-menu li a {
        font-size: 0.9rem;
        padding: 25px 0;
    }

    .logo-text {
        font-size: 1rem;
    }

    .container {
        padding: 0 25px;
    }

    /* Из файла main.html */
    .certificate-link {
        max-width: calc(50% - 7.5px);
    }

    /* Из файла section2.html, section3.html, section4.html */
    .project-title {
        font-size: 22px;
    }

    /* Из файла section3.html */
    .skill-category {
        flex: 0 1 calc(50% - 10px);
    }
}

/* Мобильные устройства (до 768px) */
@media (max-width: 768px) {
    .header-content {
        height: auto;
        min-height: 60px;
        padding: 8px 15px;
    }

    .mobile-menu-toggle {
        display: block;
        font-size: 1.8rem;
    }

    .logo {
        height: 35px;
    }

    .logo-text {
        font-size: 0.95rem;
        max-width: 150px;
        white-space: normal;
        line-height: 1.2;
    }

    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--primary-color);
        padding: 80px 20px 30px;
        transition: right 0.3s ease;
        z-index: 1001;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
        justify-content: flex-start;
        overflow-y: auto; /* Из файла main.html */
    }

    nav.active {
        right: 0;
    }

    .nav-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        width: 100%;
    }

    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-menu li a {
        padding: 15px 0;
        font-size: 1.1rem;
        white-space: normal;
        width: 100%;
        text-align: left;
    }

    .nav-menu li a::after {
        bottom: 10px;
    }

    main {
        padding: 20px 15px 40px;
    }

    .container {
        padding: 0 15px;
    }

    .page-header {
        margin-bottom: 30px;
        padding-top: 10px;
    }

    .page-header h1 {
        font-size: 28px;
    }

    .page-description {
        font-size: 16px;
        padding: 0 10px;
    }

    section h2 {
        font-size: 1.6rem;
        margin: 30px 0 15px 0;
    }

    /* Главная страница (main.html) */
    .profile-section {
        flex-direction: column;
        text-align: center;
        padding: 25px 15px;
        margin: 30px 0;
        gap: 20px;
    }

    .profile-image img {
        width: 120px;
        height: 120px;
    }

    .profile-info h1 {
        font-size: 2rem;
    }

    .profile-info h3 {
        font-size: 1.3rem;
    }

    .card {
        padding: 20px;
        margin: 20px 0;
    }

    .experience-card {
        padding: 20px;
        margin: 20px 0;
    }

    .experience-card:hover {
        transform: translateX(3px);
    }

    .company-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .dates {
        align-self: flex-start;
        white-space: normal;
    }

    .skills-list,
    .portfolio-links {
        grid-template-columns: 1fr;
        gap: 15px;
        justify-items: center;
    }

    .skill-category,
    .portfolio-link {
        max-width: 100%;
    }

    .skill-category {
        padding: 20px;
    }

    .skill-category h4 {
        font-size: 1.1rem;
    }

    .portfolio-link {
        padding: 20px;
    }

    .certificates {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    .certificate-link {
        max-width: 100%;
        width: 100%;
        min-width: auto;
        padding: 12px 20px;
    }
    /* Конец главной */

    /* Страницы 2,3,4 */
    .experience-section h2 {
        font-size: 24px;
    }

    .project-card {
        padding: 20px;
    }

    .project-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .project-title {
        font-size: 20px;
    }

    .project-period {
        font-size: 13px;
        padding: 4px 12px;
    }

    .project-description {
        font-size: 15px;
    }

    .project-features li {
        font-size: 15px;
        padding-left: 20px;
    }

    .image-gallery {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 20px 0;
    }

    .gallery-item img {
        max-height: 250px;
    }

    .image-caption {
        padding: 12px;
        font-size: 13px;
    }

    .certification-section,
    .achievement-section {
        padding: 25px;
        margin: 30px 0;
    }

    .certification-header,
    .achievement-header {
        gap: 15px;
        margin-bottom: 20px;
    }

    .certification-badge,
    .achievement-badge {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    /* Конец страниц 2,3,4 */

    /* Специфика для страницы 3 (section3.html) */
    .skills-grid {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .skills-grid .skill-category {
        flex: 0 1 100%;
        max-width: 400px;
        width: 100%;
    }

    .skills-grid .skill-category h3 {
        font-size: 18px;
    }
    /* Конец страницы 3 */

    /* Специфика для страницы 4 (section4.html) */
    .hero-banner {
        margin: 20px 0;
    }

    .hero-banner img {
        max-height: 250px;
    }
    /* Конец страницы 4 */

    /* Подвал */
    footer {
        padding: 40px 0 20px;
        margin-top: 40px;
    }

    .footer-sections {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-section {
        text-align: center;
    }

    .footer-section h3 {
        font-size: 1.1rem;
        margin-bottom: 15px;
        width: 100%;
        text-align: center;
    }

    .footer-section p {
        font-size: 14px;
    }

    .contact-info p {
        font-size: 14px;
        word-break: break-word;
    }

    /* Кнопки прокрутки */
    .scroll-buttons {
        right: 15px;
        bottom: 15px;
        gap: 8px;
    }

    .scroll-button {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* Маленькие мобильные (до 480px) */
@media (max-width: 480px) {
    .header-content {
        min-height: 55px;
    }

    .logo {
        height: 30px;
    }

    .logo-text {
        font-size: 0.85rem;
        max-width: 120px;
    }

    .mobile-menu-toggle {
        font-size: 1.5rem;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .profile-info h1 {
        font-size: 1.8rem;
    }

    .profile-info h3 {
        font-size: 1.2rem;
    }

    section h2 {
        font-size: 1.4rem;
    }

    .card,
    .experience-card,
    .skill-category,
    .portfolio-link,
    .project-card {
        padding: 15px;
    }

    .company-name {
        font-size: 1.2rem;
    }

    .dates,
    .project-period {
        font-size: 12px;
        padding: 3px 10px;
    }

    .certificate-link {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .certification-section,
    .achievement-section {
        padding: 20px 15px;
    }

    .certification-header,
    .achievement-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .gallery-item img {
        max-height: 200px;
    }

    .footer-sections {
        gap: 20px;
    }

    .copyright {
        font-size: 0.85rem;
        padding-top: 20px;
    }

    .scroll-buttons {
        right: 10px;
        bottom: 10px;
    }

    .scroll-button {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
}

/* Очень маленькие экраны (до 360px) */
@media (max-width: 360px) {
    .logo-text {
        display: none;
    }

    .logo {
        height: 30px;
    }

    .mobile-menu-toggle {
        font-size: 1.3rem;
    }

    .page-header h1 {
        font-size: 22px;
    }

    .profile-info h1 {
        font-size: 1.6rem;
    }

    section h2 {
        font-size: 1.3rem;
    }

    .profile-section {
        padding: 15px 10px;
    }

    .profile-image img {
        width: 90px;
        height: 90px;
    }

    .project-title {
        font-size: 17px;
    }
}