@font-face {
  font-family: 'SaarSP';
  src: url('assets/fonts/SaarSP.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'LiteralBold';
  src: url('assets/fonts/LiteralBold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Golos Text — Paratype, Александра Королькова и Виталий Кузьмин, SIL OFL 1.1.
   Копия лицензии лежит рядом со шрифтом.

   Зачем он тут. В --font-body был прописан Work Sans, но он НЕ грузился ни
   одним @font-face и кириллицы в нём нет вообще. То есть весь мелкий русский
   текст сайта рисовался системным шрифтом посетителя: SF Pro на маке, Segoe UI
   на винде. Два разных сайта, ни один не выбран.
   Golos сделан Паратайпом под экранное чтение по-русски: высокий рост строчных,
   свободная межбуквенная, простые формы. Ровно то, что нужно подписи в 13-14 px
   на почти чёрном фоне.
   Один вариативный файл на подмножество, вес 400-900 — отдельные начертания
   не грузим. Всего ~79 КБ на три подмножества.
   latin-ext здесь не роскошь: в нём живёт ₽ (U+20BD), а рубль на этом сайте
   в каждом втором блоке. Без него знак валюты падал бы в системный шрифт
   посреди строки. */
@font-face {
  font-family: 'Golos Text';
  src: url('assets/fonts/GolosText-cyrillic.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Golos Text';
  src: url('assets/fonts/GolosText-latin.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Golos Text';
  src: url('assets/fonts/GolosText-latin-ext.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Reset & base */
*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --bg: #0a0c0d;
  --surface: #131619;
  --surface-2: #1a1f22;
  --border: #23282c;
  --border-strong: #333a3f;
  --text: #f0f2f4;
  /* Подзаголовок героя — не body и не заголовок. Без своего токена он брался
     из --muted и садился в один тон со сноской под кнопками: три роли одним
     серым. */
  --lead: #d3d8dd;
  /* было #8a9199 — 6:1, проходит AA и всё равно читается вяло: на лендинге
     основной текст не должен выглядеть отключённым. #a4acb4 даёт 8.4:1. */
  --muted: #a4acb4;
  /* Мета и юридический мелкий шрифт: ступень ниже --muted, чтобы спецификация
     не спорила с текстом. Контраст на --bg = 4.6:1, порог AA держится. */
  --meta: #767d85;
  --accent: #5ee7b3;
  --accent-dim: #3d9e7a;
  --accent-glow: rgba(94, 231, 179, 0.15);
  --danger: #ff8080;
  --max-width: 1200px;
  --font-display: 'SaarSP', 'LiteralBold', Arial, sans-serif;
  --font-body: 'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --z-sticky: 100;
  --z-buybar: 200;
}

/* Корень намеренно остаётся браузерным (16 px). Через него легко поднять
   весь сайт одной строкой — но тогда вместе с текстом едут заголовки (у них
   clamp с rem-границами), кнопки с паддингами в px и вся раскладка.
   Крупный текст здесь уже настроен, чинить надо было только мелкий, поэтому
   размеры подняты точечно по ролям ниже, а не корнем. */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  /* 17 px вместо браузерных 16. Крупный текст на странице уже настроен,
     поэтому размер поднят здесь, а не в html: заголовки живут в clamp с
     rem-границами и от смены корня поехали бы вместе с раскладкой. */
  font-size: 1.0625rem;
  line-height: 1.6;
  /* Golos вариативный, 400-900. На почти чёрном фоне Regular выглядит рыхлым:
     светлый штрих на тёмном визуально худеет. 450 возвращает вес, которого
     ждёшь от 400 на белом, и не читается как полужирный. */
  font-weight: 450;
  /* Было antialiased. На тёмной теме это ровно тот переключатель, который
     срезает у светлого текста часть штриха и делает его серым и «мыльным».
     Оставляем субпиксельное сглаживание: тот же шрифт, тот же размер, но
     буквы снова плотные. */
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Скриншоты плагинов завёрнуты в <picture> ради webp-варианта (PNG Faraway —
   1.4 МБ, webp на 800 px — 15 КБ). Обёртка по умолчанию inline и добавляет
   строчный отступ под картинкой внутри figure с overflow: hidden. */
picture {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  background: rgba(10, 12, 13, 0.78);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  color: var(--text);
  white-space: nowrap;
}

/* меню как на podlesnytwins.com: SaarSP 17px, обычное начертание */
.nav {
  display: none;
  gap: 28px;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  letter-spacing: 0.02em;
  margin-left: auto;
}

.nav a {
  color: var(--text);
  transition: color 0.2s ease;
}

/* белые как на podlesnytwins.com, поэтому ховер уводим в акцент страницы */
.nav a:hover {
  color: var(--accent);
}

/* scoped so the later .btn { display: inline-flex } cannot win on specificity */
.site-header .header-buy {
  display: none;
}

@media (min-width: 860px) {
  .nav {
    display: flex;
  }
  .site-header .header-buy {
    display: inline-flex;
  }
  /* Кнопка главной существует только ради телефона, где в шапке иначе один
     логотип. На десктопе там уже есть .nav со ссылками на оба продукта, и
     раньше кнопки не было — не меняем то, что решено. Правило идёт после
     общего, специфичность та же, поэтому побеждает порядком. */
  .site-header .header-buy--mobile {
    display: none;
  }
}

/* Typography */
h1, h2, h3, h4 {
  margin: 0 0 24px;
  line-height: 1.12;
  font-weight: 400;
  text-wrap: balance;
}

h1, h2 {
  font-family: var(--font-display);
  letter-spacing: 0.005em;
}

h1 {
  font-size: clamp(2.5rem, 5.6vw, 4.5rem);
  margin-bottom: 28px;
}

h2 {
  font-size: clamp(1.875rem, 4vw, 3rem);
}

h3 {
  font-size: 1.125rem;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.01em;
}

p {
  margin: 0 0 24px;
  color: var(--muted);
  text-wrap: pretty;
  max-width: 68ch;
}

p:last-child {
  margin-bottom: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 26px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.2;
  transition: background 0.25s var(--ease-out), border-color 0.25s var(--ease-out),
              color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
  cursor: pointer;
  border: 1px solid transparent;
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: #081410;
}

.btn-primary:hover {
  background: #7af0c4;
  box-shadow: 0 0 36px var(--accent-glow);
}

.btn-primary:disabled {
  background: var(--accent-dim);
  color: rgba(8, 20, 16, 0.65);
  cursor: progress;
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-large {
  padding: 16px 34px;
  font-size: 1.0625rem;
}

.btn-small {
  padding: 10px 18px;
  font-size: 0.875rem;
}

/* `display: inline-flex` above beats the UA rule for [hidden], so a hidden
   button would still be drawn. Say it here once, for every button. */
.btn[hidden] {
  display: none;
}

/* Sections */
.section {
  padding: 88px 0;
}

@media (min-width: 1024px) {
  .section {
    padding: 132px 0;
  }
}

.section + .section {
  border-top: 1px solid var(--border);
}

/* Hero */
.hero {
  padding: 120px 0 32px;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  gap: 56px;
  align-items: center;
}

@media (min-width: 1000px) {
  .hero {
    padding: 168px 0 120px;
  }
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 64px;
  }
}

.hero-copy h1 {
  max-width: 15ch;
}

/* Строка форматов — спецификация, а не текст. Разрядка и ступень вниз по
   тону отделяют её от заголовка; без этого она читалась как первая строка
   абзаца и утяжеляла вход в экран. */
.hero-meta {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--meta);
  margin-bottom: 22px;
}

/* Второй голос страницы. Был набран как body: тот же серый, тот же
   межстрочный 1.7 — и обещание продукта весило меньше сноски про демо.
   Мера 40ch держит его в три строки максимум при любой ширине. */
.hero-sub {
  max-width: 40ch;
  margin-bottom: 36px;
  font-size: clamp(1.1875rem, 1.7vw, 1.4375rem);
  line-height: 1.42;
  letter-spacing: -0.005em;
  color: var(--lead);
  text-wrap: balance;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* Демо: одна кнопка, платформа выбирается в раскрывающемся списке.
   Держится на <details>, поэтому клавиатура, screen reader и Enter/Space
   работают без JS; скрипт только закрывает меню по Esc и по клику мимо. */
.demo {
  position: relative;
  display: inline-flex;
}

.demo > summary {
  gap: 10px;
  list-style: none;
}

.demo > summary::-webkit-details-marker {
  display: none;
}

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

.demo-caret {
  flex: none;
  transition: transform 0.2s var(--ease-out);
}

.demo[open] > summary .demo-caret {
  transform: rotate(180deg);
}

/* абсолютное позиционирование: раскрытие не меняет высоту .hero-actions */
.demo-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  display: grid;
  width: max-content;
  min-width: 100%;
  max-width: min(340px, calc(100vw - 48px));
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.demo-option {
  display: grid;
  gap: 2px;
  align-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 7px;
  color: var(--text);
  transition: background 0.2s var(--ease-out);
}

.demo-option:hover {
  background: var(--surface);
}

.demo-option:hover .demo-option-name {
  color: var(--accent);
}

.demo-option:focus-visible {
  background: var(--surface);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 7px;
}

.demo-option-name {
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.3;
}

.demo-option-note {
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted);
}

@keyframes demo-open {
  from { opacity: 0; transform: translateY(-4px); }
}

.demo[open] .demo-menu {
  animation: demo-open 0.16s var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  .demo[open] .demo-menu { animation: none; }
  .demo-caret { transition: none; }
}

/* Условия демо под кнопками. Держим одной строкой на десктопе: всё, что
   длиннее, — это уже лицензия и платформы, им место в блоке цены. */
.hero-fine {
  max-width: 52ch;
  margin-bottom: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--meta);
}

.hero-shot {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 48px 120px rgba(0, 0, 0, 0.6), 0 0 90px -40px var(--accent-glow);
}

/* Плагин и есть герой: скриншот выходит за край контейнера в поле до края
   экрана. Объявление стоит ЗДЕСЬ, после `margin: 0` выше, а не в медиаблоке
   в начале файла, где оно пролежало мёртвым: медиазапрос не добавляет
   специфичности, поэтому более позднее `margin: 0` его перебивало и выноса
   не было ни на одной странице. У Faraway он был только потому, что
   дублировался отдельным правилом в /styles.css — лист грузится вторым. */
@media (min-width: 1000px) {
  .hero-shot { margin-right: calc((100vw - var(--max-width)) / -2 - 24px); }
}

/* Split layout */
.split {
  display: grid;
  gap: 48px;
  align-items: center;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 1fr 1fr;
    gap: 80px;
  }
}

.split .text p {
  max-width: 55ch;
}

/* The full comparison stays readable at desktop size; mobile reuses the
   same waveform pixels with native labels above each pair of channels. */
.problem .text { max-width: 70ch; }
.waveform-comparison { margin: 40px 0 0; }
.waveform-comparison__desktop { width: 100%; }
.waveform-comparison__mobile { display: none; }
.waveform-comparison figcaption { margin-top: 12px; color: var(--meta); font-size: 1rem; }

@media (max-width: 699px) {
  .waveform-comparison__desktop { display: none; }
  .waveform-comparison__mobile { display: block; }
  .waveform-comparison__row { padding: 24px 0; border-top: 1px solid var(--border); }
  .waveform-comparison__row h3 { margin: 0 0 6px; font-family: var(--font-display); font-size: 2rem; font-weight: 400; line-height: 1.15; }
  .waveform-comparison__row p { margin: 0; font-size: 1rem; color: var(--muted); }
  .waveform-comparison__row--panman h3 { color: #cc9690; }
  .waveform-comparison__row--ricochet h3 { color: var(--accent); }
  .waveform-comparison__chart { position: relative; margin-top: 20px; padding-left: 24px; }
  .waveform-comparison__channel { position: absolute; left: 0; transform: translateY(-50%); font-size: 0.875rem; font-weight: 500; line-height: 1; color: var(--muted); }
  .waveform-comparison__channel--left { top: 21.58%; }
  .waveform-comparison__channel--right { top: 78.95%; }
  .waveform-comparison__crop { position: relative; overflow: hidden; aspect-ratio: 1195 / 190; }
  .waveform-comparison__crop img { position: absolute; width: 133.891214%; max-width: none; height: auto; left: -30.543933%; }
  .waveform-comparison__crop--source img { top: -50%; }
  .waveform-comparison__crop--panman img { top: -197.368421%; }
  .waveform-comparison__crop--ricochet img { top: -344.736842%; }
  .waveform-comparison__note { margin: 12px 0 0; font-size: 1rem; color: var(--muted); }
}

/* Steps — a real sequence, so the numerals stay; the badges do not */
.steps {
  display: grid;
  gap: 8px;
  margin: 0 0 40px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

@media (min-width: 820px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
  }
}

.step {
  padding: 28px 0 4px;
  border-top: 1px solid var(--border);
}

.step-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2.5rem;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 18px;
}

.step h3 {
  margin-bottom: 10px;
}

.step p {
  margin-bottom: 0;
  max-width: 34ch;
  font-size: 1rem;
  line-height: 1.55;
}

.section-note {
  margin: 0;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 1rem;
  max-width: none;
}

/* Use cases — rows, not a card grid */
.cases {
  margin: 0;
}

.case {
  display: grid;
  gap: 8px;
  padding: 26px 0;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 820px) {
  .case {
    grid-template-columns: minmax(220px, 0.8fr) 2fr;
    gap: 48px;
    align-items: baseline;
    padding: 30px 0;
  }
}

.case:last-child {
  border-bottom: none;
}

/* Имя модуля — объект, а не выделенное жирным слово. Раньше dt и dd шли одним
   Work Sans с разницей в 100 весов, и список читался как четыре одинаковых
   серых абзаца. Дисплейный шрифт даёт настоящую ступень и рифмуется с шапкой
   плагина, где модули подписаны так же.
   ВНИМАНИЕ: в SaarSP нет цифр. Не ставьте в <dt> числа — упадёт в Arial
   посреди строки. Числа живут в .control-group dt, он остался на body. */
.case dt {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 1.9vw, 1.875rem);
  line-height: 1.15;
  letter-spacing: 0.035em;
  color: #fff;
  /* body стоит на antialiased — на тёмном фоне это срезает у светлого текста
     примерно четверть штриха. Заголовки крупные и переживают, а узкий SaarSP
     в размере подписи от этого становился серым и рыхлым. Возвращаем
     субпиксельное сглаживание точечно: тот же шрифт, тот же размер, но
     штрих снова полный. */
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
}

.case dd {
  margin: 0;
  max-width: 58ch;
  line-height: 1.55;
  color: var(--muted);
}

/* Controls */
.control-grid {
  display: grid;
  gap: 48px;
}

@media (min-width: 900px) {
  .control-grid {
    grid-template-columns: 1.15fr 1fr;
    align-items: start;
    gap: 64px;
  }
}

.control-shot {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

/* the close-up is a real crop of the same render, not the same picture again:
   the lower band of the plate, where TRIGGER and MOTION actually live */
.control-shot {
  aspect-ratio: 1040 / 330;
}

.control-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}

.control-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.control-group h3 {
  color: var(--accent);
  margin-bottom: 16px;
  font-size: 0.9375rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.control-group dl {
  margin: 0;
}

.control-group dl > div {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.control-group dl > div:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.control-group dt {
  color: var(--text);
  font-weight: 600;
  margin-bottom: 4px;
}

.control-group dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Pricing */
.pricing-inner {
  display: grid;
  gap: 48px;
  align-items: center;
}

@media (min-width: 900px) {
  .pricing-inner {
    grid-template-columns: 1fr 1fr;
    gap: 80px;
  }
}

.price-head p {
  max-width: 42ch;
}

.price-card {
  padding: 40px 32px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
  max-width: none;
}

.price-current {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 4.5rem);
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.02em;
}

.price-cur {
  font-size: 1.75rem;
  color: var(--muted);
}

.price-note {
  margin-bottom: 28px;
  font-size: 0.9375rem;
}

.formats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
}

.formats li {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
}

.price-card .btn {
  width: 100%;
  margin-bottom: 16px;
}

.price-guarantee {
  font-size: 0.875rem;
  margin-bottom: 0;
}

/* FAQ */
.faq-inner {
  max-width: 760px;
}

.faq details {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 22px 0;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
  flex: none;
}

.faq details[open] summary::after {
  content: "−";
}

.faq details p {
  padding-bottom: 22px;
  margin-bottom: 0;
  font-size: 0.9375rem;
}

/* Footer */
.site-footer {
  padding: 72px 0 40px;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: grid;
  gap: 48px;
  margin-bottom: 48px;
}

@media (min-width: 720px) {
  .footer-inner {
    grid-template-columns: 2fr 1fr;
  }
}

.footer-col h4 {
  font-size: 0.9375rem;
  color: var(--text);
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col a {
  color: var(--muted);
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: var(--text);
}

.copyright {
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.copyright p {
  margin-bottom: 0;
  font-size: 0.875rem;
}

/* Sticky buy bar — mobile only, where the header CTA is not shown */
.buybar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-buybar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: rgba(10, 12, 13, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  transform: translateY(100%);
  transition: transform 0.4s var(--ease-out);
}

.buybar[hidden] {
  display: none;
}

.buybar.is-shown {
  transform: translateY(0);
}

/* Открытый чекаут прячет бар: на телефоне он иначе лежит поверх нижней части
   формы — как раз там, где кнопка оплаты. Через :has, без JS, поэтому
   работает и когда диалог открыт не нашим обработчиком. */
body:has(dialog[open]) .buybar,
body:has(details.demo[open]) .buybar {
  transform: translateY(100%);
}

.buybar-price {
  font-size: 0.9375rem;
  font-weight: 600;
}

@media (min-width: 860px) {
  .buybar {
    display: none;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   МОБИЛЬНАЯ ВИТРИНА — единый блок, ниже десктопного контракта (860px).

   Весь остальной лист построен на min-width, поэтому мобильные правила
   собраны здесь, в одном месте, а не размазаны по файлу. Граница 860 не
   случайна: ровно на ней включаются .nav и .header-buy, то есть это и есть
   переход «телефон/планшет → десктоп». Не заводите отдельный 980/1000 для
   шапки и кнопок — там другой контракт, двухколоночный герой.

   Измерение, из которого всё следует: кнопке «14 дней бесплатно» нужно
   269 px, а колонка на экране 390 px даёт 342 px. Две .btn-large в строку
   не помещаются ни при какой вёрстке — отсюда столбик, а не уменьшение
   шрифта и не сокращение подписей.
   ───────────────────────────────────────────────────────────────────────── */
@media (max-width: 859px) {

  /* --- Кнопки: только столбик, только на всю ширину --- */
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .hero-actions .btn,
  .hero-actions .demo,
  .hero-actions .demo > summary {
    width: 100%;
  }

  .btn {
    min-height: 48px;
    /* текст кнопки не клипится никогда: лучше две строки, чем обрезок */
    white-space: normal;
    text-align: center;
  }

  /* --- Меню демо: на всю ширину колонки, а не max-content за краем --- */
  .demo {
    display: flex;
  }

  .demo-menu {
    left: 0;
    right: 0;
    width: auto;
    max-width: none;
  }

  .demo-option {
    min-height: 48px;
  }

  /* --- Шапка: бренд + покупка. Якорное меню на телефон не тащим --- */
  .site-header .header-buy {
    display: inline-flex;
    /* компактнее десктопной: рядом с логотипом на 320 px места мало */
    padding: 10px 16px;
    min-height: 40px;
    font-size: 0.875rem;
  }

  .logo {
    font-size: 1.0625rem;
  }

  .header-inner {
    gap: 12px;
  }

  /* --- Под липким баром покупки должен оставаться воздух --- */
  body:has(.buybar) .site-footer {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }

  /* --- Чекаут --- */
  .checkout {
    padding: 24px 20px;
    /* с открытой клавиатурой форма выше экрана: даём ей прокрутиться внутри */
    max-height: 100dvh;
    overflow-y: auto;
  }

  /* 16 px — не вкусовщина, а порог: на всём, что меньше, Safari на iOS
     зумит страницу при фокусе в поле и обратно уже не отъезжает. */
  .field input {
    font-size: 16px;
    min-height: 48px;
  }

  .checkout-submit {
    width: 100%;
  }

  .checkout-close {
    width: 44px;
    height: 44px;
    top: 8px;
    right: 8px;
  }

  /* заголовок не должен подлезать под крестик */
  .checkout > h2 {
    padding-right: 44px;
  }
}

/* Checkout dialog */
.checkout {
  width: min(440px, calc(100vw - 32px));
  padding: 32px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  overflow: visible;
}

.checkout::backdrop {
  background: rgba(4, 6, 7, 0.72);
  backdrop-filter: blur(4px);
}

.checkout h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.checkout-lead {
  font-size: 0.9375rem;
  margin-bottom: 28px;
}

.checkout-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.checkout-close:hover {
  color: var(--text);
  background: var(--surface-2);
}

.field {
  display: block;
  margin-bottom: 20px;
}

.field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.field input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  transition: border-color 0.2s ease;
}

.field input::placeholder {
  color: var(--muted);
}

.field input:focus {
  border-color: var(--accent);
  outline: none;
}

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

.field-hint {
  display: block;
  margin-top: 8px;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
}

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 24px;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.55;
  cursor: pointer;
}

.check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.check a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.checkout-error {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 128, 128, 0.35);
  border-radius: 8px;
  background: rgba(255, 128, 128, 0.08);
  color: var(--danger);
  font-size: 0.875rem;
  max-width: none;
}

.checkout-submit {
  width: 100%;
}

.checkout-fine {
  margin: 16px 0 0;
  font-size: 0.8125rem;
  text-align: center;
}

/* Status pages */
.status {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 96px 0;
  text-align: left;
}

.status-card {
  max-width: 620px;
}

.status-card h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  max-width: 18ch;
}

.status-steps {
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
}

.status-steps li {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.status-steps li:first-child {
  border-top: 1px solid var(--border);
}

.status-steps b {
  color: var(--text);
  font-weight: 600;
}

.status-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* Account */
.account {
  padding: 140px 0 96px;
}

.account-pane[hidden] {
  display: none;
}

.account h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  max-width: 16ch;
}

.account-pane > p {
  max-width: 56ch;
}

.account #login-form {
  max-width: 380px;
  margin-top: 32px;
}

.account-email {
  margin-bottom: 40px;
  font-size: 0.9375rem;
}

.muted-note {
  font-size: 0.875rem;
  color: var(--muted);
}

.purchase {
  padding: 28px 0;
  border-top: 1px solid var(--border);
}

.purchase-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.purchase-head h2 {
  margin: 0;
  font-size: 1.75rem;
}

.purchase-order {
  font-size: 0.8125rem;
  color: var(--muted);
}

/* Прежняя версия в карточке покупки: отделена линией, чтобы две пары кнопок
   «скачать» не читались как одна. Показывается только тем, у кого она была. */
.legacy {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.legacy-head {
  margin: 0 0 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.legacy .status-actions {
  margin-top: 12px;
}

.devices-head {
  margin: 28px 0 12px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.device {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  margin-bottom: 8px;
}

.device div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.device b {
  font-size: 0.9375rem;
  font-weight: 600;
}

.device span {
  font-size: 0.8125rem;
  color: var(--muted);
}

.account-alt {
  margin: 20px 0 0;
  font-size: 0.875rem;
}

.linklike {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.linklike:hover {
  color: #7af0c4;
}

.account-password {
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.account-password h2 {
  font-size: 1.5rem;
}

.account-password form {
  max-width: 380px;
  margin-top: 24px;
}

.account-ok {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(94, 231, 179, 0.35);
  border-radius: 8px;
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 0.875rem;
  max-width: none;
}

.account-data {
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.account-data h2 {
  font-size: 1.5rem;
}

.btn-danger:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.account-erase-note {
  margin-top: 20px;
  font-size: 0.875rem;
  color: var(--accent);
}

/* Legal pages */
.legal {
  padding: 140px 0 96px;
}

.legal-inner {
  max-width: 760px;
}

.legal h1 {
  font-size: clamp(1.875rem, 4.5vw, 2.75rem);
  max-width: none;
}

.legal h2 {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 48px 0 16px;
}

.legal p,
.legal li {
  font-size: 0.9375rem;
  max-width: none;
}

.legal ul {
  margin: 0 0 24px;
  padding-left: 20px;
  color: var(--muted);
}

.legal li {
  margin-bottom: 8px;
}

.legal b {
  color: var(--text);
  font-weight: 600;
}

.legal a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-meta {
  font-size: 0.875rem;
  margin-bottom: 8px;
}

.legal-draft {
  padding: 16px 18px;
  border: 1px solid rgba(255, 128, 128, 0.35);
  border-radius: 10px;
  background: rgba(255, 128, 128, 0.08);
  color: var(--danger);
  margin-bottom: 40px;
}

.legal-draft b {
  color: var(--danger);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 0.875rem;
  display: block;
  overflow-x: auto;
}

.legal-table th,
.legal-table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  min-width: 140px;
}

.legal-table th {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.legal-back {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* Motion — content is visible by default; reveals only where they mean something */
.reveal {
  opacity: 1;
  transform: none;
}

.js .reveal:not(.visible) {
  opacity: 0.001;
  transform: translateY(20px);
}

.js .reveal {
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal,
  .js .reveal:not(.visible) {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn,
  .buybar {
    transition: none;
  }
}
