/* Единственная таблица стилей сайта.
 *
 * До появления генератора страниц их было две: styles.css (дизайн прежнего
 * многосекционного лендинга, из которого страница использовала шесть базовых
 * правил из двадцати килобайт) и minimal.css (первый экран). Теперь страниц
 * много, шапка и подвал общие, и разделять нечего.
 *
 * Первый экран перенесён из minimal.css как есть — вместе с расчётами под
 * метрики Golos Text. Их правили по живой вёрстке, на глаз они не выводятся.
 *
 * Версия в ссылке (`?v=`) — хеш содержимого, его ставит release-site/build.mjs.
 * Руками поднимать больше нечего.
 */

/* ——— Шрифт: Golos Text со своего домена ———
 *
 * Переменный woff2 с Google Fonts (v7, wght 400–900), по файлу на подмножество;
 * лицензия OFL-1.1 — release-site/fonts/OFL.txt. К fonts.googleapis.com
 * страницы не обращаются: IP посетителей не уходят в США, страну вне перечня
 * Роскомнадзора (docs/legal-compliance-ru.md, срез S3). */

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/fonts/golos-text-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/fonts/golos-text-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/fonts/golos-text-latin-ext.woff2") format("woff2");
  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;
}

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/fonts/golos-text-latin.woff2") format("woff2");
  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;
}

:root {
  --landing-bg-start: #fff;
  --landing-bg-middle: #f7f8fc;
  --landing-bg-end: #f4f6fa;
  --landing-ink: #151823;
  --landing-accent: #2f6bff;
  --muted: #656d80;
  --line: #e4e7ef;
  --surface: #fff;
  --surface-soft: #f1f3f9;
  --code-bg: #eef1f7;
  --frame-border: rgba(99, 111, 139, 0.2);
  --frame-glow: rgba(84, 126, 255, 0.22);
  --frame-start: #1d2230;
  --frame-end: #10131b;
  --frame-inner-border: rgba(255, 255, 255, 0.07);
  --frame-shadow: rgba(29, 39, 66, 0.16);
  --button-shadow: rgba(47, 107, 255, 0.28);
  --secondary-bg: rgba(91, 103, 124, 0.08);
  --secondary-hover: rgba(91, 103, 124, 0.14);
  --secondary-border: rgba(91, 103, 124, 0.12);
  --secondary-text: #737b8b;
  font-family: "Golos Text", system-ui, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --landing-bg-start: #171b26;
    --landing-bg-middle: #0d1017;
    --landing-bg-end: #090b10;
    --landing-ink: #f3f5fb;
    --landing-accent: #7399ff;
    --muted: #9ba3b5;
    --line: rgba(255, 255, 255, 0.1);
    --surface: #14171f;
    --surface-soft: #101319;
    --code-bg: rgba(255, 255, 255, 0.06);
    --frame-border: rgba(255, 255, 255, 0.12);
    --frame-glow: rgba(74, 116, 255, 0.3);
    --frame-start: #222838;
    --frame-end: #11141d;
    --frame-inner-border: rgba(255, 255, 255, 0.09);
    --frame-shadow: rgba(0, 0, 0, 0.42);
    --button-shadow: rgba(29, 74, 255, 0.38);
    --secondary-bg: rgba(255, 255, 255, 0.08);
    --secondary-hover: rgba(255, 255, 255, 0.13);
    --secondary-border: rgba(255, 255, 255, 0.09);
    --secondary-text: #9ca5b7;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.page {
  min-height: 100vh;
  margin: 0;
  color: var(--landing-ink);
  background: radial-gradient(
    circle at 50% -10%,
    var(--landing-bg-start) 0,
    var(--landing-bg-middle) 34%,
    var(--landing-bg-end) 100%
  );
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--landing-accent) 45%, transparent);
  text-underline-offset: 3px;
}

img,
video {
  max-width: 100%;
}

/* ——— Первый экран (перенесено из minimal.css) ——— */

.minimal-hero {
  display: flex;
  /* Ширина ограничена и высотой окна: первый экран должен помещаться целиком,
     иначе кнопки скачивания уходят под фолд. Вычет вырос с 412 до 430 пикселей —
     ровно на подзаголовок под H1, который тут появился. Дальше поднимать нельзя:
     на 1280×720 колонка уже становится заметно уже прежней. */
  width: min(1180px, calc(100% - clamp(28px, 5vw, 64px)), max(280px, calc(136svh - 430px)));
  min-height: 100svh;
  margin-inline: auto;
  padding: clamp(24px, 4svh, 64px) 0 clamp(28px, 4.5svh, 72px);
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  container-type: inline-size;
}

/* Лок-ап по guidelines/wordmark.html дизайн-системы:
   знак + «АЙЛИНА» шрифтом Golos Text, вес 600, отрицательный трекинг. */
.hero-brand {
  display: flex;
  /* Слева 5% — ровно половина пустого поля вокруг .demo-frame (100% − 90%) / 2,
     чтобы левый край текста совпадал с левым краем центрированного видео.
     Тот же отступ у h1 и .hero-lead ниже. */
  margin: 0 0 20px 5%;
  align-items: center;
  gap: 13px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hero-brand img {
  /* Знак шире, чем выше (viewBox 700×630) — квадратом его плющит. */
  width: 38px;
  height: 34px;
}

.minimal-hero h1 {
  /* Прежний H1 был слоганом из двух коротких строк и жил с white-space: nowrap
     и размером, посчитанным под конкретную длину строки. Новый заголовок —
     категорийный и втрое длиннее, поэтому он переносится сам. */
  max-width: 14em;
  margin: 0 0 0 5%;
  font-size: clamp(28px, 6.4cqw, 64px);
  font-weight: 800;
  line-height: 1.03;
  /* В Golos Text прежние -0.07em слипают буквы («мп», «ер», «св»). */
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.minimal-hero h1 .title-accent {
  color: var(--landing-accent);
}

.hero-lead {
  max-width: 44em;
  margin: 18px 0 0 5%;
  color: var(--muted);
  font-size: clamp(15px, 1.6cqw, 19px);
  line-height: 1.5;
}

.demo-frame {
  position: relative;
  display: grid;
  /* 90%, не 100%: на первом экране это даёт высоте кадра (родной 16:9)
     те же -10%, что и раньше, но пропорционально по обеим осям — видео
     умещается целиком, без обрезки object-fit: cover. Освобождённой
     высоты хватает под кнопки скачивания на невысоких окнах. */
  width: 90%;
  min-width: 0;
  margin-top: clamp(22px, 4cqw, 48px);
  /* Родитель выравнивает детей по левому краю (align-items: flex-start) —
     без этого 90%-кадр прижимался бы влево, а не стоял по центру наравне
     с .download-actions (у неё центрирование уже было через margin auto). */
  margin-inline: auto;
  overflow: hidden;
  place-items: center;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--frame-border);
  border-radius: clamp(18px, 2.2vw, 28px);
  background:
    radial-gradient(circle at 50% 42%, var(--frame-glow), transparent 36%),
    linear-gradient(145deg, var(--frame-start), var(--frame-end));
  box-shadow: 0 28px 70px var(--frame-shadow);
}

.demo-frame::after {
  position: absolute;
  z-index: 1;
  inset: clamp(8px, 1vw, 12px);
  border: 1px solid var(--frame-inner-border);
  border-radius: clamp(12px, 1.5vw, 18px);
  content: "";
  pointer-events: none;
}

/* Раньше видео держали прозрачным до `canplay`, чтобы не мигать пустым кадром.
   Теперь у него есть постер — он и есть первый кадр, скрывать нечего. */
.demo-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.download-actions {
  display: flex;
  width: min(100%, 340px);
  margin: clamp(20px, 2.7cqw, 32px) auto 0;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.minimal-download {
  display: inline-flex;
  width: 100%;
  min-height: 54px;
  padding: 17px 28px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2f6bff, #4c82ff);
  box-shadow: 0 12px 28px var(--button-shadow);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
}

.platform-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  flex: 0 0 20px;
}

.platform-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.platform-icon svg[hidden] {
  display: none;
}

.other-os-download {
  display: inline-flex;
  width: 100%;
  min-height: 46px;
  padding: 12px 17px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--secondary-border);
  border-radius: 12px;
  color: var(--secondary-text);
  background: var(--secondary-bg);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background 160ms ease, transform 160ms ease;
}

.other-os-download:hover {
  background: var(--secondary-hover);
  transform: translateY(-1px);
}

.download-paused {
  margin: 0;
  padding: 17px 28px;
  border-radius: 14px;
  background: var(--secondary-bg);
  border: 1px solid var(--secondary-border);
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
}

.download-paused-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
}

.cta .download-paused {
  width: min(100%, 420px);
  margin-inline: auto;
}

/* ——— Шапка и подвал ——— */

.site-header {
  display: flex;
  width: min(1180px, calc(100% - clamp(28px, 5vw, 64px)));
  height: 72px;
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-header-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.site-header-nav {
  display: flex;
  gap: 22px;
  color: var(--muted);
  font-size: 14px;
}

.site-header-nav a:hover,
.site-footer-nav a:hover {
  color: var(--landing-accent);
}

.site-footer {
  margin-top: clamp(48px, 8vw, 96px);
  padding: 34px 0 44px;
  border-top: 1px solid var(--line);
}

.site-footer-inner {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 14px 28px;
}

.site-footer-brand {
  display: inline-flex;
  margin: 0;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer-note {
  flex: 1 1 100%;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

/* ——— Секции ——— */

.shell {
  width: min(1180px, calc(100% - clamp(28px, 5vw, 64px)));
  margin-inline: auto;
}

.band {
  padding: clamp(48px, 7vw, 92px) 0;
}

.band-soft {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.band-soft + .band-soft {
  border-top: 0;
}

.section-heading {
  margin-bottom: clamp(26px, 3vw, 42px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--landing-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.section-heading h1,
.section-heading h2 {
  /* Ограничение в em считается от собственного кегля заголовка: общий
     max-width на блоке рвал крупный H2 на строки по два слова. */
  max-width: 19em;
  margin: 0;
  font-size: clamp(26px, 3.6vw, 44px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.lead,
.section-heading p:not(.eyebrow) {
  max-width: 44em;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.6;
}

/* ——— Карточки, шаги, факты ——— */

.cards {
  display: grid;
  gap: 14px;
}

.cards-2 {
  grid-template-columns: repeat(2, 1fr);
}

.cards-3 {
  grid-template-columns: repeat(3, 1fr);
}

.card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.card h2,
.card h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* Два класса в селекторе, а не !important: `.card p` иначе перебивает цвет
   и кегль реплики пользователя. */
.task-card .task-command {
  margin: 0 0 10px;
  color: var(--landing-ink);
  font-size: 15px;
  font-style: italic;
  line-height: 1.5;
}

.steps {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 18px;
  grid-template-columns: repeat(3, 1fr);
  list-style: none;
}

.step {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.step-number {
  display: grid;
  width: 26px;
  height: 26px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 9px;
  background: color-mix(in srgb, var(--landing-accent) 14%, transparent);
  color: var(--landing-accent);
  font-size: 12px;
  font-weight: 800;
}

.step h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.step p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.facts {
  margin: 0;
  padding: 0;
  list-style: none;
}

.facts li {
  position: relative;
  max-width: 62em;
  padding: 13px 0 13px 26px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.facts li::before {
  position: absolute;
  left: 2px;
  color: var(--landing-accent);
  content: "—";
}

.facts li:last-child {
  border-bottom: 0;
}

.facts strong {
  color: var(--landing-ink);
}

.platforms-line {
  max-width: 62em;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.platforms-line strong {
  color: var(--landing-ink);
}

/* ——— Тарифы ——— */

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

.plan {
  display: flex;
  position: relative;
  padding: 24px 22px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  flex-direction: column;
}

.plan-featured {
  border-color: color-mix(in srgb, var(--landing-accent) 45%, var(--line));
  box-shadow: 0 18px 44px var(--frame-shadow);
}

.plan-badge {
  position: absolute;
  top: -11px;
  left: 22px;
  margin: 0;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--landing-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plan-title {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.plan-tagline {
  min-height: 2.9em;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.plan-price {
  display: flex;
  margin: 0;
  align-items: baseline;
  gap: 8px;
}

.plan-price-value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.plan-price-period {
  color: var(--muted);
  font-size: 13px;
}

.plan-credits {
  margin: 9px 0 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  color: var(--landing-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.plan-features {
  display: grid;
  margin: 0;
  padding: 16px 0 0;
  gap: 9px;
  align-content: start;
  list-style: none;
  flex: 1;
}

.plan-features li {
  position: relative;
  padding-left: 17px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

/* Точка вместо галочки: U+2713 в Golos Text нет, и её рисовал бы запасной
   шрифт — чужим весом и размером. */
.plan-features li::before {
  position: absolute;
  top: 0.55em;
  left: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--landing-accent);
  content: "";
}

.plan-cta {
  display: inline-flex;
  width: 100%;
  min-height: 46px;
  margin-top: 18px;
  padding: 12px 17px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--secondary-border);
  border-radius: 12px;
  background: var(--secondary-bg);
  color: var(--landing-ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background 160ms ease, transform 160ms ease;
}

.plan-cta:hover {
  background: var(--secondary-hover);
  transform: translateY(-1px);
}

.plan-featured .plan-cta {
  border-color: transparent;
  background: linear-gradient(135deg, #2f6bff, #4c82ff);
  box-shadow: 0 12px 28px var(--button-shadow);
  color: #fff;
}

.plans-notes {
  display: grid;
  max-width: 62em;
  margin-top: 24px;
  gap: 14px;
}

.plans-notes p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.plans-legal {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ——— Страницы скачивания ——— */

.download-hero {
  display: grid;
  gap: 26px;
  align-items: start;
  grid-template-columns: minmax(220px, 300px) 1fr;
}

.download-card .minimal-download {
  margin-top: 16px;
}

.download-card .download-card-note {
  margin-top: 14px;
  font-size: 13px;
}

.card .download-missing,
.download-hero .download-missing {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.spec {
  margin: 0;
  padding: 0;
}

.spec-row {
  display: grid;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  gap: 6px 20px;
  grid-template-columns: minmax(120px, 200px) 1fr;
}

.spec-row:last-child {
  border-bottom: 0;
}

.spec dt {
  color: var(--muted);
  font-size: 14px;
}

.spec dd {
  margin: 0;
  font-size: 15px;
}

.code {
  max-width: 100%;
  margin: 18px 0 0;
  padding: 14px 16px;
  overflow-x: auto;
  border-radius: 12px;
  background: var(--code-bg);
  font-size: 13px;
  line-height: 1.5;
}

code {
  font-size: 0.94em;
}

.cta {
  max-width: 34em;
  margin-inline: auto;
  text-align: center;
}

.cta h2 {
  margin: 0;
  font-size: clamp(26px, 3.6vw, 42px);
  font-weight: 800;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.cta p {
  margin: 14px 0 26px;
  color: var(--muted);
  font-size: 16px;
}

.cta-download {
  width: min(100%, 340px);
}

/* ——— FAQ ——— */

.faq {
  display: grid;
  max-width: 62em;
  gap: 10px;
}

.faq details {
  padding: 16px 19px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.faq summary {
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.faq-answer {
  margin-top: 11px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

/* ——— Сравнение с другим агентом (/muse-alternative) ——— */

.summary {
  max-width: 62em;
  padding: 6px 22px;
}

.summary .spec dd {
  line-height: 1.55;
}

/* Предложение АЙЛИНЫ на первом экране: своя карточка со знаком и названием,
   чтобы кнопки скачивания под рассказом о Muse читались как кнопки АЙЛИНЫ.
   Стоит сразу под лидом — до кнопки не нужно листать. */
.hero-offer {
  display: flex;
  max-width: 62em;
  margin: 0 0 clamp(16px, 2vw, 22px);
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
  border-color: var(--landing-accent);
}

.hero-offer-brand {
  display: flex;
  flex: 1 1 320px;
  align-items: flex-start;
  gap: 14px;
}

.hero-offer-brand img {
  width: 38px;
  height: 34px;
  flex: 0 0 38px;
  margin-top: 2px;
}

.hero-offer .hero-offer-title {
  margin: 0 0 4px;
  color: var(--landing-ink);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Кнопки столбиком справа: так тексту карточки остаётся вся ширина слева. */
.hero-offer .download-actions {
  width: min(100%, 360px);
  margin: 0;
}

@media (max-width: 680px) {
  .hero-offer .download-actions {
    width: 100%;
  }
}

/* Звёздочка сноски в заголовке: заметная (пометка о Meta обязательна), но без
   подчёркивания и не раздвигает строки. */
.section-heading h1 sup {
  font-size: 0.6em;
  line-height: 0;
}

.section-heading sup a {
  text-decoration: none;
}

/* Кнопка скачивания посреди страницы — после примеров задач. */
.band-cta {
  margin: clamp(26px, 3vw, 40px) 0 0;
  text-align: center;
}

/* Ролик вне первого экрана: без .minimal-hero ширину и отступы задаёт обёртка,
   а контейнер для cqw-единиц кадра — она же. */
.page-demo {
  max-width: 960px;
  margin: 0 auto clamp(32px, 4vw, 48px);
  container-type: inline-size;
}

/* Составное слово в крупном заголовке не рвём по дефису: «ИИ-» в конце
   строки и «агент» в начале следующей читаются как два слова. */
.nowrap {
  white-space: nowrap;
}

.page-demo .demo-frame {
  width: 100%;
  margin-top: 0;
}

/* Скругление — углами ячеек, а не overflow: hidden на таблице: тот обрезал
   бы и подпись над рамкой, вместе с краем первой буквы. */
.compare {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  font-size: 15px;
  line-height: 1.55;
}

.compare thead th:first-child {
  border-top-left-radius: 17px;
}

.compare thead th:last-child {
  border-top-right-radius: 17px;
}

.compare tbody tr:last-child th {
  border-bottom-left-radius: 17px;
}

.compare tbody tr:last-child td:last-child {
  border-bottom-right-radius: 17px;
}

.compare caption {
  padding: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  text-align: left;
}

.compare th,
.compare td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.compare thead th {
  background: var(--surface-soft);
  font-size: 14px;
  font-weight: 800;
}

.compare tbody th {
  width: 24%;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.compare td {
  width: 38%;
}

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

/* Подпись для скринридера: видна в дереве доступности, не на экране. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.compare-note {
  max-width: 62em;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.sources {
  max-width: 62em;
  margin: 0;
  padding: 0 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.footnote {
  max-width: 62em;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

/* Таблица на телефоне складывается в карточки: строка — блок, у каждой
   ячейки подпись столбца из data-label. Горизонтальный скролл таблицы на
   узком экране читают хуже, чем две короткие строки друг под другом. */
@media (max-width: 680px) {
  .compare,
  .compare tbody,
  .compare tr,
  .compare th,
  .compare td {
    display: block;
    width: auto;
  }

  .compare thead {
    display: none;
  }

  .compare tbody tr {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
  }

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

  /* Блочная таблица забирает подпись внутрь рамки: отступ — как у строк. */
  .compare caption {
    display: block;
    padding: 14px 16px 0;
  }

  .compare tbody th,
  .compare td {
    width: auto;
    padding: 0;
    border-bottom: 0;
  }

  .compare tbody th {
    margin-bottom: 8px;
    color: var(--landing-ink);
    font-size: 15px;
    font-weight: 700;
  }

  .compare td + td {
    margin-top: 8px;
  }

  .compare td::before {
    display: block;
    color: var(--muted);
    content: attr(data-label);
    font-size: 12px;
    font-weight: 700;
  }
}

/* ——— Текстовые страницы ——— */

.prose {
  width: min(760px, calc(100% - clamp(28px, 5vw, 64px)));
  margin: clamp(28px, 5vw, 64px) auto 0;
}

.prose h1 {
  margin: 0 0 8px;
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 800;
  letter-spacing: -0.045em;
}

.prose h2 {
  margin: 36px 0 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.prose p,
.prose li {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.prose .facts {
  margin-top: 18px;
}

@media (max-width: 980px) {
  .cards-3,
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Четыре тарифа ровно складываются в две колонки на планшете. */
  .plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .download-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .minimal-hero {
    width: min(calc(100% - 32px), max(280px, calc(136svh - 430px)));
    padding-top: clamp(24px, 4svh, 44px);
  }

  .download-actions {
    width: min(100%, 380px);
  }
}

/* ——— Временная заглушка публичного сайта (SITE_PUBLIC = false) ——— */

.coming-soon {
  display: flex;
  min-height: 100svh;
  margin: 0;
  padding: clamp(24px, 4svh, 64px) clamp(28px, 5vw, 64px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.coming-soon .hero-brand {
  margin-bottom: 18px;
  justify-content: center;
}

.coming-soon h1 {
  margin: 0;
  color: var(--landing-ink);
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 800;
  letter-spacing: -0.045em;
}

@media (max-width: 680px) {
  .plans {
    grid-template-columns: 1fr;
  }
  .minimal-hero {
    width: calc(100% - 28px);
    padding: 32px 0 40px;
    /* Контейнерные единицы ниже этой ширины больше не помогают: считаем от
       ширины окна, как и остальная мобильная вёрстка. */
    container-type: normal;
  }

  .hero-brand {
    margin-bottom: 14px;
    gap: 10px;
    font-size: 17px;
  }

  .hero-brand img {
    width: 29px;
    height: 26px;
  }

  .minimal-hero h1 {
    font-size: clamp(26px, 8vw, 44px);
    line-height: 1.06;
  }

  .hero-lead {
    margin-top: 14px;
    font-size: 15px;
  }

  .minimal-download {
    width: 100%;
    min-height: 52px;
    padding: 15px 20px;
  }

  .download-actions {
    width: 100%;
    margin-top: 22px;
    gap: 8px;
  }

  .other-os-download {
    width: 100%;
    min-height: 46px;
    padding-inline: 14px;
  }

  .demo-frame {
    margin-top: 26px;
    border-radius: 18px;
  }

  .demo-frame::after {
    inset: 8px;
    border-radius: 12px;
  }

  .cards-2,
  .cards-3,
  .steps {
    grid-template-columns: 1fr;
  }

  /* В колонку карточки встали друг под другом — выравнивать подписи
     по высоте больше незачем, а пустое место на мобильном дорогое. */
  .plan-tagline {
    min-height: 0;
  }

  .site-header {
    height: 62px;
  }

  .site-header-nav {
    gap: 16px;
    font-size: 13px;
  }

  .site-header-secondary {
    display: none;
  }

  .spec-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  .minimal-hero {
    width: calc(100% - 24px);
    padding-top: 28px;
  }

  .other-os-download {
    font-size: 12px;
  }
}

/* ——— Подвал: реквизиты и возрастная категория ——— */

.site-footer-brand .age-badge {
  margin-left: 4px;
}

.age-badge {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid currentColor;
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  vertical-align: middle;
}

.site-footer-nav button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.site-footer-nav button:hover {
  color: var(--landing-accent);
}

.site-footer-legal {
  flex: 1 1 100%;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.site-footer-legal a {
  color: inherit;
}

/* ——— Юридические документы: /terms.html, /privacy.html, /third-party.html ——— */

.legal h1 {
  font-size: clamp(26px, 3.6vw, 38px);
  letter-spacing: -0.035em;
}

.legal h1 + p {
  color: var(--muted);
  font-size: 18px;
}

.legal .legal-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.legal h2 {
  margin-top: 40px;
  font-size: 20px;
}

.legal h3 {
  margin: 24px 0 0;
  font-size: 17px;
  font-weight: 700;
}

.legal p,
.legal li,
.legal td,
.legal th {
  color: var(--landing-ink);
  font-size: 15px;
  line-height: 1.65;
}

.legal p {
  margin: 12px 0 0;
}

.legal .legal-dash {
  margin-top: 6px;
  padding-left: 22px;
  text-indent: -22px;
}

.legal ul {
  margin: 12px 0 0;
  padding-left: 22px;
}

.legal li + li {
  margin-top: 6px;
}

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

.legal table {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  font-size: 14px;
}

.legal th,
.legal td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.legal th {
  background: var(--surface-soft);
  font-weight: 600;
}

.third-party td:nth-child(2),
.third-party td:nth-child(3) {
  white-space: nowrap;
}

.third-party td:nth-child(4) {
  word-break: break-all;
}

@media (max-width: 680px) {
  .legal table {
    display: block;
    overflow-x: auto;
  }
}

/* ——— Согласие на аналитику: Метрика включается только после «Принять» ——— */

/*
 * Правый нижний угол, а не полоса по центру экрана: баннер висит поверх
 * страницы всё время до ответа и по центру перекрывал демо в первом экране.
 */
.cookie-consent {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: auto;
  z-index: 50;
  display: flex;
  width: min(340px, calc(100vw - 32px));
  padding: 14px 16px;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 40px var(--frame-shadow);
  /* С раскрытым документом согласия уведомление выше низкого экрана: тогда
     прокручивается оно само, а не уезжает за верхний край. */
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

/* На узком экране углов нет — тянем на всю ширину, иначе текст в три слова. */
@media (max-width: 560px) {
  .cookie-consent {
    left: 16px;
    width: auto;
  }
}

.cookie-consent[hidden] {
  display: none;
}

.cookie-consent p {
  margin: 0;
  color: var(--landing-ink);
  font-size: 13px;
  line-height: 1.5;
}

.cookie-consent a {
  color: var(--landing-accent);
}

/* Документ согласия целиком: доступен до выбора, но не заслоняет кнопки. */
.cookie-consent-full summary {
  color: var(--landing-accent);
  font-size: 13px;
  cursor: pointer;
}

.cookie-consent-full-body {
  max-height: 32vh;
  margin-top: 8px;
  padding-right: 6px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cookie-consent-full-body p {
  font-size: 12px;
}

/* Кнопки не уезжают из прокрутки: выбор должен быть под рукой в любой момент. */
.cookie-consent-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
  background: var(--surface);
}

/* Обе кнопки одинаковые намеренно: «Отклонить» не должна быть слабее «Принять». */
.cookie-consent-actions button {
  flex: 1 1 140px;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--secondary-border);
  border-radius: 10px;
  background: var(--secondary-bg);
  color: var(--landing-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.cookie-consent-actions button:hover {
  background: var(--secondary-hover);
}

/* Страница возврата OAuth: код подключения и кнопка «Скопировать». */
.oauth-code {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.oauth-code input {
  flex: 1 1 260px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border, #d7dae2);
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  background: var(--surface, #fff);
  color: inherit;
}

.oauth-actions {
  margin-top: 18px;
}

/* ——— Модалка «Попробовать на компьютере» (замена скачивания на мобильном) ———
 *
 * Десктопное приложение на телефон не поставить, поэтому на ширине ≤680px
 * (тот же порог, что и у остальной адаптивной вёрстки) главная кнопка вместо
 * скачивания открывает эту модалку: просит почту и присылает на неё ссылку
 * на сайт — app.js, раздел «Мобильный лендинг». */
.try-dialog {
  width: min(360px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--landing-ink);
  box-shadow: 0 28px 70px var(--frame-shadow);
}

.try-dialog::backdrop {
  background: rgba(9, 11, 16, 0.6);
}

.try-dialog-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.try-dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: var(--secondary-bg);
  color: var(--secondary-text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.try-dialog-close:hover {
  background: var(--secondary-hover);
}

.try-dialog-form h2 {
  margin: 0;
  padding-right: 28px;
  font-size: 19px;
  font-weight: 800;
}

.try-dialog-form p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.try-dialog-label {
  font-size: 13px;
  font-weight: 600;
}

.try-dialog-form input[type="email"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--secondary-border);
  border-radius: 10px;
  background: var(--surface-soft);
  color: inherit;
  font: inherit;
  font-size: 15px;
}

.try-dialog-form input[type="email"]:focus {
  outline: 2px solid var(--landing-accent);
  outline-offset: 1px;
}

.try-dialog-submit {
  width: 100%;
  min-height: 46px;
}

.try-dialog-status {
  margin: 0;
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
}

/* Иконка ОС на кнопке лишняя, когда кнопка не скачивает, а зовёт модалку. */
.platform-download.is-try-link .platform-icon {
  display: none;
}
