/* Quadrum — стили сайта.
   Весь сайт светлый; ритм задают оттенки фона (--tint, --mist) и тонкие линии.
   Движение по скроллу делает anim.js (GSAP). Здесь только hover/focus-переходы,
   состояния шапки и появление строк каталога. */

/* ── Токены ───────────────────────────────────────── */

:root {
  --bg: #F4F6F6;
  --surface: #FFFFFF;
  --fg: #0E1C27;
  --fg-2: #4A5C6B;
  --fg-3: #6F818D;         /* только иконки и графика: 3.7:1 на --bg */
  --line: #D5DFE4;
  --line-strong: #A9BCC6;
  --mist: #DCE9EE;
  --mist-2: #BFD6E0;
  --tint: #EAF1F4;
  --accent: #A8236A;
  --accent-2: #8E1C59;
  --on-accent: #FFFFFF;
  --danger: #B3261E;
  --joint: #F4F6F6;        /* разрезы в логотипе = цвет фона под ним */

  --font: "Geologica", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1280px;
  --gutter: clamp(16px, 4vw, 48px);
  --header-h: 72px;
  --r-ctl: 6px;
  --r-card: 16px;
  --r-pill: 999px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 24%, transparent);

  color-scheme: light;
}

/* ── База ─────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  interpolate-size: allow-keywords;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-weight: 380;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }

h1, h2, h3 { margin: 0; font-weight: 580; letter-spacing: -0.02em; text-wrap: balance; }
p, figure, dl, dd { margin: 0; }
p { text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

::selection { background: color-mix(in srgb, var(--accent) 20%, transparent); }

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

.sr-only {
  position: absolute !important; 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: 12px; top: -64px; z-index: 100;
  padding: 10px 16px; border-radius: var(--r-ctl);
  background: var(--fg); color: var(--bg); text-decoration: none;
}
.skip:focus { top: 12px; color: var(--bg); }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.nowrap { white-space: nowrap; }

/* ── Кнопки ───────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  border: 1.5px solid transparent; border-radius: var(--r-ctl);
  font-size: 0.9375rem; font-weight: 500; line-height: 1.2; letter-spacing: -0.005em;
  text-align: center; text-decoration: none; white-space: nowrap;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.btn-lg { min-height: 54px; padding: 14px 28px; font-size: 1rem; }
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: var(--on-accent); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-2); color: var(--on-accent); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--fg); }
.btn-ghost:hover { border-color: var(--fg); color: var(--fg); }
.btn[disabled] { opacity: .6; cursor: progress; }

.link-btn {
  padding: 4px 0; background: none; border: 0;
  color: var(--fg-2); font-size: 0.9375rem;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  transition: color .2s var(--ease);
}
.link-btn:hover { color: var(--accent); }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  background: transparent; color: var(--fg);
  border: 1.5px solid var(--line); border-radius: var(--r-ctl);
  transition: border-color .2s var(--ease);
}
.icon-btn:hover { border-color: var(--fg); }
.icon-btn:disabled { opacity: .35; cursor: default; border-color: var(--line); }
.icon-btn svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* ── Индикатор прочтения ──────────────────────────── */

.progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  height: 3px; pointer-events: none;
}
.progress span {
  display: block; height: 100%;
  background: var(--accent);
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
}

/* ── Шапка ────────────────────────────────────────── */

.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  color: var(--fg);
  background-color: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color .3s var(--ease), border-color .3s var(--ease);
}
.site-header.is-scrolled {
  background-color: rgba(244, 246, 246, .94);
  border-bottom-color: var(--line);
}
/* Открытое мобильное меню — сплошной фон, чтобы строка шапки не просвечивала */
.site-header:has(.mobile-menu:not([hidden])) {
  background-color: var(--bg);
  border-bottom-color: var(--line);
}
/* Без JS шапку никто не переключит — сразу сплошной фон */
html:not(.js) .site-header { background-color: rgba(244, 246, 246, .94); border-bottom-color: var(--line); }

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

.logo {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--fg); text-decoration: none;
}
.logo:hover { color: var(--fg); }
.logo-mark { width: 26px; height: 26px; flex: none; }
.lm-arch { fill: currentColor; }
.lm-key { fill: var(--accent); }
.lm-joint { fill: none; stroke: var(--joint); stroke-width: 1.2; }
.logo-word { font-size: 1.3125rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }

.nav { display: flex; gap: 32px; margin-left: auto; }
.nav a {
  position: relative; padding: 6px 0;
  color: var(--fg-2); font-size: 0.9375rem; text-decoration: none;
  transition: color .2s var(--ease);
}
.nav a:hover, .nav a.is-active { color: var(--fg); }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .25s var(--ease);
}
.nav a.is-active::after { transform: scaleX(1); }

.header-cta { min-height: 40px; padding: 8px 16px; }
.menu-back { display: none; }

.menu-toggle {
  display: none; align-items: center; gap: 8px; margin-left: auto;
  min-height: 44px; padding: 8px 4px 8px 12px;
  background: none; border: 0; color: var(--fg); font-size: 0.9375rem;
}
.menu-toggle svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.menu-toggle path { transition: transform .2s var(--ease); transform-origin: 12px 12px; }
.menu-toggle[aria-expanded="true"] .mt-a { transform: translateY(4px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .mt-b { transform: translateY(-4px) rotate(-45deg); }

.mobile-menu {
  height: calc(100vh - var(--header-h));
  height: calc(100dvh - var(--header-h));
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.mobile-menu nav { display: flex; flex-direction: column; padding-top: 12px; padding-bottom: 32px; }
.mobile-menu a:not(.btn) {
  padding: 16px 0; border-bottom: 1px solid var(--line);
  font-size: 1.375rem; font-weight: 500; letter-spacing: -0.015em; text-decoration: none;
}
.mobile-menu .btn { margin-top: 28px; min-height: 56px; font-size: 1.0625rem; }

/* ── Секции ───────────────────────────────────────── */

.hero, .industries, .section, .site-footer { background: var(--bg); color: var(--fg); }

.section { padding: clamp(88px, 11vw, 168px) 0; }

/* Тонированные секции переопределяют --bg: всё, что «вырезает» фон
   (кружки шагов, текст на тёмных кнопках), берёт правильный оттенок. */
.section-tint {
  --bg: var(--tint);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
main > .section-tint:last-child { border-bottom: 0; }

.section-head { max-width: 820px; margin-bottom: clamp(48px, 6vw, 88px); }
.section-head h2, .process-head h2, .tech-title {
  font-size: clamp(2.25rem, 1.25rem + 3.4vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
}
.lede {
  margin-top: 20px; max-width: 58ch;
  color: var(--fg-2); font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem);
}
.lede a { color: var(--fg); }
.lede a:hover { color: var(--accent); }

/* Хуки для anim.js: маска заголовка и пословная анимация.
   Обёртки создаёт скрипт; трансформации не работают на inline-элементах. */
.reveal-title span { display: block; }
html.anim-ready .reveal-title { overflow: hidden; padding-bottom: .12em; margin-bottom: -.12em; }
.contact-title > span, .contact-title .w { display: inline-block; }

/* ── Первый экран ─────────────────────────────────── */

.hero {
  position: relative;
  display: flex; align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--header-h) + clamp(24px, 5vh, 64px)) 0 clamp(48px, 8vh, 96px);
  overflow: hidden;
}
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(40px, 5vw, 96px); align-items: center;
}
@media (min-width: 1200px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.hero-title {
  font-size: clamp(2.6rem, 1.2rem + 3.8vw, 4.25rem);
  line-height: .98;
  letter-spacing: -0.04em;
  font-weight: 600;
}
.hero-lede {
  margin-top: clamp(20px, 3vh, 32px); max-width: 54ch;
  color: var(--fg-2); font-size: clamp(1.0625rem, .95rem + .45vw, 1.25rem);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(28px, 4vh, 40px); }

.hero-quick { margin-top: clamp(36px, 6vh, 64px); }
.hero-quick-label { margin-bottom: 12px; color: var(--fg-2); font-size: 0.875rem; }
.hero-quick-list { display: flex; flex-wrap: wrap; gap: 6px; }
.hero-quick-list a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  color: var(--fg); font-size: 0.9375rem; line-height: 1.2; text-decoration: none;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.hero-quick-list a:hover { border-color: var(--accent); color: var(--accent); }

.hero-figure { width: 100%; max-width: 680px; justify-self: end; }

/* Схема ИТ-ландшафта. Трансформации узлов, связей и пакетов ставит anim.js —
   здесь только цвет, никаких transform/transform-origin. */
.map { width: 100%; height: auto; overflow: visible; }

.map-node { cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.map-node rect {
  fill: var(--surface); stroke: var(--fg); stroke-width: 1.5;
  transition: fill .25s var(--ease), stroke .25s var(--ease), stroke-width .25s var(--ease);
}
.map-node text { text-anchor: middle; pointer-events: none; user-select: none; -webkit-user-select: none; }
.mn-label { fill: var(--fg); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.mn-cap { fill: var(--fg-2); font-size: 12px; font-weight: 400; }
.map-node:hover rect,
.map-node:focus-visible rect { fill: var(--mist); stroke: var(--accent); }
.map-node:focus-visible rect { stroke-width: 2.5; }

.map-node.is-ai rect { fill: var(--accent); stroke: var(--accent); }
.map-node.is-ai .mn-label, .map-node.is-ai .mn-cap { fill: var(--on-accent); }
.map-node.is-ai:hover rect,
.map-node.is-ai:focus-visible rect { fill: var(--accent-2); stroke: var(--accent-2); }
.map-node.is-ai:focus-visible rect { stroke: var(--fg); }

.map-bus rect { fill: var(--mist); }
.map-bus .mn-label { font-size: 14px; font-weight: 560; }
.map-bus:hover rect, .map-bus:focus-visible rect { fill: var(--mist-2); }

.map-link { fill: none; stroke: var(--line-strong); stroke-width: 1.5; transition: stroke .25s var(--ease), stroke-width .25s var(--ease); }
.map-link.is-hot { stroke: var(--accent); stroke-width: 2.5; }
.map-flow { fill: none; stroke: var(--line-strong); stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 2 7; pointer-events: none; }

/* Пакеты данных: невидимы, пока их не покажет anim.js */
.map-packets { opacity: 0; pointer-events: none; }
.map-packets circle { fill: var(--accent); }

.map-hint {
  min-height: 3em; margin-top: 16px;
  color: var(--fg-2); font-size: 0.875rem; line-height: 1.5; text-align: center;
}

/* ── Отрасли: бегущие строки ──────────────────────── */

.industries { padding: clamp(64px, 9vw, 136px) 0; overflow: hidden; }

.marquee-row { overflow: hidden; }
@supports (overflow: clip) {
  /* clip по горизонтали не обрезает выносные элементы букв по вертикали */
  .marquee-row { overflow: visible; overflow-x: clip; }
}
.marquee-track {
  display: flex; flex-wrap: nowrap; width: max-content;
  white-space: nowrap; will-change: transform;
}
/* Отступы только margin (без gap): обе половины дорожки одинаковой ширины,
   сдвиг на -50% совпадает с началом копии. */
.industries .marquee-track {
  align-items: baseline;
  font-size: clamp(3rem, 1.5rem + 6.4vw, 8rem);
  font-weight: 600; line-height: 1.08; letter-spacing: -0.04em;
}
.industries .marquee-track i {
  flex: none; width: .34em; height: .17em; margin: 0 .32em;
  border-radius: .34em .34em 0 0;
  background: var(--accent);
}
.industries .marquee-row + .marquee-row { margin-top: clamp(4px, 1vw, 12px); }
.marquee-row-outline .marquee-track span { color: var(--fg-3); }
@supports (-webkit-text-stroke: 1px black) {
  .marquee-row-outline .marquee-track span { color: transparent; -webkit-text-stroke: 1.5px var(--fg); }
}

/* ── Услуги ───────────────────────────────────────── */

.service-list { display: grid; gap: 72px; }
.service { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.service-figure {
  padding: clamp(16px, 3vw, 44px);
  border-radius: var(--r-card);
  background: var(--mist);
}
.ill { width: 100%; height: auto; overflow: visible; }

.service-text h3 {
  font-size: clamp(1.75rem, 1.15rem + 1.8vw, 2.75rem);
  line-height: 1.06; letter-spacing: -0.03em; font-weight: 600;
}
.service-text h3 .kind-dot { width: 14px; height: 14px; margin-right: .45em; vertical-align: .18em; }
.service-text p { margin-top: 20px; max-width: 44ch; color: var(--fg-2); font-size: 1.125rem; }

.kind-link {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 28px; padding-bottom: 4px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--fg); font-weight: 500; text-decoration: none;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.kind-link:hover { color: var(--accent); border-color: var(--accent); }
.kind-link:empty { display: none; }

@media (min-width: 961px) {
  .service-list { gap: clamp(24px, 4vw, 64px); }
  .service {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(48px, 6vw, 112px);
    align-items: start;
    min-height: 85vh;
  }
  .service-figure { position: sticky; top: max(15vh, calc(var(--header-h) + 24px)); }
  .service-text { align-self: center; padding: 32px 0; }
}

/* Приглушение неактивного блока — только когда anim.js расставляет .is-active */
html.anim-ready .service-text { opacity: .35; transition: opacity .6s var(--ease); }
html.anim-ready .service.is-active .service-text,
html.anim-ready .service-text:focus-within { opacity: 1; }

.kind-dot { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 50%; }
.kind-dot[data-kind="dev"]    { background: var(--fg); }
.kind-dot[data-kind="integr"] { border: 2px solid var(--fg); }
.kind-dot[data-kind="optim"]  { border: 2px solid var(--accent); }
.kind-dot[data-kind="model"]  { background: var(--accent); }

/* Иллюстрации услуг (.i-*). Прозрачность и transform не задаём — их анимирует anim.js. */
.ill text { fill: var(--fg); font-size: 14px; font-weight: 560; text-anchor: middle; }

.i-frame { fill: var(--surface); stroke: var(--mist-2); stroke-width: 1.5; }
.i-line { fill: none; stroke: var(--line); stroke-width: 1.5; }
.i-dot { fill: var(--mist-2); }
.i-side { fill: var(--mist); }
.i-head { fill: var(--fg); }
.i-row { fill: var(--bg); stroke: var(--line); stroke-width: 1; }
.i-chip { fill: var(--mist-2); }
.i-chip-accent { fill: var(--accent); }
.i-btn { fill: var(--fg); }

.i-wire { fill: none; stroke: var(--line-strong); stroke-width: 2; stroke-linecap: round; }
.i-node rect, .i-node circle { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; }
.i-hub circle { fill: var(--fg); stroke: var(--fg); }
.i-hub text { fill: var(--surface); }
.i-packets circle { fill: var(--accent); }
/* У пакетов нет координат, их ведёт MotionPath: без анимации прячем, иначе они в углу */
html:not(.anim-ready) .i-packets { visibility: hidden; }

.i-grid { fill: none; stroke: var(--mist-2); stroke-width: 1; }
.i-chaos { fill: none; stroke: var(--line-strong); stroke-width: 1.5; stroke-dasharray: 4 6; stroke-linejoin: round; }
.i-route { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.i-depot { fill: var(--fg); }
.i-stop { fill: var(--surface); stroke: var(--fg); stroke-width: 2; }
.i-truck { fill: var(--accent); stroke: var(--surface); stroke-width: 2.5; }

.i-axis { fill: none; stroke: var(--fg-3); stroke-width: 1.5; }
.i-gridh { fill: none; stroke: var(--mist-2); stroke-width: 1; }
.i-band { fill: var(--accent); fill-opacity: .14; stroke: none; }
.i-hist { fill: none; stroke: var(--fg); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.i-fc { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.i-today { fill: none; stroke: var(--fg-3); stroke-width: 1.5; stroke-dasharray: 3 5; }
.i-now { fill: var(--accent); stroke: var(--surface); stroke-width: 2.5; }

/* ── Каталог ──────────────────────────────────────── */

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; }
.field { position: relative; min-width: 0; }
.field-search { flex: 1 1 360px; max-width: 600px; }
.field-select { flex: 0 1 280px; }

/* Поля ввода: каталог и форма заявки */
.field-search input,
.field-select select,
.f input[type="text"],
.f textarea {
  width: 100%; min-height: 48px; padding: 11px 14px;
  background: var(--surface); color: var(--fg);
  border: 1.5px solid #7F919D; border-radius: var(--r-ctl);
  font-size: 1rem; line-height: 1.45;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field-search input { min-height: 52px; padding-left: 46px; }
.field-select select {
  min-height: 52px; padding-right: 42px;
  appearance: none; -webkit-appearance: none; cursor: pointer;
}
.field-search input::placeholder,
.f input::placeholder,
.f textarea::placeholder { color: var(--fg-2); opacity: 1; }
.field-search input:hover,
.field-select select:hover,
.f input[type="text"]:hover,
.f textarea:hover { border-color: var(--fg-3); }
.field-search input:focus,
.field-select select:focus,
.f input[type="text"]:focus,
.f textarea:focus {
  outline: 2px solid transparent; /* виден в режиме высокой контрастности */
  border-color: var(--accent);
  box-shadow: var(--ring);
}
.field-search input::-webkit-search-cancel-button { cursor: pointer; }

.field-icon {
  position: absolute; left: 15px; top: 50%; translate: 0 -50%; width: 20px; height: 20px;
  fill: none; stroke: var(--fg-3); stroke-width: 1.8; stroke-linecap: round; pointer-events: none;
}
.field-chevron {
  position: absolute; right: 14px; top: 50%; translate: 0 -50%; width: 18px; height: 18px;
  fill: none; stroke: var(--fg-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  pointer-events: none;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  min-height: 40px; padding: 9px 16px;
  background: transparent; color: var(--fg);
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  font-size: 0.9375rem; line-height: 1.3;
  transition: border-color .15s var(--ease), background-color .15s var(--ease), color .15s var(--ease);
}
.chip:hover { border-color: var(--fg); }
.chip-count { color: var(--fg-2); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.chip[aria-pressed="true"] .chip-count { color: color-mix(in srgb, var(--bg) 72%, transparent); }
.chip:disabled { opacity: .45; cursor: default; }
.chip:disabled:hover { border-color: var(--line-strong); }

.results-bar { display: flex; align-items: center; gap: 20px; min-height: 32px; margin-top: 28px; }
.results-count { color: var(--fg-2); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }

.cases-head, .case {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px 150px;
  gap: 24px; align-items: baseline;
}
.cases-head {
  margin-top: 12px; padding: 0 16px 10px;
  border-bottom: 1px solid var(--fg);
  color: var(--fg-2); font-size: 0.8125rem;
}
.cases { list-style: none; }
.cases > li {
  border-bottom: 1px solid var(--line);
  animation: row-in .35s var(--ease-out) both;
  animation-delay: calc(min(var(--i, 0), 12) * 35ms);
}
@keyframes row-in {
  from { opacity: 0; transform: translateY(8px); }
}
.case {
  padding: 22px 16px; color: var(--fg); text-decoration: none;
  transition: background-color .15s linear;
}
.case:hover { background: var(--surface); color: var(--fg); }
.case:focus-visible { outline-offset: -2px; }
.case-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.case-title {
  font-size: 1.125rem; font-weight: 520; line-height: 1.3; letter-spacing: -0.01em;
  transition: color .15s linear;
}
.case:hover .case-title { color: var(--accent); }
.case-summary { max-width: 70ch; color: var(--fg-2); font-size: 0.9375rem; line-height: 1.45; }
.case-area { color: var(--fg-2); font-size: 0.9375rem; }
.case-kind { display: inline-flex; align-items: center; gap: 8px; color: var(--fg); font-size: 0.9375rem; }
.case-kind .kind-dot { width: 10px; height: 10px; }

@media (min-width: 961px) {
  .case-meta-row { display: contents; }
}

mark {
  padding: 0 1px; border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: inherit;
}

.cases-more { margin-top: 24px; }
.cases-more .btn { min-width: 280px; }

.empty { max-width: 640px; margin-top: 8px; padding: 40px 0; border-top: 1px solid var(--fg); }
.empty-title { margin-bottom: 8px; font-size: 1.375rem; font-weight: 520; letter-spacing: -0.015em; }
.empty p:not(.empty-title) { color: var(--fg-2); }
.empty-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* ── Этапы работы ─────────────────────────────────── */

.process-grid { display: grid; gap: 48px; }

.timeline { position: relative; }
.timeline-line {
  position: absolute; left: 21px; top: 22px; bottom: 0; width: 2px;
  background: var(--line-strong);
  overflow: hidden;
}
/* По умолчанию линия заполнена; начальный scaleY(0) ставит anim.js */
.timeline-fill {
  position: absolute; inset: 0;
  background: var(--accent);
  transform-origin: 50% 0;
}

.steps { list-style: none; display: grid; gap: clamp(40px, 5vw, 64px); }
.step { position: relative; padding-left: 80px; }
.step-n {
  position: absolute; left: 0; top: 0;
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 1.5px solid var(--line-strong); border-radius: 50%;
  background: var(--bg); color: var(--fg-2);
  font-size: 1rem; font-weight: 560; font-variant-numeric: tabular-nums;
  transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.step.is-active .step-n { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.step h3 {
  padding-top: 4px;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); line-height: 1.1; letter-spacing: -0.025em; font-weight: 580;
}
.step p:not([class]) { margin-top: 12px; max-width: 54ch; color: var(--fg-2); }

@media (min-width: 961px) {
  .process-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(48px, 7vw, 128px); align-items: start;
  }
  .process-head { position: sticky; top: calc(var(--header-h) + 48px); }
}

/* ── Принципы ─────────────────────────────────────── */

.principles-label {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: clamp(24px, 3vw, 40px);
  color: var(--fg-2); font-size: 1rem; font-weight: 500; letter-spacing: 0;
}
.principles-label::before {
  content: ""; flex: none; width: 16px; height: 8px;
  border-radius: 16px 16px 0 0; background: var(--accent);
}
.manifesto {
  max-width: 1120px;
  font-size: clamp(1.75rem, .9rem + 3.1vw, 3.75rem);
  line-height: 1.16; letter-spacing: -0.03em; font-weight: 540;
}

/* ── Технологии ───────────────────────────────────── */

.tech {
  padding: clamp(80px, 10vw, 144px) 0;
  background: var(--mist); color: var(--fg);
  overflow: hidden;
}
.tech-title { margin-bottom: clamp(36px, 5vw, 64px); }
.tech-row + .tech-row { margin-top: 14px; }
.tech-row .marquee-track span {
  flex: none; margin: 0 6px; padding: .5em 1.1em;
  border: 1.5px solid var(--fg); border-radius: var(--r-pill);
  color: var(--fg);
  font-size: clamp(1.0625rem, .8rem + 1.1vw, 1.625rem); font-weight: 500;
  line-height: 1.2; letter-spacing: -0.015em;
}
/* Контурные и залитые чередуются, во втором ряду — со сдвигом */
.tech-row .marquee-track span:nth-child(even),
.tech-row + .tech-row .marquee-track span:nth-child(odd) { background: var(--fg); color: var(--mist); }
.tech-row + .tech-row .marquee-track span:nth-child(even) { background: transparent; color: var(--fg); }

/* ── Заявка ───────────────────────────────────────── */

.contact-grid { display: grid; gap: 56px; }
@media (min-width: 961px) {
  .contact-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(56px, 7vw, 128px);
  }
  .contact-text { position: sticky; top: calc(var(--header-h) + 48px); align-self: start; }
}
.contact-title {
  font-size: clamp(2.75rem, 1.4rem + 4.6vw, 5.5rem);
  line-height: .98; letter-spacing: -0.04em; font-weight: 600;
}
.contact-direct { list-style: none; margin-top: 48px; border-top: 1px solid var(--line); }
.contact-direct li {
  display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; align-items: baseline;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.contact-direct span { color: var(--fg-2); font-size: 0.9375rem; }
.contact-direct a { font-size: 1.1875rem; font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }

.form-fields { display: grid; gap: 24px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.f { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.f label, .f legend { padding: 0; color: var(--fg); font-size: 0.9375rem; font-weight: 500; }
.f legend { margin-bottom: 10px; }
.opt { margin-left: 4px; color: var(--fg-2); font-weight: 380; }
.f textarea { min-height: 140px; resize: vertical; }
.f input[type="text"][aria-invalid="true"],
.f textarea[aria-invalid="true"] { border-color: var(--danger); }
.f-hint { color: var(--fg-2); font-size: 0.8125rem; }
.f-err { color: var(--danger); font-size: 0.875rem; font-weight: 500; }


.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip { position: relative; }
.f .check-chip { font-weight: 380; }
.check-chip input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.check-chip span {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  font-size: 0.9375rem; cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.check-chip span::before {
  content: ""; flex: none; width: 14px; height: 14px;
  border: 1.5px solid var(--fg-3); border-radius: 3px;
}
.check-chip:hover span { border-color: var(--fg); }
.check-chip input:checked + span {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}
.check-chip input:checked + span::before {
  border-color: var(--accent);
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3 7.2l2.6 2.6L11 4.4' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}
.check-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.f .check { font-weight: 380; }
.check input {
  flex: none; width: 20px; height: 20px; margin: 2px 0 0;
  appearance: none; -webkit-appearance: none;
  background: var(--surface);
  border: 1.5px solid var(--fg-3); border-radius: 4px;
  cursor: pointer;
}
.check input:checked {
  border-color: var(--accent);
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.3l3.4 3.4L15 7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}
.check input[aria-invalid="true"] { border-color: var(--danger); }
.check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.check a { text-decoration: underline; }

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

.form-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-top: 6px; }
.form-error { max-width: 56ch; color: var(--danger); font-weight: 500; }

.form-done { padding: 8px 0; }
.form-done:focus { outline: none; }
.form-done h3 { margin-bottom: 12px; font-size: 1.75rem; letter-spacing: -0.025em; }
.form-done p { max-width: 56ch; color: var(--fg-2); }
.done-copy {
  max-height: 260px; margin: 24px 0 0; padding: 16px; overflow: auto;
  background: var(--surface); color: var(--fg);
  border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  font-family: inherit; font-size: 0.9375rem; line-height: 1.5; white-space: pre-wrap;
}
.done-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 24px; }
#done-copy-btn { min-width: 15.5em; }

/* ── Подвал ───────────────────────────────────────── */

.site-footer {
  padding: clamp(56px, 7vw, 88px) 0 40px;
  border-top: 1px solid var(--line);
  color: var(--fg-2); font-size: 0.9375rem;
}
.site-footer a { color: var(--fg); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer .logo:hover { color: var(--fg); text-decoration: none; }
.footer-grid {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 3fr) minmax(0, 3fr);
  gap: 40px 48px;
}
.footer-brand p { max-width: 40ch; margin-top: 16px; }
.footer-nav, .footer-contacts { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.footer-legal { grid-column: 1 / -1; padding-top: 24px; border-top: 1px solid var(--line); }

/* ── Карточка задачи (всегда светлая) ─────────────── */

.sheet {
  position: fixed; inset: 0 0 0 auto; margin: 0;
  width: min(680px, 100vw); max-width: 100vw;
  height: 100vh; height: 100dvh; max-height: 100dvh;
  padding: 0; border: 0;
  background: var(--bg); color: var(--fg);
}
.sheet::backdrop { background: rgba(14, 28, 39, .5); }
.sheet[open] { animation: sheet-in-side .32s var(--ease-out); }
.sheet[open]::backdrop { animation: fade-in .32s linear; }
@keyframes sheet-in-side { from { opacity: 0; transform: translateX(40px); } }
@keyframes sheet-in-up { from { opacity: 0; transform: translateY(24px); } }
@keyframes fade-in { from { opacity: 0; } }

.sheet-inner { display: flex; flex-direction: column; height: 100%; }
.sheet-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 20px 14px 32px; border-bottom: 1px solid var(--line);
}
.sheet-pos { color: var(--fg-2); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 32px 32px 40px; }
.sheet-title {
  max-width: 22ch;
  font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.25rem); line-height: 1.12; letter-spacing: -0.03em; font-weight: 600;
}
.sheet-summary { max-width: 56ch; margin-top: 14px; color: var(--fg-2); font-size: 1.0625rem; }
.sheet-facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px;
  margin: 28px 0 8px; padding: 16px 0;
  border-top: 1px solid var(--fg); border-bottom: 1px solid var(--line);
}
.sheet-facts dt { color: var(--fg-2); font-size: 0.8125rem; }
.sheet-facts dd { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-weight: 500; }
.sheet-facts .kind-dot { width: 10px; height: 10px; }
.sheet-sec { padding-top: 24px; }
.sheet-sec h3, .sheet-note h3 { margin-bottom: 8px; font-size: 1.0625rem; letter-spacing: -0.01em; }
.sheet-sec p { max-width: 60ch; color: var(--fg-2); }
.sheet-sec ul:not(.tags) { list-style: none; display: grid; gap: 6px; color: var(--fg-2); }
.sheet-sec ul:not(.tags) li { position: relative; padding-left: 20px; }
.sheet-sec ul:not(.tags) li::before {
  content: ""; position: absolute; left: 2px; top: .75em; width: 8px; height: 1.5px; background: var(--fg-3);
}
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  padding: 4px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  color: var(--fg); font-size: 0.875rem;
}
.sheet-note { margin-top: 28px; padding: 18px 20px; background: var(--mist); border-left: 3px solid var(--accent); }
.sheet-note p { color: var(--fg); }
.sheet-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px 14px 32px; border-top: 1px solid var(--line); background: var(--bg);
}
.sheet-nav { display: flex; gap: 8px; }

/* ── Простые страницы: политика, 404 ──────────────── */

body.page-simple { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
body.page-simple > main { flex: 1 0 auto; }

.page { padding: calc(var(--header-h) + clamp(48px, 7vw, 96px)) 0 clamp(72px, 9vw, 128px); }
.page-narrow { max-width: 760px; }
.page h1 {
  font-size: clamp(2.25rem, 1.4rem + 3vw, 3.75rem);
  line-height: 1.04; letter-spacing: -0.035em; font-weight: 600;
}
.page-meta { margin-top: 16px; color: var(--fg-2); }
.prose { margin-top: 48px; }
.prose h2 { margin: 44px 0 12px; font-size: 1.375rem; line-height: 1.25; letter-spacing: -0.02em; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { max-width: 68ch; color: var(--fg-2); }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: 12px; }
.prose ul { display: grid; gap: 6px; padding-left: 22px; }
.prose a { color: var(--fg); }
.prose a:hover { color: var(--accent); }
.prose .fill { padding: 1px 6px; border-radius: 4px; background: var(--mist); color: var(--fg); }
.page .hero-actions { margin-top: 32px; }

.notfound { display: flex; align-items: center; padding-bottom: clamp(48px, 7vw, 96px); }
.notfound p { max-width: 48ch; margin-top: 16px; color: var(--fg-2); font-size: 1.125rem; }

/* ── Адаптив ──────────────────────────────────────── */

@media (max-width: 960px) {
  .nav, .header-cta { display: none; }
  .menu-toggle { display: inline-flex; }
  .menu-back { display: inline-flex; margin-left: auto; min-height: 40px; padding: 8px 16px; }

  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .hero-figure { max-width: 560px; justify-self: center; }

  .cases-head { display: none; }
  .cases { border-top: 1px solid var(--fg); }
  .case { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 18px 4px; }
  .case:hover { background: transparent; }
  .case-meta-row { display: flex; flex-wrap: wrap; gap: 6px 18px; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }

  .btn { white-space: normal; }
  .hero-actions .btn { flex: 1 1 100%; }
  .hero-figure { margin-top: -8px; }
  .mn-label { font-size: 21px; } /* схема на телефоне уменьшена — подписи крупнее в единицах viewBox */
  .mn-cap { font-size: 15px; }
  .map-bus .mn-label { font-size: 19px; }

  .toolbar > .field { flex: 1 1 100%; max-width: none; }
  /* Направления — одной прокручиваемой строкой */
  .chips {
    flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain;
    margin: 10px calc(-1 * var(--gutter)) 0; padding: 6px var(--gutter) 8px;
    scroll-padding: 0 var(--gutter); scrollbar-width: none;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .cases-more .btn { width: 100%; min-width: 0; }

  .industries .marquee-row-outline .marquee-track span { -webkit-text-stroke-width: 1px; }

  .step { padding-left: 60px; }
  .step-n { width: 38px; height: 38px; font-size: 0.9375rem; }
  .timeline-line { left: 18px; top: 19px; }
  .step h3 { padding-top: 3px; }


  .contact-direct li { grid-template-columns: 88px minmax(0, 1fr); }
  .form-row-2 { grid-template-columns: minmax(0, 1fr); }

  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }

  .sheet { width: 100vw; }
  .sheet[open] { animation-name: sheet-in-up; }
  .sheet-top { padding: 10px 12px 10px 20px; }
  .sheet-body { padding: 24px 20px 32px; }
  .sheet-foot { padding: 12px 12px calc(12px + env(safe-area-inset-bottom)) 20px; }
}

/* ── Меньше движения ──────────────────────────────── */

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

/* Пока не началась анимация первого экрана, схема скрыта, чтобы не мелькнула собранной.
   Класс ставит скрипт в <head>, снимает anim.js (или таймер через 3 с). */
html.hero-pending .map-stage { opacity: 0; }

/* ── Направления разработки ─────────────────────────── */

.topics-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px;
  margin-top: clamp(32px, 4vw, 48px);
}
.topic {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  padding: 28px 24px 24px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  transition: border-color .25s var(--ease), translate .25s var(--ease);
}
.topic::before {
  content: ""; position: absolute; left: 24px; right: 24px; top: -1px; height: 3px;
  border-radius: 0 0 3px 3px; background: var(--accent);
  opacity: 0; transition: opacity .25s var(--ease);
}
.topic:hover { border-color: var(--line-strong); translate: 0 -3px; }
.topic:hover::before, .topic:focus-within::before { opacity: 1; }
.topic-title { font-size: 1.25rem; line-height: 1.2; letter-spacing: -0.015em; font-weight: 580; }
.topic-summary { color: var(--fg-2); font-size: 0.9375rem; line-height: 1.5; }
.topic-tasks { list-style: none; display: grid; gap: 8px; padding: 14px 0 0; border-top: 1px solid var(--line); }
.topic-tasks li { position: relative; padding-left: 16px; font-size: 0.9375rem; line-height: 1.4; color: var(--fg); }
.topic-tasks li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 1.5px; background: var(--fg-3); }
.topic-more {
  align-self: flex-start; margin-top: auto; padding-top: 6px; padding-bottom: 3px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--fg); font-weight: 500; font-size: 0.9375rem; text-decoration: none;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.topic:hover .topic-more, .topic-more:hover { color: var(--accent); border-color: var(--accent); }

.sheet-sec ul#sheet-tasks, .sheet-sec ul#sheet-results { list-style: none; display: grid; gap: 8px; }
.sheet-sec ul#sheet-tasks li, .sheet-sec ul#sheet-results li { position: relative; padding-left: 18px; color: var(--fg); }
.sheet-sec ul#sheet-tasks li::before, .sheet-sec ul#sheet-results li::before {
  content: ""; position: absolute; left: 0; top: .7em; width: 8px; height: 1.5px; background: var(--accent);
}

@media (max-width: 1100px) { .topics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .topics-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .topic { padding: 24px 20px 20px; }
}
@media (prefers-reduced-motion: reduce) { .topic { transition: none; } .topic:hover { translate: none; } }
