/* Egor Danchenko — shared design system. Tokens only in :root. */
:root {
  --bg: oklch(98.6% 0.004 85);
  --surface: oklch(100% 0 0);
  --fg: oklch(18% 0.012 50);
  --muted: oklch(46% 0.012 50);
  --border: oklch(89% 0.008 75);
  --accent: oklch(42% 0.12 22);

  --accent-soft: color-mix(in oklch, var(--accent) 14%, transparent);
  --fg-soft: color-mix(in oklch, var(--fg) 6%, transparent);
  --ink: color-mix(in oklch, var(--fg) 92%, black);
  --ink-fg: var(--bg);
  --ink-muted: color-mix(in oklch, var(--bg) 68%, transparent);

  --font-display: "Manrope", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --fs-h1: clamp(36px, 5vw, 64px);
  --fs-h2: clamp(28px, 3.4vw, 42px);
  --fs-h3: 21px;
  --fs-lead: 18px;
  --fs-body: 16px;
  --fs-meta: 13px;

  --gap-xs: 8px;
  --gap-sm: 12px;
  --gap-md: 20px;
  --gap-lg: 32px;
  --gap-xl: 56px;
  --gap-2xl: 96px;
  --container: 1120px;
  --gutter: 32px;
  --radius: 10px;
  --radius-lg: 16px;
  --motion-press: 0.12s;
  --motion-ui: 0.18s;
  --motion-enter: 0.22s;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-fade-out var(--motion-ui) ease-out both; }
::view-transition-new(root) { animation: vt-fade-in var(--motion-ui) ease-out both; }
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
p { text-wrap: pretty; margin: 0; }
h1, h2, h3, h4 { text-wrap: balance; }

.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(56px, 8vw, var(--gap-2xl)); }
.section + .section { border-top: 1px solid var(--border); }
.stack { display: flex; flex-direction: column; gap: var(--gap-md); }
.stack-sm { gap: var(--gap-sm); }
.stack-lg { gap: var(--gap-lg); }
.grid-tight { gap: var(--gap-sm); }
.section-copy { max-width: 40ch; }
.section-copy-sm { max-width: 36ch; }
.flow-xs { margin-top: var(--gap-xs); }
.flow-sm { margin-top: var(--gap-sm); }
.flow-md { margin-top: var(--gap-md); }
.flow-lg { margin-top: var(--gap-lg); }
.row { display: flex; align-items: center; gap: var(--gap-md); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-md); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap-lg); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-lg); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap-md); }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gap-xl); align-items: start; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: var(--gap-xl); align-items: start; }
@media (max-width: 920px) {
  .grid-2, .grid-3, .grid-4, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
  :root { --gutter: 20px; }
}

.h1, h1 { font-family: var(--font-display); font-size: var(--fs-h1); line-height: 1.06; letter-spacing: -0.03em; margin: 0; font-weight: 650; }
.h2, h2 { font-family: var(--font-display); font-size: var(--fs-h2); line-height: 1.12; letter-spacing: -0.025em; margin: 0; font-weight: 650; }
.h3, h3 { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 640; line-height: 1.3; letter-spacing: -0.015em; margin: 0; }
.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--muted); max-width: 60ch; margin: 0; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--gap-md);
}
.eyebrow-quiet { color: var(--muted); }
.meta { font-family: var(--font-mono); font-size: var(--fs-meta); color: var(--muted); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.topnav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topnav-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 60px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--fg); color: var(--bg);
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
}
.brand-name { font-family: var(--font-display); font-size: 15px; font-weight: 640; letter-spacing: -0.02em; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { font-size: 14px; color: var(--muted); min-height: 44px; display: inline-flex; align-items: center; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--fg); }
.nav-tools { display: flex; align-items: center; gap: 10px; }
.lang-switch {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border); border-radius: 999px; padding: 2px;
  position: relative; z-index: 2;
}
.lang-switch button {
  min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  pointer-events: auto;
}
.lang-check { font-size: 12px; line-height: 1; }
.lang-switch button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.lang-switch button:hover { color: var(--fg); }
.lang-switch button[aria-pressed="true"]:hover { color: var(--bg); background: color-mix(in oklch, var(--fg) 88%, white); }
.mobile-panel .lang-switch { margin-top: 8px; width: fit-content; }
.icon-link {
  width: 44px; height: 44px; display: grid; place-items: center;
  color: var(--fg); border: 1px solid transparent; border-radius: 10px;
}
.icon-link:hover { background: var(--fg-soft); }
.nav-toggle {
  display: none; width: 44px; height: 44px; border-radius: 10px;
  border: 1px solid var(--border);
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 16px; height: 1.5px; background: var(--fg); position: relative;
  transition: transform var(--motion-ui) ease, top var(--motion-ui) ease, background var(--motion-ui) ease;
}
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -5px; }
.nav-toggle span::after { top: 5px; }
body.nav-open .nav-toggle span { background: transparent; }
body.nav-open .nav-toggle span::before { top: 0; transform: rotate(45deg); }
body.nav-open .nav-toggle span::after { top: 0; transform: rotate(-45deg); }

.pagefoot { padding-block: var(--gap-xl); color: var(--muted); font-size: 14px; border-top: 1px solid var(--border); }
.pagefoot .foot-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: var(--gap-lg); }
.foot-col { display: flex; flex-direction: column; align-items: flex-start; gap: var(--gap-xs); }
.foot-col .meta { margin: 0; }
@media (max-width: 920px) { .pagefoot .foot-grid { grid-template-columns: 1fr; } }
.pagefoot a:hover { color: var(--fg); }
.pagefoot .legal { margin-top: var(--gap-lg); padding-top: var(--gap-md); border-top: 1px solid var(--border); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 11px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 15px; font-weight: 560; letter-spacing: -0.01em;
  transition: background var(--motion-ui) ease, border-color var(--motion-ui) ease, color var(--motion-ui) ease;
}
.btn-primary { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.btn-primary:hover { background: color-mix(in oklch, var(--accent) 82%, black); color: var(--surface); }
.btn-secondary { background: transparent; color: var(--fg); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--fg); background: var(--fg-soft); color: var(--fg); }
.btn-ghost { background: transparent; color: var(--fg); border-color: transparent; padding-inline: 8px; }
.btn-ghost:hover { color: var(--accent); }
.btn-arrow::after { content: "→"; }
.ext::after { content: "↗"; font-size: 0.85em; margin-left: 4px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; }
.card-flat { background: transparent; border: 0; padding: 0; }
.card-rule { background: transparent; border: 0; border-top: 1px solid var(--fg); padding: 24px 0 0; border-radius: 0; }
.card-link { display: block; color: inherit; transition: border-color var(--motion-ui) ease; }
.card-link:hover { border-color: var(--fg); }
.card-link.grid-2 { align-items: center; }

.feature .feature-mark {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 10px; color: var(--accent); margin-bottom: var(--gap-md);
}
.feature .feature-mark svg { width: 18px; height: 18px; }
.feature h3 { margin-bottom: var(--gap-xs); }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }

.work-body .stat-num {
  font-size: 42px;
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}
.stat .stat-num {
  font-family: var(--font-display); font-size: clamp(40px, 5vw, 64px);
  line-height: 0.95; letter-spacing: -0.04em; color: var(--fg); font-weight: 650;
}
.stat .stat-label { color: var(--muted); font-size: 14px; margin-top: 8px; max-width: 28ch; }

.quote { font-family: var(--font-display); font-size: clamp(24px, 2.6vw, 32px); line-height: 1.32; letter-spacing: -0.015em; max-width: 36ch; }
.quote-author { color: var(--muted); font-size: 14px; margin-top: var(--gap-md); }
.quote-mark { font-family: var(--font-display); font-size: 140px; line-height: 0.7; color: var(--accent); opacity: 0.18; margin-bottom: -28px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; background: var(--fg-soft); color: var(--fg);
  border-radius: 999px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
}
.tag {
  display: inline-flex; align-items: center; padding: 4px 10px;
  background: transparent; color: var(--muted); border: 1px solid var(--border);
  border-radius: 999px; font-size: 12px;
}
.tag-row { display: flex; flex-wrap: wrap; gap: var(--gap-xs); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); }
.input, .textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--fg); font: inherit; font-size: 15px;
}
.input:hover, .textarea:hover { border-color: color-mix(in oklch, var(--fg) 35%, var(--border)); }
.input:focus-visible, .textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.55; }

.ds-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ds-table th, .ds-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.ds-table th { color: var(--muted); font-weight: 500; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.ds-table tbody tr:hover { background: var(--fg-soft); }
.ds-table .num-col { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }

.ph-img {
  background: linear-gradient(135deg, var(--accent-soft), var(--fg-soft)), var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  aspect-ratio: 16 / 10; display: grid; place-items: center;
  color: var(--muted); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em;
}
.ph-img.square { aspect-ratio: 1 / 1; }
.ph-img.portrait { aspect-ratio: 3 / 4; }
.ph-img.wide { aspect-ratio: 16 / 9; }

.founder-portrait {
  margin: 0;
  aspect-ratio: 3 / 4;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}
.founder-portrait img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 16%;
}

.rule { border: 0; border-top: 1px solid var(--border); margin: 0; }
.rule-strong { border: 0; border-top: 1px solid var(--fg); margin: 0; }

.hero { padding-block: clamp(64px, 10vw, 120px); }
.hero-center { text-align: center; max-width: 32ch; margin-inline: auto; }
.hero h1 { margin-bottom: var(--gap-md); }
.hero .lead { margin-bottom: var(--gap-lg); }
.hero-cta { display: inline-flex; gap: var(--gap-sm); flex-wrap: wrap; align-items: center; }
.hero .hero-cta { margin-top: 0; }
.hero-center .hero-cta { justify-content: center; }
.hero-split { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: var(--gap-2xl); align-items: center; }
@media (max-width: 920px) { .hero-split { grid-template-columns: 1fr; } }

.log-row { display: grid; grid-template-columns: 140px 1fr 120px; gap: var(--gap-lg); padding: 22px 0; border-top: 1px solid var(--border); align-items: baseline; }
.log-row .meta { color: var(--muted); }
.log-row h3 { font-size: 19px; }
.log-row .pull { text-align: right; }
@media (max-width: 920px) { .log-row { grid-template-columns: 1fr; } }

.proof-row { display: flex; flex-wrap: wrap; gap: var(--gap-xs) var(--gap-md); margin-top: var(--gap-lg); }
.proof-row span { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.trust { border-top: 1px solid var(--border); padding-block: 18px; }
.trust p { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); text-align: center; }

.work-card { overflow: hidden; padding: 0; }
.work-card .work-visual { background: var(--fg-soft); padding: var(--gap-md); min-height: 280px; display: grid; place-items: center; color: inherit; }
.work-card .work-body { padding: 28px; }
.work-body .lead { margin-top: var(--gap-sm); }
.work-body .tag-row { margin-top: var(--gap-sm); }
.work-body .hero-cta { margin-top: var(--gap-md); }
.work-body .meta + .meta,
.work-body .meta + p { margin-top: var(--gap-sm); }
.work-visual img { max-height: 320px; width: auto; margin-inline: auto; }
.device-row { display: flex; gap: var(--gap-md); justify-content: center; align-items: flex-end; flex-wrap: wrap; }
.phone {
  width: min(168px, 42vw); aspect-ratio: 9 / 19.2;
  border: 1px solid var(--border); border-radius: 22px; overflow: hidden;
  background: var(--surface); box-shadow: none;
}
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.app-icon { width: 56px; height: 56px; border-radius: 14px; }

.band-ink { background: var(--ink); color: var(--ink-fg); }
.band-ink .lead, .band-ink .meta, .band-ink p { color: var(--ink-muted); }
.band-ink .section + .section, .band-ink { border-color: color-mix(in oklch, var(--bg) 12%, transparent); }
.band-ink .tag { border-color: color-mix(in oklch, var(--bg) 18%, transparent); color: var(--ink-muted); }
.band-ink .card { background: color-mix(in oklch, var(--bg) 6%, transparent); border-color: color-mix(in oklch, var(--bg) 14%, transparent); }

.process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.process article { padding: 0 var(--gap-md) 0 0; border-right: 1px solid var(--border); }
.process article:last-child { border-right: 0; padding-right: 0; }
.process ol { margin: var(--gap-sm) 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
@media (max-width: 920px) {
  .process { grid-template-columns: 1fr; gap: var(--gap-md); }
  .process article { border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 var(--gap-md); }
}

.timeline { display: grid; gap: 0; }
.timeline article { display: grid; grid-template-columns: 160px 1fr; gap: 28px; padding: var(--gap-lg) 0; border-top: 1px solid var(--border); }
.timeline .lead { margin-top: var(--gap-xs); }
@media (max-width: 920px) { .timeline article { grid-template-columns: 1fr; } }

.arch {
  width: 100%; height: 100%;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); padding: 20px; overflow: hidden;
  display: grid; place-items: center;
}
.arch svg { width: 100%; height: auto; }
.arch-node { fill: var(--surface); stroke: var(--border); }
.arch-node-fill { fill: var(--fg); }
.arch-line { stroke: var(--muted); fill: none; }
.arch-accent { stroke: var(--accent); fill: none; }
.arch-label { font-family: var(--font-mono); font-size: 11px; fill: var(--fg); }
.arch-label-inv { fill: var(--bg); }

.media-thumb { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); }
.media-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.play {
  position: absolute; inset: auto 16px 16px auto;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); color: var(--fg);
  display: grid; place-items: center; border: 1px solid var(--border);
}

.store-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap-sm); }
.store-badge { height: 40px; width: auto; object-fit: contain; }
.store-badge.play { height: 40px; }

.skip {
  position: absolute; left: 12px; top: -40px;
  background: var(--fg); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 50;
}
.skip:focus { top: 12px; }

.mobile-panel {
  display: block;
  overflow: hidden;
  border-top: 1px solid var(--border);
  padding: var(--gap-sm) var(--gutter) var(--gap-md);
}
.mobile-panel[hidden] { display: none !important; }
.mobile-panel a, .mobile-panel button { display: flex; align-items: center; min-height: 44px; }
.mobile-panel .lang-switch { margin-top: var(--gap-xs); }

@media (max-width: 1100px) {
  .nav-links { display: none; }
  .nav-toggle { display: grid; place-items: center; }
  .topnav .btn { display: none; }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.btn-primary:focus-visible { outline-color: var(--fg); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.form-status { font-size: 14px; color: var(--muted); min-height: 1.4em; }
.form-status.ok { color: var(--fg); }
.form-status.err { color: var(--accent); }

html[data-motion="on"] .reveal {
  opacity: 0;
  transform: translateY(10px);
}
html[data-motion="on"] .reveal .tag-row .tag {
  opacity: 0;
}

h2 + .lead,
h3 + .lead,
.meta + h2,
.meta + h3 { margin-top: var(--gap-sm); }
.hero h1 + .lead { margin-top: 0; }
.card > .lead,
.card h2 + .lead,
.card h3 + .lead { margin-top: var(--gap-sm); }
.card .lead + .num,
.card .lead + .meta,
.card .num + .meta,
.card .meta + .meta { margin-top: var(--gap-sm); }
.card .pill { margin-top: var(--gap-sm); }
h2 + .tag-row,
.lead + .tag-row { margin-top: var(--gap-sm); }
.hero .tag-row { margin-top: var(--gap-md); }
.lead + .arch { margin-top: var(--gap-sm); }
.arch + .meta { margin-top: var(--gap-sm); }
.card h3 + .meta { margin-top: var(--gap-xs); }
.card .lead + .tag { margin-top: var(--gap-sm); }
.btn.flow-md,
a.btn.flow-md { margin-top: var(--gap-md); }
.section-copy .lead,
.section-copy-sm .lead { margin-top: var(--gap-sm); }
.cta-band { text-align: center; }
.cta-band .container { max-width: 640px; }
.cta-band .lead { margin: var(--gap-sm) auto var(--gap-lg); }
.cta-band .hero-cta { justify-content: center; }
.cta-band .meta { margin-top: var(--gap-md); }
.section-title { max-width: 22ch; margin-bottom: var(--gap-lg); }
.media-head { margin-bottom: var(--gap-lg); }
.resume-hero { flex-wrap: wrap; align-items: flex-end; }
.grid-align { align-items: center; }
