/* ==========================================================================
   adresume — личный сайт-визитка
   ========================================================================== */

:root {
  --bg: #f6f5f1;
  --bg-2: #efede6;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #15161a;
  --ink-2: #474a54;
  --ink-3: #7b7f8b;
  --line: #e2dfd6;
  --line-2: #d4d0c4;
  --accent: #5b4cf0;
  --accent-ink: #ffffff;
  --accent-soft: #ecebff;
  --signal: #13a36b;
  --signal-soft: #def5ea;
  --warn: #c2410c;
  --grid: rgba(21, 22, 26, .045);
  --glow: rgba(91, 76, 240, .14);
  --shadow: 0 1px 2px rgba(20, 20, 30, .04), 0 8px 28px -12px rgba(20, 20, 30, .14);
  --shadow-lg: 0 2px 4px rgba(20, 20, 30, .04), 0 24px 60px -24px rgba(20, 20, 30, .28);
  --radius: 18px;
  --radius-sm: 10px;
  --maxw: 1180px;
  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0d11;
    --bg-2: #111219;
    --surface: #14151c;
    --surface-2: #181a22;
    --ink: #eef0f5;
    --ink-2: #b4b8c5;
    --ink-3: #7f8494;
    --line: #23252f;
    --line-2: #2e313d;
    --accent: #8b7fff;
    --accent-ink: #0c0d11;
    --accent-soft: #211d45;
    --signal: #3ddc97;
    --signal-soft: #10301f;
    --warn: #fb923c;
    --grid: rgba(255, 255, 255, .035);
    --glow: rgba(139, 127, 255, .16);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 30px 70px -30px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0d11;
  --bg-2: #111219;
  --surface: #14151c;
  --surface-2: #181a22;
  --ink: #eef0f5;
  --ink-2: #b4b8c5;
  --ink-3: #7f8494;
  --line: #23252f;
  --line-2: #2e313d;
  --accent: #8b7fff;
  --accent-ink: #0c0d11;
  --accent-soft: #211d45;
  --signal: #3ddc97;
  --signal-soft: #10301f;
  --warn: #fb923c;
  --grid: rgba(255, 255, 255, .035);
  --glow: rgba(139, 127, 255, .16);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 30px 70px -30px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
main { overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
  pointer-events: none;
  z-index: -1;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
@media (max-width: 560px) { .wrap { padding: 0 16px; } body { font-size: 16px; } }

.mono { font-family: var(--mono); font-feature-settings: normal; }
.muted { color: var(--ink-3); }
.accent { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.nav { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; }
.logo-mark {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--ink); color: var(--bg);
  font: 600 13px/1 var(--mono); letter-spacing: -.04em;
}
.logo-text { font-family: var(--mono); font-size: 14px; font-weight: 500; }
.logo-text span { color: var(--ink-3); }
.nav-links { display: flex; gap: 4px; margin-left: auto; list-style: none; padding: 0; margin-top: 0; margin-bottom: 0; }
.nav-links a {
  display: block; padding: 8px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--ink); background: var(--bg-2); }
.theme-toggle {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); cursor: pointer;
  transition: color .15s, border-color .15s;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--line-2); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
@media (max-width: 760px) { .nav-links { display: none; } .theme-toggle { margin-left: auto; } }

/* ---------- buttons, chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 22px; border-radius: 12px;
  font-weight: 700; font-size: 15px;
  border: 1px solid transparent;
  transition: transform .15s, background .15s, border-color .15s, box-shadow .15s;
}
.btn svg { width: 18px; height: 18px; transition: transform .2s; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary:hover svg { transform: translateX(3px); }
.btn-ghost { border-color: var(--line-2); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--ink-3); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.chip {
  display: inline-flex; align-items: center;
  padding: 5px 11px; border-radius: 999px;
  font: 500 12.5px/1.3 var(--mono);
  color: var(--ink-2); background: var(--surface-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.chip-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 12.5px/1 var(--mono);
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--ink-3);
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 4px var(--signal-soft);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 7px transparent; } }

/* ---------- hero ---------- */
.hero { position: relative; padding: 88px 0 64px; }
.hero::after {
  content: ""; position: absolute; z-index: -1;
  top: -120px; right: -10%; width: 720px; height: 520px;
  background: radial-gradient(closest-side, var(--glow), transparent);
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.hero h1 {
  margin: 22px 0 10px;
  font-size: clamp(44px, 7vw, 84px);
  line-height: .98; letter-spacing: -.045em; font-weight: 800;
}
.hero h1 .last { display: block; color: var(--ink-3); }
.hero .role {
  font: 500 clamp(15px, 1.6vw, 18px)/1.4 var(--mono);
  color: var(--accent); margin: 0 0 22px;
}
.hero .lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); max-width: 36ch; margin: 0 0 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 900px) {
  .hero { padding: 56px 0 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
}

/* terminal */
.term {
  border-radius: var(--radius);
  background: #0f1016;
  color: #d6d8e0;
  border: 1px solid #23252f;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  font: 13.5px/1.75 var(--mono);
}
.term-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid #1f212a; }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #2b2e39; }
.term-bar i:nth-child(1) { background: #ff5f57; } .term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: auto; color: #6b7080; font-size: 12px; }
.term-body { padding: 18px 20px 22px; overflow-x: auto; }
.term-body p { margin: 0; white-space: pre; }
.term .p { color: #8b7fff; } .term .c { color: #3ddc97; } .term .k { color: #7f8494; } .term .v { color: #f3f4f8; }
.term .cursor { display: inline-block; width: 8px; height: 16px; background: #d6d8e0; vertical-align: -3px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- metrics strip ---------- */
.metrics {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.metric { padding: clamp(18px, 4vw, 26px); border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric b { display: block; font-size: clamp(30px, 3.4vw, 42px); line-height: 1; letter-spacing: -.04em; font-weight: 800; }
.metric b small { font-size: .5em; letter-spacing: -.01em; color: var(--ink-3); font-weight: 700; margin-left: 2px; }
.metric span { display: block; margin-top: 10px; font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.metric .from { font: 500 12px/1 var(--mono); color: var(--ink-3); margin-top: 12px; }
@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 340px) {
  .metrics { grid-template-columns: 1fr; }
  .metric { border-right: 0; border-bottom: 1px solid var(--line); }
  .metric:last-child { border-bottom: 0; }
}

/* ---------- sections ---------- */
.section { padding: 96px 0 0; scroll-margin-top: 64px; }
.section:last-of-type { padding-bottom: 96px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 36px; flex-wrap: wrap; }
.section-head h2 {
  margin: 12px 0 0;
  font-size: clamp(30px, 4vw, 46px); line-height: 1.05; letter-spacing: -.035em; font-weight: 800;
}
.section-head p { margin: 0; color: var(--ink-2); max-width: 46ch; }
.num { color: var(--accent); }
@media (max-width: 560px) { .section { padding-top: 72px; } }

/* about */
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
}
.about-text p { margin: 0 0 16px; color: var(--ink-2); font-size: 18px; }
.about-text p:first-child { color: var(--ink); font-size: 21px; font-weight: 600; letter-spacing: -.01em; line-height: 1.45; }
.facts { list-style: none; margin: 0; padding: 0; }
.facts li { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px dashed var(--line-2); font-size: 15px; }
.facts li:first-child { padding-top: 0; }
.facts li:last-child { border-bottom: 0; padding-bottom: 0; }
.facts dt, .facts .k { font: 500 12.5px/1.7 var(--mono); color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .facts li { grid-template-columns: 1fr; gap: 2px; } .card { padding: 22px; } }

/* ---------- project cards ---------- */
.projects { display: grid; gap: 28px; }
.project {
  display: grid; grid-template-columns: 1.1fr 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  transition: border-color .2s, box-shadow .25s, transform .25s;
}
.project:hover { border-color: var(--line-2); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.project:nth-child(even) .project-media { order: 2; }
.project-media {
  position: relative; overflow: hidden;
  background: #16171f;
  min-height: 320px;
}
.project-media img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.project:hover .project-media img { transform: scale(1.035); }
.project-body { padding: 40px 40px 36px; display: flex; flex-direction: column; }
.project-index { font: 500 13px/1 var(--mono); color: var(--ink-3); display: flex; gap: 10px; align-items: center; }
.project h3 { margin: 16px 0 12px; font-size: clamp(26px, 2.8vw, 34px); line-height: 1.1; letter-spacing: -.03em; font-weight: 800; }
.project p { margin: 0 0 22px; color: var(--ink-2); }
.project-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 4px 0 26px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.project-kpis b { display: block; font-size: 24px; letter-spacing: -.03em; line-height: 1.1; font-weight: 800; }
.project-kpis span { display: block; font-size: 12.5px; color: var(--ink-3); line-height: 1.35; margin-top: 4px; }
.project .more { margin-top: auto; padding-top: 24px; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--accent); }
.project .more svg { width: 18px; height: 18px; transition: transform .2s; }
.project:hover .more svg { transform: translateX(4px); }
@media (max-width: 900px) {
  .project { grid-template-columns: 1fr; }
  .project:nth-child(even) .project-media { order: 0; }
  .project-media { min-height: 0; aspect-ratio: 16 / 9; }
  .project-body { padding: 28px 24px; }
}
@media (max-width: 420px) { .project-kpis { grid-template-columns: 1fr 1fr; } .project-kpis div:last-child { grid-column: span 2; } }

/* cases */
.cases { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 28px; }
.case { padding: 26px 28px; }
.case .eyebrow { margin-bottom: 14px; }
.case h4 { margin: 0 0 8px; font-size: 19px; letter-spacing: -.015em; line-height: 1.3; }
.case p { margin: 0 0 16px; color: var(--ink-2); font-size: 15.5px; }
@media (max-width: 760px) { .cases { grid-template-columns: 1fr; } }

/* ---------- stack ---------- */
.stack { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stack .card { padding: 24px; }
.stack h4 { margin: 0 0 14px; font: 600 13px/1.4 var(--mono); color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; display: flex; gap: 10px; align-items: center; }
.stack h4 svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
@media (max-width: 900px) { .stack { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .stack { grid-template-columns: 1fr; } }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 1px; background: var(--line-2); }
.job { position: relative; padding: 0 0 44px 44px; }
.job:last-child { padding-bottom: 0; }
.job::before {
  content: ""; position: absolute; left: 0; top: 6px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line-2);
}
.job.current::before { border-color: var(--signal); background: var(--signal); box-shadow: 0 0 0 5px var(--signal-soft); }
.job-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; }
.job h4 { margin: 0; font-size: 21px; letter-spacing: -.02em; line-height: 1.3; }
.job h4 span { color: var(--ink-3); font-weight: 600; }
.job time { font: 500 13px/1.4 var(--mono); color: var(--ink-3); }
.job .ctx { margin: 6px 0 14px; color: var(--ink-3); font-size: 15px; }
.job ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.job li { position: relative; padding-left: 20px; color: var(--ink-2); font-size: 15.5px; }
.job li::before { content: "—"; position: absolute; left: 0; color: var(--ink-3); }

/* edu */
.edu { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 16px; }
.edu .card h4 { margin: 0 0 8px; font-size: 18px; letter-spacing: -.01em; line-height: 1.35; }
.edu .card p { margin: 0; color: var(--ink-2); font-size: 15px; }
.edu .card .eyebrow { margin-bottom: 16px; }
@media (max-width: 900px) { .edu { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 40px; margin-top: 96px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font: 13px/1.6 var(--mono); color: var(--ink-3); }

/* ==========================================================================
   project page
   ========================================================================== */
.crumbs { padding-top: 32px; font: 500 13px/1 var(--mono); color: var(--ink-3); }
.crumbs a { display: inline-flex; align-items: center; gap: 8px; transition: color .15s; }
.crumbs a:hover { color: var(--ink); }
.crumbs svg { width: 16px; height: 16px; }

.p-hero { padding: 40px 0 56px; position: relative; }
.p-hero::after {
  content: ""; position: absolute; z-index: -1; top: -80px; left: 30%; width: 760px; height: 480px;
  background: radial-gradient(closest-side, var(--glow), transparent); pointer-events: none;
}
.p-hero h1 { margin: 20px 0 18px; font-size: clamp(38px, 6vw, 72px); line-height: 1; letter-spacing: -.045em; font-weight: 800; max-width: 16ch; }
.p-hero .lead { font-size: clamp(17px, 1.7vw, 21px); color: var(--ink-2); max-width: 60ch; margin: 0 0 28px; }
.p-cover {
  margin-top: 48px; border-radius: 22px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  display: block; background: var(--bg-2);
}
.p-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.p-section { padding-top: 88px; scroll-margin-top: 72px; }
.p-section h2 { margin: 12px 0 14px; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.08; letter-spacing: -.035em; font-weight: 800; }
.p-section > .wrap > p.intro { margin: 0 0 32px; color: var(--ink-2); max-width: 64ch; font-size: 18px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.pcard .ic {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 18px;
}
.pcard .ic svg { width: 20px; height: 20px; }
.pcard.problem .ic { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.pcard h3 { margin: 0 0 8px; font-size: 17.5px; letter-spacing: -.01em; line-height: 1.35; }
.pcard p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.pcard ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.pcard li { position: relative; padding-left: 18px; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.pcard li::before { content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); }

/* architecture flow */
.flow {
  display: grid; grid-template-columns: 1fr auto 1.25fr auto 1fr; align-items: center; gap: 14px;
  padding: 28px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line);
}
.flow-col { display: grid; gap: 12px; }
.node { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; background: var(--surface-2); }
.node b { display: block; font-size: 15.5px; letter-spacing: -.01em; margin-bottom: 4px; }
.node span { display: block; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.node.core { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.node.core span { color: inherit; opacity: .85; }
.node.dashed { border-style: dashed; }
.flow-arrow { color: var(--ink-3); display: grid; place-items: center; }
.flow-arrow svg { width: 26px; height: 26px; }
.flow-notes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
@media (max-width: 900px) {
  .flow { grid-template-columns: 1fr; }
  .flow-arrow svg { transform: rotate(90deg); }
}

/* steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: s; }
.step { position: relative; padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.step::before {
  counter-increment: s; content: counter(s, decimal-leading-zero);
  display: block; font: 600 13px/1 var(--mono); color: var(--accent); margin-bottom: 18px;
}
.step h3 { margin: 0 0 6px; font-size: 16.5px; line-height: 1.35; letter-spacing: -.01em; }
.step p { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* compare table */
.compare-wrap { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--surface); }
.compare { width: 100%; border-collapse: collapse; font-size: 15px; }
.compare th, .compare td { text-align: left; padding: 14px 20px; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare thead th { font: 600 12px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); background: var(--surface-2); }
.compare tbody tr:last-child td { border-bottom: 0; }
.compare td:first-child { font-weight: 700; width: 28%; }
.compare td.old { color: var(--ink-3); }
.compare td.new { color: var(--ink); }
.compare td.new::before { content: "✓"; color: var(--signal); font-weight: 800; margin-right: 8px; }
@media (max-width: 680px) {
  .compare thead { display: none; }
  .compare, .compare tbody, .compare tr, .compare td { display: block; width: 100% !important; }
  .compare tr { padding: 14px 18px; border-bottom: 1px solid var(--line); }
  .compare tbody tr:last-child { border-bottom: 0; }
  .compare td { padding: 2px 0; border: 0; }
  .compare td.old::before { content: "было: "; font-family: var(--mono); font-size: 12px; }
}

/* big numbers */
.bignums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.bignum { padding: 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.bignum b { display: block; font-size: clamp(34px, 4vw, 48px); line-height: 1; letter-spacing: -.045em; font-weight: 800; color: var(--accent); }
.bignum span { display: block; margin-top: 12px; font-size: 14.5px; color: var(--ink-2); line-height: 1.45; }
@media (max-width: 900px) { .bignums { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px) { .bignums { grid-template-columns: 1fr; } }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.gallery button {
  all: unset; cursor: zoom-in; display: block; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-2);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.gallery button:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }
.gallery button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
@media (max-width: 900px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.note { margin-top: 16px; font: 12.5px/1.5 var(--mono); color: var(--ink-3); }

/* lightbox */
.lb {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  background: rgba(8, 9, 12, .92);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 64px 72px;
}
.lb.open { display: flex; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.lb img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lb-btn {
  position: absolute; display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 12px; border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06); color: #fff; cursor: pointer;
  transition: background .15s;
}
.lb-btn:hover { background: rgba(255,255,255,.14); }
.lb-btn svg { width: 22px; height: 22px; }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); font: 13px/1 var(--mono); color: rgba(255,255,255,.6); }
@media (max-width: 700px) {
  .lb { padding: 64px 10px; }
  .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; }
  .lb-count { bottom: 24px; }
}

/* next project */
.next {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  margin-top: 96px; padding: 36px 40px; border-radius: 24px;
  background: var(--ink); color: var(--bg);
  transition: transform .2s;
}
.next:hover { transform: translateY(-2px); }
.next .eyebrow { color: color-mix(in srgb, var(--bg) 60%, transparent); }
.next h3 { margin: 10px 0 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.03em; line-height: 1.1; }
.next svg { width: 36px; height: 36px; flex: none; transition: transform .2s; }
.next:hover svg { transform: translateX(6px); }
@media (max-width: 560px) { .next { padding: 26px 22px; } }

/* reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
