/* ==========================================================================
   Овация — лендинг. Основные стили (светлая тема).
   Палитра совпадает с приложением: тёплый фон, чернильный текст,
   оранжевый акцент. Анимации и параллакс — в animations.css.
   ========================================================================== */

:root {
  /* Цвета */
  --bg:            #ffffff;
  --bg-2:          #ffffff;
  --bg-tint:       #EDEDEF;
  --bg-sand:       #f6efe6;
  --ink:           #1e1d1a;
  --ink-2:         #37352f;
  --muted:         #66645f;
  --muted-2:       #75736e;
  --line:          #e7e6e1;
  --line-2:        #dedcd6;
  --accent:        #e7571f;
  /* Тот же акцент, но пригодный для текста на светлом: 5,5:1 вместо 3,6:1. */
  --accent-text:   #b8410f;
  --accent-hover:  #cf4a16;
  --accent-soft:   #E6E9F3;
  --blue:          #3e7bb6;
  --blue-soft:     #e9f0f8;
  --green:         #2f9e63;

  /* Тени */
  --shadow-sm: 0 1px 2px rgba(30, 29, 26, .05), 0 2px 8px rgba(30, 29, 26, .04);
  --shadow-md: 0 6px 18px rgba(30, 29, 26, .07), 0 2px 6px rgba(30, 29, 26, .04);
  --shadow-lg: 0 26px 60px rgba(30, 29, 26, .13), 0 8px 22px rgba(30, 29, 26, .06);
  --shadow-xl: 0 44px 100px rgba(30, 29, 26, .18), 0 12px 30px rgba(30, 29, 26, .07);

  /* Геометрия */
  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --container: 1200px;

  /* Ubuntu — из макета; системные шрифты остаются запасными, если
     веб-шрифт не загрузился (лендинг должен выглядеть целым и без сети). */
  --font: 'Ubuntu', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Helvetica Neue',
          Helvetica, Arial, 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;

  --ease: cubic-bezier(.16, .84, .24, 1);
}

/* ==========================================================================
   ТЁМНЫЕ РАЗДЕЛЫ

   Экраны лендинга чередуются, начиная с тёмного первого экрана: тёмный —
   светлый. Тёмные берут палитру тёмной темы приложения
   (css/theme-tokens.css, [data-theme="dark"]): фон и поверхности — тёплый
   графит, текст — сливочный, акцент — оранжевый. Имена переменных те же, что
   на свету, поэтому карточки, плитки и панели перекрашиваются сами, без
   отдельных правил на каждый блок.

   .clouds__panel — тёмный остров внутри светлого раздела «Модели»: панель
   с настройками провайдеров повторяет экран приложения в тёмной теме, и на
   белом листе она читается чужой. Токены те же, поэтому весь узел — шапки
   провайдеров, поля с ключами, списки моделей — перекрашивается сам.

   [data-theme="dark"] — страница покупки (buy.html): она единственная на
   сайте живёт в тёмной теме целиком. Атрибут стоит прямо на <html>, как
   в справке, поэтому палитра достаёт и до модалки поддержки, которая лежит
   в <body> мимо тёмных разделов.
   ========================================================================== */

.section--dark,
.footer--dark,
.hero--dark,
.clouds__panel,
[data-theme="dark"] {
  --bg:            #241e20;
  --bg-2:          #2b2426;
  --bg-tint:       #2e2729;
  /* Самый тёмный тон приложения (--editor-bg): поля и текстовые окна */
  --bg-deep:       #110c0c;
  --ink:           #e3d3bb;
  --ink-2:         #d8c9b3;
  --muted:         #b5a795;
  --muted-2:       #9c9080;
  --line:          #322b2d;
  --line-2:        #3d3437;
  --accent:        #f2682f;
  --accent-hover:  #ff7f4a;
  --accent-soft:   #3a1d12;
  --blue:          #8ec0ea;
  --blue-soft:     #262a33;
  --green:         #5cc07f;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .34), 0 2px 8px rgba(0, 0, 0, .24);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, .40), 0 2px 6px rgba(0, 0, 0, .26);
  --shadow-lg: 0 26px 60px rgba(0, 0, 0, .52), 0 8px 22px rgba(0, 0, 0, .32);
  --shadow-xl: 0 44px 100px rgba(0, 0, 0, .60), 0 12px 30px rgba(0, 0, 0, .36);

  color: var(--ink-2);
}

/* Фон тёмного раздела — тот же графит. Первый экран красит себя сам
   (фотография в .hero), поэтому заливка вынесена отдельно. */
.section--dark,
.footer--dark { background: var(--bg); }

/* Страница целиком в тёмной теме: графит и на <html> — иначе при прокрутке
   за края документа мелькал бы белый. color-scheme отдаёт браузеру тёмные
   системные контролы: выпадающий список темы обращения, флажок согласия
   и полосы прокрутки. */
[data-theme="dark"] {
  background: var(--bg);
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* Одно кольцо фокуса на всю страницу: currentColor сам берёт чернильный тон
   на свету и сливочный на графите, поэтому кольцо видно в любом разделе. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 4px;
}
button { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -.022em;
  line-height: 1.08;
}

p { margin: 0; }

code {
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  font-size: .88em;
  background: rgba(30, 29, 26, .06);
  border-radius: 6px;
  padding: 2px 6px;
}

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

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

/* ============================== ПРОГРЕСС ============================== */

.scroll-progress {
  position: fixed;
  inset: 0 auto auto 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #f5a24b);
  z-index: 120;
  border-radius: 0 3px 3px 0;
  transition: width .1s linear;
}

/* ============================== ШАПКА ==============================

   Шапка всегда тёмная — и над первым экраном, и над белыми разделами. Раньше
   она перекрашивалась: js/main.js вешал класс .nav--dark, когда под ней
   оказывался тёмный экран, и на светлых разделах полоса становилась белой.
   При беглой прокрутке это давало мигание, а на белом фоне шапка сливалась с
   содержимым. Теперь цвета тёмной палитры стоят прямо в правилах .nav и не
   зависят ни от класса, ни от скрипта.

   Цвета здесь заданы значениями, а не переменными: сама шапка лежит в светлой
   области документа, и var(--ink) внутри неё — тёмный, а не сливочный. */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background .3s ease, box-shadow .3s ease, border-color .3s ease;
  border-bottom: 1px solid transparent;
}

/* Над контентом шапка полупрозрачная: под ней видно и графит первого экрана,
   и белый раздел — размытие гасит разницу. */
.nav.is-stuck {
  background: rgba(36, 30, 32, .86);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: #322b2d;
}

/* Три колонки: логотип — ссылки — кнопка. Боковые колонки одной ширины
   (1fr), поэтому ссылки стоят ровно по центру шапки, как и раньше, когда
   логотипа ещё не было. */
.nav__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  height: 68px;
}

/* Логотип: значок-овца и надпись «Овация» одним файлом. */
.nav__brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-width: max-content;   /* знак не сжимается, когда ссылки упираются в края */
  line-height: 0;
  border-radius: 12px;
  transition: opacity .2s ease;
}

.nav__brand:hover { opacity: .8; }

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

/* Логотип: значок-овца и надпись «Овация» одним файлом. Надпись в исходнике
   белая — она рассчитана ровно на тёмную шапку. */
.nav__brand-logo { display: block; width: auto; height: 51px; }

.nav__links {
  display: flex;
  justify-self: center;
  gap: 4px;
}

.nav__links a {
  padding: 9px 14px;
  border-radius: 999px;
  color: #b5a795;
  font-size: 16px;
  font-weight: 500;
  transition: color .2s ease, background .2s ease;
}

.nav__links a:hover { color: #e3d3bb; background: rgba(227, 211, 187, .08); }

/* Кнопка на тёмной шапке: чёрная плитка на графите не читается — берём акцент.
   Подпись тёмная, а не белая: белым по #f2682f выходило 3,1:1, а по тёмному
   графиту кнопка всё равно читается как акцентное пятно. */
.nav .btn--primary { background: #f2682f; color: #1b0d05; }

.nav .btn--primary:hover { background: #ff7f4a; color: #1b0d05; }

.nav__actions { justify-self: end; display: flex; align-items: center; gap: 10px; }

.nav__burger {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid #3d3437;
  border-radius: 12px;
  background: #2b2426;
  cursor: pointer;
  padding: 0;
  place-items: center;
  gap: 5px;
  flex-direction: column;
}

.nav__burger span {
  display: block;
  width: 17px;
  height: 2px;
  border-radius: 2px;
  background: #e3d3bb;
  transition: transform .25s var(--ease), opacity .2s ease;
}

.nav__burger.is-open span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav__burger.is-open span:last-child  { transform: translateY(-3.5px) rotate(-45deg); }

/* ============================== КНОПКИ ============================== */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform .28s var(--ease), box-shadow .28s var(--ease),
              background .2s ease, border-color .2s ease, color .2s ease;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: #1e1d1a;
  /* background: var(--accent); */
  color: #fff;
  /* box-shadow: 0 6px 16px rgba(231, 87, 31, .24); */
}

.btn--primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 14px 30px rgba(231, 87, 31, .32);
}

/* Второстепенная кнопка: рамка заметнее обычной линии — тень убрана,
   контур держит кнопку сам. */
.btn--ghost {
  background: var(--bg-2);
  border-color: #787672;
  color: var(--ink);
  /* box-shadow: var(--shadow-sm); */
}

.btn--ghost:hover { border-color: var(--ink-2); box-shadow: var(--shadow-md); }

.btn--sm { padding: 9px 18px; font-size: 15px; }

.btn--lg { padding: 15px 26px; font-size: 17px; }

.btn--block { width: 100%; }

.btn__icon { width: 22px; height: 22px; flex: none; }

.btn__text { display: grid; text-align: left; line-height: 1.2; }

.btn__text small {
  font-size: 12px;
  font-weight: 500;
  opacity: .72;
  letter-spacing: .01em;
}

/* «Скоро» — сборка готова, но на сервер её ещё не выложили */
.btn.is-soon {
  background: var(--bg-tint);
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: auto;
}

.btn.is-soon:hover { transform: none; box-shadow: none; }
.btn.is-soon .btn__text small::after { content: ' · скоро'; color: var(--accent); font-weight: 600; }

/* ============================== HERO ==============================
   Первый экран — тёмный: палитру берёт класс .hero--dark из блока токенов
   выше, а фон — фотография-градиент во весь экран. Цвет в background стоит
   страховкой: пока картинка грузится (и если её отключили), экран остаётся
   графитовым, а не белым. */

.hero {
  position: relative;
  /* Первый экран занимает окно целиком. Именно min-height, а не height:
     содержимое первого экрана — около 1055px (заголовок, кнопки, снимок
     приложения), и на низком окне — ноутбук 900px — фиксированная высота
     обрезала бы его, а снимок вылезал на белый раздел «Проекты». На высоком
     окне разницы нет: секция всё равно растягивается на весь экран. */
  min-height: 100vh;
  padding: 116px 0 92px;
  background: #241e20 url('../img/bg-2k.jpg') center / cover no-repeat;
}

/* Тот же кадр в WebP: 1,5 МБ JPEG против 13 КБ WebP на десктопе и 4 КБ на
   телефоне. @supports не даёт старым движкам остаться без фона, а media
   отдаёт мобильному вдвое меньший файл. */
@supports (background-image: image-set(url("x.webp") type("image/webp"))) {
  .hero--dark { background-image: url('../img/bg-2k-1600.webp'); }

  @media (max-width: 760px) {
    .hero--dark { background-image: url('../img/bg-2k-1024.webp'); }
  }
}

.blob--orange {
  width: 620px; height: 620px;
  left: -180px; top: -220px;
  background: radial-gradient(circle at 50% 50%, rgba(231, 87, 31, .30), rgba(231, 87, 31, 0) 68%);
}

.blob--blue {
  width: 560px; height: 560px;
  right: -160px; top: -120px;
  background: radial-gradient(circle at 50% 50%, rgba(62, 123, 182, .26), rgba(62, 123, 182, 0) 70%);
}

.blob--soft { opacity: .34; }

.hero__copy {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  max-width: 980px;
}

.hero__icon {
  width: 68px;
  height: 68px;
  border-radius: 12px;
  image-rendering: pixelated;
  box-shadow: 0 10px 26px rgba(231, 87, 31, .20);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.eyebrow::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.eyebrow--tight { margin-bottom: 4px; }

.hero__title {
  max-width: 100%;
  font-size: clamp(32px, 4.4vw, 62px);
  line-height: 1.14;
  /* Ubuntu сам по себе узкий: в макете заголовок набран без трекинга */
  letter-spacing: normal;
  font-weight: 800;
  color: var(--ink);
}

/* Подложка под «быстро и просто»: тёмная плашка из макета — снизу строки
   вверх, чуть шире слов, позади текста. Размеры в em, чтобы масштабировались
   вместе с кеглем заголовка. */
.hero__title .mark {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  z-index: 0;
}

.hero__title .mark::before {
  content: '';
  position: absolute;
  left: -.01em;
  right: -.01em;
  bottom: 0;
  height: .52em;
  border-radius: .26em;
  background: #4b4242;
  z-index: -1;
}

.hero__subtitle {
  font-size: clamp(16px, 1.25vw, 18px);
  color: var(--muted);
}

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

.hero__actions .btn {
  padding: 14px 24px;
}

/* Кнопки первого экрана. Селекторы с двойным классом перебивают состояние
   .is-soon: в hero кнопки выглядят как в макете, даже если сборки на сервере
   ещё нет (клик по ней в таком случае скажет, что файл не выложен). */
.btn.btn--mac {
  background: #ffffff;
  border-color: #ffffff;
  color: #000000;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .28);
}

.btn.btn--mac:hover {
  background: #eceae4;
  border-color: #eceae4;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .38);
}

.btn.btn--win {
  background: #82b7d8;
  border-color: #82b7d8;
  color: #101010;
  box-shadow: 0 8px 20px rgba(130, 183, 216, .34);
}

.btn.btn--win:hover {
  background: #93c4e1;
  border-color: #93c4e1;
  box-shadow: 0 14px 30px rgba(130, 183, 216, .46);
}

.btn--mac .btn__text small,
.btn--win .btn__text small { opacity: .68; }

.hero__actions .btn.is-soon { cursor: pointer; }

.hero__actions .btn.is-soon .btn__text small::after { content: none; }

.hero__meta {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

/* ---- Сцена: окно приложения и овечки ---- */

.hero__stage { position: relative; margin-top: 84px; z-index: 2; }

.stage { position: relative; }

.window {
  position: relative;
  z-index: 1;
  border-radius: 20px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .52), 0 6px 18px rgba(0, 0, 0, .32);
  overflow: hidden;
  will-change: transform;
}

.window picture { display: block; }

.window img { width: 100%; }

/* Овечки расставлены по макету: спит на кромке окна, пасётся у левого края,
   идёт правее окна. Разная скорость параллакса даёт глубину сцены. */
.stage__sheep {
  position: absolute;
  z-index: 4;
  height: auto;
  pointer-events: none;
  user-select: none;
  image-rendering: pixelated;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .45));
  will-change: transform;
}

.stage__sheep--sleep {
  left: 19.4%;
  bottom: 100%;
  width: clamp(74px, 10.9%, 128px);
  margin-bottom: -1.2%;
}

.stage__sheep--eat {
  left: -4.1%;
  top: 71%;
  width: clamp(74px, 10.9%, 128px);
}

.stage__sheep--walk {
  left: 100%;
  top: 58%;
  margin-left: 11.3%;
  width: clamp(68px, 10.1%, 120px);
}


/* ============================== СЕКЦИИ ============================== */

.section {
  position: relative;
  padding: 112px 0;
}

.section--dark { background: var(--bg); }

/* Волосяная линия на стыке тёмного раздела со светлым: без неё края
   сливаются, когда разделы идут подряд. */
.section--dark::before,
.section--dark::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
}

.section--dark::before { top: 0; }
.section--dark::after  { bottom: 0; }

/* Подсветка в углах раздела: слой под содержимым. Пятна лежат в
   .section__decor, поэтому без position: absolute они схлопывались в
   невидимую строку, а без z-index перекрывали текст. */
.section__decor { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }

.section > .container { position: relative; z-index: 1; }

.blob { position: absolute; display: block; border-radius: 50%; }

/* 880px — под ширину Ubuntu: строки заголовков с <br> должны влезать целиком */
.section__head { max-width: 880px; margin-bottom: 60px; }
.section__head--center { margin-left: auto; margin-right: auto; text-align: center; justify-items: center; display: grid; }

.section__head h2 { margin: 18px 0 0; font-size: clamp(30px, 3.8vw, 50px); }

.section__head .eyebrow { margin-bottom: 4px; }

.section__lead {
  margin-top: 20px;
  font-size: clamp(16.5px, 1.15vw, 19px);
  color: var(--muted);
  max-width: 680px;
}

.section__head--center .section__lead { margin-left: auto; margin-right: auto; }

/* ============================== ПРОЕКТЫ ============================== */

.split {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 64px;
  align-items: start;
}

.split__text { display: grid; gap: 30px; }

.feature {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 6px 16px;
  align-items: start;
}

.feature__icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  color: var(--accent);
}

/* Иконки — контурные SVG 16×16 из набора приложения (js/ui-icons.js):
   линия наследует цвет от родителя, поэтому эмодзи здесь больше нет. */
.feature__icon svg { width: 22px; height: 22px; }

.feature h3 { font-size: 20px; }
.feature p { color: var(--muted); font-size: 15.8px; }

.split__media { position: relative; }

.media {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  will-change: transform;
}

/* Скриншот проекта — цельная карточка «Типаж автора» (772×779), а не длинный
   свиток: контейнер держит ровно её пропорции, поэтому кадр виден целиком, без
   обрезки по бокам. Мягкого затемнения снизу тут нет: оно съедало бы нижнюю
   строку карточки, а прятать обрезанный край больше нечего. В одну колонку
   (≤1080px) высоту тоже не ограничиваем: квадратный кадр помещается сам. */
.media img { display: block; width: 100%; height: auto; }

.media--shot { aspect-ratio: 772 / 779; }

.media--shot img { height: 100%; object-fit: cover; object-position: top center; }

.media__pin {
  position: absolute;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .93);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.media__pin--top { top: 14px; left: 14px; }
.media__pin--bottom { bottom: 14px; right: 14px; color: var(--accent); }

/* ---- Правила ---- */

.rules-strip {
  margin-top: 96px;
  padding-top: 64px;
  border-top: 1px solid var(--line);
}

.rules-strip__head { display: grid; gap: 16px; max-width: 760px; margin-bottom: 34px; }
.rules-strip__head h3 { font-size: clamp(22px, 2.2vw, 30px); }
.rules-strip__head p { color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: 14.5px;
  color: var(--muted);
  transition: transform .25s var(--ease), border-color .25s ease, color .25s ease, box-shadow .25s ease;
}

.chip:hover { transform: translateY(-2px); border-color: var(--line-2); color: var(--ink); box-shadow: var(--shadow-sm); }

.chip--on {
  background: var(--accent-soft);
  border-color: rgba(231, 87, 31, .28);
  color: var(--accent-hover);
  font-weight: 600;
}

.chip--on::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.chip--more {
  border-style: dashed;
  background: transparent;
  color: var(--muted-2);
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 56px;
}

.mini {
  padding: 26px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}

.mini:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.mini b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 8px; }
.mini p { color: var(--muted); font-size: 15px; }

/* ============================== ЧАТ И АГЕНТЫ ============================== */

.cards { display: grid; gap: 20px; }
.cards--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform .32s var(--ease), box-shadow .32s var(--ease), border-color .3s ease;
}

.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--line-2); }

.card__icon {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 13px;
  background: var(--bg-tint);
  font-size: 21px;
  margin-bottom: 18px;
}

.card h3 { font-size: 18.5px; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 15.5px; }

/* «Простые» карточки: светлый градиент из макета задавался белым цветом, из-за
   чего в тёмном разделе они оставались белыми, а заголовки в них — сливочными
   (h3 берёт --ink). Собираем тот же градиент из переменных: на свету это
   по-прежнему белый в почти белый, на графите — две соседние его ступени. */
/* ---- Агенты ---- */

/* Прежде блок был врезкой на подложке --bg-2; теперь это четыре плиты во всю
   ширину колонки, как в макете, поэтому внешняя заливка и рамка убраны —
   иначе плиты стояли бы на плите того же тона. */
.agents { margin-top: 72px; }

.agents__head { max-width: 720px; margin-bottom: 30px; display: grid; gap: 12px; }
.agents__head h3 { font-size: clamp(22px, 2.2vw, 30px); }
.agents__head p { color: var(--muted); }

/* Плиты агентов — сетка 2×2 из макета (Figma, узел 12:66). Цвета взяты
   значениями из макета, а не токенами раздела: плита #262122 чуть светлее
   фона раздела #241e20, у неё своя рамка #3d3d3d (у токена --line-2 она
   розовее), сливочный заголовок #dfcdb4 и сизые плашки правил #555368 —
   такого цвета в палитре лендинга нет вовсе. Чтобы значения не расползались
   по правилам, они стоят здесь, рядом с остальной геометрией блока. */
.agents__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.agent-card {
  /* Масштаб овцы: 1 — плита в макете (560 px). На узких экранах фигурка
     ужимается вместе с плитой, иначе она налезала бы на текст. */
  --sheep-scale: 1;

  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  /* 303 px — высота плиты в макете. Тело поджато к верху, плашки правил —
     к низу, промежуток между ними забирает justify-content. */
  min-height: 303px;
  padding: 24px;
  border-radius: 16px;
  background: #262122;
  border: 1px solid #3d3d3d;
  /* Овца крупнее плиты: нижняя кромка её срезает, и она «стоит» на краю. */
  overflow: hidden;
}

/* У каждой роли своя фигурка, и ширина у них разная — поэтому ширина овцы,
   её отступ справа и предельная ширина плашек заданы на плите. Плашки не
   должны заезжать под овцу: это и есть назначение --rules-w. */
.agent-card--plot   { --sheep-w: 141px; --sheep-right: 11px; --rules-w: 385px; }
.agent-card--writer { --sheep-w: 160px; --sheep-right: 10px; --rules-w: 359px; }
.agent-card--editor { --sheep-w: 148px; --sheep-right: 24px; --rules-w: 385px; }
.agent-card--plain  { --sheep-w: 141px; --sheep-right: 18px; --rules-w: 359px; }

/* Заголовок и описание роли. Ширина 345 px — из макета: она оставляет
   место овце справа и задаёт те же четыре строки текста, что в макете. */
.agent-card__body { display: grid; gap: 16px; max-width: 345px; }

.agent-card__body h4 {
  font-size: 30px;
  line-height: 34px;
  color: #dfcdb4;
}

/* Межстрочное 16 px при кегле 14 px — тоже из макета: строки описания
   должны занимать ровно те же четыре строки. */
.agent-card__body p {
  font-size: 14px;
  line-height: 16px;
  color: #b7aea1;
}

/* Плашки правил — «что включит этот агент». Предельная ширина отсекает
   строку до овцы, поэтому перенос выходит таким же, как в макете. */
.agent-card__rules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: var(--rules-w, 385px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.agent-card__rules li {
  padding: 4px 8px;
  border-radius: 50px;
  background: #555368;
  color: #dfcdb4;
  font-size: 12px;
  line-height: 14px;
}

/* Фигурка прижата к нижней кромке плиты, поэтому её срезает overflow —
   ровно тот же эффект, что в макете. pointer-events снят: под овцой может
   оказаться текст при переполнении, и она не должна перехватывать клик. */
.agent-card__sheep {
  position: absolute;
  right: var(--sheep-right, 12px);
  bottom: 0;
  width: calc(var(--sheep-w, 141px) * var(--sheep-scale, 1));
  max-width: none;
  height: auto;
  pointer-events: none;
}

/* ============================== МОДЕЛИ ============================== */

.providers {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.provider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-size: 15px;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s ease;
}

.provider:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-2); }

/* Логотип провайдера — настоящий знак бренда из img/logos;
   плитка остаётся тонированной фирменным цветом (--c) */
.provider__mark {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  flex: none;
  border-radius: 11px;
  background: color-mix(in srgb, var(--c) 12%, #fff);
  border: 1px solid color-mix(in srgb, var(--c) 22%, #fff);
}

.provider__mark img { display: block; width: 22px; height: 22px; }

.provider b { color: var(--ink); font-weight: 600; }

.provider--local { background: linear-gradient(180deg, #fff, var(--blue-soft)); }

/* ---- YandexGPT и GIGA-чат ---- */

.clouds {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 56px;
  align-items: start;
  margin-top: 64px;
}

.clouds__copy h3 { font-size: clamp(24px, 2.4vw, 34px); margin: 14px 0 16px; }
.clouds__copy p { color: var(--muted); }

/* Имя провайдера в списке — не просто жирная строка внутри серого текста */
.ticks b { color: var(--ink-2); font-weight: 600; }

.ticks { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 11px; }

.ticks li {
  position: relative;
  padding-left: 30px;
  color: var(--muted);
  font-size: 15.5px;
}

.ticks li::before {
  content: '';
  position: absolute;
  left: 0; top: .45em;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23e7571f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5 6.5 11.5 12.5 5'/%3E%3C/svg%3E") center/11px no-repeat;
}

.clouds__panel {
  display: grid;
  gap: 14px;
  padding: 26px;
  border-radius: var(--radius-xl);
  background: var(--bg-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  will-change: transform;
}

.cloud {
  padding: 18px 18px 16px;
  border-radius: var(--radius);
  background: var(--bg-tint);
}

.cloud__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.cloud__logo {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  flex: none;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}

.cloud__logo img { display: block; width: 20px; height: 20px; }

.cloud__title { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
.cloud__title b { color: var(--ink); font-size: 16px; }
.cloud__title i { color: var(--muted-2); font-style: normal; font-size: 12.5px; }

/* Поля внутри карточки провайдера — те же панельные, только плотнее */
.cloud .panel__field { margin: 14px 0 0; }
.cloud .panel__status { margin-top: 8px; }
.cloud .panel__models { margin: 12px 0 0; }
.cloud .panel__models li { background: var(--bg-2); }

.clouds__panel .panel__note { margin: 4px 2px 0; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
}

.badge--ok { background: rgba(47, 158, 99, .1); color: var(--green); }

.pulse {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 rgba(47, 158, 99, .5);
  animation: pulse 2.4s infinite;
}

.panel__status { margin-top: 10px; color: var(--muted-2); font-size: 14px; }

.panel__field {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.panel__input,
.panel__btn {
  padding: 10px 14px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: var(--bg);
  font-size: 13.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink-2);
}

.panel__input { flex: 1 1 180px; }

.panel__btn { background: var(--bg-2); font-family: var(--font); font-weight: 600; color: var(--muted); }

.panel__btn--dark { background: var(--ink); color: #fff; border-color: var(--ink); }

.panel__models { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }

.panel__models li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 15px;
  border-radius: 12px;
  background: var(--bg-tint);
  font-size: 13.5px;
}

.panel__models b { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); font-weight: 600; }
.panel__models i { color: var(--muted-2); font-style: normal; }

.panel__note { font-size: 13.5px; color: var(--muted-2); }

.models__foot {
  margin-top: 44px;
  max-width: 720px;
  color: var(--muted);
  font-size: 15.5px;
}

/* ============================== СКАЧАТЬ ============================== */

/* Дуэт по бокам заголовка. Стоит вне его колонки в 880 px, поэтому держится
   симметрично тексту на любой ширине экрана, а не по краям раздела. */
.downloads__head { position: relative; }

.downloads__cast {
  position: absolute;
  inset: 0;
  pointer-events: none;
  user-select: none;
}

.downloads__pal {
  position: absolute;
  top: 50%;
  /* Середина коробки заголовка — это и середина его текста: подгонять по
     высоте строк не нужно. Центрирование живёт в translate, а не в
     transform: transform целиком собран скриптом (параллакс + появление).
     Тот же сдвиг лежит в --pal-lift — из него считается покачивание. */
  translate: 0 -50%;
  --pal-lift: -50%;
  /* Наклон — отдельным свойством rotate по той же причине: transform занят
     параллаксом. rotate идёт до transform и потому крутит вокруг центра
     картинки, а не вместе с её смещением. Угол лежит в --pal-tilt: из него же
     считается покачивание, а при отключённых анимациях он просто остаётся. */
  rotate: var(--pal-tilt, 0deg);
  width: 121px;
  height: auto;
  filter: drop-shadow(0 10px 16px rgba(31, 26, 28, .16));
}

/* Высоты и наклоны нарочно разные: стрелок ниже и завален влево, любитель
   бургеров выше и завален вправо. Пара читается как случайный кадр, а не как
   построение, и заодно разъезжается по вертикали сильнее, чем даёт один
   параллакс. Зазор в 22 px, а не в 28: наклонённый на 18° герой справа шире
   своей рамки на 12 px в каждую сторону, и при 1200 px поле контейнера
   кончается — с прежним зазором афро срезалось бы кромкой экрана. */
.downloads__pal--left  { right: calc(100% + 22px); top: 80%; --pal-tilt: -9.02deg; }
.downloads__pal--right { left: calc(100% + 22px);  top: 16%; --pal-tilt: 18deg; }

.downloads {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  max-width: 880px;
  margin: 0 auto;
}

.download {
  padding: 32px;
  border-radius: var(--radius-xl);
  background: var(--bg-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 6px;
  transition: transform .34s var(--ease), box-shadow .34s var(--ease);
}

.download:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

.download__icon {
  display: grid;
  place-items: center;
  width: 62px; height: 62px;
  border-radius: 18px;
  background: var(--bg-tint);
  color: var(--ink);
  margin-bottom: 10px;
}

.download__icon svg { width: 32px; height: 32px; }

.download h3 { font-size: 24px; }
.download__req { color: var(--muted); font-size: 15px; }
.download__file {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  color: var(--muted-2);
  margin-bottom: 14px;
  word-break: break-all;
}

.download--soon .download__icon { opacity: .6; }

.download__hint { margin-top: 14px; max-width: 30ch; font-size: 13.5px; color: var(--muted-2); }

.source {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  max-width: 880px;
  margin: 28px auto 0;
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: rgba(255, 255, 255, .82);
  box-shadow: var(--shadow-md);
}

.source__text { display: grid; gap: 2px; }
.source__text b { color: #fff; }
.source__text span { font-size: 14px; opacity: .72; }

.source__code {
  background: rgba(255, 255, 255, .08);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  color: #fff;
  margin-left: auto;
}

.source__prompt { color: #f5a24b; margin-right: 6px; }
.source__comment { color: rgba(255, 255, 255, .45); margin-left: 8px; }

.source__copy {
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, transform .2s var(--ease);
}

.source__copy:hover { background: rgba(255, 255, 255, .14); transform: translateY(-1px); }

.notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  max-width: 880px;
  margin: 28px auto 0;
}

.note {
  padding: 20px 24px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: 14.5px;
  color: var(--muted);
}

.note b { color: var(--ink); }

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

.faq { max-width: 880px; margin: 88px auto 0; }

.faq h3 { font-size: clamp(22px, 2.2vw, 30px); margin-bottom: 24px; }

.faq__list { display: grid; gap: 12px; }

.faq details {
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: box-shadow .3s ease, border-color .3s ease;
}

.faq details[open] { box-shadow: var(--shadow-md); border-color: var(--line-2); }

.faq summary {
  position: relative;
  list-style: none;
  cursor: pointer;
  padding: 20px 56px 20px 24px;
  font-weight: 600;
  color: var(--ink);
  font-size: 16.5px;
}

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

.faq summary::after {
  content: '';
  position: absolute;
  right: 24px; top: 50%;
  width: 11px; height: 11px;
  border-right: 2px solid var(--muted-2);
  border-bottom: 2px solid var(--muted-2);
  transform: translateY(-70%) rotate(45deg);
  transition: transform .3s var(--ease);
}

.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }

.faq details p { padding: 0 24px 22px; color: var(--muted); font-size: 15.5px; }

/* ============================== ПОДВАЛ ============================== */

/* Подвал закрывает чередование: за белым разделом скачивания идёт тёмный,
   как и остальные пары на странице. */
.footer {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  padding: 44px 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.footer__brand { display: flex; align-items: center; gap: 12px; }
.footer__brand img { height: 30px; width: auto; image-rendering: pixelated; }
.footer__brand b { display: block; color: var(--ink); }
.footer__brand span { font-size: 13.5px; color: var(--muted-2); }

.footer__links { display: flex; gap: 20px; margin: auto; flex-wrap: wrap; align-items: center; }

/* Ссылка на свету и кнопка «Написать в поддержку» в подвале выглядят одинаково:
   кнопка нужна лишь потому, что открывает модалку, а не переход по якорю. */
.footer__links a,
.footer__support {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14.5px;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s ease;
}

.footer__links a:hover,
.footer__support:hover { color: var(--accent); }

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

.footer__note { font-size: 13.5px; color: var(--muted-2); width: 100%; }

/* ==================== ТЁМНЫЕ РАЗДЕЛЫ: ЧАСТНОСТИ ====================
   То, что не перекрашивается переменными: цвета, зашитые в светлую тему,
   знаки провайдеров и поля-макеты внутри карточек.

   Кроме тёмных разделов эти же правила нужны тёмной панели провайдеров
   (.clouds__panel): она стоит островом в светлом разделе «Модели», и селекторы
   вида `.section--dark …` до неё не достают. */

/* Поля и кнопки в карточках провайдеров.
   В приложении тёмная тема уводит поле в самый тёмный тон, а кнопка остаётся
   поверхностью карточки. На лендинге этого мало: карточка, поле и кнопка
   собирались в одно тёмное пятно, и кнопку с полем не было видно. Поэтому у
   поля и кнопки контур из сливочного (--ink), а текст — почти белый. */
.section--dark .panel__input,
.clouds__panel .panel__input {
  background: var(--bg-deep);
  border-color: rgba(227, 211, 187, .42);
  color: var(--ink);
}

.section--dark .panel__btn,
.clouds__panel .panel__btn {
  background: rgba(227, 211, 187, .18);
  border-color: rgba(227, 211, 187, .42);
  color: var(--ink);
}

/* Строка модели: раньше её подложка совпадала с карточкой, и список читался
   серой массой. Теперь строка светлее карточки и обведена контуром. */
.section--dark .cloud .panel__models li,
.clouds__panel .cloud .panel__models li {
  background: rgba(227, 211, 187, .11);
  border: 1px solid rgba(227, 211, 187, .22);
}

/* Пояснение справа от модели («умнее», «быстрее и дешевле») и строка статуса
   на тёмном фоне были почти нечитаемы: поднимаем до --muted. */
.section--dark .panel__models i,
.section--dark .panel__status,
.clouds__panel .panel__models i,
.clouds__panel .panel__status { color: var(--muted); }

.section--dark .panel__btn--dark { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Плитка знака провайдера: на свету она подмешивает белый, в тёмном разделе —
   поверхность карточки, иначе плитка светится пятном. */
.section--dark .provider__mark {
  background: color-mix(in srgb, var(--c) 20%, var(--bg-2));
  border-color: color-mix(in srgb, var(--c) 30%, var(--bg-2));
}

.section--dark .provider--local { background: linear-gradient(180deg, var(--bg-2), var(--blue-soft)); }

/* Галочка в списке: подложка берётся из переменной, а сама галочка нарисована
   в data-URI цветом светлой темы — в тёмной её нужно перекрасить. */
.section--dark .ticks li::before {
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23f2682f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5 6.5 11.5 12.5 5'/%3E%3C/svg%3E") center/11px no-repeat;
}

.section--dark .badge--ok,
.clouds__panel .badge--ok { background: rgba(92, 192, 127, .14); }

.section--dark code { background: rgba(227, 211, 187, .1); }

/* Кнопка на тёмном фоне: чёрная плитка на графите не читается — берём акцент.
   Подпись чернильная: белым по #e7571f выходило 3,6:1, а с тёмной подписью
   акцентное пятно остаётся ярким и читается на 5,2:1. Наведение светлеет,
   а не темнеет, — так кнопка ведёт себя последовательно во всех разделах. */
.section--dark .btn--primary { background: var(--accent); color: #1b0d05; }

.section--dark .btn--primary:hover { background: #f2682f; }

/* ---- Тёмная тема страницы покупки ----
   Токены у неё те же, что у тёмных разделов (data-theme="dark" на <html>),
   а здесь — то, что в светлой теме было зашито значениями. */

/* Кнопка на графите: чёрная плитка не читается — берём акцент. Модалка,
   формы и кнопки лежат вне .section--dark, поэтому нужен свой селектор. */
[data-theme="dark"] .btn--primary { background: var(--accent); color: #1b0d05; }
[data-theme="dark"] .btn--primary:hover { background: #f2682f; }

[data-theme="dark"] code { background: rgba(227, 211, 187, .1); }

/* Всплывающая подсказка на свету — чернильная плашка с белым текстом.
   В тёмной теме «чернила» становятся сливочными, и белый текст на них
   пропадал: подсказку уводим в самый тёмный тон приложения. */
[data-theme="dark"] .toast { background: var(--bg-deep); color: var(--ink); }

/* Ошибки формы: тёмно-красный на графите не читается */
[data-theme="dark"] .field__error { color: #f0907f; }
[data-theme="dark"] .field.is-invalid .field__area,
[data-theme="dark"] .field.is-invalid .field__input { border-color: #f0907f; }
[data-theme="dark"] .consent.is-invalid .consent__input { outline-color: #f0907f; }

/* ==================== ПОДДЕРЖКА: МОДАЛКА И ФОРМА ====================
   Модалка живёт в <body>, а не в тёмном подвале, поэтому берёт светлую
   палитру из :root — как остальные поверхности страницы. */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal[hidden] { display: none; }

/* Прячем всё, что помечено hidden, даже если у элемента свой display:
   у .support и .support__done он grid, и атрибут сам по себе их не скрыл бы. */
.modal [hidden] { display: none !important; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 29, 26, .48);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .3s ease;
}

.modal__dialog {
  position: relative;
  width: min(620px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 34px;
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  box-shadow: var(--shadow-xl);
  opacity: 0;
  transform: translateY(18px) scale(.985);
  transition: opacity .3s ease, transform .4s var(--ease);
}

.modal.is-open .modal__backdrop { opacity: 1; }
.modal.is-open .modal__dialog { opacity: 1; transform: none; }

/* Пока модалка открыта, страница под ней не прокручивается */
body.is-locked { overflow: hidden; }

.modal__close {
  position: absolute;
  top: 20px; right: 20px;
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--muted);
  cursor: pointer;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}

.modal__close svg { width: 15px; height: 15px; }
.modal__close:hover { color: var(--ink); background: var(--bg-tint); border-color: var(--line-2); }

.modal__head { padding-right: 44px; }
.modal__head h2 { font-size: clamp(21px, 2.4vw, 27px); }
.modal__head p { margin-top: 10px; color: var(--muted); font-size: 15px; }

/* ---- поля ---- */

.support { display: grid; gap: 20px; margin-top: 26px; }

.field { display: grid; gap: 8px; }

.field__label { font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: .01em; }

.field__req { color: var(--accent); }

.field__area,
.field__input,
.select__input {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 15.5px;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.field__area {
  min-height: 152px;
  line-height: 1.55;
  resize: vertical;
}

.field__area::placeholder,
.field__input::placeholder { color: var(--muted-2); }

.field__area:focus,
.field__input:focus,
.select__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(231, 87, 31, .15);
}

.select { position: relative; display: block; }

.select__input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  cursor: pointer;
}

.select__arrow {
  position: absolute;
  right: 16px; top: 50%;
  width: 15px; height: 15px;
  margin-top: -7.5px;
  color: var(--muted-2);
  pointer-events: none;
}

.field.is-invalid .field__area,
.field.is-invalid .field__input { border-color: #cf4a3f; }

.field.is-invalid .field__area:focus,
.field.is-invalid .field__input:focus { box-shadow: 0 0 0 3px rgba(207, 74, 63, .15); }

.field__error { color: #c0392b; font-size: 13.5px; line-height: 1.45; }

/* Подсказка под полем: тише ошибки, но заметнее обычного текста. Она объясняет
   правило, а не ругается, поэтому и цвет спокойный. */
.field__hint { color: var(--muted); font-size: 13px; line-height: 1.45; }

/* ---- скриншоты: зона перетаскивания ---- */

.dropzone {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 24px 20px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--bg-2);
  text-align: center;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}

.dropzone:hover,
.dropzone:focus-within,
.dropzone.is-over { border-color: var(--accent); background: rgba(231, 87, 31, .045); }

.dropzone.is-over { border-style: solid; }

/* Поле выбора файла остаётся в разметке — на нём держится и клик по зоне,
   и работа с клавиатуры, — но само не рисуется. */
.dropzone__input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dropzone__icon { width: 24px; height: 24px; color: var(--muted-2); }
.dropzone.is-over .dropzone__icon { color: var(--accent); }
.dropzone__title { font-weight: 600; font-size: 15.5px; color: var(--ink); }
.dropzone__hint { font-size: 13.5px; color: var(--muted-2); }
.dropzone__hint b { color: var(--accent); font-weight: 600; }

/* ---- приложенные файлы ---- */

.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.thumb {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 6px 38px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
  box-shadow: var(--shadow-sm);
}

.thumb img {
  width: 42px; height: 42px;
  flex: none;
  border-radius: 8px;
  background: var(--bg-tint);
  object-fit: cover;
}

.thumb__meta { display: grid; min-width: 0; }

.thumb__name {
  max-width: 190px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thumb__size { color: var(--muted-2); font-size: 12px; }

.thumb__remove {
  position: absolute;
  top: 50%; right: 8px;
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  margin-top: -11px;
  border: 0;
  border-radius: 50%;
  background: var(--bg-tint);
  color: var(--muted);
  cursor: pointer;
  transition: color .2s ease, background .2s ease;
}

.thumb__remove svg { width: 12px; height: 12px; }
.thumb__remove:hover { background: rgba(231, 87, 31, .14); color: var(--accent); }

/* ---- низ формы: подпись и кнопка ---- */

.support__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.support__foot .btn[aria-busy="true"] { opacity: .72; pointer-events: none; }

.support__alert {
  padding: 12px 16px;
  border: 1px solid rgba(207, 74, 63, .28);
  border-radius: var(--radius-sm);
  background: rgba(207, 74, 63, .07);
  color: #b03a2e;
  font-size: 14px;
  line-height: 1.5;
}

.support__alert a { color: inherit; text-decoration: underline; }

/* ---- экран после отправки ---- */

.support__done {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 24px;
  text-align: center;
}

.support__done-icon {
  display: grid;
  place-items: center;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: rgba(47, 158, 99, .13);
  color: var(--green);
}

.support__done-icon svg { width: 24px; height: 24px; }
.support__done h3 { font-size: 21px; }
.support__done p { max-width: 42ch; color: var(--muted); font-size: 15px; }
.support__done .btn { margin-top: 6px; }

/* ============================== АДАПТИВ ============================== */

/* Позициям из макета нужен запас за кромками окна: овца слева заходит на
   кромку, овца справа стоит в поле за окном. На узких экранах запаса нет,
   поэтому прижимаем их внутрь — иначе срезает краем окна. */
@media (max-width: 1650px) {
  .stage__sheep--walk { left: 88%; margin-left: 0; }
}

@media (max-width: 1260px) {
  .stage__sheep--eat  { left: -1%; }
  .stage__sheep--walk { left: 86%; }
}

/* Двум плитам агентов нужно больше места, чем даёт узкая колонка: описание
   занимает 345 px, овце справа нужно ещё ~170 px, плюс поля плиты. Как
   только плита становится уже 560 px (а это ровно ширина плиты в макете),
   сетка 2×2 распадается в одну колонку, и овца переезжает в правый верхний
   угол: у нижней кромки широкой плиты она стояла бы одна в пустом правом
   поле, а описание вытягивалось бы в одну длинную строку. Место под неё в
   описании считается той же долей от её ширины, поэтому у каждой роли
   пропорции остаются своими. Плашки правил получают всю ширину плиты. */
@media (max-width: 1200px) {
  .agents__grid { grid-template-columns: minmax(0, 1fr); }
  .agent-card { --sheep-scale: .5; min-height: 0; }
  .agent-card__sheep { top: 20px; right: 18px; bottom: auto; }
  .agent-card__body {
    max-width: min(560px, calc(100% - var(--sheep-w, 141px) * .5 - 10px));
  }
  .agent-card__rules { max-width: none; }
}

@media (max-width: 1080px) {
  .cards--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .providers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .split__media { order: 2; }
}

/* Дуэту по бокам заголовка нужно около 150 px свободного поля с каждой
   стороны, а коробка заголовка в 880 px подходит к краям контейнера уже при
   1200 px: герои встают в строку над заголовком — там место есть и на
   телефоне. Пропорции те же, поэтому в строке они просто меньше. */
@media (max-width: 1199px) {
  .downloads__cast {
    position: static;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 24px;
    margin-bottom: 10px;
  }

  .downloads__pal {
    position: static;
    translate: none;
    --pal-lift: 0px;
    width: 96px;
  }

  /* Наклоны в строке остаются своими, а «разная высота» превращается в
     лёгкий сдвиг: flex ставит героев на одну линию ног, и разводить их по
     вертикали так, как на широком экране, здесь уже нечем. Отступ считается
     от края строки, поэтому right из широкой раскладки надо погасить. */
  .downloads__pal--left { position: relative; top: 10px; right: auto; left: auto; }
}

/* С логотипом в 51 px шапке нужно заметно больше места: 173 + 696 + 98 плюс
   зазоры — это 999 px, то есть строка перестаёт помещаться задолго до общего
   мобильного порога. Поэтому меню уезжает в бургер своим правилом, а запас
   в 1100 px оставлен на случай, если веб-шрифт Ubuntu не загрузится и ссылки
   наберутся системным шрифтом — он чуть шире. */
@media (max-width: 1100px) {
  /* В строке остаются логотип и кнопки — раскладываем их по краям. */
  .nav__inner { display: flex; justify-content: space-between; }

  .nav__brand-logo { height: 40px; }

  .nav__links {
    position: absolute;
    top: 68px; left: 16px; right: 16px;
    /* justify-self из раскладки-сетки здесь только мешает: у абсолютной
       коробки он включает «по размеру содержимого», и панель схлопывается
       вместо того, чтобы растянуться по left/right. */
    justify-self: auto;
    flex-direction: column;
    gap: 2px;
    padding: 12px;
    border-radius: var(--radius);
    background: rgba(36, 30, 32, .96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid #322b2d;
    box-shadow: var(--shadow-lg);
    margin-left: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .25s ease, transform .25s var(--ease), visibility .25s;
  }

  .nav__links.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav__links a { padding: 12px 14px; font-size: 16px; }
  .nav__burger { display: flex; }
}

@media (max-width: 900px) {
  .clouds { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .mini-grid, .cards--3 { grid-template-columns: minmax(0, 1fr); }
  .notes { grid-template-columns: minmax(0, 1fr); }
  .section { padding: 80px 0; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .container { padding: 0 20px; }
  .hero { padding-top: 104px; }
  .hero__icon { width: 56px; height: 56px; border-radius: 10px; }
  /* Больше воздуха до окна: овца на кромке не должна залезать на подпись */
  .hero__stage { margin-top: 58px; }
  .hero__actions { gap: 10px; }
  .downloads { grid-template-columns: minmax(0, 1fr); }
  .cards--4 { grid-template-columns: minmax(0, 1fr); }
  .providers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage__sheep { filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .4)); }
  .stage__sheep--sleep { left: 8%; width: clamp(56px, 15%, 86px); margin-bottom: -1.8%; }
  .stage__sheep--eat   { left: -3%; top: 74%; width: clamp(56px, 15%, 86px); }
  .stage__sheep--walk  { left: 86%; top: 58%; width: clamp(52px, 14%, 80px); }
  .agents { margin-top: 56px; }
  /* Плита сужается до телефона: заголовок роли ужимается вместе с ней,
     иначе «Агент «Писатель»» ломается на две строки уже при 400 px. */
  .agent-card { padding: 20px; }
  .agent-card__sheep { top: 16px; right: 14px; }
  .agent-card__body h4 { font-size: clamp(22px, 6.3vw, 30px); line-height: 1.16; }
  .source { flex-direction: column; align-items: flex-start; }
  .source__code { margin-left: 0; }
  .footer__links { margin-left: 0; }

  /* На телефоне модалка выезжает снизу листом: так до кнопки проще достать
     большим пальцем, а высокий экран не режется пополам. */
  .modal { padding: 0; align-items: flex-end; }
  .modal__dialog {
    width: 100%;
    max-height: 92vh;
    padding: 26px 20px calc(26px + env(safe-area-inset-bottom, 0px));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .modal__close { top: 16px; right: 16px; }
  .modal__head { padding-right: 40px; }
  .support { gap: 18px; margin-top: 22px; }
  .dropzone { padding: 20px 16px; }
  .thumb__name { max-width: 150px; }
  .support__foot { flex-direction: column; align-items: stretch; }
  .support__foot .btn { width: 100%; }
}

@media (max-width: 460px) {
  .hero__actions { flex-direction: column; width: 100%; }
  .hero__actions .btn { width: 100%; }
  .providers { grid-template-columns: minmax(0, 1fr); }
  .media__pin { display: none; }
}

/* ============================== ДОПОЛНЕНИЯ ============================== */

/* Якорные ссылки не прячутся под фиксированной шапкой */
[id] { scroll-margin-top: 84px; }

/* Карточка Windows, когда сборки действительно нет */
.download--soon.is-confirmed-soon {
  background: linear-gradient(180deg, #fff, var(--bg-tint));
  border-style: dashed;
}

.download--soon.is-confirmed-soon .download__hint { color: var(--accent); }

/* Всплывающая подсказка */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  max-width: min(560px, calc(100vw - 32px));
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14.5px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  z-index: 130;
  transition: opacity .3s ease, transform .35s var(--ease), visibility .3s;
}

.toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* Пиксельные картинки не размываются при увеличении */
.footer__brand img,
.hero__icon,
.stage__sheep { image-rendering: pixelated; }

/* ============================== ТАРИФЫ ==============================
   Раздел «Тарифы» на главной и страница покупки (buy.html). Числа и списки
   форматов подставляет js/pricing.js — здесь только вид. */

/* Полоса тарифов лежит между тёмным разделом моделей и белым разделом
   скачивания: тон отделяет её от обоих, не ломая чередование «светлый —
   тёмный». */
.section--tint { background: var(--bg-tint); }

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  max-width: 880px;
  margin: 0 auto;
  /* Карточки стоят по верхнему краю. Карточка Pro выше бесплатной — в ней
     на пункт списка, вторая кнопка и подпись больше, — и разница высот
     читается как «главный тариф». По центру (align-items: center) короткая
     бесплатная карточка повисала посреди блока: её верх оказывался на
     118 px ниже верхнего края Pro, и это выглядело поломкой вёрстки, а не
     акцентом. */
  align-items: start;
}

.plan {
  display: grid;
  gap: 8px;
  padding: 32px;
  border-radius: var(--radius-xl);
  background: var(--bg-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.plan h3 { font-size: 24px; }

/* Шапка тарифа: название и плашка одной строкой — «Pro» и «Скоро». Место
   плашки в потоке задаёт флекс, а не justify-self, поэтому на узкой карточке
   она переносится под название, а не наезжает на него. */
.plan__top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

/* Плашка состояния: «Скоро» или «Можно купить». Живёт в строке .plan__top,
   поэтому место в потоке задаёт флекс, а не justify-self. */
.plan__badge {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-tint);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.plan--pro { border-color: rgba(231, 87, 31, .38); box-shadow: var(--shadow-lg); }
.plan--pro .plan__badge { background: var(--accent); border-color: transparent; color: #fff; }

/* ---- Pro: карточка, которую продаём ----
   Она стоит справа, а взгляд идёт слева направо: чтобы человек всё равно
   прочитал первым платный тариф, у карточки тёплый градиент сверху,
   акцентные рамка и тень, и чуть больший шаг внутри. */

.plan--pro {
  position: relative;
  padding: 38px 34px;
  background:
    linear-gradient(180deg, rgba(231, 87, 31, .08), rgba(231, 87, 31, 0) 46%),
    var(--bg-2);
}

/* «Выбор авторов» — акцентная плашка; состояние у Pro контурное, чтобы
   две заливки не спорили между собой. */
.plan__flag {
  padding: 4px 11px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #f2913b);
  color: #2b1204;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.plan--pro .plan__badge {
  background: var(--bg-2);
  border-color: rgba(231, 87, 31, .45);
  color: var(--accent);
}

.plan__price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 4px 0 6px;
  font-size: 34px;
  font-weight: 700;
  color: var(--ink);
}

/* Цена Pro крупнее: рядом с «0 ₽» она должна быть заметнее */
.plan--pro .plan__price { font-size: 40px; }

.plan__price small { font-size: 14px; font-weight: 400; color: var(--muted); }

/* Строка «для кого эта редакция» — под ценой */
.plan__pitch { font-size: 15px; color: var(--muted); }

.plan__list {
  display: grid;
  gap: 11px;
  margin: 6px 0 16px;
  padding: 0;
  list-style: none;
}

.plan__list li {
  position: relative;
  padding-left: 27px;
  font-size: 15px;
  color: var(--ink-2);
}

/* Галочка нарисована рамкой, а не картинкой: цвет меняется переменной,
   и в тёмных разделах знак перекрашивается вместе с текстом. */
.plan__list li::before {
  content: '';
  position: absolute;
  left: 3px; top: 4px;
  width: 7px; height: 12px;
  border-right: 2px solid var(--green);
  border-bottom: 2px solid var(--green);
  transform: rotate(42deg);
}

/* Галочка одна на оба тарифа — зелёная и в бесплатной карточке, и в Pro:
   перекрашивать знак у Pro в акцент не нужно, карточка и без этого читается
   как главная. */

/* Главный пункт Pro — обновления: подложка и тёмный текст, чтобы взгляд
   цеплялся за него раньше остальных. Правило идёт после общего, иначе
   галочка вернулась бы на старое место. */
.plan__list li.is-key {
  padding: 12px 14px 12px 38px;
  border-radius: var(--radius-sm);
  background: rgba(231, 87, 31, .08);
  color: var(--ink);
  font-weight: 500;
}

.plan__list li.is-key::before { left: 16px; top: 18px; }

/* Чего в редакции нет: приглушаем и меняем знак на прочерк */
.plan__list li.is-off { color: var(--muted); }

.plan__list li.is-off::before {
  left: 3px; top: 11px;
  width: 12px; height: 0;
  border: 0;
  border-top: 2px solid var(--muted-2);
  transform: none;
}

.plan__note { font-size: 13.5px; color: var(--muted); }

/* Кнопка Pro. Стоит последней и растянута по карточке — как кнопка бесплатной
   редакции слева, чтобы карточки читались одинаково. Пока Pro не вышел, это
   «Сообщить о выходе» (открывает окно поддержки), после выкладки pricing.js
   подменит её ссылкой на страницу покупки. */
.plan__cta { margin-top: 20px; }

/* Юридическая сноска под кнопкой Pro: что за товар покупают и где условия.
   Мелкая и негромкая — её читают, только когда решают платить, но у того,
   кто решает, она должна быть на виду. */
.plan__legal { font-size: 12.5px; line-height: 1.5; color: var(--muted-2); }
.plan__legal a { color: var(--accent); }

.plans__hint {
  max-width: 880px;
  margin: 26px auto 0;
  text-align: center;
  font-size: 15px;
  color: var(--muted);
}

.plans__hint a { color: var(--accent); }

/* Блоки одного состояния. Атрибут hidden сам по себе не сработает там, где
   у элемента задан display, поэтому гасим явно. */
[data-pricing-when][hidden] { display: none !important; }

/* ============================== СТРАНИЦА ПОКУПКИ ============================== */

.section__head h1 { margin: 18px 0 0; font-size: clamp(32px, 4.2vw, 52px); }

.buy__state {
  max-width: 880px;
  margin: 0 auto;
  padding: 30px 32px;
  border-radius: var(--radius-xl);
  background: var(--bg-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.buy__state h2 { font-size: clamp(20px, 2vw, 26px); margin-bottom: 10px; }
.buy__state p { color: var(--muted); font-size: 15.5px; }

/* Абзацы в блоке покупки — крупный серый текст для чтения, и это правило
   перебивало .field__error: ошибка под полем выходила серой и на размер
   больше нужного. Служебным строкам возвращаем их собственный вид. */
.buy__state .field__error { color: #c0392b; font-size: 13.5px; }
.buy__state .field__hint { font-size: 13px; }

.buy__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 20px;
}

.buy__pay { margin-top: 14px; font-size: 13.5px; color: var(--muted-2); }

/* ---- Сравнение редакций ---- */

.compare { max-width: 880px; margin: 0 auto; }

/* На узком экране таблица прокручивается боком: перестраивать её в карточки
   ради трёх колонок не стоит. */
.compare__wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg-2);
  box-shadow: var(--shadow-md);
}

.compare table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

.compare th,
.compare td {
  padding: 15px 20px;
  text-align: left;
  font-size: 15.5px;
  border-bottom: 1px solid var(--line);
}

.compare thead th {
  background: var(--bg-tint);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.compare tbody tr:last-child td { border-bottom: 0; }

.compare th:nth-child(2), .compare td:nth-child(2),
.compare th:nth-child(3), .compare td:nth-child(3) {
  width: 21%;
  text-align: center;
}

.compare td:first-child { color: var(--ink); }

.compare .yes { color: var(--green); font-weight: 600; }
.compare .no { color: var(--muted-2); }

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

  /* В одну колонку карточки стоят друг под другом, и лишний шаг внутри
     Pro только удлиняет прокрутку: выравниваем по бесплатной. */
  .plan--pro { padding: 32px; }
}

/* ---- Сравнение редакций на телефоне ----
   Три колонки в 500 px не помещаются: их пришлось бы листать боком, а человек
   просто не увидит колонку Pro — то есть цену. Поэтому на узких экранах каждая
   строка таблицы становится карточкой «что — бесплатно — Pro». */
@media (max-width: 620px) {
  .compare__wrap { overflow: visible; border: 0; background: none; box-shadow: none; }
  .compare table { min-width: 0; }

  .compare thead { display: none; }

  .compare tbody tr {
    display: grid;
    gap: 8px;
    padding: 16px 18px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-2);
    box-shadow: var(--shadow-sm);
  }

  .compare td {
    width: auto !important;
    padding: 0;
    border: 0;
    text-align: left;
    font-size: 15px;
  }

  .compare td:first-child { color: var(--ink); font-weight: 600; }

  .compare td[data-label]::before {
    content: attr(data-label) ': ';
    color: var(--muted);
    font-weight: 400;
  }

  .compare td:last-child { border-top: 1px solid var(--line); padding-top: 9px; }
}

/* ============================== ОКНО ЗАКАЗА ==============================

   Окно на странице покупки (Landing/buy.html): слева краткое описание заказа,
   справа единственное поле с почтой. Устроено по образцу окна оплаты Scrivener —
   человек видит, за что платит, и заполняет одно поле.

   Внутри окна живут те же .field и .consent, что и в форме обращения: поля
   должны выглядеть одинаково. Здесь только раскладка самого окна. */

.modal--order .modal__dialog {
  width: min(940px, 100%);
  padding: 0;
}

/* overflow-y: auto у .modal__dialog базовый: он же скругляет углы цветных
   колонок по border-radius, поэтому отдельный overflow: hidden не нужен. */

.order-modal__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  align-items: stretch;
}

/* ---- левая колонка: что покупают ---- */

.order-summary { padding: 34px 32px 30px; }

.order-summary__title { font-size: 19px; letter-spacing: -.01em; }

.order-summary__price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 16px 0 0;
}

.order-summary__price b {
  font-size: 34px;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.order-summary__tax { color: var(--muted); font-size: 14px; }

.order-summary__item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-top: 20px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.order-summary__icon img { display: block; width: 48px; height: 48px; border-radius: 12px; }

.order-summary__name { font-weight: 600; line-height: 1.3; }

.order-summary__name small {
  display: block;
  margin-top: 3px;
  font-weight: 400;
  font-size: 13.5px;
  color: var(--muted);
}

.order-summary__qty {
  min-width: 38px;
  padding: 5px 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.order-summary__rows { display: grid; gap: 12px; margin: 18px 0 0; }

.order-summary__row { display: flex; justify-content: space-between; gap: 16px; font-size: 15px; }
.order-summary__row dt { color: var(--muted); }
.order-summary__row dd { margin: 0; font-variant-numeric: tabular-nums; }

.order-summary__row--total {
  margin-top: 2px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-weight: 600;
}
.order-summary__row--total dt { color: var(--ink); }

/* ---- правая колонка: куда писать ---- */

.order-details {
  padding: 34px 32px 30px;
  background: var(--bg-tint);
  border-left: 1px solid var(--line);
}

/* Шапка «Ваши реквизиты › Оплата»: крестик закрытия сидит справа сверху,
   поэтому заголовку оставляем место. */
.order-details__steps {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 0 48px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.order-details__steps b { color: var(--ink); }
.order-details__arrow { color: var(--muted-2); }

.order-details__lead { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.order-form { display: grid; gap: 18px; margin-top: 22px; }

/* На тонированной панели белое поле читается лучше прозрачного. */
.order-form .field__input { background: var(--bg); }

.order-form__submit { width: 100%; justify-content: center; }

.order-form__fine { margin: -4px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }

/* Ловушка для ботов: живой человек этого поля не видит, робот заполняет.
   Именно display: none, а не сдвиг за экран: так поле не подставит и
   автозаполнение браузера, иначе настоящий заказ молча пропал бы. */
.order__trap { display: none; }

/* Согласие с офертой: флажок слева, текст справа. Ссылка на договор открывается
   в новой вкладке — иначе покупатель потерял бы заполненное окно. Ошибку
   показываем тем же .field__error, что и у почты, а сам флажок при ошибке
   обводим: галочку ищут глазами, а не читают про неё в тексте. */
.consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  align-items: start;
}

.consent__input {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.consent__text {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
  cursor: pointer;
}

.consent__text a { color: var(--accent); }

.consent.is-invalid .consent__input {
  outline: 2px solid #cf4a3f;
  outline-offset: 2px;
}

.consent.is-invalid .consent__text { color: var(--ink-2); }

/* ---- экран благодарности ---- */

/* Экран благодарности уже не двухколоночный: узкое окно читается как итог,
   а не как форма, из которой что-то убрали. */
.modal--order .modal__dialog.is-done { width: min(620px, 100%); }

.order-done {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 52px 32px 44px;
  text-align: center;
}

.order-done__title { font-size: clamp(22px, 2.6vw, 28px); }

/* Заголовок получает фокус после отправки — рамка ему не нужна. */
.order-done__title:focus { outline: none; }

/* Ожидание — не успех: часы в оранжевом круге вместо зелёной галочки. */
.order-done--wait .support__done-icon { background: var(--bg-tint); color: var(--accent-text); }

.order-done__text { margin: 0; max-width: 44ch; color: var(--muted); font-size: 15.5px; }
.order-done__text b { color: var(--ink); }

.order-done__link { margin: 6px 0 0; }
.order-done__link a {
  color: var(--accent-text);
  font-weight: 600;
  border-bottom: 1px solid rgba(184, 65, 15, .3);
  transition: border-color .2s ease;
}
.order-done__link a:hover { border-bottom-color: currentColor; }

.order-done__number { margin: 10px 0 0; color: var(--muted-2); font-size: 13px; }

/* Телефон и узкое окно: колонки встают одна над другой, сводка первой —
   человек сначала видит цену, потом поле. */
@media (max-width: 820px) {
  .order-modal__grid { grid-template-columns: 1fr; }
  .order-details { border-left: 0; border-top: 1px solid var(--line); }
  .order-summary,
  .order-details { padding: 24px 20px; }
  .order-summary__price b { font-size: 30px; }
  .order-done { padding: 40px 20px 34px; }
}

/* ============================== ПУБЛИЧНАЯ ОФЕРТА ==============================

   Страница договора (Landing/oferta.html). Это длинный текст, который читают
   вдумчиво и не подряд: отсюда колонка поуже, абзацы с воздухом, а ключевое
   условие про возврат вынесено отдельной плашкой. Всё остальное — общие
   .section, .eyebrow и .btn, чтобы оферта не выглядела чужой страницей. */

.legal {
  display: grid;
  gap: 16px;
  max-width: 760px;
  margin: 34px auto 0;
}

.legal h2 {
  margin-top: 20px;
  font-size: clamp(20px, 2vw, 26px);
  letter-spacing: -.01em;
}

.legal h2:first-child { margin-top: 0; }

.legal p,
.legal li {
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.65;
}

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

.legal ul,
.legal ol {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 8px;
}

.legal code { white-space: nowrap; }

/* Ключевое условие договора — то самое, ради которого оферта и написана:
   после передачи цифрового контента возврат не производится. Плашка тёплая,
   как акцент Pro, и не сливается с остальным текстом. */
.legal__clause {
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(231, 87, 31, .38);
  background: var(--bg-tint);
  color: var(--ink) !important;
  font-size: 16.5px !important;
  font-weight: 500;
}

/* Места, которые продавец заполняет перед публикацией. Пока в них скобки,
   это видно и ему, и случайному читателю — молча выложить оферту с пустыми
   реквизитами не получится. */
.legal__fill {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(231, 87, 31, .12);
  color: var(--ink);
}

.legal__requisites {
  padding: 22px 26px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg-2);
  list-style: none;
}

.legal__requisites li { font-size: 15px; }

.legal__note {
  padding-top: 6px;
  font-size: 14.5px;
  color: var(--muted-2);
}

.legal__back { margin-top: 10px; }

@media (max-width: 620px) {
  .legal__clause { padding: 16px 18px; font-size: 15.5px !important; }
  .legal__requisites { padding: 18px 20px; }
}
