/* ==========================================================================
   Сборка — стили лендинга
   Палитра: холодная бумага + индиго-чернила + кобальт.
   ========================================================================== */

:root {
  --paper: #EEF0F3;
  --paper-2: #E3E6EC;
  --surface: #FFFFFF;
  --ink: #191B33;
  --ink-2: #24274A;
  --ink-3: #34385E;
  --muted: #5B6077;
  --muted-dark: #A9AECB;
  --line: #CBD0DB;
  --cobalt: #3346F0;
  --cobalt-ink: #2433C9;
  --cobalt-l: #8C98FF;
  --tint: #DCE0FF;
  --ok: #1F9D6B;
  --err: #C93A3A;

  --font: "Geologica", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --maxw: 1280px;
  --gutter: clamp(16px, 4vw, 48px);
  --header-h: 72px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  interpolate-size: allow-keywords;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }

h1, h2, h3 {
  margin: 0;
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -.028em;
  font-variation-settings: "SHRP" 40;
  text-wrap: balance;
}

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px;
  text-decoration: none; transition: top .2s;
}
.skip:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 11px 20px;
  border: 1.5px solid transparent;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-lg { min-height: 56px; padding: 15px 26px; font-size: 1.0625rem; border-radius: 12px; }
.btn-block { width: 100%; }

.btn-primary { background: var(--cobalt); color: #fff; }
.btn-primary:hover { background: var(--cobalt-ink); }

.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

.btn-light { background: var(--paper); color: var(--ink); }
.btn-light:hover { background: #fff; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--cobalt); font-weight: 600; text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
}

/* Фон и размытие — на псевдоэлементе, а не на самой шапке:
   backdrop-filter на шапке сделал бы её контейнером для position: fixed,
   и мобильное меню схлопнулось бы до высоты шапки. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 var(--line);
  transition: opacity .3s;
}
.site-header.is-scrolled::before { opacity: 1; }
.site-header.nav-open::before { opacity: 1; background: var(--paper); }

.header-row {
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -.04em;
  text-decoration: none;
  color: var(--ink);
  font-variation-settings: "SHRP" 80;
}
.logo--light { color: var(--paper); }

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 26px;
}
.nav a:not(.btn) {
  text-decoration: none;
  font-size: .95rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: color .2s;
}
.nav a:not(.btn):hover { color: var(--cobalt); }
.nav-cta { display: none; }

.burger {
  display: none;
  margin-left: auto;
  width: 46px; height: 46px;
  align-items: center; justify-content: center;
  background: none; border: 1.5px solid var(--ink); border-radius: 10px; cursor: pointer;
}
.burger-lines { position: relative; width: 18px; height: 10px; }
.burger-lines i {
  position: absolute; left: 0; right: 0; height: 2px; background: var(--ink); border-radius: 2px;
  transition: transform .3s var(--ease-out), top .3s var(--ease-out);
}
.burger-lines i:first-child { top: 0; }
.burger-lines i:last-child { top: 8px; }
.nav-open .burger-lines i:first-child { top: 4px; transform: rotate(45deg); }
.nav-open .burger-lines i:last-child { top: 4px; transform: rotate(-45deg); }

@media (max-width: 1080px) {
  .nav { gap: 18px; }
}

@media (max-width: 960px) {
  .burger { display: inline-flex; }
  .header-cta { display: none; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px var(--gutter) 32px;
    background: var(--paper);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .25s, transform .35s var(--ease-out), visibility 0s .35s;
  }
  .nav a:not(.btn) {
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -.02em;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
  }
  .nav-cta { display: inline-flex; margin-top: 28px; min-height: 56px; }
  .nav-open .nav {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .25s, transform .35s var(--ease-out), visibility 0s;
  }
}

/* ---------- Sections ---------- */

.section { padding-block: clamp(80px, 11vw, 150px); }
.section--compact { padding-block: clamp(64px, 8vw, 110px); }
.section--tint { background: var(--paper-2); }
.section--dark { background: var(--ink); color: var(--paper); }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 20px 64px;
  align-items: end;
  margin-bottom: clamp(40px, 6vw, 72px);
}
.section-head h2,
.process-head h2,
.faq-grid > h2,
.contact-intro h2 {
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
}
.section-head p {
  color: var(--muted);
  font-size: 1.125rem;
  max-width: 46ch;
}
.section--dark .section-head p { color: var(--muted-dark); }

@media (max-width: 820px) {
  .section-head { grid-template-columns: 1fr; }
}

/* ---------- Hero ---------- */

.hero { position: relative; }

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
  min-height: 100svh;
  padding-top: calc(var(--header-h) + 24px);
  padding-bottom: 32px;
}

@media (min-width: 961px) and (prefers-reduced-motion: no-preference) {
  .hero { height: 185vh; }
  .hero-inner {
    position: sticky;
    top: 0;
    height: 100svh;
    min-height: 560px;
  }
}

.hero h1 {
  font-size: clamp(2.6rem, 5.3vw, 5.1rem);
  line-height: 1;
  letter-spacing: -.04em;
  font-weight: 760;
  font-variation-settings: "SHRP" 70;
  max-width: 12ch;
}

.hero-lead {
  margin-top: 28px;
  font-size: clamp(1.0625rem, 1.35vw, 1.25rem);
  color: var(--muted);
  max-width: 44ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.hero-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  font-size: .95rem;
  color: var(--muted);
}

.pulse {
  position: relative;
  flex: none;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ok);
}
.pulse::after {
  content: "";
  position: absolute; inset: -5px;
  border-radius: 50%;
  border: 2px solid var(--ok);
  opacity: 0;
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(.5); opacity: .8; }
  100% { transform: scale(1.4); opacity: 0; }
}

.hero-visual {
  position: relative;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-visual .stack-host {
  width: 100%;
  height: 100%;
  max-height: calc(100svh - var(--header-h) - 40px);
}
.hero-visual .stack { width: 100%; height: 100%; }

@media (max-width: 960px) {
  .hero-inner {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: calc(var(--header-h) + 40px);
  }
  .hero h1 { max-width: 14ch; }
  .hero-visual .stack-host { max-height: none; height: auto; }
  .hero-visual .stack { height: auto; max-height: 78svh; }
}

/* ---------- Isometric stack (hero, calculator, avatars) ---------- */

.stack { overflow: visible; font-family: var(--font); user-select: none; }

.stack .layer {
  transform: translateY(calc(var(--i) * var(--gap) * 1px));
  transition: opacity .35s;
}
.stack .stack-root { transform: translateY(calc((var(--gmax) - var(--gap)) * 2px)); }
.stack .flat * { vector-effect: non-scaling-stroke; }

.stack .face-top { fill: #fff; stroke: var(--ink); stroke-width: 1.25; transition: fill .25s, stroke .25s; }
.stack .face-l { fill: #D3D8E6; stroke: var(--ink); stroke-width: 1.25; stroke-linejoin: round; transition: fill .25s, stroke .25s; }
.stack .face-r { fill: #AEB5CC; stroke: var(--ink); stroke-width: 1.25; stroke-linejoin: round; transition: fill .25s, stroke .25s; }

.stack .f-ink { fill: var(--ink); }
.stack .f-ink2 { fill: var(--ink-2); }
.stack .f-cobalt { fill: var(--cobalt); }
.stack .f-tint { fill: var(--tint); }
.stack .f-paper { fill: var(--paper); }
.stack .f-card { fill: #fff; stroke: var(--line); stroke-width: 1; }
.stack .s-dash { fill: none; stroke: var(--cobalt); stroke-width: 1.4; stroke-dasharray: 4 3; }
.stack .s-ink { fill: none; stroke: var(--ink); stroke-width: 1.4; }
.stack .s-cobalt { fill: none; stroke: var(--cobalt); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.stack .bar { fill: var(--tint); stroke: var(--cobalt); stroke-width: 1.2; }
.stack .led { fill: #4BE3A4; }
.stack .led--b { fill: var(--cobalt-l); }

.stack .callout { opacity: var(--lab, 1); transition: opacity .2s; cursor: pointer; }
.stack .callout:focus { outline: none; }
.stack .callout line { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 4; }
.stack .callout circle { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; transition: fill .2s, stroke .2s; }
.stack .callout .code { font-size: 17px; font-weight: 700; fill: var(--ink); transition: fill .2s; }
.stack .callout .name { font-size: 20px; font-weight: 600; fill: var(--ink); letter-spacing: -.01em; }

.stack.has-hot .layer:not(.is-hot) { opacity: .35; }
.stack .layer.is-hot .face-top { fill: var(--tint); stroke: var(--cobalt); }
.stack .layer.is-hot .callout circle,
.stack .callout:focus-visible circle { fill: var(--cobalt); stroke: var(--cobalt); }
.stack .layer.is-hot .callout .code,
.stack .callout:focus-visible .code { fill: #fff; }
.stack .layer.is-hot .callout .name { fill: var(--cobalt); }

.stack .badge { pointer-events: none; opacity: var(--built, 0); transform: translateY(calc((1 - var(--built, 0)) * 14px)); }
.stack .badge rect { fill: var(--ink); }
.stack .badge text { fill: var(--paper); font-size: 17px; font-weight: 600; }
.stack .badge circle { fill: #4BE3A4; }

/* Hero: слои падают по одному снизу вверх */
.stack--hero .layer-body {
  animation: drop .9s var(--ease-out) both;
  animation-delay: calc(var(--d) * 140ms + 200ms);
}
@keyframes drop {
  from { transform: translateY(-110px); opacity: 0; }
  60% { opacity: 1; }
}
.stack--hero .led { animation: blink 2.6s infinite; animation-delay: var(--ld, 0s); }
@keyframes blink {
  0%, 72% { opacity: 1; }
  76%, 94% { opacity: .2; }
}

/* Calculator: невыбранные слои — пунктирный контур */
.stack--calc .layer-body { transition: opacity .45s, transform .55s var(--ease-out); }
.stack--calc .flat-content { transition: opacity .3s; }
.stack--calc .layer.is-off .layer-body { opacity: .5; transform: translateX(22px); }
.stack--calc .layer.is-off .flat-content { opacity: 0; }
.stack--calc .layer.is-off :is(.face-top, .face-l, .face-r) {
  fill: transparent;
  stroke: #6E7399;
  stroke-dasharray: 5 5;
}
.section--dark .stack .face-top,
.section--dark .stack .face-l,
.section--dark .stack .face-r { stroke: var(--ink); }

/* ---------- Services (parts) ---------- */

.parts { border-top: 1.5px solid var(--ink); }

.part {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 280px;
  gap: 24px 48px;
  padding-block: 44px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 8px);
}

.part-code {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  font-size: 1.75rem;
  font-weight: 700;
  font-variation-settings: "SHRP" 80;
  transition: background-color .3s, color .3s, border-color .3s;
}
.part:target .part-code,
.part.is-flash .part-code {
  background: var(--cobalt); border-color: var(--cobalt); color: #fff;
}

.part h3 { font-size: clamp(1.5rem, 2.5vw, 2.1rem); }
.part-desc { margin-top: 12px; color: var(--muted); max-width: 52ch; font-size: 1.0625rem; }

.part-list {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 32px;
}
.part-list li { position: relative; padding-left: 22px; }
.part-list li::before {
  content: ""; position: absolute; left: 0; top: .78em;
  width: 10px; height: 2px; background: var(--cobalt);
}

.part-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}
.part-result { font-size: .95rem; color: var(--muted); }
.part-result b { color: var(--ink); font-weight: 600; }
.part-price { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.part-time { color: var(--muted); font-size: .95rem; margin-top: 4px; }

@media (max-width: 1080px) {
  .part { grid-template-columns: 72px minmax(0, 1fr); }
  .part-aside {
    grid-column: 2;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 32px;
    padding-top: 8px;
  }
  .part-result { flex: 1 1 100%; max-width: 60ch; }
}

@media (max-width: 600px) {
  .part { grid-template-columns: 1fr; padding-block: 36px; gap: 18px; }
  .part-code { width: 52px; height: 52px; font-size: 1.4rem; border-radius: 12px; }
  .part-aside { grid-column: auto; }
  .part-aside .btn { width: 100%; }
  .part-list { grid-template-columns: 1fr; }
}

/* ---------- What we build ---------- */

.work {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.work > li {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 32px 28px 28px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-height: 270px;
}
.work h3 { font-size: 1.5rem; }
.work p { color: var(--muted); }
.work-time { margin-top: auto; font-weight: 600; color: var(--ink) !important; }

.kit { display: flex; gap: 6px; margin-top: 8px; }
.kit span {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 7px;
  font-size: .8rem; font-weight: 700;
  border: 1.5px dashed #A3A9BC;
  color: #8F95AA;
}
.kit span.on { background: var(--ink); border: 1.5px solid var(--ink); color: var(--paper); }
.kit--any span { border-style: solid; border-color: var(--cobalt); color: var(--cobalt); }

@media (max-width: 960px) { .work { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .work { grid-template-columns: 1fr; }
  .work > li { min-height: 0; padding: 28px 20px; }
}

/* ---------- Calculator ---------- */

.calc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}

.calc-controls fieldset + fieldset { margin-top: 40px; }
.calc-controls legend {
  font-size: .95rem;
  font-weight: 600;
  color: var(--muted-dark);
  margin-bottom: 14px;
}

.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg-btn,
.seg label span {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 16px;
  border: 1.5px solid var(--ink-3);
  border-radius: 999px;
  background: transparent;
  color: var(--paper);
  font-weight: 500;
  font-size: .95rem;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.seg-btn:hover,
.seg label:hover span { border-color: var(--muted-dark); }
.seg input:checked + span { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.seg input:focus-visible + span { outline: 3px solid var(--cobalt-l); outline-offset: 2px; }
.seg-btn.is-active { border-color: var(--cobalt-l); color: var(--cobalt-l); }

.toggles { border-top: 1px solid var(--ink-3); }
.toggle {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 46px;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--ink-3);
  cursor: pointer;
  position: relative;
}
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-code {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1.5px solid var(--ink-3);
  font-weight: 700;
  transition: background-color .25s, border-color .25s;
}
.toggle-name { font-weight: 600; font-size: 1.0625rem; line-height: 1.3; }
.toggle-short { display: block; color: var(--muted-dark); font-size: .9rem; font-weight: 400; margin-top: 2px; }
.toggle-price { color: var(--muted-dark); font-size: .95rem; white-space: nowrap; }
.switch {
  width: 46px; height: 26px;
  border-radius: 999px;
  background: var(--ink-3);
  position: relative;
  transition: background-color .25s;
}
.switch::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--paper);
  transition: transform .3s var(--ease-out);
}
.toggle input:checked ~ .switch { background: var(--cobalt); }
.toggle input:checked ~ .switch::after { transform: translateX(20px); }
.toggle input:checked ~ .toggle-code { background: var(--cobalt); border-color: var(--cobalt); }
.toggle input:focus-visible ~ .switch { outline: 3px solid var(--cobalt-l); outline-offset: 3px; }

.calc-result {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  background: var(--ink-2);
  border: 1px solid var(--ink-3);
  border-radius: 24px;
  padding: clamp(20px, 3vw, 32px);
}
.calc-stack { max-width: 210px; margin: 0 auto 8px; }
.calc-stack .stack { width: 100%; height: auto; }

.calc-out {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
  margin: 0 0 24px;
  padding-top: 20px;
  border-top: 1px solid var(--ink-3);
}
.calc-row { grid-column: 1 / -1; }
.calc-row--half { grid-column: auto; }
.calc-out dt { color: var(--muted-dark); font-size: .9rem; margin-bottom: 6px; }
.calc-out dd { margin: 0; }
.calc-big {
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.who { display: flex; flex-wrap: wrap; gap: 8px; min-height: 36px; }
.who span {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--ink-3);
  font-size: .9rem;
  font-weight: 500;
  animation: pop .35s var(--ease-out);
}
.who span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #4BE3A4; }
.who em { font-style: normal; color: var(--muted-dark); font-size: .95rem; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }

.calc-hint { margin-top: 14px; font-size: .875rem; color: var(--muted-dark); text-align: center; }

/* Разбивка бюджета по этапам */
.calc-stages { list-style: none; margin: 0; padding: 0; }
.calc-stages li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 16px;
  padding: 7px 0;
  border-top: 1px solid var(--ink-3);
}
.calc-stages li:first-child { border-top: 0; padding-top: 0; }
.calc-stages b { font-weight: 500; }
.calc-stages em { font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Блок результата закреплён при прокрутке: на невысоких экранах убираем декоративную
   иллюстрацию, чтобы кнопка «Перенести в заявку» не уходила за нижний край */
@media (min-width: 961px) and (max-height: 1100px) {
  .calc-stack { display: none; }
  .calc-out { padding-top: 0; border-top: 0; }
}

.calc-first {
  margin: -4px 0 16px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--ink-3);
  font-size: .95rem;
  line-height: 1.45;
}
.calc-first b { color: #fff; font-weight: 700; white-space: nowrap; }

@media (max-width: 960px) {
  .calc-grid { grid-template-columns: 1fr; }
  .calc-result { position: relative; top: 0; }
}
@media (max-width: 480px) {
  .toggle { grid-template-columns: 40px minmax(0, 1fr) 46px; gap: 12px; }
  .toggle-code { width: 40px; height: 40px; }
  .toggle-price { grid-column: 2; grid-row: 2; margin-top: -8px; }
  .switch { grid-column: 3; grid-row: 1 / span 2; }
}

/* ---------- Process ---------- */

.process-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.process-head {
  position: sticky;
  top: calc(var(--header-h) + 40px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}
.process-head p { color: var(--muted); font-size: 1.125rem; max-width: 38ch; }

.steps { position: relative; --p: 0; }
.steps::before,
.steps::after {
  content: "";
  position: absolute;
  left: 27px;
  top: 28px;
  width: 2px;
  background: var(--line);
  bottom: 28px;
}
/* синяя линия прогресса: высота из --p, которую задаёт main.js при прокрутке */
.steps::after {
  bottom: auto;
  height: calc(var(--p) * (100% - 56px));
  background: var(--cobalt);
  z-index: 1;
}

.step {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 8px 28px;
  padding-block: 24px;
}
.step:first-of-type { padding-top: 0; }
.step-num {
  position: relative;
  z-index: 2;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--paper);
  font-weight: 700;
  font-size: 1.2rem;
  transition: background-color .35s, border-color .35s, color .35s;
}
.step.is-reached .step-num { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.step h3 { font-size: 1.5rem; margin-top: 12px; }
.step p { margin-top: 8px; color: var(--muted); max-width: 52ch; }
.step-time {
  margin-top: 16px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}

@media (max-width: 960px) {
  .process-grid { grid-template-columns: 1fr; }
  .process-head { position: static; }
}
@media (max-width: 600px) {
  .step { grid-template-columns: 56px minmax(0, 1fr); }
  .step-time { grid-column: 2; margin-top: 0; }
}

/* ---------- Team ---------- */

.team {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
}
.person {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 24px;
  padding: 16px 16px 28px;
}
.person-photo {
  aspect-ratio: 5 / 4;
  border-radius: 14px;
  background: var(--paper);
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 24px;
}
.person-photo img { width: 100%; height: 100%; object-fit: cover; }
.person-photo .stack { width: 62%; height: auto; }
.person h3, .person-text, .person-kit { margin-inline: 12px; }
.person h3 { font-size: 1.6rem; }
.person-text { color: var(--muted); margin-top: 12px; flex: 1; }
.person-kit { display: flex; gap: 6px; margin-top: 20px; }
.person-kit span,
.code-chip {
  width: 30px; height: 30px;
  display: inline-grid; place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: .85rem;
  font-weight: 700;
}

.principles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  margin-top: clamp(56px, 7vw, 96px);
}
.principles li { border-top: 2px solid var(--ink); padding-top: 20px; }
.principles h3 { font-size: 1.2rem; letter-spacing: -.015em; line-height: 1.2; }
.principles p { color: var(--muted); margin-top: 10px; font-size: 1rem; }

@media (max-width: 1080px) { .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .team { grid-template-columns: 1fr; max-width: 520px; }
}
@media (max-width: 560px) { .principles { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- Tools ---------- */

.tools { margin: 0; border-top: 1.5px solid var(--ink); }
.tools-row {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 12px 32px;
  padding-block: 20px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.tools dt { display: flex; align-items: center; gap: 14px; font-weight: 600; font-size: 1.125rem; }
.tools dd { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tools dd span {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: .95rem;
}
@media (max-width: 700px) { .tools-row { grid-template-columns: 1fr; } }

/* ---------- Pricing ---------- */

.formats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
}
.format {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(24px, 3vw, 36px);
  border: 1.5px solid var(--ink);
  border-radius: 24px;
}
.format h3 { font-size: 1.5rem; }
.format-price { font-size: 1.25rem; font-weight: 600; color: var(--cobalt); }
.format > p:not(.format-price) { color: var(--muted); }
.format-list {
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}
.format-list li { position: relative; padding-left: 26px; }
.format-list li::before {
  content: "";
  position: absolute; left: 2px; top: .45em;
  width: 12px; height: 7px;
  border-left: 2px solid var(--cobalt);
  border-bottom: 2px solid var(--cobalt);
  transform: rotate(-45deg);
}
@media (max-width: 900px) { .formats { grid-template-columns: 1fr; max-width: 560px; } }

/* ---------- FAQ ---------- */

.faq-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.faq { border-top: 1.5px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 22px 0;
  list-style: none;
  cursor: pointer;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--cobalt); }
.faq-icon {
  position: relative;
  flex: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  transition: transform .35s var(--ease-out), background-color .2s;
}
.faq-icon::before,
.faq-icon::after {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 12px; height: 2px;
  margin: -1px 0 0 -6px;
  background: currentColor;
}
.faq-icon::after { transform: rotate(90deg); }
.faq details[open] .faq-icon { transform: rotate(45deg); }
.faq details::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size .4s var(--ease-out), content-visibility .4s allow-discrete;
}
.faq details[open]::details-content { block-size: auto; }
.faq-body { padding: 0 56px 24px 0; color: var(--muted); max-width: 66ch; }
.faq-body a { color: var(--cobalt); }

@media (max-width: 900px) {
  .faq-grid { grid-template-columns: 1fr; }
  .faq-body { padding-right: 0; }
}

/* ---------- Contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.contact-intro > p { margin-top: 20px; color: var(--muted); font-size: 1.125rem; max-width: 38ch; }


.form-wrap { position: relative; }
.lead-form,
.form-done {
  background: var(--surface);
  border-radius: 28px;
  padding: clamp(22px, 4vw, 48px);
}

.from-calc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--tint);
  font-size: .95rem;
  animation: pop .4s var(--ease-out);
}
.from-calc[hidden] { display: none; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 20px;
}
.span-2 { grid-column: 1 / -1; }
.field { display: grid; gap: 8px; align-content: start; }
.lbl { font-weight: 600; font-size: .95rem; margin-bottom: 0; }
fieldset.field > legend { margin-bottom: 10px; }

.lead-form input[type="text"],
.lead-form select,
.lead-form textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid transparent;
  border-radius: 12px;
  padding: 13px 16px;
  min-height: 52px;
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.lead-form textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.lead-form select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23191B33' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  cursor: pointer;
}
.lead-form ::placeholder { color: #8A8FA3; }
.lead-form input[type="text"]:hover,
.lead-form select:hover,
.lead-form textarea:hover { border-color: var(--line); }
.lead-form input[type="text"]:focus,
.lead-form select:focus,
.lead-form textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--cobalt);
  box-shadow: 0 0 0 4px var(--tint);
}
.field.has-error input[type="text"] { border-color: var(--err); background: #fff; }

.err { color: var(--err); font-size: .875rem; }
.err:empty { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  font-size: .95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.chip:hover span { border-color: var(--ink); }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip input:focus-visible + span { outline: 3px solid var(--cobalt); outline-offset: 2px; }

.consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: .9rem;
  color: var(--muted);
  cursor: pointer;
}
.consent input {
  flex: none;
  width: 20px; height: 20px;
  margin: 1px 0 0;
  accent-color: var(--cobalt);
  cursor: pointer;
}
.consent a { color: var(--ink); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-top: 32px;
}
.form-status { font-size: .95rem; color: var(--muted); }
.form-status.is-error { color: var(--err); }
.form-status a { color: inherit; }

[data-submit] { position: relative; }
.spinner {
  display: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.is-sending .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-done {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  min-height: 420px;
  justify-content: center;
}
.form-done[hidden] { display: none; }
.form-done:focus { outline: none; }
.form-done h3 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.form-done p { color: var(--muted); font-size: 1.125rem; max-width: 40ch; }
.form-done b { color: var(--ink); }
.done-mark { width: 64px; height: 64px; margin-bottom: 8px; }
.done-mark circle {
  fill: none; stroke: var(--ok); stroke-width: 3;
  stroke-dasharray: 189; stroke-dashoffset: 189;
  animation: draw .7s var(--ease-out) forwards;
}
.done-mark path {
  fill: none; stroke: var(--ok); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 40; stroke-dashoffset: 40;
  animation: draw .45s .45s var(--ease-out) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

@media (max-width: 960px) { .contact-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .form-foot .btn { width: 100%; }
  .lead-form, .form-done { border-radius: 20px; }
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: var(--muted-dark);
  padding-block: 56px 40px;
}
.footer-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px 48px;
  align-items: start;
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: center; }
.footer-nav a, .footer-meta a { text-decoration: none; }
.footer-nav a:hover, .footer-meta a:hover { color: var(--paper); }
.footer-meta { display: grid; gap: 6px; text-align: right; font-size: .9rem; }
@media (max-width: 800px) {
  .footer-row { grid-template-columns: 1fr; }
  .footer-nav { justify-content: flex-start; }
  .footer-meta { text-align: left; }
}

/* ---------- Privacy page ---------- */

.doc { padding-top: calc(var(--header-h) + 56px); padding-bottom: 120px; }
.doc-body { max-width: 72ch; }
.doc h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: 16px; }
.doc h2 { font-size: 1.5rem; margin: 48px 0 14px; }
.doc p, .doc li { color: var(--ink-2); }
.doc p + p { margin-top: 12px; }
.doc ul { list-style: disc; padding-left: 1.4em; display: grid; gap: 6px; margin-top: 10px; }
.doc .doc-meta { color: var(--muted); }
.doc-note {
  margin: 28px 0 8px;
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--tint);
  font-size: .95rem;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
