:root {
  --bg: #ffffff;
  --tile: #ffffff;
  --tile-border: #eef0f3;
  --tile-shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 10px 28px rgba(16, 24, 40, .07);
  --soft: #eef3fd;
  --text: #111111;
  --muted: #575757;
  --line: #e4e7ec;
  --accent: #1f4fd8;
  --on-accent: #ffffff;
  --live: #1f9d63;
  --strong: #111111;
  --on-strong: #ffffff;
  --track: #f1f3f6;
  --bar: #cdd2da;
  --contact-line: rgba(255, 255, 255, .28);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115; --tile: #171a20; --tile-border: #272c34; --tile-shadow: none; --soft: #1f2430;
    --text: #eceef2; --muted: #a3aab7; --line: #2a2f38; --accent: #8ca6ff; --on-accent: #0f1115;
    --live: #5dd39e; --strong: #eceef2; --on-strong: #0f1115; --track: #232830; --bar: #454c59;
    --contact-line: rgba(15, 17, 21, .25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1115; --tile: #171a20; --tile-border: #272c34; --tile-shadow: none; --soft: #1f2430;
  --text: #eceef2; --muted: #a3aab7; --line: #2a2f38; --accent: #8ca6ff; --on-accent: #0f1115;
  --live: #5dd39e; --strong: #eceef2; --on-strong: #0f1115; --track: #232830; --bar: #454c59;
  --contact-line: rgba(15, 17, 21, .25); color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
a:hover { opacity: .75; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, h4, p { margin: 0; }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--strong); color: var(--on-strong); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 16px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.dot.live, .status.is-live .dot { background: var(--live); }
.tile { background: var(--tile); border: 1px solid var(--tile-border); box-shadow: var(--tile-shadow); border-radius: 16px; }

/* header */
.header { padding-top: 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.name { font-family: "Inter Tight", sans-serif; font-weight: 700; font-size: 18px; text-decoration: none; letter-spacing: -.01em; }
.status-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); background: var(--soft); border-radius: 999px; padding: 5px 12px; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 24px; font-size: 15px; }
.nav > a { text-decoration: none; }
.lang { display: inline-flex; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang-btn { text-decoration: none; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.lang-btn.is-current { background: var(--strong); color: var(--on-strong); }
.lang-btn.is-current:hover { opacity: 1; }
.theme-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: none; }
}

/* hero */
.hero { padding-top: 88px; padding-bottom: 64px; display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-end; }
.hero-text { flex: 999 1 560px; min-width: 0; }
.kicker { font-size: 15px; font-weight: 500; color: var(--muted); margin-bottom: 22px; }
h1 { font-family: "Inter Tight", sans-serif; font-weight: 600; line-height: 1.02; letter-spacing: -.045em; font-size: clamp(40px, 6.4vw, 84px); text-wrap: balance; }
h1.h1-ru { font-size: clamp(36px, 5.6vw, 74px); }
.lede { margin-top: 28px; max-width: 640px; font-size: 19px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 24px; border-radius: 999px; font-weight: 600; font-size: 15px; text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-outline { border: 1px solid var(--text); }
.portrait { flex: 0 1 240px; width: 240px; max-width: 100%; height: 296px; object-fit: cover; object-position: 50% 20%; border-radius: 22px; display: block; }

/* kpis */
.kpis { padding-bottom: 96px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.kpi { padding: 20px 22px; min-height: 150px; display: flex; flex-direction: column; gap: 6px; }
.kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kpi-label { font-size: 14px; color: var(--muted); }
.badge { font-family: "IBM Plex Mono", monospace; font-size: 11px; color: var(--accent); background: var(--soft); border-radius: 6px; padding: 3px 7px; white-space: nowrap; }
.kpi-num { font-family: "Inter Tight", sans-serif; font-size: 52px; font-weight: 600; letter-spacing: -.045em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi-sub { font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--accent); }

/* sections */
.block { border-top: 1px solid var(--line); }
.split { padding-top: 96px; padding-bottom: 96px; display: flex; flex-wrap: wrap; gap: 40px; }
.label { flex: 1 1 220px; font-family: "Inter Tight", sans-serif; font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.split-body { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.lead { font-family: "Inter Tight", sans-serif; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.3; letter-spacing: -.015em; font-weight: 500; }
.muted { color: var(--muted); margin-top: 14px; }
.chips { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--soft); border-radius: 999px; padding: 6px 14px; font-size: 14px; }

/* projects */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.project { color: var(--text); padding: 22px 24px; min-height: 176px; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; text-align: left; font: inherit; cursor: pointer; transition: transform .15s ease, background-color .15s ease; }
.project:hover { transform: translateY(-2px); }
.project-top { display: flex; justify-content: space-between; gap: 12px; width: 100%; font-size: 13px; }
.project-tag { opacity: .8; }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; }
.project-title { font-family: "Inter Tight", sans-serif; font-size: 21px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; }
.project-cta { font-size: 13px; opacity: .8; }
.project[aria-expanded="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); box-shadow: none; }
.project[aria-expanded="true"] .dot { background: var(--on-accent); }
.case { border: 1.5px solid var(--accent); border-radius: 16px; padding: 32px; }
.case-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; }
.case h3 { font-family: "Inter Tight", sans-serif; font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 8px 16px; font: inherit; font-size: 14px; cursor: pointer; min-height: 40px; }
.case-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-top: 22px; }
.case h4 { font-size: 13px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.case p { margin-top: 8px; color: var(--muted); }

/* experience */
.gantt { padding: 24px 26px; display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.gantt-row, .gantt-axis { display: grid; grid-template-columns: minmax(90px, 160px) 1fr; gap: 16px; align-items: center; }
.gantt-row { background: transparent; border: 0; padding: 7px 0; margin: 0; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; min-height: 32px; width: 100%; }
.gantt-label { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-track { position: relative; display: block; height: 10px; background: var(--track); border-radius: 5px; }
.gantt-bar { position: absolute; top: 0; height: 10px; border-radius: 5px; background: var(--bar); transform-origin: left center; transition: transform 1.1s cubic-bezier(.22, 1, .36, 1), background-color .2s ease; }
.js .gantt:not(.is-ready) .gantt-bar { transform: scaleX(0); }
.gantt-row.is-active .gantt-label { color: var(--text); font-weight: 600; }
.gantt-row.is-active .gantt-bar { background: var(--accent); }
.gantt-axis { margin-top: 8px; font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--muted); }
.axis { display: flex; justify-content: space-between; }
.jobs { list-style: none; margin: 0; padding: 0; }
.job { display: flex; flex-wrap: wrap; gap: 6px 32px; padding: 22px 16px; margin: 0 -16px; border-radius: 16px; transition: background-color .2s ease; }
.job.is-active { background: var(--soft); }
.job-years { flex: 0 0 140px; color: var(--muted); font-size: 15px; }
.job-body { flex: 1 1 340px; }
.job-role { font-weight: 600; font-size: 19px; }
.job-company { font-size: 15px; }
.job p { margin-top: 6px; color: var(--muted); font-size: 16px; }

/* credentials */
.certs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.cert { padding: 20px 22px; }
.cert-name { font-family: "Inter Tight", sans-serif; font-size: 19px; font-weight: 600; }
.cert-meta { font-size: 14px; color: var(--muted); margin-top: 4px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.fact { padding: 22px; }
.fact-label { font-size: 13px; color: var(--muted); }
.fact-title { font-weight: 600; margin-top: 6px; }
.fact-text { color: var(--muted); font-size: 15px; }

/* contact */
.contact-wrap { padding-bottom: 0; }
.contact { background: var(--strong); color: var(--on-strong); border-radius: 28px; padding: clamp(28px, 5vw, 64px); display: flex; flex-wrap: wrap; gap: 48px; }
.contact-text { flex: 1 1 420px; min-width: 0; }
.contact h2 { font-family: "Inter Tight", sans-serif; font-size: clamp(36px, 4.6vw, 60px); line-height: 1.04; letter-spacing: -.035em; font-weight: 600; }
.contact p { margin-top: 20px; max-width: 460px; opacity: .75; }
.contact-links { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.contact-links a { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; padding: 18px 0; border-top: 1px solid var(--contact-line); text-decoration: none; }
.contact-links a:last-child { border-bottom: 1px solid var(--contact-line); }
.contact-links span { font-size: 14px; opacity: .7; }
.contact-links strong { font-family: "Inter Tight", sans-serif; font-size: 22px; font-weight: 600; overflow-wrap: anywhere; }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 28px; padding-bottom: 48px; font-size: 14px; color: var(--muted); }

@media (max-width: 640px) {
  .hero { padding-top: 48px; gap: 32px; }
  .kpis { padding-bottom: 64px; }
  .split { padding-top: 64px; padding-bottom: 64px; gap: 20px; }
  .portrait { width: 100%; height: 360px; flex-basis: 100%; }
  .header { gap: 12px; }
  .nav { gap: 10px; width: 100%; justify-content: space-between; }
  .nav > a { display: none; }
  .lang { margin-right: auto; }
  .case { padding: 22px; }
  .case h3 { font-size: 22px; }
  .gantt { padding: 18px 16px; }
  .gantt-row, .gantt-axis { grid-template-columns: 76px 1fr; gap: 10px; }
  .gantt-label { font-size: 13px; }
  .axis { font-size: 11px; }
  .axis span:nth-child(2), .axis span:nth-child(4) { display: none; }
  .certs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cert { padding: 16px; }
  .cert-name { font-size: 17px; }
  .contact-links strong { font-size: 18px; overflow-wrap: normal; }
  .job-years { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .gantt-bar, .project, .job { transition: none; }
  .js .gantt:not(.is-ready) .gantt-bar { transform: none; }
}
