/* Portfolio — design system "Control Ledger" (banking ledger + engineering schematic).
   Single stylesheet, no build step. Tokens live here and only here. */

:root {
  --bg: #06101E;
  --bg2: #0B1A2F;
  --bg3: #132747;
  --line: rgba(146, 176, 207, .14);
  --line2: rgba(146, 176, 207, .28);
  --text: #EAF1F8;
  --text2: #92A6BA;
  --text3: #758BA2;
  --accent: #00D4FF;
  --accent2: #00B4D8;
  --hero-base: #080A22;
  --hero-blue: #162F74;
  --hero-violet: #2B1762;
  --gold: #E3C46B;
  --gold2: #F0D98D;
  --serif: 'Piazzolla', Georgia, serif;
  --sans: 'Golos Text', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.62 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.w { max-width: 1180px; margin: 0 auto; padding: 0 30px; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--gold2); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--bg3); color: var(--text); padding: 10px 16px;
  font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
}
.skip:focus { left: 12px; top: 12px; }

/* ---------------------------------------------------------------- typography */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -.02em;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: clamp(30px, 4.6vw, 52px); line-height: 1.08; }
h2 { font-size: clamp(27px, 3.5vw, 40px); line-height: 1.14; }
h3 { font-size: clamp(17px, 1.6vw, 21px); line-height: 1.28; letter-spacing: -.012em; }

p { margin: 0 0 12px; color: var(--text2); }
p:last-child { margin-bottom: 0; }

.kicker {
  font: 500 11.5px/1.4 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.lbl {
  font: 500 10.5px/1.4 var(--mono);
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text3);
  margin: 16px 0 6px;
}
.lead { max-width: 64ch; font-size: 16px; color: var(--text2); }
.lead--hero { font-size: clamp(16px, 1.5vw, 19px); max-width: 60ch; color: #C3D3E2; }
.note { font: 400 12.5px/1.6 var(--mono); color: var(--text3); margin-top: 14px; }
.val { color: var(--gold2); }

/* --------------------------------------------------------------------- chrome */
.top {
  position: sticky; top: 0; z-index: 50;
  background: rgba(6, 16, 30, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-in { display: flex; align-items: center; gap: 20px; height: 58px; justify-content: space-between; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 13px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text);
}
.brand-d {
  width: 11px; height: 11px; flex: none;
  background: var(--gold);
  transform: rotate(45deg);
  box-shadow: 0 0 12px rgba(227, 196, 107, .55);
}
.nav { display: flex; flex-wrap: wrap; gap: 2px 6px; }
.nav a {
  font: 500 11.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--text2); padding: 7px 9px; border-radius: 6px;
  transition: color .16s ease, background .16s ease;
}
.nav a:hover { color: var(--bg); background: var(--accent); }

/* ----------------------------------------------------------------------- hero */
.hero {
  position: relative;
  padding: 76px 0 66px;
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(43, 23, 98, .85), transparent 70%),
    radial-gradient(760px 380px at 88% 0%, rgba(22, 47, 116, .7), transparent 72%),
    linear-gradient(180deg, var(--hero-base), var(--bg) 88%);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px);
  background-size: 100% 34px;
  opacity: .5;
  mask-image: linear-gradient(180deg, transparent, #000 60%, transparent);
}
.hero-in { position: relative; z-index: 1; }
.hero h1 { max-width: 24ch; }
.hero h1 + .lead { margin-top: 18px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 0; }

.btn {
  display: inline-flex; align-items: baseline; gap: 9px;
  padding: 12px 18px; border-radius: 8px;
  font: 500 13px/1 var(--mono); letter-spacing: .04em;
  border: 1px solid var(--line2);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
.btn-l {
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase; opacity: .72;
}
.btn--primary {
  background: linear-gradient(180deg, rgba(0, 212, 255, .16), rgba(0, 180, 216, .08));
  border-color: rgba(0, 212, 255, .45);
  color: var(--text);
  box-shadow: 0 6px 20px rgba(0, 212, 255, .14);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0, 212, 255, .26); color: var(--text); }
.btn--ghost { color: var(--text2); }
.btn--ghost:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); }

/* --------------------------------------------------------------------- ledger */
.ledger {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  border-top: 1px solid var(--line2);
  margin-top: 20px;
}
.ledger--hero { margin-top: 40px; }
.stat {
  padding: 16px 16px 16px 0;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.stat:last-child { border-right: 0; }
.stat-v {
  font: 700 clamp(24px, 3vw, 38px)/1 var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  color: var(--accent);
  text-shadow: 0 0 22px rgba(0, 212, 255, .4);
}
.stat-u { font-size: .48em; margin-left: 5px; color: var(--text2); text-shadow: none; letter-spacing: .06em; }
.stat-l { margin-top: 7px; font-size: 13px; color: var(--text); }
.stat-n { margin-top: 3px; font: 400 11.5px/1.45 var(--mono); color: var(--text3); }

/* ------------------------------------------------------------------ flow band */
.band {
  padding: 34px 0 38px;
  background: linear-gradient(180deg, rgba(11, 26, 47, .8), transparent);
  border-bottom: 1px solid var(--line);
}
.flow-strip {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 4px;
  padding: 14px 0 6px;
}
.fl-step {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 14px; border: 1px solid var(--line2); border-radius: 999px;
  font: 500 12px/1 var(--mono); letter-spacing: .05em; color: var(--text);
  background: rgba(19, 39, 71, .5);
}
.fl-dot {
  width: 7px; height: 7px; background: var(--accent); transform: rotate(45deg);
  box-shadow: 0 0 10px rgba(0, 212, 255, .8);
}
.fl-arrow {
  flex: 1 1 26px; min-width: 26px; height: 1px; position: relative;
  background: var(--line2);
}
.fl-arrow::after {
  content: ""; position: absolute; top: -2px; left: 0; width: 22px; height: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: pulse 3.6s linear infinite;
}
.fl-arrow:nth-of-type(2)::after { animation-delay: .5s; }
.fl-arrow:nth-of-type(3)::after { animation-delay: 1s; }
.fl-arrow:nth-of-type(4)::after { animation-delay: 1.5s; }
@keyframes pulse {
  0% { transform: translateX(-14px); opacity: 0; }
  18% { opacity: 1; }
  82% { opacity: 1; }
  100% { transform: translateX(calc(100% + 6px)); opacity: 0; }
}

/* ------------------------------------------------------------------- sections */
.sec { padding: 82px 0; border-bottom: 1px solid var(--line); position: relative; }
.sec--cyan { background: radial-gradient(760px 340px at 88% 6%, rgba(0, 180, 216, .09), transparent 70%); }
.sec--gold { background: radial-gradient(760px 340px at 10% 6%, rgba(227, 196, 107, .085), transparent 70%); }
.sec--violet { background: radial-gradient(820px 360px at 50% 0%, rgba(43, 23, 98, .5), transparent 72%); }

/* section head: hairline + glowing rhombus notch — the signature detail */
.sh { position: relative; padding-top: 22px; margin-bottom: 34px; }
.sh::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: var(--line2);
}
.sh::after {
  content: ""; position: absolute; top: -4px; left: 0;
  width: 9px; height: 9px; background: var(--accent); transform: rotate(45deg);
  box-shadow: 0 0 14px rgba(0, 212, 255, .85);
}
.sec--gold .sh::after { background: var(--gold); box-shadow: 0 0 14px rgba(227, 196, 107, .8); }
.sec--gold .kicker { color: var(--gold2); }
.sh h2 { margin-bottom: 12px; }
.sh--sub { margin-top: 62px; }

.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 46px; align-items: start; }
.prose p { margin-bottom: 14px; }
.prose p:first-child { color: var(--text); font-size: 16.5px; }

.pillars { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.pillar {
  background: var(--bg);
  padding: 20px 20px 22px;
  transition: background .18s ease;
}
.pillar:hover { background: rgba(19, 39, 71, .55); }
.pillar .kicker { margin-bottom: 9px; font-size: 10.5px; }
.pillar h3 { margin-bottom: 8px; }
.pillar p { font-size: 14px; margin: 0; }

/* ---------------------------------------------------------------------- chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--line2); color: var(--text2);
  font: 500 12px/1 var(--mono); letter-spacing: .06em;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip-n { font-size: 10.5px; color: var(--text3); }
.chip-active {
  color: var(--bg); background: var(--accent); border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0, 212, 255, .28);
}
.chip-active .chip-n { color: rgba(6, 16, 30, .7); }
.sec--gold .chip-active { background: var(--gold); border-color: var(--gold); box-shadow: 0 4px 16px rgba(227, 196, 107, .3); }
.empty { display: none; font: 400 13px/1.6 var(--mono); color: var(--text3); }
.empty.empty-on { display: block; }

/* ----------------------------------------------------------- engagement cards */
.cases { display: grid; gap: 18px; }
.case {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(11, 26, 47, .68), rgba(6, 16, 30, .5));
  padding: 24px 26px 26px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.case::before {
  content: ""; position: absolute; inset: 0; border-radius: 14px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, .5), transparent);
  height: 1px; top: -1px; opacity: 0; transition: opacity .18s ease;
}
.case:hover { transform: translateY(-2px); border-color: var(--line2); box-shadow: 0 16px 40px rgba(0, 0, 0, .32); }
.case:hover::before { opacity: 1; }
/* engineering corner ticks */
.case::after {
  content: ""; position: absolute; right: 12px; bottom: 12px; width: 14px; height: 14px;
  border-right: 1px solid var(--line2); border-bottom: 1px solid var(--line2);
  pointer-events: none;
}
.case-ix {
  position: absolute; top: 18px; right: 22px;
  font: 700 34px/1 var(--mono); color: rgba(146, 176, 207, .12);
  font-variant-numeric: tabular-nums;
}
.case-client {
  font: 500 11px/1.3 var(--mono); letter-spacing: .13em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 8px;
}
.case-head h3 { max-width: 46ch; }
.case-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 34px; margin-top: 6px; }
.case-col--side { border-left: 1px solid var(--line); padding-left: 26px; }
.bullets { margin: 0; padding-left: 18px; color: var(--text2); }
.bullets li { margin-bottom: 8px; font-size: 14.2px; }
.bullets li::marker { color: var(--accent2); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tag {
  font: 400 11px/1 var(--mono); letter-spacing: .04em;
  color: var(--text2); background: rgba(19, 39, 71, .7);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px;
  white-space: nowrap;                   /* никогда не рвать имя технологии */
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}

/* the metrics ledger inside cards is denser than the hero one */
.case .ledger, .prod .ledger { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin-top: 18px; }
.case .stat, .prod .stat { padding: 12px 12px 12px 0; }
.case .stat-v, .prod .stat-v { font-size: clamp(19px, 1.9vw, 24px); }
.case .stat-l, .prod .stat-l { font-size: 12px; color: var(--text2); margin-top: 5px; }

/* -------------------------------------------------------------- product cards */
.prods { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }
.prod {
  position: relative;
  border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(180deg, rgba(11, 26, 47, .6), rgba(6, 16, 30, .45));
  padding: 22px 24px 24px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.prod:hover { transform: translateY(-2px); border-color: var(--line2); box-shadow: 0 16px 40px rgba(0, 0, 0, .3); }
.prod--flagship {
  grid-column: 1 / -1;
  border-color: rgba(227, 196, 107, .38);
  background:
    radial-gradient(600px 220px at 92% 0%, rgba(227, 196, 107, .1), transparent 70%),
    linear-gradient(180deg, rgba(19, 39, 71, .7), rgba(6, 16, 30, .5));
}
.prod--flagship .bullets li { font-size: 14.5px; }
.flag {
  display: inline-block; vertical-align: middle; margin-left: 8px;
  font: 500 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--bg); background: var(--gold); padding: 5px 9px; border-radius: 999px;
}
.prod-head { margin-bottom: 4px; }
.prod-sub {
  margin-top: 7px;
  font: 400 12.5px/1.5 var(--mono); color: var(--text3);
}

/* -------------------------------------------------------------------- ladder */
.ladder { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1px; background: var(--line); margin-bottom: 40px; }
.rung { background: var(--bg); padding: 20px 20px 22px; position: relative; }
.rung::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: .55;
}
.rung:nth-child(2)::before { background: linear-gradient(90deg, var(--accent2), transparent); }
.rung:nth-child(3)::before { background: linear-gradient(90deg, var(--gold), transparent); }
.rung-lv {
  font: 700 13px/1.2 var(--mono); letter-spacing: .1em; color: var(--text);
  margin-bottom: 10px;
}
.rung:nth-child(3) .rung-lv { color: var(--gold2); }
.rung-m { font-size: 14px; color: var(--text2); margin-bottom: 10px; }
.rung-w { font: 400 12.5px/1.55 var(--mono); color: var(--text3); border-top: 1px solid var(--line); padding-top: 10px; }

.principles { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.principle {
  border-left: 2px solid var(--line2);
  padding: 4px 0 4px 18px;
  transition: border-color .18s ease;
}
.principle:hover { border-color: var(--accent); }
.principle h3 { font-size: 17px; margin-bottom: 7px; }
.principle p { font-size: 14px; margin: 0; }

/* ------------------------------------------------------------ stack registers */

/* depth ledger — the proof layer of this section: measured years, not adjectives */
.depth {
  border: 1px solid var(--line2); border-radius: 14px;
  padding: 22px 26px 10px;
  margin-bottom: 40px;
  background:
    radial-gradient(600px 200px at 88% 0%, rgba(0, 212, 255, .1), transparent 70%),
    linear-gradient(180deg, rgba(19, 39, 71, .6), rgba(6, 16, 30, .4));
}
.dp-k {
  font: 500 11px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 16px;
}
.dp-row {
  display: grid;
  grid-template-columns: 210px minmax(120px, 1fr) 96px;
  grid-template-areas: "label track years" "note note note";
  align-items: center; gap: 6px 18px;
  padding: 13px 0; border-top: 1px solid var(--line);
}
.dp-row:first-of-type { border-top: 0; }
.dp-l { grid-area: label; font-size: 15px; color: var(--text); font-weight: 500; }
.dp-track {
  grid-area: track; position: relative; height: 8px; border-radius: 999px;
  background: rgba(146, 176, 207, .12);
  overflow: hidden;
}
.dp-fill {
  position: absolute; inset: 0 auto 0 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent2), var(--accent) 72%, var(--gold2));
  box-shadow: 0 0 16px rgba(0, 212, 255, .55);
}
.dp-y {
  grid-area: years; text-align: right;
  font: 700 clamp(20px, 2.2vw, 27px)/1 var(--mono);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
  color: var(--accent); text-shadow: 0 0 20px rgba(0, 212, 255, .42);
}
.dp-u { font-size: .42em; margin-left: 4px; color: var(--text3); text-shadow: none; letter-spacing: .1em; }
.dp-n { grid-area: note; font: 400 12.5px/1.5 var(--mono); color: var(--text3); }
.dp-row:first-of-type .dp-y { color: var(--gold2); text-shadow: 0 0 20px rgba(227, 196, 107, .4); }
.dp-row:first-of-type .dp-fill { background: linear-gradient(90deg, var(--gold), var(--gold2)); box-shadow: 0 0 18px rgba(227, 196, 107, .5); }

/* register groups: numbered like a technical catalogue */
.regs { counter-reset: reg; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 26px 34px; }
/* flex + wrap: теги переносятся ПО ЭЛЕМЕНТАМ (в разметке между ними нет пробелов,
   а сами они nowrap — без этого строка уезжает за вьюпорт) */
.reg {
  counter-increment: reg; border-top: 1px solid var(--line2); padding-top: 14px;
  position: relative;
  display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start;
}
.reg::before {
  content: ""; position: absolute; top: -4px; left: 0;
  width: 7px; height: 7px; background: var(--accent2); transform: rotate(45deg);
  opacity: .85;
}
.reg-h {
  flex: 0 0 100%;
  display: flex; align-items: baseline; gap: 9px;
  font: 500 11px/1.3 var(--mono); letter-spacing: .13em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 7px;
}
.reg-h::before {
  content: counter(reg, decimal-leading-zero);
  font-weight: 700; color: rgba(146, 176, 207, .34); letter-spacing: .04em;
}
.reg .tag:hover { color: var(--text); border-color: var(--accent); background: rgba(0, 212, 255, .1); }

.tl { border-top: 1px solid var(--line2); }
.tl-row {
  display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 22px;
  padding: 15px 0; border-bottom: 1px solid var(--line);
  border-left: 2px solid transparent; padding-left: 12px; margin-left: -14px;
  transition: border-color .16s ease, background .16s ease;
}
.tl-row:hover { border-left-color: var(--accent); background: rgba(19, 39, 71, .38); }
.tl-p { font: 500 12.5px/1.5 var(--mono); color: var(--gold); letter-spacing: .04em; }
.tl-r b { font-size: 15px; color: var(--text); font-weight: 600; }
.tl-o { display: block; font: 400 12.5px/1.5 var(--mono); color: var(--text2); margin-top: 2px; }
.tl-n { display: block; font-size: 13.5px; color: var(--text3); margin-top: 5px; }

.edu { margin: 26px 0 0; padding: 0; list-style: none; }
.edu li {
  padding: 9px 0 9px 18px; position: relative;
  border-bottom: 1px solid var(--line); font-size: 14px; color: var(--text2);
}
.edu li::before {
  content: ""; position: absolute; left: 0; top: 17px;
  width: 6px; height: 6px; background: var(--gold); transform: rotate(45deg);
}

/* ------------------------------------------------------------------- contact */
.contact-in { max-width: 780px; }
#contact .hero-cta { margin-top: 4px; }

.foot { padding: 34px 0 46px; color: var(--text3); }
.foot p { font: 400 12.5px/1.7 var(--mono); color: var(--text3); max-width: 90ch; }
.foot-n { margin-top: 10px; color: var(--text2); }

/* -------------------------------------------------------------------- mobile */
@media (max-width: 900px) {
  .w { padding: 0 18px; }
  .two, .case-body { grid-template-columns: 1fr; gap: 26px; }
  .case-col--side { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 18px; }
  .pillars { grid-template-columns: 1fr; }
  .prods { grid-template-columns: 1fr; }
  .sec { padding: 58px 0; }
  .hero { padding: 54px 0 48px; }
  .top-in { height: auto; flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px 0; }
  .nav { gap: 2px; }
  .nav a { padding: 6px 7px; }
  .case-ix { font-size: 26px; top: 14px; right: 16px; }
  .case { padding: 20px 18px 22px; }
  .tl-row { grid-template-columns: 1fr; gap: 6px; }
  .stat { border-right: 0; }
  .fl-arrow { display: none; }
  .flow-strip { gap: 8px; }
  .depth { padding: 18px 16px 6px; }
  .dp-row { grid-template-columns: 1fr 72px; grid-template-areas: "label years" "track track" "note note"; gap: 8px 12px; }
  .dp-track { height: 7px; }
  .regs { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
