/* ═══════════════════════════════════════════════════════════════════════════
   GENREACTOR – дизайн-система
   Один файл. Никаких внешних шрифтов и CDN: ноль сетевых запросов,
   ноль layout shift, ноль зависимостей.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Токены ───────────────────────────────────────────────────────────────── */
:root {
  /* Поверхности: почти-чёрный, но не чистый #000 – так мягче для глаз */
  --bg:          #0A0B0D;
  --surface:     #131519;
  --surface-2:   #1B1E24;
  --line:        #262A32;
  --line-strong: #363B45;

  /* Текст. Контраст к --bg: base 15.8:1, muted 7.1:1 – с запасом по AA */
  --text:        #E8EAED;
  --text-muted:  #9BA3AE;
  --text-dim:    #6C7480;

  /* Акцент – «реакторный» мятный. На тёмном даёт 11.2:1 */
  --accent:      #4DE1C1;
  --accent-dim:  #2FB89B;
  --accent-glow: rgba(77, 225, 193, 0.14);

  /* Вторичный, только для градиентов и акцентных штрихов */
  --violet:      #7C6BFF;

  --danger:      #FF6B6B;
  --success:     #4DE1C1;

  /* Типографика. Системный стек – мгновенная отрисовка */
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Шкала кегля: плавная, через clamp – без брейкпоинтов */
  --fs-xs:   0.8125rem;
  --fs-sm:   0.9375rem;
  --fs-base: 1.0625rem;
  --fs-lg:   clamp(1.125rem, 0.4vw + 1.05rem, 1.3125rem);
  --fs-xl:   clamp(1.375rem, 1vw + 1.15rem, 1.75rem);
  --fs-2xl:  clamp(1.75rem, 2vw + 1.3rem, 2.5rem);
  --fs-3xl:  clamp(2.25rem, 4vw + 1.4rem, 4rem);

  /* Ритм по 4px */
  --s-1: 0.25rem;  --s-2: 0.5rem;   --s-3: 0.75rem;  --s-4: 1rem;
  --s-5: 1.5rem;   --s-6: 2rem;     --s-7: 3rem;     --s-8: 4rem;
  --s-9: 6rem;     --s-10: 8rem;

  --radius:    14px;
  --radius-sm: 9px;
  --radius-lg: 22px;

  --wrap: 1140px;
  --measure: 68ch;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Сброс ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  line-height: 1.15;
  letter-spacing: -0.022em;
  text-wrap: balance;
  font-weight: 600;
}

p { text-wrap: pretty; }

a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

/* Фокус виден всегда и везде – это не декоративная деталь */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

::selection { background: var(--accent); color: var(--bg); }

/* ── Утилиты ──────────────────────────────────────────────────────────────── */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--s-5);
}

.skip {
  position: absolute;
  left: -9999px;
  top: var(--s-3);
  background: var(--accent);
  color: var(--bg);
  padding: var(--s-3) var(--s-5);
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 100;
}
.skip:focus { left: var(--s-4); }

.section { padding-block: clamp(var(--s-7), 7vw, var(--s-9)); }
.section + .section { padding-top: 0; }

.eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s-4);
}

.lead {
  font-size: var(--fs-lg);
  color: var(--text-muted);
  max-width: var(--measure);
}

.section-title { font-size: var(--fs-2xl); margin-bottom: var(--s-3); }
.section-intro { color: var(--text-muted); max-width: var(--measure); margin-bottom: var(--s-6); }

/* ── Шапка ────────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  min-height: 68px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
  flex-shrink: 0;
}

/* Знак реактора: кольцо с ядром */
.logo-mark {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  position: relative;
  flex-shrink: 0;
}
.logo-mark::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.logo-text {
  font-weight: 700;
  letter-spacing: 0.13em;
  font-size: var(--fs-sm);
}

.nav ul {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  list-style: none;
  padding: 0;
}

.nav a {
  text-decoration: none;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  transition: color 0.18s var(--ease);
  white-space: nowrap;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--accent); }

.nav-study a {
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: var(--fs-xs);
}
.nav-study a:hover { border-color: var(--accent); color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0 11px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Первый экран ─────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding-block: clamp(var(--s-8), 11vw, var(--s-10)) clamp(var(--s-7), 8vw, var(--s-9));
  overflow: hidden;
}

/* Мягкое свечение «реактора» за текстом */
.hero::before {
  content: '';
  position: absolute;
  top: -220px; left: 50%;
  width: min(880px, 130vw); height: 620px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center,
              var(--accent-glow) 0%,
              color-mix(in srgb, var(--violet) 7%, transparent) 42%,
              transparent 68%);
  pointer-events: none;
  z-index: -1;
}

.hero h1 {
  font-size: var(--fs-3xl);
  max-width: 19ch;
  margin-bottom: var(--s-5);
}

.hero .lead { font-size: var(--fs-lg); margin-bottom: var(--s-6); max-width: 56ch; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  align-items: center;
  margin-bottom: var(--s-5);
}

.hero-study {
  font-size: var(--fs-sm);
  color: var(--text-dim);
}
.hero-study a { color: var(--text-muted); }
.hero-study a:hover { color: var(--accent); }

/* ── Кнопки ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  min-height: 48px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease),
              border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 6px 22px -8px var(--accent);
}
.btn-primary:hover { background: #5FF0D0; transform: translateY(-2px); }

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--text);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ── Сетки и карточки ─────────────────────────────────────────────────────── */
.grid { display: grid; gap: var(--s-4); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s-5);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.card h3 { font-size: var(--fs-lg); margin-bottom: var(--s-2); }
.card p { color: var(--text-muted); font-size: var(--fs-sm); }

a.card { text-decoration: none; display: block; }
a.card:hover { border-color: var(--accent); transform: translateY(-3px); }

.card-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent-glow);
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  font-family: var(--mono);
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: var(--s-3);
}

/* Список-«чипсы» для перечислений */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none; padding: 0; }
.chips li {
  padding: var(--s-2) var(--s-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* Маркированный список с акцентными галочками */
.ticks { list-style: none; padding: 0; display: grid; gap: var(--s-3); }
.ticks li { position: relative; padding-left: var(--s-6); color: var(--text-muted); }
.ticks li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.62em;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

/* ── Схема потока (Instagram → сайт → оплата → …) ─────────────────────────── */
.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: var(--s-3);
  list-style: none;
  padding: 0;
  counter-reset: flow;
}
.flow li {
  flex: 1 1 160px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--s-4);
  position: relative;
}
.flow li strong { display: block; font-size: var(--fs-sm); margin-bottom: var(--s-1); }
.flow li span { font-size: var(--fs-xs); color: var(--text-dim); }

/* ── Аккордеон FAQ на <details> – без единой строки JS ────────────────────── */
.faq { display: grid; gap: var(--s-2); }

.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.faq summary {
  padding: var(--s-4) var(--s-5);
  cursor: pointer;
  font-weight: 600;
  font-size: var(--fs-sm);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-4);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  font-size: 1.4em;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform 0.22s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details:hover { border-color: var(--line-strong); }
.faq .faq-body { padding: 0 var(--s-5) var(--s-4); color: var(--text-muted); font-size: var(--fs-sm); }

/* ── Формы ────────────────────────────────────────────────────────────────── */
.form { display: grid; gap: var(--s-4); max-width: 560px; }

.field { display: grid; gap: var(--s-2); }
.field label { font-size: var(--fs-sm); font-weight: 600; }
.field .hint { font-size: var(--fs-xs); color: var(--text-dim); }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: var(--s-3) var(--s-4);
  min-height: 48px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.field textarea { min-height: 128px; resize: vertical; }

.field input::placeholder,
.field textarea::placeholder { color: var(--text-dim); }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: var(--danger); }

.field-error { font-size: var(--fs-xs); color: var(--danger); min-height: 1em; }

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  cursor: pointer;
}
.checkbox input {
  width: 24px; height: 24px;   /* минимум WCAG для тап-цели */
  min-height: 0;
  margin-top: 1px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

/* Ловушка для спам-ботов: человек её не видит и не сфокусирует */
.honey {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.form-status {
  padding: var(--s-4);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  display: none;
}
.form-status[data-state="success"] {
  display: block;
  background: var(--accent-glow);
  border: 1px solid var(--accent-dim);
  color: var(--accent);
}
.form-status[data-state="error"] {
  display: block;
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border: 1px solid var(--danger);
  color: var(--danger);
}

/* ── Подвал ───────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: var(--s-9);
  padding-top: var(--s-7);
}

.footer-grid {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  padding-bottom: var(--s-7);
}

.footer-brand p { color: var(--text-dim); font-size: var(--fs-sm); margin-top: var(--s-3); max-width: 30ch; }

.footer-col h2 {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-dim);
  margin-bottom: var(--s-4);
  font-weight: 600;
}
.footer-col ul { list-style: none; padding: 0; display: grid; gap: var(--s-1); }
.footer-col a {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  text-decoration: none;
  /* Вертикальные отступы поднимают тап-цель выше минимума WCAG в 24px:
     без них ссылка занимает 18px и пальцем по ней не попасть */
  display: inline-block;
  padding-block: var(--s-2);
}
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-block: var(--s-5);
  color: var(--text-dim);
  font-size: var(--fs-xs);
}

/* ── Мобильные ────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }

  .nav {
    position: fixed;
    inset: 68px 0 auto 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: var(--s-5);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0.22s;
  }
  .nav[data-open="true"] { opacity: 1; visibility: visible; transform: translateY(0); }

  .nav ul { flex-direction: column; align-items: stretch; gap: var(--s-1); }
  .nav a { display: block; padding: var(--s-3) 0; font-size: var(--fs-base); }
  .nav-study { margin-top: var(--s-3); }
  .nav-study a { display: inline-block; }
}

/* Работоспособность от 320px */
@media (max-width: 380px) {
  .wrap { padding-inline: var(--s-4); }
  .hero-actions .btn { width: 100%; }
}

/* ── Уважение к настройкам пользователя ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .btn:hover, a.card:hover { transform: none; }
}

@media print {
  .site-header, .site-footer, .hero::before { display: none; }
  body { background: #fff; color: #000; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   GENREACTOR – компоненты
   Подключается ПОСЛЕ main.css: все токены уже объявлены, переопределять
   их здесь не нужно. Файл держим отдельно, чтобы дизайн-система оставалась
   стабильной, а витрина, калькулятор и бот менялись без риска её задеть.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Дополнительные токены ────────────────────────────────────────────────── */
/* Свечение для фиолетового в main.css не заводили: там --violet нужен был
   только точечно в градиентах. Витрине нужна пара «цвет + свечение», как у
   акцента, иначе карточки двух направлений выглядят по-разному собранными. */
:root {
  --violet-glow: rgba(124, 107, 255, 0.16);
  --violet-dim:  #6355E0;

  /* Высота липкой шапки. Нужна калькулятору и панели бота, чтобы липкие
     блоки не заезжали под шапку. Одно число вместо трёх магических. */
  --header-h: 68px;

  --z-bot: 60;
}

/* Угол светового следа по границе. Через @property, потому что обычная
   custom property не интерполируется и анимация была бы ступенчатой.
   Если браузер @property не поддерживает – граница просто останется
   статичной, ничего не сломается. */
@property --trace-angle {
  syntax: '<angle>';
  initial-value: 0turn;
  inherits: false;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ВИТРИНА
   ═══════════════════════════════════════════════════════════════════════════ */

/* Два входа в бизнес, поэтому ровно две колонки, а не auto-fit:
   направления равнозначны и не должны схлопываться в 1+1 по остаточному
   принципу. Ниже 760px – одна колонка, иначе карточки становятся
   нечитаемо узкими. */
.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
}

@media (max-width: 760px) {
  .split { grid-template-columns: minmax(0, 1fr); }
}

.gate {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.28s var(--ease), border-color 0.28s var(--ease),
              box-shadow 0.28s var(--ease);
}

/* Контент поднимаем над псевдоэлементами: свечение и световой след лежат
   в том же стек-контексте и иначе перекрыли бы текст. */
.gate > * { position: relative; z-index: 1; }

/* Свечение направления. Держим в ::after, а не в background карточки:
   так его можно гасить и зажигать, не трогая базовую поверхность. */
.gate::after {
  content: '';
  position: absolute;
  z-index: 0;
  inset: auto -30% -55% -30%;
  height: 78%;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s var(--ease);
}

/* Световой след по границе. Кольцо собираем маской: рамка в 1px, залитая
   вращающимся коническим градиентом. Дешевле, чем четыре анимированных
   элемента, и не влияет на раскладку. */
.gate::before {
  content: '';
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s var(--ease);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.gate:hover,
.gate:focus-visible {
  transform: translateY(-4px);
  border-color: var(--line-strong);
}

.gate:hover::after,
.gate:focus-visible::after { opacity: 1; }

.gate:hover::before,
.gate:focus-visible::before {
  opacity: 1;
  animation: borderTrace 4.5s linear infinite;
}

/* Модификаторы направлений. Отличаются только цветом свечения и следа –
   форма одинаковая, потому что это равные по весу входы. */
.gate-lab::after  { background: radial-gradient(ellipse at center, var(--accent-glow), transparent 70%); }
.gate-lab::before {
  background: conic-gradient(from var(--trace-angle),
              transparent 0 62%, var(--accent) 80%, transparent 92%);
}
.gate-lab:hover,
.gate-lab:focus-visible {
  border-color: var(--accent-dim);
  box-shadow: 0 18px 44px -26px var(--accent);
}

.gate-study::after  { background: radial-gradient(ellipse at center, var(--violet-glow), transparent 70%); }
.gate-study::before {
  background: conic-gradient(from var(--trace-angle),
              transparent 0 62%, var(--violet) 80%, transparent 92%);
}
.gate-study:hover,
.gate-study:focus-visible {
  border-color: var(--violet-dim);
  box-shadow: 0 18px 44px -26px var(--violet);
}

.gate-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s-3);
}
.gate-study .gate-label { color: var(--violet); }

.gate-title {
  font-size: var(--fs-xl);
  margin-bottom: var(--s-3);
}

/* Описание тянется, прижимая .gate-meta к низу карточки: строка фактов
   выравнивается по обеим колонкам независимо от длины текста. */
.gate-desc {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  max-width: 42ch;
  flex: 1 1 auto;
  margin-bottom: var(--s-5);
}

.gate-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
  /* Не --text-dim: он даёт 4.2:1 к фону и не проходит порог 4.5:1 */
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

.gate-meta > * {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.gate-meta > * + *::before {
  content: '';
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
  margin-right: var(--s-2);
}

@media (max-width: 420px) {
  .gate { min-height: 280px; padding: var(--s-4); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   АНИМАЦИИ
   Сдержанные и короткие: страница про инженерию, а не про эффекты.
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes reactorPulse {
  0%, 100% { box-shadow: 0 0 10px var(--accent-glow); }
  50%      { box-shadow: 0 0 20px 3px var(--accent-glow); }
}

@keyframes flowArrow {
  0%   { transform: translateX(0);    opacity: 0.35; }
  50%  { transform: translateX(4px);  opacity: 1; }
  100% { transform: translateX(0);    opacity: 0.35; }
}

@keyframes borderTrace {
  to { --trace-angle: 1turn; }
}

@keyframes revealIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* Ядро логотипа дышит – единственная постоянная анимация на странице.
   Период длинный, чтобы движение читалось как «работает», а не мигало. */
.logo-mark::after {
  animation: reactorPulse 3.6s var(--ease) infinite;
}

/* Стрелки между шагами схемы. Рисуем на всех, кроме последнего элемента,
   через ::after – в разметке .flow никаких лишних узлов не появляется. */
.flow li:not(:last-child)::after {
  content: '→';
  position: absolute;
  top: 50%;
  right: calc(var(--s-3) * -1);
  transform: translate(50%, -50%);
  color: var(--accent);
  font-size: var(--fs-sm);
  line-height: 1;
  pointer-events: none;
  animation: flowArrow 2.4s var(--ease) infinite;
}

/* На узких экранах шаги встают в столбик, и горизонтальная стрелка
   указывала бы в пустоту. Прячем: направление и так очевидно. */
@media (max-width: 560px) {
  .flow li:not(:last-child)::after { display: none; }
}

/* Появление при прокрутке. Класс .is-visible вешает IntersectionObserver.
   transition, а не animation: обратимо и не конфликтует с прокруткой вверх. */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* Страховка: без JS блок остался бы невидимым навсегда. Контент важнее
   анимации, поэтому при отключённых скриптах показываем сразу. */
@media (scripting: none) {
  .reveal { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   КАЛЬКУЛЯТОР
   ═══════════════════════════════════════════════════════════════════════════ */

/* Две колонки: выбор слева, итог справа. Итог уже панели с опциями –
   он справочный, читать его сверху вниз одной строкой удобнее. */
.calc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: var(--s-5);
  align-items: start;
}

@media (max-width: 860px) {
  .calc { grid-template-columns: minmax(0, 1fr); }
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: var(--s-3);
  margin-bottom: var(--s-6);
}

.calc-grid:last-child { margin-bottom: 0; }

/* Карточка-опция. Нативный input лежит поверх всей карточки прозрачным:
   кликабельна вся площадь, а состояние :checked и :focus-visible остаются
   настоящими – никакой имитации доступности через div. */
.calc-option {
  position: relative;
  display: block;
  padding: var(--s-4) var(--s-5) var(--s-4) var(--s-4);
  padding-right: calc(var(--s-6) + var(--s-3));
  min-height: 64px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.calc-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.calc-option strong {
  display: block;
  font-size: var(--fs-sm);
  margin-bottom: var(--s-1);
}
.calc-option span {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* Отметка выбора. Круглая для radio, квадратная для checkbox – форма
   сама подсказывает, один вариант или несколько. */
.calc-option::after {
  content: '';
  position: absolute;
  top: var(--s-4);
  right: var(--s-4);
  width: 20px; height: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease),
              background 0.18s var(--ease);
}
.calc-option:has(input[type="checkbox"])::after { border-radius: 5px; }

.calc-option:hover { border-color: var(--line-strong); }

.calc-option:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}
.calc-option:has(input:checked)::after {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--surface);
}

/* Фокус с клавиатуры на скрытом input не виден сам по себе – переносим
   обводку на карточку, иначе таб-навигация «слепая». */
.calc-option:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.calc-summary {
  position: sticky;
  top: calc(var(--header-h) + var(--s-4));
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: var(--s-5);
}

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-4);
  padding-block: var(--s-2);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.calc-row span:last-child {
  color: var(--text);
  font-family: var(--mono);
  font-size: var(--fs-xs);
  white-space: nowrap;
}

.calc-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-3);
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
  font-size: var(--fs-xl);
  font-weight: 600;
}
.calc-total span:last-child {
  color: var(--accent);
  font-family: var(--mono);
  white-space: nowrap;
}

.calc-note {
  margin-top: var(--s-3);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* На мобильном липкая панель сверху съедала бы пол-экрана, поэтому
   прижимаем итог к низу окна – он остаётся на виду при выборе опций. */
@media (max-width: 860px) {
  .calc-summary {
    position: sticky;
    top: auto;
    bottom: var(--s-3);
  }
}

@media (max-width: 380px) {
  .calc-option { padding-right: calc(var(--s-5) + var(--s-4)); }
  .calc-total  { font-size: var(--fs-lg); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ЧАТ-БОТ
   ═══════════════════════════════════════════════════════════════════════════ */

.bot-launcher {
  position: fixed;
  right: var(--s-4);
  bottom: var(--s-4);
  z-index: var(--z-bot);
  width: 56px; height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-dim);
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  cursor: pointer;
  box-shadow: 0 10px 30px -10px var(--accent);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.bot-launcher:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -10px var(--accent); }
.bot-launcher:active { transform: translateY(0); }

.bot-panel {
  position: fixed;
  right: var(--s-4);
  bottom: calc(var(--s-4) + 56px + var(--s-3));
  z-index: var(--z-bot);
  display: flex;
  flex-direction: column;
  /* 100vw минус поля: при 320px панель не вылезает за экран и не даёт
     горизонтальную прокрутку */
  width: min(380px, calc(100vw - var(--s-6)));
  max-height: min(560px, calc(100dvh - var(--header-h) - var(--s-8)));
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease),
              visibility 0.22s;
}

.bot-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.bot-head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  flex-shrink: 0;
}
.bot-head strong { font-size: var(--fs-sm); }
.bot-head p { font-size: var(--fs-xs); color: var(--text-muted); }

/* Кнопка закрытия внутри шапки: 32px – выше минимума WCAG в 24px,
   промахнуться пальцем сложно. */
.bot-head button {
  margin-left: auto;
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
}
.bot-head button:hover { border-color: var(--accent); color: var(--accent); }

.bot-face {
  position: relative;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--accent-glow);
  border: 1px solid var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
}
.bot-face .eye {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.bot-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;  /* прокрутка диалога не тянет страницу */
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-4);
}

.bot-msg {
  max-width: 82%;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  line-height: 1.5;
  /* Сводка приходит списком через \n. Без pre-line строки склеиваются
     в сплошной абзац и читать её невозможно. */
  white-space: pre-line;
  /* Длинная ссылка или id заказа не должны распирать панель */
  overflow-wrap: anywhere;
}

.bot-msg.is-bot {
  align-self: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
  color: var(--text);
}

.bot-msg.is-user {
  align-self: flex-end;
  background: var(--accent);
  border-bottom-right-radius: 4px;
  color: var(--bg);          /* тёмный на мятном – контраст 11:1 */
  font-weight: 500;
}

.bot-typing {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: var(--s-3) var(--s-4);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  border-bottom-left-radius: 4px;
}
.bot-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: botDot 1.3s var(--ease) infinite;
}
.bot-typing span:nth-child(2) { animation-delay: 0.16s; }
.bot-typing span:nth-child(3) { animation-delay: 0.32s; }

@keyframes botDot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30%           { opacity: 1;   transform: translateY(-3px); }
}

.bot-quick {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  padding: 0 var(--s-4) var(--s-3);
  flex-shrink: 0;
}
.bot-quick button {
  padding: var(--s-2) var(--s-3);
  min-height: 32px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  cursor: pointer;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.bot-quick button:hover { border-color: var(--accent); color: var(--accent); }

.bot-input {
  display: flex;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4) var(--s-4);
  border-top: 1px solid var(--line);
  background: var(--surface);
  flex-shrink: 0;
}
.bot-input input {
  flex: 1 1 auto;
  min-width: 0;              /* иначе flex-элемент не даст панели сжаться */
  padding: var(--s-3) var(--s-4);
  min-height: 44px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: var(--fs-sm);
}
.bot-input input::placeholder { color: var(--text-muted); }
.bot-input input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.bot-input button {
  width: 44px; height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--bg);
  cursor: pointer;
}
.bot-input button:hover { background: #5FF0D0; }
.bot-input button[disabled] { opacity: 0.5; cursor: not-allowed; }

/* На телефоне диалог занимает весь экран: 380px в углу оставили бы
   слишком мало места под клавиатурой. dvh, а не vh – адресная строка
   Safari иначе срезает нижнюю часть панели. */
@media (max-width: 560px) {
  .bot-panel {
    inset: 0;
    width: 100%;
    max-height: none;
    height: 100dvh;
    border: none;
    border-radius: 0;
    transform: translateY(14px);
  }
  .bot-panel.is-open { transform: none; }

  /* Кнопка вызова под открытой панелью не нужна и мешает. Через :has на
     body, а не через соседний селектор: порядок этих двух узлов в разметке
     мы не фиксируем, и правило не должно от него зависеть. */
  body:has(.bot-panel.is-open) .bot-launcher { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Уважение к настройкам пользователя
   main.css уже глушит длительности глобально. Здесь добиваем то, что
   через duration не отключается: бесконечные циклы и стартовые сдвиги.
   ═══════════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .logo-mark::after,
  .flow li:not(:last-child)::after,
  .bot-typing span,
  .gate::before,
  .gate:hover::before,
  .gate:focus-visible::before {
    animation: none !important;
  }

  /* Блок должен быть виден сразу, даже если IntersectionObserver
     ещё не сработал: без анимации ждать появления нечего. */
  .reveal { opacity: 1; transform: none; }

  .gate:hover,
  .gate:focus-visible,
  .bot-launcher:hover { transform: none; }

  .bot-panel { transform: none; }
}

@media print {
  .bot-launcher, .bot-panel { display: none; }
  .reveal { opacity: 1; transform: none; }
  .gate { break-inside: avoid; }
}

/* ── Служебные классы вместо inline-стилей ──────────────────────────────────
   CSP задаёт style-src 'self' без 'unsafe-inline', поэтому атрибуты
   style="..." браузер отбрасывает молча: вёрстка едет, консоль забивается
   нарушениями. Ослаблять заголовок ради удобства нельзя - именно
   'unsafe-inline' и открывает дорогу инъекциям стилей. */

.u-measure     { max-width: 74ch; }
.u-mt-4        { margin-top: var(--s-4); }
.u-mt-5        { margin-top: var(--s-5); }
.u-mt-7        { margin-top: var(--s-7); }
.u-mb-2        { margin-bottom: var(--s-2); }
.u-mb-4        { margin-bottom: var(--s-4); }
.u-mb-5        { margin-bottom: var(--s-5); }
.u-mb-6        { margin-bottom: var(--s-6); }
.u-pad-6       { padding: var(--s-6); }
.u-gap-3       { gap: var(--s-3); }
.u-muted       { color: var(--text-muted); }
.u-accent      { color: var(--accent); }
.u-note        { color: var(--text-muted); font-size: var(--fs-sm); }
.u-sub         { font-size: var(--fs-base); margin-bottom: var(--s-2); }
.u-case-title  { font-size: var(--fs-xl); margin-bottom: var(--s-4); }

/* Двухколоночная секция с выравниванием по верху - для страниц контактов */
.u-split-wide  { gap: var(--s-7); align-items: start; }

/* Карточка-предупреждение «требует проверки перед публикацией» */
.u-warn        { border-color: var(--accent-dim); margin-bottom: var(--s-6); }
