/* ---------- Темы ---------- */
/* Тёмная тема — по умолчанию */
:root {
    --bg: #0a0a0f;
    --bg-2: #0d0d14;
    --card: #111119;
    --card-2: #16161f;
    --border: #22222f;
    --border-2: #30303f;
    --text: #e4e4ee;
    --heading: #ffffff;
    --muted: #a3a3b8;
    --dim: #8686a0;
    --accent: #8b7cf6;
    --accent-2: #6d5dfc;
    --accent-text: #a295f9;
    --accent-soft: rgba(139, 124, 246, .15);
    --accent-line: rgba(139, 124, 246, .35);
    --string: #f5b7d0;
    --key: #a5b4fc;
    --green: #34d399;
    --grad-a: #9c93ff;
    --grad-b: #c4b5fd;
    --nav-bg: rgba(10, 10, 15, .82);
    --term-bg: rgba(12, 12, 18, .94);
    --win-bar: #1c1c24;
    --win-tab-text: #e4e4ee;
    --win-ctrl: #a3a3b8;
    --term-shadow: 0 30px 80px rgba(0, 0, 0, .5);
    --card-shadow: 0 12px 40px rgba(109, 93, 252, .12);
    --btn-shadow: 0 6px 24px rgba(109, 93, 252, .35);
    --glow-1: rgba(109, 93, 252, .35);
    --glow-2: rgba(109, 93, 252, .10);
    --pill-text: #fca5a5;
    --pill-bg: rgba(248, 113, 113, .1);
    --pill-border: rgba(248, 113, 113, .25);
    --sun-display: block;
    --moon-display: none;

    --radius: 12px;
    --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
    --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color-scheme: dark;
}

/* Светлая тема: по настройке системы (если пользователь не выбрал тёмную) или по выбору пользователя */
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --bg: #f7f7fb;
        --bg-2: #f1f1f7;
        --card: #ffffff;
        --card-2: #f4f4f9;
        --border: #e2e2ec;
        --border-2: #cfcfdc;
        --text: #1d1e2c;
        --heading: #0d0e1a;
        --muted: #4a4c60;
        --dim: #62647a;
        --accent: #6d5dfc;
        --accent-2: #5443e6;
        --accent-text: #5040d8;
        --accent-soft: rgba(109, 93, 252, .1);
        --accent-line: rgba(109, 93, 252, .3);
        --string: #b4236b;
        --key: #4338ca;
        --green: #047857;
        --grad-a: #5443e6;
        --grad-b: #8b5cf6;
        --nav-bg: rgba(247, 247, 251, .85);
        --term-bg: #ffffff;
    --win-bar: #e6e6ee;
    --win-tab-text: #1d1e2c;
    --win-ctrl: #4a4c60;
        --term-shadow: 0 20px 50px rgba(30, 30, 60, .12);
        --card-shadow: 0 12px 32px rgba(60, 50, 160, .1);
        --btn-shadow: 0 6px 20px rgba(84, 67, 230, .28);
        --glow-1: rgba(109, 93, 252, .18);
        --glow-2: rgba(109, 93, 252, .06);
        --pill-text: #b42318;
        --pill-bg: rgba(220, 38, 38, .07);
        --pill-border: rgba(220, 38, 38, .2);
        --sun-display: none;
        --moon-display: block;
        color-scheme: light;
    }
}
:root[data-theme="light"] {
    --bg: #f7f7fb;
    --bg-2: #f1f1f7;
    --card: #ffffff;
    --card-2: #f4f4f9;
    --border: #e2e2ec;
    --border-2: #cfcfdc;
    --text: #1d1e2c;
    --heading: #0d0e1a;
    --muted: #4a4c60;
    --dim: #62647a;
    --accent: #6d5dfc;
    --accent-2: #5443e6;
    --accent-text: #5040d8;
    --accent-soft: rgba(109, 93, 252, .1);
    --accent-line: rgba(109, 93, 252, .3);
    --string: #b4236b;
    --key: #4338ca;
    --green: #047857;
    --grad-a: #5443e6;
    --grad-b: #8b5cf6;
    --nav-bg: rgba(247, 247, 251, .85);
    --term-bg: #ffffff;
    --win-bar: #e6e6ee;
    --win-tab-text: #1d1e2c;
    --win-ctrl: #4a4c60;
    --term-shadow: 0 20px 50px rgba(30, 30, 60, .12);
    --card-shadow: 0 12px 32px rgba(60, 50, 160, .1);
    --btn-shadow: 0 6px 20px rgba(84, 67, 230, .28);
    --glow-1: rgba(109, 93, 252, .18);
    --glow-2: rgba(109, 93, 252, .06);
    --pill-text: #b42318;
    --pill-bg: rgba(220, 38, 38, .07);
    --pill-border: rgba(220, 38, 38, .2);
    --sun-display: none;
    --moon-display: block;
    color-scheme: light;
}

/* ---------- База ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    transition: background-color .25s, color .25s;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
svg { width: 18px; height: 18px; flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* Моноширинный шрифт — для «кодовых» элементов, основной текст — Inter */
.logo, .nav-links, .lang-switch, .status, .hero h1, .role, .btn, .terminal, .stat-value,
.section-title, .card-label, .card-cmd, .chip, .tag, .project-tag, .period, .edu-year,
.contact-list .k, .contact-body h2, .footer, .pill, .quote-role {
    font-family: var(--mono);
}

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.accent { color: var(--accent-text); }
.muted { color: var(--muted); }

/* ---------- Шапка ---------- */
.nav {
    position: sticky; top: 0; z-index: 10;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 20px; height: 64px; }
.logo { font-weight: 600; font-size: 15px; color: var(--heading); }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
    padding: 7px 12px; border-radius: 7px; font-size: 14px; color: var(--muted);
    border: 1px solid transparent;
    transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--heading); }
.nav-links a.active { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-line); }

.lang-switch {
    display: flex; padding: 2px; gap: 2px;
    border: 1px solid var(--border-2); border-radius: 8px;
}
.lang-switch a {
    padding: 4px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--muted);
    transition: color .2s, background .2s;
}
.lang-switch a:hover { color: var(--heading); }
.lang-switch a.active { color: #fff; background: var(--accent-2); }

.theme-toggle {
    display: grid; place-items: center; width: 34px; height: 34px;
    border: 1px solid var(--border-2); border-radius: 8px;
    background: transparent; color: var(--muted); cursor: pointer;
    transition: color .2s, border-color .2s;
}
.theme-toggle:hover { color: var(--heading); border-color: var(--accent); }
.theme-toggle .icon-sun { display: var(--sun-display); }
.theme-toggle .icon-moon { display: var(--moon-display); }

/* ---------- Первый экран ---------- */
.hero {
    position: relative; overflow: hidden;
    padding: 84px 0 68px;
    background:
        radial-gradient(900px 500px at 95% 110%, var(--glow-1), transparent 60%),
        radial-gradient(600px 400px at 0% 0%, var(--glow-2), transparent 60%);
    border-bottom: 1px solid var(--border);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.status {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--green);
    padding: 5px 12px; border-radius: 99px; background: rgba(52, 211, 153, .1);
    border: 1px solid rgba(52, 211, 153, .3);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .4; } }

.hero h1 { font-size: clamp(32px, 4.6vw, 50px); line-height: 1.22; font-weight: 600; margin: 22px 0 18px; letter-spacing: -.5px; color: var(--heading); }
.kw { color: var(--muted); font-weight: 400; }
.muted-strong {
    background: linear-gradient(90deg, var(--grad-a), var(--grad-b));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.str { color: var(--heading); }
.role { color: var(--text); font-size: 15px; margin-bottom: 16px; }
.comment { color: var(--dim); }
.lead { color: var(--muted); max-width: 560px; font-size: 17px; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 26px; }
.socials { display: flex; gap: 18px; color: var(--muted); }
.socials a:hover { color: var(--accent-text); }
.socials svg { width: 20px; height: 20px; }
.scroll-hint { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); color: var(--dim); animation: bob 2s infinite; }
@keyframes bob { 50% { transform: translate(-50%, 5px); } }

/* ---------- Кнопки ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 18px; border-radius: 9px; font-size: 14px; font-weight: 500;
    border: 1px solid transparent; cursor: pointer; transition: transform .15s, box-shadow .2s, border-color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
    box-shadow: var(--btn-shadow);
}
.btn-primary:hover { box-shadow: 0 8px 30px rgba(109, 93, 252, .5); }
.btn-ghost { color: var(--text); border-color: var(--border-2); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); }
.btn.small { padding: 8px 14px; font-size: 13px; }
.btn-note {
    font-size: 11px; padding: 1px 6px; border-radius: 4px;
    background: rgba(255, 255, 255, .2);
}

/* ---------- Терминал (окно Windows Terminal / PowerShell) ---------- */
.terminal {
    --window-bg: var(--term-bg);
    background: var(--window-bg);
    border: 1px solid var(--border-2);
    border-radius: 8px;
    box-shadow: var(--term-shadow);
    overflow: hidden;
}
.term-bar {
    display: flex; align-items: stretch; justify-content: space-between;
    height: 38px; padding-left: 8px; background: var(--win-bar);
}
.term-tab {
    display: flex; align-items: center; gap: 8px;
    margin-top: 6px; padding: 0 16px 0 12px; border-radius: 7px 7px 0 0;
    font-size: 12.5px; color: var(--win-tab-text); background: var(--window-bg);
}
.term-tab svg { width: 16px; height: 16px; }
.win-controls { display: flex; color: var(--win-ctrl); }
.win-controls > span { display: grid; place-items: center; width: 44px; }
.win-controls svg { width: 10px; height: 10px; }
.term-body { padding: 20px 24px; font-size: 14px; line-height: 1.8; color: var(--muted); white-space: pre-wrap; min-height: 340px; }
.term-body .k { color: var(--key); }
.term-body .s { color: var(--string); }
.term-body .d { color: var(--dim); }
.prompt { color: var(--green); }
.cursor { color: var(--accent-text); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Чёрная консоль PowerShell (как в Windows Terminal) — одинаковая в обеих темах */
.terminal.ps { --window-bg: #0c0c0c; --win-tab-text: #ffffff; border-color: #2e2e2e; }
.terminal.ps .term-body {
    font-family: "Cascadia Mono", "Cascadia Code", var(--mono);
    color: #eeedf0;
}
.terminal.ps .term-body .k { color: #61d6d6; }
.terminal.ps .term-body .s { color: #f9f1a5; }
.terminal.ps .term-body .d { color: #a8a8a8; }
.terminal.ps .prompt { color: #eeedf0; }
.terminal.ps .cursor { color: #eeedf0; }

/* ---------- Цифры ---------- */
.stats { border-bottom: 1px solid var(--border); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { text-align: center; padding: 40px 12px; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat-value { font-size: 34px; font-weight: 600; color: var(--heading); }
.stat-label { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* ---------- Разделы ---------- */
.section { padding: 96px 0 30px; }
.section-title {
    display: flex; align-items: center; gap: 12px;
    font-size: 24px; font-weight: 600; color: var(--accent-text); margin-bottom: 38px;
}
.section-title .num { font-size: 13px; color: var(--dim); font-weight: 400; }
.section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-2), transparent); margin-left: 12px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
    background: linear-gradient(180deg, var(--card), var(--bg-2));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color .25s, transform .25s, box-shadow .25s, background-color .25s;
}
.card:hover { border-color: var(--accent-line); transform: translateY(-2px); box-shadow: var(--card-shadow); }
.card-label { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; color: var(--heading); margin-bottom: 18px; }
.card-text { color: var(--muted); font-size: 15.5px; line-height: 1.65; }
.card-cmd { font-size: 13px; color: var(--muted); margin-bottom: 18px; }

.bullet { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.bullet.blue { background: #60a5fa; }
.bullet.red { background: #f87171; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 11px 5px 5px; font-size: 13px; color: var(--text);
    background: var(--card-2); border: 1px solid var(--border); border-radius: 7px;
    transition: border-color .2s;
}
.chip:hover { border-color: var(--border-2); }
.chip-badge {
    display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 5px;
    font-size: 9px; font-weight: 700; color: #fff; background: var(--c);
}

/* Экспертиза */
.project { display: flex; flex-direction: column; gap: 14px; }
.project-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.project-name { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--heading); font-size: 16.5px; line-height: 1.35; }
.project-name svg { color: var(--accent-text); width: 20px; height: 20px; }
.project-tag { font-size: 12px; color: var(--dim); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tag {
    font-size: 12.5px; padding: 3px 9px; border-radius: 5px;
    color: var(--accent-text); background: var(--accent-soft);
}

/* Опыт */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 3px; top: 10px; bottom: 8px; width: 1px; background: linear-gradient(var(--accent), var(--border)); }
.timeline-item { position: relative; padding-bottom: 40px; }
.timeline-item::before {
    content: ""; position: absolute; left: -28px; top: 9px; width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), 0 0 12px var(--accent);
}
.timeline-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.timeline-head h3 { font-size: 18px; color: var(--heading); font-weight: 600; }
.at { color: var(--dim); font-weight: 400; }
.company { color: var(--accent-text); font-weight: 500; }
.company:hover { text-decoration: underline; }
.period { font-size: 13px; color: var(--dim); }
.timeline-item > .card-text { max-width: 700px; }
.highlights { margin: 16px 0 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 32px; max-width: 960px; }
.highlights li { position: relative; padding-left: 18px; color: var(--muted); font-size: 15.5px; line-height: 1.6; }
.highlights li::before { content: "›"; position: absolute; left: 0; color: var(--accent-text); font-weight: 700; }

/* Образование */
.edu-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
.edu-list li { display: flex; gap: 18px; padding: 16px 0; border-top: 1px dashed var(--border-2); }
.edu-list li:first-child { border-top: 0; padding-top: 0; }
.edu-year {
    flex-shrink: 0; font-size: 12.5px; color: var(--accent-text); background: var(--accent-soft);
    padding: 2px 9px; border-radius: 5px; height: fit-content;
}
.edu-degree { color: var(--heading); font-weight: 600; font-size: 16px; line-height: 1.4; }
.edu-inst { color: var(--text); font-size: 15px; margin-top: 3px; }
.edu-details { color: var(--dim); font-size: 14px; margin-top: 2px; }

.activity li { display: flex; gap: 12px; padding: 10px 0; }
.activity-icon { color: var(--accent-text); margin-top: 3px; }
.activity-icon.ok { color: var(--green); }
.activity-title { font-size: 15px; color: var(--heading); font-weight: 600; line-height: 1.4; }
.activity-text { font-size: 14px; color: var(--dim); }

/* Как я работаю */
.quote { display: flex; flex-direction: column; gap: 14px; }
.quote-mark { font-size: 32px; line-height: .6; color: var(--accent-text); font-family: Georgia, serif; margin-top: 8px; }
.quote blockquote { flex: 1; }
.quote figcaption { display: flex; align-items: center; gap: 12px; }
.avatar {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
    font-size: 11px; font-weight: 700; color: #fff; background: var(--c);
}
.quote-name { display: block; font-size: 15px; font-weight: 600; color: var(--heading); }
.quote-role { display: block; font-size: 12px; color: var(--dim); }

/* Языки */
.lang { display: flex; flex-direction: column; gap: 10px; }
.pill {
    align-self: flex-start; font-size: 12px; padding: 2px 9px; border-radius: 5px;
    color: var(--pill-text); background: var(--pill-bg); border: 1px solid var(--pill-border);
}
.lang-name { font-size: 18px; color: var(--heading); font-weight: 600; }
.meter { height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: inherit; }

/* Контакты */
.contact { padding-bottom: 100px; }
.contact-card { max-width: 680px; margin: 40px auto 0; }
.contact-body { padding: 30px; }
.contact-body h2 { font-size: 22px; color: var(--accent-text); margin-bottom: 12px; }
.contact-list { margin: 22px 0 8px; display: grid; gap: 10px; font-size: 15.5px; }
.contact-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.contact-list .k { min-width: 90px; font-size: 13.5px; color: var(--key); }
.contact-list a { color: var(--heading); border-bottom: 1px dashed var(--border-2); word-break: break-all; }
.contact-list a:hover { color: var(--accent-text); border-color: var(--accent); }
.contact-list .muted { font-size: 13px; }
.contact-actions { margin-bottom: 0; }

.footer { border-top: 1px solid var(--border); padding: 28px 0; text-align: center; font-size: 13px; color: var(--dim); }

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

/* ---------- Адаптивность ---------- */
@media (max-width: 960px) {
    .nav-links { display: none; }
    .lang-switch { margin-left: auto; }
}
@media (max-width: 900px) {
    .hero-grid, .edu-grid { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .highlights { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    body { font-size: 15.5px; }
    .container { padding: 0 16px; }
    .nav-inner { gap: 12px; }
    .hero { padding: 48px 0 60px; }
    .lead { font-size: 16px; }
    .grid-3 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat:nth-child(3) { border-left: 0; }
    .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
    .term-body { font-size: 12px; padding: 16px; min-height: 0; white-space: pre; overflow-x: auto; }
    .section { padding-top: 68px; }
    .section-title { font-size: 21px; }
    .card { padding: 20px; }
    .contact-body { padding: 22px; }
}
