/* ================= ОСНОВНЫЕ СТИЛИ ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.5; /* Уменьшен межстрочный */
    color: #1f2937;
    background: #f8fafc;
    padding: 12px; /* Меньше отступов по краям */
    max-width: 1000px;
    margin: 0 auto;
    min-height: 100vh;
    font-size: 0.95rem; /* Чуть меньше базовый размер */
}

/* ================= КНОПКИ УПРАВЛЕНИЯ ================= */
.controls {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1000;
    display: flex;
    gap: 10px;
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.lang-btn, .pdf-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}

.lang-btn {
    background: #f1f5f9;
    color: #475569;
}

.lang-btn:hover {
    background: #e2e8f0;
}

.pdf-btn {
    background: #2563eb;
    color: white;
}

.pdf-btn:hover {
    background: #1d4ed8;
}

.pdf-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ================= ОСНОВНОЙ КОНТЕНТ ================= */
.content {
    background: white;
    padding: 30px; /* Меньше внутренних отступов */
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    margin-top: 20px; /* Меньше отступ сверху */
    border: 1px solid #e2e8f0;
}

/* ================= HERO СЕКЦИЯ (КОМПАКТНАЯ) ================= */
.hero {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
}

.hero h1 {
    font-size: 2.2rem; /* Меньше */
    margin-bottom: 8px; /* Меньше */
    color: #0f172a;
    font-weight: 700;
}

.tagline {
    font-size: 1.2rem; /* Меньше */
    color: #2563eb;
    font-weight: 600;
    margin-bottom: 10px; /* Меньше */
}

.subtitle {
    font-size: 1rem; /* Меньше */
    color: #475569;
    max-width: 800px;
    margin: 0 auto 20px; /* Меньше снизу */
    line-height: 1.6;
}

/* ================= КОНТАКТЫ ================= */
.contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* Меньше расстояние */
    justify-content: center;
    margin-bottom: 20px; /* Меньше */
}

.contacts a {
    text-decoration: none;
    color: #475569;
    font-weight: 500;
    padding: 6px 12px; /* Компактнее */
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.contacts a:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* ================= ЗАГОЛОВКИ СЕКЦИЙ ================= */
section {
    margin-bottom: 32px; /* Меньше расстояние между секциями */
}

h2 {
    font-size: 1.5rem; /* Меньше */
    color: #0f172a;
    margin-bottom: 16px; /* Меньше */
    padding-bottom: 8px; /* Меньше */
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
}

h3 {
    font-size: 1.2rem;
    color: #1e293b;
    margin-bottom: 12px;
    font-weight: 600;
}

h4 {
    color: #374151;
    margin-bottom: 10px; /* Меньше */
    font-size: 1rem;
    font-weight: 600;
}

/* ================= БЛОК ОПЫТА РАБОТЫ ================= */
.job-block {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 25px;
}

.job-period {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 15px;
    font-style: italic;
}

.job-block ul {
    list-style-position: inside;
    color: #4b5563;
    font-size: 0.9rem;
}

.job-block li {
    margin-bottom: 10px;
    line-height: 1.5;
}

.job-block li strong {
    color: #1e293b;
}

/* ================= ТЕХНОЛОГИЧЕСКИЙ СТЕК ================= */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.tech-stack span {
    background: #dbeafe;
    color: #1e40af;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ================= КОМПАКТНЫЙ СПИСОК КОМПЕТЕНЦИЙ ================= */
.compact-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px; /* Меньше расстояние */
    margin-top: 10px; /* Меньше */
}

.list-column h4 {
    color: #1e40af;
    margin-bottom: 12px; /* Меньше */
    font-size: 1rem;
    font-weight: 600;
    border-bottom: 1px solid #dbeafe; /* Тоньше */
    padding-bottom: 6px;
}

.list-column ul {
    list-style-type: none;
    padding-left: 0;
}

.list-column li {
    margin-bottom: 10px; /* Меньше */
    line-height: 1.4; /* Плотнее */
    color: #4b5563;
    font-size: 0.9rem;
    padding-left: 6px;
    border-left: 1px solid #dbeafe; /* Тоньше */
}

.list-column li strong {
    color: #1f2937;
    font-weight: 600;
}

/* ================= ПРАКТИЧЕСКОЕ ПРИМЕНЕНИЕ ================= */
.section-intro {
    color: #6b7280;
    margin-bottom: 18px; /* Меньше */
    font-size: 0.95rem;
    line-height: 1.5;
}

.project-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px; /* Меньше */
    margin: 15px 0; /* Меньше */
}

.detail-block {
    background: #f8fafc;
    padding: 16px; /* Компактнее */
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.detail-block h4 {
    color: #374151;
    margin-bottom: 10px; /* Меньше */
    font-size: 0.95rem;
}

.detail-block p {
    color: #4b5563;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ================= СЕКЦИЯ "О СЕБЕ" ================= */
#about, #about-en {
    background: #f0f9ff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #bae6fd;
}

#about p, #about-en p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #374151;
    font-size: 0.95rem;
}

/* ================= АДАПТИВНОСТЬ ================= */
@media (max-width: 768px) {
    body {
        padding: 8px;
    }

    .controls {
        position: static;
        margin-bottom: 15px;
        justify-content: center;
        width: 100%;
    }

    .content {
        padding: 20px 15px;
        margin-top: 0;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .tagline {
        font-size: 1.1rem;
    }

    .contacts {
        flex-direction: column;
        align-items: stretch;
    }

    .contacts a {
        justify-content: center;
        padding: 8px 12px;
    }

    .compact-list, .project-details {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .job-block, .detail-block {
        padding: 15px;
    }

    h2 {
        font-size: 1.3rem;
        margin-bottom: 12px;
    }

    .section-intro {
        font-size: 0.9rem;
    }
}

/* ================= СТИЛИ ДЛЯ ЭКСПОРТА В PDF ================= */
/* Запрет разрывов внутри блоков */
section,
.detail-block,
.list-column,
.job-block,
.tech-stack,
ul,
li,
p,
#about,
#about-en {
  page-break-inside: avoid;
  break-inside: avoid;
}

h2, h3, h4 {
  page-break-after: avoid;
  break-after: avoid;
}

.content {
  background: white;
  break-inside: avoid;
}