/*
 * Страница «Печатает…». Значения берутся из tokens.css, раскладка и детали свои.
 * Один брейкпоинт: max-width 768px, desktop-first.
 * Файлы демо (demo.css, demo.js) ведутся отдельно, здесь только место под демо и его заглушка.
 */

/* ---------- локальные переменные страницы ---------- */
:root {
  --page-gutter: 32px;          /* поле на всех ширинах, в том числе 769-1140 */
  --hero-top: 104px;            /* верх первого экрана: демо должно быть видно без прокрутки */
  --focus-ring: 2px solid var(--accent-600);
  --glow-size: 440px;
  --glow-blur: 110px;
  --step-num-size: 48px;
  --stat-value: 64px;
}

@media (max-width: 768px) {
  :root {
    --page-gutter: var(--gutter);
    --hero-top: 74px;
    --glow-size: 220px;
    --glow-blur: 70px;
    --step-num-size: 42px;
    --stat-value: 44px;
  }
}

/* ---------- база ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* scroll-behavior не задаём: якоря прыгают сразу */
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-text);
  font-weight: var(--weight-text);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ol, ul, figure { margin: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
  border-radius: 6px;
}

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

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

/* ---------- заголовки ---------- */
.h1 {
  font-family: var(--font-display);
  font-weight: var(--weight-h1);
  font-size: var(--text-h1);
  line-height: var(--leading-h1);
  text-wrap: balance;
}

.h2 {
  font-family: var(--font-display);
  font-weight: var(--weight-h2);
  font-size: var(--text-h2);
  line-height: var(--leading-h2);
  text-wrap: balance;
}

/* маркер-выделение слова лаймом */
.marker {
  background: var(--lime-marker);
  padding: 0 7px;
  border-radius: var(--radius-lg);
  white-space: nowrap;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ---------- три точки набора (логотип и пузырь в CTA) ---------- */
.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.typing i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: typing-dot 1.2s var(--ease-in-out) infinite;
}

.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }

@keyframes typing-dot {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 30px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-text);
  font-weight: var(--weight-strong);
  font-size: var(--text-button-lg);
  line-height: 1.55;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    opacity var(--dur-fast) var(--ease-in-out),
    background-color var(--dur-fast) var(--ease-in-out),
    color var(--dur-fast) var(--ease-in-out);
}

.btn__icon {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn--dark { background: var(--control-dark); color: var(--ink-on-dark); }
.btn--dark:hover { opacity: var(--dim-hover); }

.btn--light { background: var(--control); color: var(--ink-strong); }
.btn--light:hover { background: var(--control-hover); }

.btn--white { background: var(--surface); color: var(--ink); }
.btn--white:hover { background: var(--control-white-hover); }

.btn--sm {
  height: 36px;
  padding: 0 16px;
  font-size: var(--text-button);
}

/* ---------- шапка ---------- */
.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: var(--z-header);
  height: var(--header-h);
  background: rgb(255 255 255 / .88);
  -webkit-backdrop-filter: blur(var(--header-blur));
  backdrop-filter: blur(var(--header-blur));
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-header) var(--ease-in-out);
}

.header.is-scrolled { border-bottom-color: var(--line); }

.header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}

.logo__dots {
  color: var(--accent-500);
  gap: 3px;
}

.logo__dots i { width: 5px; height: 5px; }

.header__right {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav__link {
  font-size: var(--text-nav);
  font-weight: var(--weight-strong);
  line-height: var(--leading-nav);
  color: var(--ink);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-in-out);
}

.nav__link:hover { color: var(--accent-600); }

/* ---------- якоря под фиксированной шапкой ---------- */
[id] { scroll-margin-top: calc(var(--header-h) + 24px); }

/* ---------- первый экран ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-top: var(--hero-top);
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pill-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 12px;
  border: var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 14px;
  font-weight: var(--weight-label);
  line-height: 20px;
  color: var(--ink-strong);
}

.pill-label__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-bg);
}

.hero__title {
  max-width: 1000px;
  margin-top: 20px;
}

.hero__lead {
  max-width: 780px;
  margin-top: 20px;
  font-size: var(--text-lead);
  line-height: var(--leading-lead);
  color: var(--ink-2);
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
}

.hero__note {
  margin-top: 14px;
  font-size: 15px;
  line-height: 24px;
  color: var(--ink-2);
}

.hero__stage {
  position: relative;
  width: 100%;
  margin-top: 44px;
}

/* подложка: три размытых круга в ряд, как три точки набора; свои цвета, без анимации */
.hero__glow {
  position: absolute;
  z-index: -1;
  top: -140px;
  left: 50%;
  width: max(100vw, 100%);
  height: 760px;
  transform: translateX(-50%);
  pointer-events: none;
}

.glow {
  position: absolute;
  width: var(--glow-size);
  height: var(--glow-size);
  border-radius: 50%;
  filter: blur(var(--glow-blur));
  opacity: .55;
}

.hero__glow .glow { top: 60px; }
.hero__glow .glow--lime  { left: calc(50% - 690px); background: var(--lime); opacity: .38; }
.hero__glow .glow--blue  { left: calc(50% - var(--glow-size) / 2); top: 0; background: var(--accent-300); }
.hero__glow .glow--lilac { left: calc(50% + 250px); background: #c2b0ff; }

/* место под демо; рамку и всё внутри рисует demo.css / demo.js */
.demo-figure {
  width: 100%;
  margin: 0;
}


.demo-root { position: relative; }

/* заглушка, пока demo.js не отрисовал содержимое; без JS блок демо скрыт целиком (noscript в head).
   Высота как у готового демо, чтобы ничего не прыгало:
   от 1119px окна рамка 8.8% ширины + экран 540 + ряд шагов 62;
   1014-1118 экран сжат полями 4.5%; уже 1014 компактная раскладка фиксированной высоты. */
.js .demo-root:empty {
  height: 0;
  padding-bottom: calc(8.8% + 604px);
}

.js .demo-root:empty::before {
  content: "";
  position: absolute;
  inset: 0 0 62px;
  border: var(--border);
  border-radius: var(--radius-frame);
  background: var(--gradient-stage);
}

@media (max-width: 1118px) {
  .js .demo-root:empty { padding-bottom: calc(60.09% + 63px); }
}

@media (max-width: 1013px) {
  .js .demo-root:empty { padding-bottom: 0; height: 550px; }
  .js .demo-root:empty::before { bottom: 60px; border-radius: 24px; }
}

/* ---------- секции ---------- */
.section { margin-top: var(--section-gap); }

.section__title--center { text-align: center; }

/* ---------- как это работает ---------- */
.steps {
  list-style: none;
  padding: 0;
  margin-top: var(--heading-gap);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--grid-gap);
}

.step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--pad-card-lg);
  border: var(--border);
  border-radius: var(--radius-frame);
  background: var(--surface);
}

/* номер шага в форме пузыря сообщения */
.step__num {
  display: grid;
  place-items: center;
  width: var(--step-num-size);
  height: calc(var(--step-num-size) - 4px);
  margin-bottom: 24px;
  border-radius: 16px 16px 16px 5px;
  background: var(--accent-50);
  color: var(--accent-700);
  font-size: 18px;
  font-weight: var(--weight-label);
  line-height: 1;
}

.step__title {
  font-size: var(--text-h3);
  line-height: var(--leading-h3);
  font-weight: var(--weight-label);
  color: var(--ink);
}

.step__text {
  margin-top: 14px;
  font-size: var(--text-body-lg);
  line-height: 27px;
  color: var(--ink-2);
  text-wrap: pretty;
}

.tag {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: var(--weight-label);
  line-height: 16px;
}

.tag--beta { background: var(--status-click-bg); color: var(--status-click-ink); box-shadow: inset 0 0 0 1px #e6d6ff; }

.ai-note {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: var(--grid-gap);
  padding: 22px 32px;
  border: var(--border);
  border-radius: var(--radius-frame);
  background: var(--tint-2);
  font-size: var(--text-body-lg);
  line-height: 27px;
  color: var(--ink-2);
}

.ai-note strong { font-weight: var(--weight-label); color: var(--ink); }

/* ---------- цифры ---------- */
/* та же сетка в 4 колонки, что у карточки цифр: текст начинается на линии третьей ячейки */
.numbers__head {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
}

.numbers__head > .h2 {
  grid-column: 1 / 3;
  padding-right: 40px;
}

.numbers__intro { grid-column: 3 / 5; }

.numbers__lead {
  font-size: var(--text-body-lg);
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: pretty;
}

.signature {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  font-size: var(--text-body);
  font-weight: var(--weight-strong);
  color: var(--ink-strong);
}

.signature__mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: var(--lime);
  color: var(--ink);
  font-size: 13px;
  font-weight: var(--weight-label);
}

.stats {
  list-style: none;
  padding: 0;
  margin-top: var(--heading-gap);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: var(--border);
  border-radius: var(--radius-frame);
  background: var(--surface);
  overflow: hidden;
}

.stat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 36px 32px 34px;
}

.stat + .stat { border-left: var(--border); }

/* стрелка воронки на разделителе между числами */
.stat + .stat::before,
.stat + .stat::after {
  content: "";
  position: absolute;
  top: 50%;
}

.stat + .stat::before {
  left: -15px;
  width: 28px;
  height: 28px;
  margin-top: -14px;
  border: var(--border);
  border-radius: 50%;
  background: var(--surface);
}

.stat + .stat::after {
  left: -4px;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-top: 1.5px solid var(--ink-3);
  border-right: 1.5px solid var(--ink-3);
  transform: rotate(45deg);
}

.stat__value {
  font-size: var(--stat-value);
  font-weight: var(--weight-label);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.stat__label {
  font-size: var(--text-body);
  line-height: 24px;
  color: var(--ink-2);
}

.stat--final { background: var(--success-bg); }

.stat--final .stat__value::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 10px;
  border-radius: 50%;
  background: var(--success);
  vertical-align: middle;
}


/* в Unbounded нет знака рубля: берём его из Manrope, иначе подставится системный тонкий */
.rub { font-family: var(--font-text); font-weight: var(--weight-label); }

/* ---------- финальный CTA ---------- */
.cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: var(--pad-cta);
  border-radius: var(--radius-frame);
  background: var(--ink);
  color: var(--ink-on-dark);
}

.cta__glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.cta__glow .glow--blue  { right: -120px; top: -160px; background: var(--accent-500); opacity: .55; }
.cta__glow .glow--lilac { left: 28%; bottom: -320px; background: #c2b0ff; opacity: .3; }

.cta__body { max-width: var(--text-max-cta); }

.cta__title { color: var(--ink-on-dark); }

.cta__text {
  margin-top: 20px;
  font-size: var(--text-lead);
  line-height: 30px;
  color: rgb(255 255 255 / .82);
  text-wrap: pretty;
}

.cta .btn { margin-top: 32px; }

.cta :focus-visible { outline-color: var(--lime); }

.cta__bubble {
  flex: none;
  display: grid;
  place-items: center;
  width: 132px;
  height: 84px;
  margin-right: 24px;
  border: 1px solid rgb(255 255 255 / .18);
  border-radius: 32px 32px 32px 10px;
  background: rgb(255 255 255 / .08);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  color: var(--ink-on-dark);
}

.typing--lg { gap: 8px; }
.typing--lg i { width: 12px; height: 12px; }

/* ---------- футер ---------- */
.footer {
  margin-top: var(--section-gap);
  padding: 32px 0;
  border-top: var(--border);
}

.footer__line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 10px;
  row-gap: 4px;
  font-size: var(--text-small);
  line-height: var(--leading-small);
  color: var(--ink-3);
}

.footer__line > span { white-space: nowrap; }

.footer__link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease-in-out), text-decoration-color var(--dur-fast) var(--ease-in-out);
}

.footer__link:hover { color: var(--accent-600); text-decoration-color: currentColor; }
.footer__link:focus-visible { outline-offset: 2px; }

/* ---------- появления при прокрутке ---------- */
/* скрываем только когда JS точно есть (класс js на html ставится в head до отрисовки) */
.js .reveal {
  opacity: 0;
  transform: translateY(var(--reveal-shift-y));
  transition:
    opacity var(--dur-reveal) var(--ease-out) var(--delay, 0ms),
    transform var(--dur-reveal) var(--ease-out) var(--delay, 0ms);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- средние ширины ---------- */
/* заголовок не прыгает между 2 и 3 строками около 1024 */
@media (min-width: 769px) and (max-width: 1100px) {
  .h1 { font-size: clamp(36px, 4.4vw, 48px); }
}

/* цифры не упираются в разделитель */
@media (min-width: 769px) and (max-width: 960px) {
  :root { --stat-value: 48px; }
  .stat { padding: 28px 20px; }
}

/* ---------- мобильная раскладка ---------- */
@media (max-width: 768px) {
  /* 30px дают 5 строк на 360-413: держим 3 строки */
  .h1 { font-size: clamp(23px, 7.2vw, 30px); }

  .header__right { gap: 0; }
  .nav { display: none; }

  .logo { font-size: 18px; }

  .hero__title { margin-top: 16px; }
  .hero__lead { margin-top: 16px; }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 12px;
    margin-top: 24px;
  }

  .hero__actions { max-width: 440px; }
  .hero__actions .btn { padding: 12px 20px; }

  .btn__icon { width: 20px; height: 20px; }

  .hero__note { margin-top: 12px; font-size: 14px; }

  .hero__stage { margin-top: 28px; }

  .hero__glow { top: -80px; height: 520px; }
  .hero__glow .glow { top: 40px; }
  .hero__glow .glow--lime  { left: calc(50% - 250px); }
  .hero__glow .glow--blue  { top: 0; }
  .hero__glow .glow--lilac { left: calc(50% + 40px); }


  .steps { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .step { padding: 24px 20px; border-radius: var(--radius-2xl); }
  .step__num { margin-bottom: 20px; font-size: 16px; border-radius: 14px 14px 14px 5px; }
  .step__text { font-size: 16px; line-height: 24px; }

  .ai-note {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-top: 16px;
    padding: 20px;
    border-radius: var(--radius-2xl);
    font-size: 16px;
    line-height: 24px;
  }

  .numbers__head { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .numbers__head > .h2,
  .numbers__intro { grid-column: auto; padding-right: 0; }
  .numbers__lead { font-size: 16px; }

  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: var(--radius-2xl); }
  .stat { padding: 22px 18px; gap: 8px; }
  .stat + .stat { border-left: 0; }
  .stat + .stat::before,
  .stat + .stat::after { content: none; }
  .stat:nth-child(even) { border-left: var(--border); }
  .stat:nth-child(n + 3) { border-top: var(--border); }
  .stat__label { font-size: 14px; line-height: 20px; }
  .stat--final .stat__value::after { width: 8px; height: 8px; margin-left: 8px; }


  .cta {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 24px;
    border-radius: var(--radius-2xl);
  }

  .cta__text { margin-top: 14px; font-size: 16px; line-height: 24px; }
  .cta__body { width: 100%; }
  .cta .btn { margin-top: 24px; width: 100%; max-width: 440px; padding: 12px 20px; }

  .cta__bubble {
    width: 84px;
    height: 54px;
    margin-right: 0;
    border-radius: 22px 22px 22px 7px;
  }

  .typing--lg { gap: 6px; }
  .typing--lg i { width: 8px; height: 8px; }

  .cta__glow .glow--blue { right: -80px; top: -80px; }
  .cta__glow .glow--lilac { left: 10%; bottom: -170px; }

  .footer { padding: 24px 0 28px; }
  .footer__line { flex-direction: column; align-items: flex-start; row-gap: 6px; }
  .footer__sep { display: none; }
}

/* ---------- совсем узкие экраны: шапка помещается на 320 ---------- */
@media (max-width: 359px) {
  .header__inner { gap: 12px; }
  .logo { font-size: 16px; }
  .btn--sm { padding: 0 12px; font-size: 14px; }
}

/* ---------- без движения ---------- */
@media (prefers-reduced-motion: reduce) {
  .typing i {
    animation: none;
    opacity: 1;
  }

  .typing i:nth-child(2) { opacity: .7; }
  .typing i:nth-child(3) { opacity: .45; }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn, .nav__link, .footer__link, .header { transition: none; }
}
