/* ===== Переменные ===== */
:root {
    --red: #e10600;
    --red-dark: #b00500;
    --red-soft: rgba(225, 6, 0, .1);
    --black: #0d0d0d;
    --text: #1f1f1f;
    --text-muted: #6b6b6b;
    --bg: #ffffff;
    --bg-alt: #f4f4f4;
    --tag-bg: #ececec;
    --track: #e9e9e9;
    --card: #ffffff;
    --border: #e4e4e4;
    --shadow: 0 4px 18px rgba(0, 0, 0, .08);
    --shadow-hover: 0 8px 28px rgba(0, 0, 0, .14);
    --header-h: 70px;
    --radius: 12px;
    --container: 1140px;
}

/* ===== Базовые стили ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
    margin: 0;
    font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 17px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--red); }
button, input, textarea { font: inherit; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.section { padding: 90px 0; }
.section--alt {
    --bg-alt: var(--black);
    --card: #181818;
    --text: #f2f2f2;
    --text-muted: #9a9a9a;
    --border: #2e2e2e;
    --tag-bg: #2a2a2a;
    --track: #2a2a2a;
    --shadow: 0 4px 18px rgba(0, 0, 0, .5);
    --shadow-hover: 0 8px 28px rgba(225, 6, 0, .25);
    color: var(--text);
    background: var(--bg-alt);
}
.section__title {
    position: relative;
    margin-bottom: 16px;
    font-size: 32px;
    text-align: center;
}
.section__title::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    margin: 10px auto 0;
    border-radius: 2px;
    background: var(--red);
}
.section__subtitle { margin-bottom: 40px; color: var(--text-muted); text-align: center; }

/* ===== Шапка ===== */
.header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 100;
    height: var(--header-h);
    color: #fff;
    background: rgba(8, 8, 8, .85);
    border-bottom: 1px solid rgba(225, 6, 0, .35);
    backdrop-filter: blur(8px);
}
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 100%; }
.logo { color: #fff; font-size: 24px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.logo span { color: var(--red); }

.nav__list { display: flex; gap: 22px; }
.nav__link { color: #fff; font-size: 15px; font-weight: 500; text-decoration: none; transition: color .2s; }
.nav__link:hover, .nav__link.active { color: var(--red); }

.lang { position: relative; display: flex; padding: 3px; border-radius: 20px; background: var(--red); }
.lang__btn {
    position: relative;
    z-index: 1;
    width: 44px;
    padding: 4px 0;
    border: 0;
    border-radius: 16px;
    color: #fff;
    background: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: color .25s, background .25s;
}
.lang__btn.active { color: var(--red); background: #fff; }

.burger { display: none; width: 36px; height: 36px; padding: 6px; border: 0; background: none; cursor: pointer; }
.burger span { display: block; height: 3px; margin: 5px 0; border-radius: 2px; background: #fff; transition: transform .3s, opacity .3s; }
.burger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ===== Первый экран ===== */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--header-h) 20px 60px;
    color: #fff;
    text-align: center;
    background: #222 url("../img/hero.webp") center / cover no-repeat;
    clip-path: polygon(0 0, 100% 0, 100% 90%, 50% 100%, 0 90%);
}
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(0, 0, 0, .75), rgba(90, 0, 0, .55)); }
.hero__content { position: relative; max-width: 800px; padding: 30px 40px; border-left: 4px solid var(--red); border-radius: var(--radius); background: rgba(0, 0, 0, .55); }
.hero__title { font-size: 58px; line-height: 1.2; }
.hero__text { min-height: 1.6em; margin-top: 10px; font-size: 22px; }
#typed span { color: var(--red); font-weight: 600; }
.cursor { display: inline-block; width: 2px; height: 1.1em; margin-left: 2px; vertical-align: text-bottom; background: #fff; animation: blink .75s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero__btn {
    display: inline-block;
    margin-top: 26px;
    padding: 12px 30px;
    border-radius: 30px;
    color: #fff;
    background: var(--red);
    font-weight: 600;
    text-decoration: none;
    transition: background .2s, transform .2s;
}
.hero__btn:hover { background: var(--red-dark); transform: translateY(-2px); }

/* ===== Обо мне ===== */
.about { display: grid; grid-template-columns: 2fr 3fr; gap: 60px; align-items: center; }
.about__photo-wrap { position: relative; width: 100%; max-width: 380px; margin-left: auto; }
.about__photo-wrap::before {
    content: "";
    position: absolute;
    inset: 18px -18px -18px 18px;
    border: 3px solid var(--red);
    border-radius: var(--radius);
}
.about__photo { position: relative; width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-hover); filter: saturate(.95) contrast(1.05); }
.about__label { color: var(--red); font-size: 14px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.about__role { display: inline-block; margin: 8px 0 20px; padding: 4px 14px; border-radius: 20px; color: #fff; background: var(--black); font-weight: 600; font-size: 15px; }
.about__lead { margin-bottom: 12px; font-size: 19px; font-weight: 500; }
.fact__value p + p { margin-top: 4px; }
.fact__value b { color: var(--text); }
.fact__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.fact__tags li { padding: 2px 10px; border: 1px solid var(--red); border-radius: 14px; color: var(--red); font-size: 13px; font-weight: 600; }
.about__name { font-size: 32px; line-height: 1.25; }
.about__text { margin-bottom: 12px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; margin-top: 24px; }
.fact { display: flex; gap: 12px; align-items: flex-start; }
.fact__icon { flex: 0 0 38px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--red); background: var(--red-soft); }
.fact__icon svg { width: 20px; height: 20px; }
.fact__title { font-weight: 700; }
.fact__value { color: var(--text-muted); }

/* ===== Слайдер ===== */
.slider { position: relative; overflow: hidden; }
.slider__track { display: flex; transition: transform .5s ease; }
.slider__slide { flex: 0 0 calc(100% / var(--per-view, 3)); padding: 10px 15px; }
.slider__item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 12px;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
    cursor: zoom-in;
}
.slider__item:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.slider__item img { max-height: 340px; border-radius: 6px; }
.slider__caption { margin-top: 10px; font-size: 15px; font-weight: 600; text-align: center; }
.slider__controls { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 26px; }
.slider__arrow {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: var(--red);
    font-size: 20px;
    cursor: pointer;
    transition: background .2s;
}
.slider__controls[hidden] { display: none; }
.slider__arrow:hover { background: var(--red-dark); }
.slider__arrow:disabled { opacity: .35; cursor: default; }
.slider__dots { display: flex; gap: 10px; }
.slider__dot { width: 30px; height: 8px; padding: 0; border: 0; border-radius: 8px; background: var(--border); cursor: pointer; transition: background .25s; }
.slider__dot.active { background: var(--red); }

/* ===== Навыки ===== */
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 36px; }
.filter {
    padding: 7px 18px;
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    background: var(--card);
    font-size: 15px;
    cursor: pointer;
    transition: all .2s;
}
.filter:hover { border-color: var(--red); color: var(--red); }
.filter.active { border-color: var(--red); color: #fff; background: var(--red); }

.skills { display: grid; grid-template-columns: 1fr 340px; gap: 40px; align-items: start; }
.skills__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.skill {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    color: var(--text);
    background: var(--card);
    box-shadow: var(--shadow);
    font-size: 18px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: transform .15s, border-color .15s;
    animation: fade-in .3s ease;
}
.skill:hover { transform: scale(1.04); }
.skill.active { border-color: var(--red); }
.skill img { width: 40px; height: 40px; object-fit: contain; }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } }

.skill-card { position: sticky; top: calc(var(--header-h) + 20px); padding: 24px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.skill-card__head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.skill-card__head img { width: 70px; height: 70px; object-fit: contain; }
.skill-card__name { font-size: 26px; font-weight: 700; }
.skill-card__category { color: var(--text-muted); font-size: 14px; }
.progress__label { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-muted); }
.progress__bar { height: 8px; margin: 4px 0 18px; overflow: hidden; border-radius: 8px; background: var(--track); }
.progress__fill { height: 100%; border-radius: 8px; background: var(--red); transition: width .6s ease; }
.skill-card__text { font-size: 16px; }

/* ===== Опыт (таймлайн) ===== */
.timeline { position: relative; max-width: 960px; margin: 0 auto; }
.timeline::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: var(--border); transform: translateX(-50%); }
.job { position: relative; width: 50%; padding: 0 40px 40px 0; }
.job:nth-child(even) { margin-left: 50%; padding: 0 0 40px 40px; }
.job__year {
    position: absolute;
    top: 0;
    right: -24px;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 4px solid var(--bg-alt);
    border-radius: 50%;
    color: #fff;
    background: var(--red);
    font-size: 13px;
    font-weight: 700;
}
.job:nth-child(even) .job__year { right: auto; left: -24px; }
.job__card { padding: 20px 22px; border-left: 4px solid var(--red); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.job__title { font-size: 20px; }
.job__date { margin-bottom: 12px; color: var(--text-muted); font-size: 14px; }
.job__label { margin: 10px 0 6px; font-weight: 700; font-size: 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 4px 12px; border-radius: 15px; background: var(--tag-bg); font-size: 14px; }
.tag--project { position: relative; color: #fff; background: var(--red); cursor: help; }
.tag--project .tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    z-index: 5;
    width: 260px;
    padding: 10px 14px;
    border: 1px solid var(--red);
    border-radius: 10px;
    color: var(--text);
    background: var(--card);
    box-shadow: var(--shadow);
    font-size: 14px;
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: all .2s;
}
.tag--project:hover .tooltip, .tag--project:focus .tooltip { opacity: 1; visibility: visible; transform: none; }

/* ===== Интересы ===== */
.interests { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.interest { overflow: hidden; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.interest:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.interest__img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: center 30%; }
.interest__body { padding: 20px 22px 24px; }
.interest__title { margin-bottom: 10px; font-size: 20px; }
.interest__body p { margin-bottom: 8px; font-size: 16px; }

/* ===== Контакты ===== */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 900px; margin: 0 auto; }
.field--full { grid-column: 1 / -1; }
.field__label { display: block; margin-bottom: 6px; font-weight: 600; }
.field__input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    color: var(--text);
    transition: border-color .2s, box-shadow .2s;
}
.field__input:focus { border-color: var(--red); outline: none; box-shadow: 0 0 0 3px var(--red-soft); }
textarea.field__input { min-height: 150px; resize: vertical; }
.contact__footer { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; grid-column: 1 / -1; }
.btn {
    padding: 12px 32px;
    border: 0;
    border-radius: 30px;
    color: #fff;
    background: var(--red);
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.btn:hover { background: var(--red-dark); }
.contact__status { color: var(--red-dark); font-weight: 600; }
.contact__status a { margin-left: 4px; }
.btn:disabled { opacity: .6; cursor: wait; }

/* ===== Подвал ===== */
.footer { padding: 30px 0; text-align: center; background: var(--black); color: #bbb; border-top: 3px solid var(--red); }
.socials { display: flex; justify-content: center; gap: 14px; margin-bottom: 12px; }
.socials a { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: #fff; background: #2c2c2c; transition: background .2s; }
.socials a:hover { background: var(--red); }
.socials svg { width: 20px; height: 20px; fill: currentColor; }

/* ===== Просмотр картинки ===== */
.lightbox { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 30px; background: rgba(0, 0, 0, .85); cursor: zoom-out; }
.lightbox.open { display: flex; }
.lightbox img { max-height: 90vh; border-radius: 8px; }

/* ===== Появление при прокрутке ===== */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; }
    html { scroll-behavior: auto; }
}

/* ===== Адаптив ===== */
@media (max-width: 1100px) {
    .nav__list { gap: 14px; }
    .nav__link { font-size: 14px; }
}
@media (max-width: 992px) {
    .burger { display: block; order: 3; }
    .nav {
        position: fixed;
        top: var(--header-h);
        right: 0;
        left: 0;
        max-height: 0;
        overflow: hidden;
        background: rgba(8, 8, 8, .97);
        transition: max-height .35s ease;
    }
    .nav.open { max-height: 480px; }
    .nav__list { flex-direction: column; gap: 0; padding: 10px 20px 20px; }
    .nav__link { display: block; padding: 10px 0; font-size: 17px; }
    .lang { margin-left: auto; }
    .skills { grid-template-columns: 1fr; }
    .skill-card { position: static; order: -1; }
    .interests { grid-template-columns: repeat(2, 1fr); }
    .slider { --per-view: 2 !important; }
}
@media (max-width: 768px) {
    body { font-size: 16px; }
    .section { padding: 60px 0; }
    .section__title { font-size: 26px; }
    .hero__title { font-size: 38px; }
    .hero__text { font-size: 18px; }
    .hero__content { padding: 20px; }
    .about { grid-template-columns: 1fr; gap: 30px; text-align: center; }
    .about__photo-wrap { max-width: 280px; margin: 0 auto; }
    .fact__tags { justify-content: flex-start; }
    .facts { grid-template-columns: 1fr; text-align: left; }
    .timeline::before { left: 24px; }
    .job, .job:nth-child(even) { width: 100%; margin-left: 0; padding: 0 0 30px 64px; }
    .job__year, .job:nth-child(even) .job__year { right: auto; left: 0; }
    .interests { grid-template-columns: 1fr; }
    .contact { grid-template-columns: 1fr; }
    .skills__grid { grid-template-columns: repeat(2, 1fr); }
    .skill { font-size: 16px; padding: 12px; }
}
@media (max-width: 520px) {
    .logo { font-size: 20px; }
    .slider { --per-view: 1 !important; }
}
.contact__trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
