/* ============================================================
   Портфолио — светлая минималистичная тема
   ============================================================ */

:root {
    --bg: #ffffff;
    --bg-alt: #f7f8fa;
    --fg: #111318;
    --fg-dim: #6b7280;
    --accent: #2563eb;
    --accent-light: #eff6ff;
    --line: #e5e7eb;
    --radius: 12px;
    --maxw: 1100px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
    line-height: 1.6;
}

body {
    overflow-x: clip;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.2;
}

/* ============================================================
   Шапка
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 2rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-name {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.site-nav {
    display: flex;
    gap: 1.5rem;
}

.site-nav a {
    font-size: 0.875rem;
    color: var(--fg-dim);
    transition: color 0.2s var(--ease);
}

.site-nav a:hover {
    color: var(--fg);
    text-decoration: none;
}

/* Переключатель языка */
.lang-switch {
    position: relative;
    display: flex;
    padding: 0.2rem;
    background: var(--bg-alt);
    border-radius: 999px;
    border: 1px solid var(--line);
    isolation: isolate;
}

.lang-switch::after {
    content: '';
    position: absolute;
    top: 0.2rem;
    bottom: 0.2rem;
    left: 0.2rem;
    width: calc(50% - 0.2rem);
    background: #fff;
    border-radius: 999px;
    z-index: -1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s var(--ease);
}

.lang-switch[data-active="en"]::after {
    transform: translateX(100%);
}

.lang-switch button {
    appearance: none;
    background: transparent;
    border: none;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    color: var(--fg-dim);
    transition: color 0.3s var(--ease);
    position: relative;
    min-width: 2.2rem;
}

.lang-switch button[aria-pressed="true"] {
    color: var(--fg);
}

/* Кнопка-«гамбургер» */
.nav-toggle {
    display: none;
    appearance: none;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.35rem 0.45rem;
    cursor: pointer;
    width: 38px;
    height: 38px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.bar {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--fg);
    border-radius: 2px;
    transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}

body.is-nav-open .bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

body.is-nav-open .bar:nth-child(2) {
    opacity: 0;
}

body.is-nav-open .bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 700px) {
    .site-header {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .site-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 5rem 1.5rem 2rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        transform: translateY(-100%);
        transition: transform 0.3s var(--ease);
        z-index: 90;
    }

    .site-nav a {
        padding: 1rem 0;
        font-size: 1.25rem;
        color: var(--fg);
        border-bottom: 1px solid var(--line);
    }

    body.is-nav-open .site-nav {
        transform: translateY(0);
    }

    body.is-nav-open {
        overflow: hidden;
    }
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
    padding: 5rem 2rem;
}

.hero-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 3.5rem;
}

.hero-photo {
    width: 240px;
    height: 240px;
    border-radius: 12px;
    object-fit: cover;
    object-position: top center;
    flex-shrink: 0;
    border: 5px solid var(--line);
}

.hero-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 0.75rem;
}

.hero-name {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.hero-bio {
    color: var(--fg-dim);
    font-size: 1.05rem;
    max-width: 560px;
    margin: 0 0 1.5rem;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
}

@media (max-width: 700px) {
    .hero {
        padding: 2rem 1.5rem;
    }

    .hero-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .hero-photo {
        width: 120px;
        height: 120px;
        border-radius: 10px;
    }
}

/* ============================================================
   Секции
   ============================================================ */
.section {
    padding: 5rem 2rem;
}

.section--alt {
    background: var(--bg-alt);
}

.section-inner {
    max-width: var(--maxw);
    margin: 0 auto;
}

.section-inner--narrow {
    max-width: 640px;
}

.section-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 2.5rem;
}

.section-lead {
    color: var(--fg-dim);
    margin: -1.5rem 0 2rem;
}

@media (max-width: 700px) {
    .section {
        padding: 3rem 1.5rem;
    }
}

/* ============================================================
   Навыки
   ============================================================ */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
}

.skill-group h3 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-dim);
    margin-bottom: 0.75rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--fg);
}

.section--alt .tag {
    background: var(--bg);
}

/* ============================================================
   Опыт (таймлайн)
   ============================================================ */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.timeline-item {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 2rem;
    padding: 2rem 0;
    border-top: 1px solid var(--line);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.timeline-item.is-visible {
    opacity: 1;
    transform: none;
}

.timeline-date {
    font-size: 0.85rem;
    color: var(--fg-dim);
    padding-top: 0.2rem;
}

.timeline-company {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.timeline-role {
    font-size: 0.875rem;
    color: var(--accent);
    font-weight: 500;
    margin: 0 0 0.75rem;
}

.timeline-list {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--fg-dim);
    font-size: 0.9rem;
    line-height: 1.7;
}

.timeline-list li+li {
    margin-top: 0.2rem;
}

@media (max-width: 700px) {
    .timeline-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* ============================================================
   Проекты
   ============================================================ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.project-card {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
    opacity: 0;
    transform: translateY(16px);
}

.project-card.is-visible {
    opacity: 1;
    transform: none;
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), box-shadow 0.2s var(--ease);
}

.project-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.project-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.project-card__desc {
    color: var(--fg-dim);
    font-size: 0.875rem;
    margin: 0 0 0.75rem;
    line-height: 1.6;
}

.project-card__links {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ============================================================
   Контакты
   ============================================================ */
.contact-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1rem;
}

.contact-label {
    width: 80px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-dim);
    flex-shrink: 0;
}

/* ============================================================
   Анимация появления для skill-group
   ============================================================ */
.skill-group {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.skill-group.is-visible {
    opacity: 1;
    transform: none;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    text-align: center;
    padding: 2rem;
    font-size: 0.85rem;
    color: var(--fg-dim);
    border-top: 1px solid var(--line);
}