/* ProsaMD — главная (сборка 2026-10-11 из /new + /new_1; стенды /new и /new_1 живут
   на собственных landing*.css). Рабочий акцент интерфейсных элементов — ультрамарин
   Цвет — по схеме Б палитры C (prosamd/kit/GUIDELINES.md, «Палитра сайта»):
   · сайт: кнопки и плоские акценты — киноварь (--site-accent), шапка — чернила;
   · окно программы (демо, кадры): цвета приложения — ультрамарин (--accent);
   · градиент киноварь → ультрамарин — только выделенное слово H1;
   · ультрамарин на самом сайте — только полутона (--accent-soft: подложки иконок).
   «Текст — король, вёрстка — слуга»: издательская типографика, бумага, воздух.
   Бренд: киноварь #D9452B — только знак, крупные акценты и один CTA (hero);
   мелкий текст — чернилами: контраст киновари к белому 4,35:1 (kit/GUIDELINES.md).
   Для мелких акцентов (маркеры разметки, сноски) — глубокий тон #C13A22 (5,39:1)
   и светлый #e86a50 в тёмной теме (5,27:1).
   Ревизия 2026-10-09: мягкие градиенты (киноварь → фиолетовый акцент приложения),
   стеклянные поверхности, больше движения — поверх той же бумажной основы. */

/* Градиентные стопы бренда: киноварь сайта → фиолетовый рабочий акцент приложения.
   Только крупный текст, заливки CTA и фоновые свечения — не для мелкого текста. */
:root {
  --grad-brand: linear-gradient(96deg, #d9452b 12%, #d21c69 34%, #b600a3 52%, #8900d6 72%, #4600f9 96%);
  --glass-bg: rgba(255, 255, 255, 0.66);
  --glass-bg-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

:root[data-theme="dark"] {
  --grad-brand: linear-gradient(96deg, #f85942 12%, #ee578b 34%, #d462c3 52%, #ac72e8 72%, #7885f7 96%);
  --glass-bg: rgba(25, 27, 36, 0.55);
  --glass-bg-strong: rgba(25, 27, 36, 0.68);
  --glass-border: rgba(234, 235, 238, 0.16);
  --glass-highlight: inset 0 1px 0 rgba(234, 235, 238, 0.08);
}

@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/noto-sans-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/noto-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+21A9, U+FEFF, U+FFFD;
}

:root {
  --cinnabar: #D9452B;
  --cinnabar-deep: #C13A22;      /* фон CTA: контраст к белому 5,38:1 (AA) */
  --cinnabar-press: #A93319;
  --mark: #C13A22;               /* мелкие акценты сайта (ошибки формы) */
  --paper: #ffffff;
  --paper-tint: #f6f7fa;         /* тёплая бумага для чередования секций */
  --ink: #181a23;
  --ink-soft: #4d4f58;
  --ink-muted: #6a6c75;          /* 5,2:1 к белому, 4,7:1 к sunken — AA */
  --line: rgba(24, 26, 35, 0.12);
  --line-strong: rgba(24, 26, 35, 0.22);
  --btn-outline: rgba(24, 26, 35, 0.55); /* ≥3:1 к белому и бумаге (WCAG 1.4.11) */
  --surface: #ffffff;
  --surface-sunken: #f2f3f7;
  --bar-other: #b8bac4;          /* полоса «обычного редактора»: нейтральная, не спорит с киноварью */
  --shadow-window: 0 28px 72px -20px rgba(24, 26, 35, 0.24), 0 4px 16px rgba(24, 26, 35, 0.06);
  --maxw: 1120px;
  --radius: 12px;
  --accent: #4c52c5;             /* приглушённый ультрамарин палитры C: 6,3:1 к белому (2026-10-11) */
  --accent-soft: rgba(76, 82, 197, 0.09);
  --accent-hover: #3f41b2;
  --accent-fg: #ffffff;
  --site-accent: #C13A22;        /* акцент сайта по схеме Б: киноварь знака, 5,4:1 к белому */
  --section-pad: clamp(80px, 10vw, 128px);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --mark: #e86a50;
  --paper: #111218;
  --paper-tint: #15161d;
  --ink: #eaebee;
  --ink-soft: #bcbdc3;
  --ink-muted: #96989e;          /* 6,1:1 к #111218, 5,7:1 к #15161d */
  --line: rgba(234, 235, 238, 0.14);
  --line-strong: rgba(234, 235, 238, 0.26);
  --btn-outline: rgba(234, 235, 238, 0.42);
  --surface: #191b24;
  --surface-sunken: #0c0d13;
  --bar-other: #4a4c58;
  --accent: #7885f7;             /* 6,1:1 к #111218 */
  --accent-soft: rgba(120, 133, 247, 0.14);
  --accent-hover: #8d9bf8;
  --accent-fg: #0c0d13;
  --site-accent: #e86a50;        /* 5,3:1 к #111218 */
  --shadow-window: 0 28px 72px -16px rgba(0, 0, 0, 0.6), 0 4px 16px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Якорные секции не уезжают под липкую шапку */
section[id], main[id], #demo { scroll-margin-top: 80px; }

body {
  margin: 0;
  font-family: "Noto Sans", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

code, kbd, pre {
  font-family: ui-monospace, "Cascadia Code", Consolas, "JetBrains Mono", monospace;
}

code {
  font-size: 0.86em;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.08em 0.36em;
}

kbd {
  font-size: 0.78em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.05em 0.42em;
  background: var(--surface);
  white-space: nowrap;
}

a { color: inherit; }

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

.container-narrow { max-width: 780px; }

/* Только RU-локаль (донаты): в EN скрыто и визуально, и для скринридеров */
:root[lang="en"] .ru-only { display: none !important; }

/* ─────────── Шапка ─────────── */

/* Шапка, иконки и мобильное меню — в общем site-header.css (одна копия на весь сайт) */

/* ─────────── Кнопки ─────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border: 1.5px solid transparent;
  border-radius: 10px;
  font: 600 16px/1.2 "Noto Sans", sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: progress; }

/* Единственный киноварный CTA страницы — «Скачать» в hero.
   Градиент держим в глубокой гамме (#A93319→#C9412A): белый текст ≥ 4,9:1 по всей длине (AA). */
.btn-primary {
  background: linear-gradient(180deg, #c9412a, #b03a22);
  color: #fff;
  box-shadow: 0 10px 28px -10px rgba(217, 69, 43, 0.55);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #d4462d, #b03a22);
  box-shadow: 0 14px 34px -10px rgba(217, 69, 43, 0.65);
}
.btn-primary:active { box-shadow: 0 6px 18px -8px rgba(217, 69, 43, 0.55); }

/* Остальные основные действия — чернилами */
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: color-mix(in srgb, var(--ink) 84%, var(--paper)); }

.btn-block { width: 100%; }

/* ─────────── Герой ─────────── */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 8vw, 92px) 0 40px;
}

/* Мягкие градиентные свечения (киноварь + фиолетовый акцент приложения):
   два псевдоэлемента медленно дрейфуют — движение есть, шума нет.
   Текст лежит выше (z-index у .hero-inner и .demo-wrap). */
/* Свечения и водяной знак убраны (гейт ★2, волна 2): декор заполнял пустоту
   там, где должны стоять доказательства; знак под свечением читался
   лиловым — по сути нарушение брендбука. Бумага остаётся чистой. */
.hero-inner { text-align: center; position: relative; z-index: 1; }

.hero h1 {
  margin: 0 auto 22px;
  max-width: 15em;
  font-size: clamp(2.6rem, 7vw, 4.9rem);
  line-height: 1.04;
  letter-spacing: -0.032em;
  font-weight: 700;
  text-wrap: balance;
}

.hero h1 .accent { color: var(--cinnabar); } /* крупный текст — киноварь допустима */

/* Градиент на слове «Markdown» (★2 владельца, палитра C: киноварь → ультрамарин) */
.hero h1 .grad {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Градиентное слово убрано: акцент — сплошная киноварь на реальном
   тезисе («Быстрый»), не SaaS-приём. */

.hero-lede {
  margin: 0 auto 30px;
  max-width: 35em;
  font-size: clamp(1.08rem, 1.9vw, 1.28rem);
  line-height: 1.6;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.hero-lede code { font-size: 0.82em; background: none; border: 0; padding: 0; }

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Три главных преимущества (решение владельца 2026-10-09):
   стеклянные карточки с иконкой и подписью, в один ряд до 640px. */
.hero-advantages {
  list-style: none;
  margin: 32px auto 0;
  padding: 0;
  max-width: 780px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: stretch;
}

.adv {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
  transition: border-color 0.2s, transform 0.2s;
}

.adv:hover { border-color: var(--line-strong); transform: translateY(-2px); }

@supports (backdrop-filter: blur(1px)) {
  .adv {
    background: var(--glass-bg);
    border-color: var(--glass-border);
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    box-shadow: var(--glass-highlight), 0 8px 24px -14px rgba(24, 26, 35, 0.18);
  }
}

.adv-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--site-accent);
}

.adv-icon svg { width: 19px; height: 19px; }

.adv-body { display: grid; gap: 1px; min-width: 0; }

.adv-title { font-weight: 700; font-size: 15px; line-height: 1.3; letter-spacing: -0.01em; }

.adv-sub { font-size: 12.5px; line-height: 1.4; color: var(--ink-muted); }

@media (max-width: 640px) {
  .hero-advantages { grid-template-columns: 1fr; }
  .adv { padding: 12px 14px; }
}

.hero-note {
  margin: 16px 0 0;
  font-size: 13.5px;
  color: var(--ink-muted);
}

/* ─────────── Демо-окно ─────────── */

.demo-wrap { margin-top: clamp(40px, 6vw, 64px); position: relative; max-width: 940px; z-index: 1; }

.window {
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-window);
  overflow: hidden;
}

/* Стеклянное окно: полупрозрачная поверхность над градиентными свечениями hero.
   Фолбэк без backdrop-filter — плотный var(--surface) выше. */
@supports (backdrop-filter: blur(1px)) {
  .window {
    background: var(--glass-bg-strong);
    border-color: var(--glass-border);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    box-shadow: var(--glass-highlight), var(--shadow-window);
  }
  .window-bar, .window-status { background: color-mix(in srgb, var(--surface-sunken) 62%, transparent); }
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-sunken);
}

.window-symbol { flex: none; }

.mode-switch {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  flex: none;
}

.mode-switch button {
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-muted);
  font: 600 12.5px/1.15 "Noto Sans", sans-serif;
  padding: 6px 12px;
  min-height: 32px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.mode-switch button:hover:not([aria-selected="true"]) {
  color: var(--ink);
  background: var(--surface-sunken);
}

.mode-switch button[aria-selected="true"] {
  background: var(--ink);
  color: var(--paper);
}

.window-body { padding: 30px 40px 26px; min-height: 380px; }

.doc:focus-visible { outline-offset: 6px; border-radius: 4px; }

/* Отрисованный документ (Просмотр и Динамический просмотр) */
.doc-rendered { font-size: 16px; line-height: 1.72; max-width: 36em; }

.doc-rendered .d-h1 {
  font-size: 1.6em;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.018em;
  margin: 0 0 0.6em;
}

.doc-rendered p { margin: 0 0 0.9em; }

.doc-rendered ul { list-style: none; margin: 0 0 0.9em; padding: 0; }

.doc-rendered li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 2.5px 0;
}

.doc-rendered .d-box {
  flex: none;
  width: 15px;
  height: 15px;
  border-radius: 4px;
  border: 1.5px solid var(--line-strong);
  position: relative;
  top: 2px;
}

.doc-rendered .d-box-on { background: var(--accent); border-color: var(--accent); }

.doc-rendered .d-box-on::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid var(--accent-fg);
  border-width: 0 2px 2px 0;
  transform: rotate(40deg);
}

.doc-rendered .d-done { color: var(--ink-muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }

.doc-rendered blockquote {
  position: relative;
  margin: 0;
  padding: 0.5em 1em 0.5em 1.2em;
  border-radius: 0 8px 8px 0;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  color: var(--ink-soft);
}
.doc-rendered blockquote::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 55%, transparent);
}

/* Сноски: маркер в тексте + определение (номер, текст, ↩ обратно) */
.d-fn-ref {
  font-size: 0.7em;
  font-weight: 700;
  line-height: 0;
  margin-left: 1px;
  color: var(--accent);
}

.d-fn {
  display: grid;
  grid-template-columns: minmax(1.25em, auto) minmax(0, max-content) auto;
  justify-content: start;
  column-gap: 0.5em;
  align-items: baseline;
  font-size: 0.86em;
  line-height: 1.6;
  color: var(--ink-soft);
}

.d-fn-num { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.d-fn-back { color: var(--ink-muted); }

/* Просмотр: сноски собраны внизу документа, под тонкой чертой */
.d-fn-list {
  margin-top: 1.6em;
  padding-top: 1.1em;
  border-top: 1px solid var(--line);
}

/* Динамический просмотр: определение сноски стоит там, где написано */
.doc-visual .d-fn { margin: -0.3em 0 1em; }

/* Каретка — живой документ «печатается» */
.d-caret {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  margin-left: 1px;
  vertical-align: -0.2em;
  background: var(--accent);
  animation: caret 1.1s steps(1) infinite;
}

@keyframes caret { 50% { opacity: 0; } }

/* Кодовый режим — как в приложении (CodeMirror 6): акцент приложения фиолетовый,
   маркеры разметки приглушённо-серые, слева нумерация строк */
.doc-code {
  --cm-accent: #4c52c5;
  --cm-mark: #6e7385;
  --cm-gutter: #a3a6b3;
  --cm-code: #3f41b2;
  --cm-code-bg: #f4f5f8;
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-x: auto;
}

:root[data-theme="dark"] .doc-code {
  --cm-accent: #7885f7;
  --cm-mark: #8d90a2;
  --cm-gutter: #5c5e68;
  --cm-code: #8d9bf8;
  --cm-code-bg: #23252e;
}

/* Сброс общего стиля code: это контейнер строк, не инлайн-код */
.doc-code > code { display: block; font-size: inherit; background: none; border: 0; border-radius: 0; padding: 0; }

.cm-line {
  display: grid;
  grid-template-columns: 2ch minmax(0, 1fr);
  column-gap: 18px;
}

.cm-gutter {
  text-align: right;
  color: var(--cm-gutter);
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.cm-text { overflow-wrap: anywhere; }

.doc-code .cm-h1 { color: var(--cm-accent); font-weight: 700; }
.doc-code .cm-mark { color: var(--cm-mark); }
.doc-code strong { font-weight: 700; }
.doc-code .cm-code { color: var(--cm-code); background: var(--cm-code-bg); border-radius: 3px; }
.doc-code .cm-quote { color: var(--cm-mark); font-style: italic; }

.window-status {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 7px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface-sunken);
  font-size: 12px;
  color: var(--ink-muted);
}

.status-path {
  margin-right: auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-right { display: inline-flex; gap: 14px; flex: none; }
.status-saved { color: var(--ink-soft); }

.demo-hint {
  margin: 20px auto 0;
  max-width: 44em;
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-muted);
}

/* ─────────── Секции ─────────── */

.section { padding: var(--section-pad) 0; }
.section-tinted { background: var(--paper-tint); }

.overline {
  margin: 0 0 16px;
  font: 700 12.5px/1 "Noto Sans", sans-serif;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.overline::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: var(--site-accent);
  margin-right: 12px;
  vertical-align: 3px;
}

.section h2 {
  margin: 0 0 20px;
  max-width: 18em;
  font-size: clamp(1.95rem, 4.4vw, 3.05rem);
  line-height: 1.1;
  letter-spacing: -0.026em;
  text-wrap: balance;
}

.section-lede {
  margin: 0 0 44px;
  max-width: 36em;
  color: var(--ink-soft);
  font-size: clamp(1.04rem, 1.5vw, 1.14rem);
  line-height: 1.5;
  text-wrap: pretty;
}

.text-link { margin: 8px 0 0; font-size: 15px; }

.text-link a, .dl-alt, .fb-alt-links a, .donate a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  transition: color 0.15s, text-decoration-color 0.15s;
}

.text-link a:hover, .dl-alt:hover, .fb-alt-links a:hover, .donate a:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}

/* ─────────── Как выглядит: ролик + ряды «клип крупно, текст рядом» ───────────
   Главное — движение на кадре; текст вторичен и поясняет. Все клипы и
   постеры одного формата 16:10 (кадр окна 1440×900 @2x). */

.reel { margin: 48px 0 0; }

.reel-frame, .clip-frame {
  position: relative;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-sunken);
  box-shadow: 0 24px 60px -30px rgba(24, 26, 35, 0.35);
}

.reel-frame video, .clip-frame video, .clip-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.reel-frame video { aspect-ratio: 16 / 9; }

.clip-rows { list-style: none; margin: clamp(56px, 7vw, 96px) 0 0; padding: 0; display: grid; gap: clamp(56px, 7vw, 104px); }

.clip-row {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}

/* Змейка: чётный ряд — клип справа */
.clip-row:nth-child(even) { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
.clip-row:nth-child(even) .clip-frame { order: 2; }

.clip-text { max-width: 22em; }

.clip-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--site-accent);
  font: 700 13.5px/1 "Noto Sans", sans-serif;
  font-variant-numeric: tabular-nums;
}

.clip-text h3 {
  margin: 0 0 10px;
  font-size: clamp(1.3rem, 2vw, 1.55rem);
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.clip-text p { margin: 0; color: var(--ink-soft); }

/* Кнопка «пауза/пуск» клипа — для тех, кому мешает движение (WCAG 2.2.2) */
.clip-toggle {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  color: var(--ink);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}
.clip-frame:hover .clip-toggle, .clip-toggle:focus-visible, .clip-frame[data-paused] .clip-toggle { opacity: 1; }
.clip-toggle .ico-play { display: none; }
.clip-frame[data-paused] .clip-toggle .ico-play { display: block; }
.clip-frame[data-paused] .clip-toggle .ico-pause { display: none; }

@media (hover: none) { .clip-toggle { opacity: 1; } }

@media (max-width: 900px) {
  .clip-row, .clip-row:nth-child(even) { grid-template-columns: 1fr; gap: 18px; }
  .clip-row:nth-child(even) .clip-frame { order: 0; }
  .clip-text { max-width: none; }
}

/* ─────────── ProsaMD в цифрах ───────────
   Строка = значение крупно + подпись + круглая кнопка «+».
   Вся строка — кнопка-раскрытие: hover-тонировка, фокус-кольцо. */

.colophon { margin: 36px 0 0; display: grid; gap: 10px; }

.col-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.col-item:hover { border-color: var(--line-strong); }
.col-item[open] { border-color: var(--line-strong); box-shadow: 0 18px 40px -28px rgba(24, 26, 35, 0.35); }

.col-item summary {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
  border-radius: 14px;
}

.col-item summary::-webkit-details-marker { display: none; }
.col-item summary:focus-visible { outline-offset: -2px; }

.col-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--site-accent);
}
.col-ico svg { width: 21px; height: 21px; }

.col-main { display: grid; gap: 1px; min-width: 0; }

.col-val {
  font-size: clamp(1.18rem, 2.2vw, 1.42rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
}

.col-key { font-size: 14px; color: var(--ink-muted); }

.col-more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-muted);
  transition: color 0.15s;
}

.col-plus {
  position: relative;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.15s, background 0.15s;
}
.col-plus::before, .col-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 1.75px;
  margin: -0.875px 0 0 -6px;
  border-radius: 1px;
  background: currentColor;
}
.col-plus::after { transform: rotate(90deg); }

.col-item summary:hover .col-more { color: var(--ink); }
.col-item summary:hover .col-plus { border-color: var(--ink-soft); }
.col-item[open] .col-plus { transform: rotate(45deg); background: var(--surface-sunken); }
.col-item[open] .col-more-text { display: none; }

.col-body { padding: 0 18px 22px 78px; max-width: 46em; }
.col-body p { margin: 0 0 12px; color: var(--ink-soft); }
.col-body p:last-child { margin-bottom: 0; }

.col-link {
  font-weight: 600;
  color: var(--site-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.col-link:hover { text-decoration-thickness: 2px; }

@media (max-width: 640px) {
  .col-item summary { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; padding: 14px; }
  .col-ico { width: 38px; height: 38px; border-radius: 10px; }
  .col-more-text { display: none; }
  .col-body { padding: 0 14px 18px; }
}

/* ── «Размер»: меньше = лучше. Площадь квадрата честно пропорциональна
   мегабайтам (4 к 100 → сторона 1 к 5); ProsaMD — акцент и галочка,
   тяжёлый редактор — серая штриховка. Ниже — «гонка» скачивания. ── */

.size-viz { display: grid; gap: 26px; margin-top: 4px; }

.size-compare {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: end;
  gap: 18px 26px;
}

.size-item { display: grid; justify-items: start; gap: 10px; }

.size-sq {
  display: grid;
  place-items: center;
  border-radius: 6px;
}

.size-sq-prosa {
  width: 32px;
  height: 32px;
  background: var(--site-accent);
  color: #fff;
}
.size-sq-prosa svg { width: 18px; height: 18px; }

.size-sq-other {
  width: 160px;
  height: 160px;
  border: 1.5px solid var(--bar-other);
  background: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--bar-other) 55%, transparent) 7px 8.5px);
}

.size-cap { display: grid; gap: 0; font-size: 13.5px; line-height: 1.35; color: var(--ink-muted); }
.size-cap b { font-size: 15.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.size-item-prosa .size-cap b { color: var(--site-accent); }

.size-verdict {
  align-self: center;
  display: grid;
  gap: 2px;
  padding-left: 8px;
}
.size-x {
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--site-accent);
  font-variant-numeric: tabular-nums;
}
.size-verdict span:last-child { font-size: 14.5px; color: var(--ink-soft); }

.race { display: grid; gap: 12px; margin: 0; }
.race-title { margin: 0 0 2px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }

.race-row {
  display: grid;
  grid-template-columns: minmax(7.5em, auto) minmax(0, 1fr) 4.8em;
  align-items: center;
  gap: 14px;
  font-size: 14px;
}
.race-name { font-weight: 600; }
.race-track { height: 10px; border-radius: 5px; background: var(--surface-sunken); overflow: hidden; }
.race-fill { display: block; height: 100%; width: var(--p, 0%); border-radius: 5px; background: var(--bar-other); }
.race-row-prosa .race-fill { background: var(--site-accent); }
.race-time { display: inline-flex; align-items: center; gap: 5px; justify-content: flex-end; font-variant-numeric: tabular-nums; color: var(--ink-muted); white-space: nowrap; }
.race-row-prosa .race-time { color: var(--site-accent); font-weight: 700; }
.race-time svg { width: 15px; height: 15px; display: none; }
.race-row.is-done .race-time svg { display: block; }

.size-note { margin: 0; font-size: 13px; color: var(--ink-muted); }

@media (max-width: 640px) {
  .size-compare { grid-template-columns: auto 1fr; }
  .size-verdict { grid-column: 1 / -1; padding-left: 0; }
  .size-sq-other { width: 120px; height: 120px; }
  .size-sq-prosa { width: 24px; height: 24px; }
  .race-row { grid-template-columns: 1fr 4.8em; }
  .race-track { grid-column: 1 / -1; grid-row: 2; }
}

/* ── «Язык»: живое мини-окно + переключатель RU | EN ── */

.lang-demo { display: grid; gap: 14px; justify-items: start; margin-top: 4px; }

.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-sunken);
}
.seg button {
  min-width: 64px;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-muted);
  font: 600 13.5px/1 "Noto Sans", sans-serif;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.seg button:hover:not([aria-pressed="true"]) { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--site-accent); box-shadow: 0 1px 3px rgba(24, 26, 35, 0.14); }

.mini-win {
  width: 100%;
  max-width: 560px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  font-size: 13px;
}
.mini-bar, .mini-status {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 12px;
  background: var(--surface-sunken);
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
}
.mini-bar { border-bottom: 1px solid var(--line); }
.mini-status { border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-muted); }
.mini-status span:first-child { margin-right: auto; }
.mini-body { padding: 14px 16px; display: grid; gap: 6px; }
.mini-body b { font-size: 15px; }
.mini-body span { color: var(--ink-soft); }
.mini-win [data-l] { display: inline-block; transition: opacity 0.18s, transform 0.18s; }
.mini-win.is-swapping [data-l] { opacity: 0; transform: translateY(-4px); }

/* ─────────── Возможности ─────────── */

.features-grid {
  margin-top: 52px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 28px 26px 24px;
  transition: border-color 0.2s, transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.25s;
}

.feature-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
  box-shadow: 0 16px 34px -22px rgba(24, 26, 35, 0.3);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--surface-sunken);
  color: var(--site-accent);
  margin-bottom: 18px;
}

.feature-icon svg { width: 22px; height: 22px; }

.feature-card h3 { margin: 0 0 8px; font-size: 1.12rem; letter-spacing: -0.01em; line-height: 1.3; }
.feature-card p { margin: 0; font-size: 15px; color: var(--ink-soft); }

/* ─────────── Скачать ─────────── */

.dl-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}

.dl-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 26px;
  display: flex;
  flex-direction: column;
}

.dl-card-main { border-color: var(--line-strong); }

.dl-platform { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.dl-platform > svg { color: var(--ink-soft); flex: none; }
.dl-card h3 { margin: 0; font-size: 1.1rem; }
.dl-platform p { margin: 1px 0 0; font-size: 13px; color: var(--ink-muted); }

.dl-alt { margin-top: 14px; font-size: 13.5px; color: var(--ink-muted); }

.dl-note { margin: auto 0 4px; font-size: 14px; color: var(--ink-soft); }

.dl-footnote {
  margin: 32px 0 0;
  font-size: 13.5px;
  color: var(--ink-muted);
  max-width: 52em;
}

/* Тихая строка поддержки — после сноски об установке */
.donate { margin: 14px 0 0; font-size: 14px; color: var(--ink-muted); }

/* ─────────── Роадмап ─────────── */

.roadmap { list-style: none; margin: 40px 0 0; padding: 0; }

.roadmap li {
  position: relative;
  display: flex;
  gap: 20px;
  padding: 0 0 34px;
}

.roadmap li::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 22px;
  bottom: -4px;
  width: 2px;
  background: var(--line);
}

.roadmap li:last-child::before { display: none; }

.rm-marker {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: var(--paper-tint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.roadmap .done .rm-marker { background: var(--site-accent); border-color: var(--site-accent); }
.roadmap li.doing .rm-marker { color: var(--site-accent); }

.rm-marker .rm-spin { animation: rm-spin 1.4s linear infinite; }
@keyframes rm-spin { to { transform: rotate(360deg); } }

.roadmap h3 { margin: 0 0 4px; font-size: 1.08rem; }
.roadmap p { margin: 0; font-size: 15px; color: var(--ink-soft); }

.rm-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink-soft);
  vertical-align: 2px;
}

/* ─────────── FAQ ─────────── */

.faq-list { display: grid; gap: 0; margin-top: 36px; border-top: 1px solid var(--line-strong); }

.faq-item { border-bottom: 1px solid var(--line-strong); }

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 2px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.06rem;
  letter-spacing: -0.008em;
  list-style: none;
  color: var(--ink);
}

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

.faq-item summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--ink-muted);
  border-bottom: 2px solid var(--ink-muted);
  transform: rotate(45deg);
  margin-top: -4px;
  transition: transform 0.15s ease;
}

.faq-item[open] summary::after { transform: rotate(-135deg); margin-top: 2px; }

.faq-item summary:focus-visible { border-radius: 4px; }

.faq-item p {
  margin: 0;
  padding: 0 2px 22px;
  max-width: 40em;
  color: var(--ink-soft);
  line-height: 1.65;
}

/* ─────────── Обратная связь ─────────── */

.feedback-form { margin: 0 0 16px; }

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}

.feedback-form textarea {
  width: 100%;
  min-height: 132px;
  padding: 12px 14px;
  border: 1.5px solid var(--btn-outline);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  resize: vertical;
  transition: border-color 0.15s;
}

.feedback-form textarea::placeholder { color: var(--ink-muted); opacity: 1; }
.feedback-form textarea:hover { border-color: var(--ink-soft); }
.feedback-form textarea:focus { border-color: var(--ink); }

/* honeypot: вне экрана, боты всё равно заполняют */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* «Отправить»: та же геометрия, что у поля (рамка 1,5px, радиус 10px),
   высота 44px, ровно по левому краю поля; hover — инверсия, видна сразу */
.btn-send {
  min-height: 44px;
  padding: 0 24px;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 15px;
}

.btn-send:hover:not(:disabled) { background: transparent; color: var(--ink); }

.form-status { margin: 0; font-size: 14px; color: var(--ink-muted); }
.form-status[data-kind="ok"] { color: #0e7a14; }
:root[data-theme="dark"] .form-status[data-kind="ok"] { color: #7ee08a; }
.form-status[data-kind="err"] { color: var(--mark); }

.fb-alt-links { margin: 0; font-size: 14px; color: var(--ink-muted); }

/* ─────────── Подвал ─────────── */

/* Подвал — в общем site-header.css */

/* ─────────── Skip-link и фокус ─────────── */

.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  border-radius: 0 0 10px 10px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus { top: 0; }

:focus-visible { outline: 2px solid var(--site-accent); outline-offset: 2px; }
/* Внутри окна программы — фокус цветом приложения */
.window :focus-visible { outline-color: var(--accent); }

/* ─────────── Появление при прокрутке (только без reduced-motion) ─────────── */

@media (prefers-reduced-motion: no-preference) {
  .reveal-ready .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
  .reveal-ready .reveal.is-in { opacity: 1; transform: none; }

  /* Карточки возможностей входят волной: +70мс на соседа по сетке */
  .reveal-ready .features-grid .reveal:nth-child(3n+2) { transition-delay: 0.07s; }
  .reveal-ready .features-grid .reveal:nth-child(3n) { transition-delay: 0.14s; }
  .reveal-ready .spread-rows .reveal:nth-child(2) { transition-delay: 0.06s; }
  .reveal-ready .spread-rows .reveal:nth-child(3) { transition-delay: 0.12s; }

  .reveal-ready .weight-chart .wbar-fill { width: 0; transition: width 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s; }
  .reveal-ready .weight-chart.is-in .wbar-fill { width: var(--w); }

  /* Вход hero: заголовок → лид → кнопки → преимущества → сноска → демо-окно */
  .hero h1, .hero .hero-lede, .hero .hero-cta, .hero .hero-advantages, .hero .hero-note, .hero .demo-wrap {
    animation: hero-enter 0.65s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  }
  .hero .hero-lede { animation-delay: 0.09s; }
  .hero .hero-cta { animation-delay: 0.18s; }
  .hero .hero-advantages { animation-delay: 0.27s; }
  .hero .hero-note { animation-delay: 0.34s; }
  .hero .demo-wrap { animation-delay: 0.42s; }

  @keyframes hero-enter {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ─────────── Адаптив ─────────── */

@media (max-width: 960px) {
  .features-grid { grid-template-columns: 1fr 1fr; }
  .dl-grid { grid-template-columns: 1fr 1fr; }
  .dl-card-main { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .features-grid { grid-template-columns: 1fr; }
  .dl-grid { grid-template-columns: 1fr; }
  .window-bar { flex-wrap: wrap; }
  .mode-switch { width: 100%; }
  .mode-switch button { flex: 1 1 0; padding: 6px 6px; }
  .window-body { padding: 22px 20px 18px; min-height: 0; }
  .status-path { display: none; }
  .status-right { margin-left: auto; }
  .form-row { flex-direction: column; align-items: flex-start; }
  .hero-cta .btn { width: 100%; }
}

@media (max-width: 400px) {
  .container { padding: 0 16px; }
  .mode-switch button { font-size: 12px; }
  .window-body { padding: 20px 16px 16px; }
  .doc-rendered { font-size: 15px; }
  .doc-code { font-size: 12.5px; }
  .status-right { gap: 10px; }
  .wbar-head { flex-wrap: wrap; gap: 2px 12px; }
}

/* ── Демо-окно: хром как в настоящем приложении (гейт ★2) ──
   Строка меню слева; справа язык, тема и иконки режимов.
   Активный режим — рабочим акцентом приложения (#4c52c5 / #7885f7). */
.window-menu {
  display: flex;
  gap: 16px;
  margin-right: auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.window-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  font: 600 11.5px/1 "Noto Sans", sans-serif;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.mode-switch-icons { padding: 2px; gap: 2px; border: 0; background: transparent; }

.mode-switch-icons button {
  min-height: 30px;
  min-width: 34px;
  padding: 0 8px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mode-switch-icons button[aria-selected="true"] {
  color: #4c52c5;
  background: rgba(76, 82, 197, 0.12);
}

:root[data-theme="dark"] .mode-switch-icons button[aria-selected="true"] {
  color: #7885f7;
  background: rgba(120, 133, 247, 0.16);
}

/* hero-note: ссылка на исходники — тихая, как примечание */
.hero-note a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.hero-note a:hover { color: var(--ink); text-decoration-color: currentColor; }

@media (max-width: 640px) { .window-menu { display: none; } }

/* ─────────── Тултипы демо-окна ───────────
   Название + клавиша; появляются по hover (задержка 300 мс) и по фокусу
   с клавиатуры. Текст тултипа — aria-hidden: имя кнопки уже в aria-label. */

.has-tip { position: relative; }

.tip {
  position: absolute;
  top: calc(100% + 9px);
  left: 50%;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 7px;
  background: var(--ink);
  color: var(--paper);
  font: 600 12.5px/1.2 "Noto Sans", sans-serif;
  letter-spacing: 0;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -3px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  transition-delay: 0s;
}

.tip::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-bottom-color: var(--ink);
}

.tip kbd {
  font-size: 11px;
  font-weight: 600;
  color: var(--paper);
  background: color-mix(in srgb, var(--paper) 16%, transparent);
  border-color: color-mix(in srgb, var(--paper) 30%, transparent);
}

.tip-end .tip { left: auto; right: -4px; transform: translate(0, -3px); }
.tip-end .tip::before { left: auto; right: 12px; }

.has-tip:hover .tip, .has-tip:focus-visible .tip {
  opacity: 1;
  transform: translate(-50%, 0);
  transition-delay: 0.3s;
}
.has-tip:focus-visible .tip { transition-delay: 0s; }
.tip-end.has-tip:hover .tip, .tip-end.has-tip:focus-visible .tip { transform: translate(0, 0); }

.window-meta .wm-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  border-radius: 6px;
}

/* ─────────── Демо: три режима должны выглядеть по-разному ───────────
   Просмотр — страница: шире поля, без каретки, замок «только чтение».
   Визуальный — живой редактор: каретка, рамка активного блока, панель формата.
   Код — разметка с подсветкой. */

.window { position: relative; }
/* Одна высота для всех режимов — окно не прыгает при переключении */
.window-body { position: relative; min-height: 500px; }
@media (max-width: 640px) { .window-body { min-height: 560px; } }

/* Подпись режима — всплывает на 1,6 с при переключении */
.mode-toast {
  position: absolute;
  bottom: 14px;
  margin: 0;
  left: 50%;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: 600 13px/1.2 "Noto Sans", sans-serif;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.mode-toast svg { width: 15px; height: 15px; flex: none; }
.mode-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Смена панели — короткий кроссфейд */
.doc.is-entering { animation: doc-enter 0.22s ease both; }
@keyframes doc-enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* Просмотр: «страница», курсор-стрелка, ничего не выделяется как ввод */
.doc-reading { cursor: default; margin: 0 auto; max-width: 34em; }
.doc-reading .d-h1 { font-size: 1.75em; }

/* Визуальный редактор: текстовый курсор, рамка активного блока */
.doc-visual { cursor: text; }
.doc-visual .is-active {
  border-radius: 6px;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 7%, transparent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.doc-visual p, .doc-visual li, .doc-visual .d-h1 { transition: background 0.25s, box-shadow 0.25s; }

.d-sel { background: color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 2px; transition: background 0.2s; }

/* Панель форматирования над выделением (как ПКМ-панель приложения) */
.fmt-bar {
  position: absolute;
  z-index: 6;
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 12px 28px -12px rgba(24, 26, 35, 0.35);
  opacity: 0;
  transform: translateY(4px) scale(0.98);
  transform-origin: bottom center;
  transition: opacity 0.16s ease, transform 0.16s ease;
  pointer-events: none;
}
.fmt-bar.is-on { opacity: 1; transform: none; }
.fmt-bar span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 26px;
  padding: 0 6px;
  border-radius: 6px;
  font: 700 13px/1 "Noto Sans", sans-serif;
  color: var(--ink-soft);
  transition: background 0.12s, color 0.12s;
}
.fmt-bar span.is-press { background: var(--accent-soft); color: var(--accent); }
.fmt-bar .fb-i { font-style: italic; font-family: Georgia, serif; }
.fmt-bar .fb-s { text-decoration: line-through; }
.fmt-bar .fb-c { font: 600 11px/1 ui-monospace, Consolas, monospace; }

/* Указатель мыши — сцена «выделил → нажал Ж» */
.demo-pointer {
  position: absolute;
  z-index: 7;
  left: 0;
  top: 0;
  width: 18px;
  height: 22px;
  pointer-events: none;
  opacity: 0;
  transition: transform 0.55s cubic-bezier(0.3, 0.7, 0.25, 1), opacity 0.2s;
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.35));
}
.demo-pointer.is-on { opacity: 1; }
.demo-pointer.is-click { animation: ptr-click 0.22s ease; }
@keyframes ptr-click { 50% { scale: 0.86; } }

/* Таблица в документе */
.d-table { width: 100%; max-width: 26em; border-collapse: collapse; margin: 0.2em 0 1em; font-size: 0.93em; }
.d-table th, .d-table td { padding: 5px 10px; border: 1px solid var(--line-strong); text-align: left; }
.d-table th { background: var(--surface-sunken); font-weight: 600; }
.d-table td:last-child, .d-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.doc-visual .d-table td.is-active { box-shadow: inset 0 0 0 2px var(--accent); background: transparent; border-radius: 0; }

/* Строка состояния: замок «только чтение» и статус правки */
.status-mode { display: none; align-items: center; gap: 5px; font-weight: 600; color: var(--ink-soft); }
.status-mode svg { width: 13px; height: 13px; }
.window[data-mode="reading"] .status-ro { display: inline-flex; }
.window[data-mode="visual"] .status-edit { display: inline-flex; color: var(--accent); }
.window[data-mode="code"] .status-md { display: inline-flex; }
.status-saved.is-dirty { color: var(--accent); }

/* ─────────── Что умеет: компактная сетка 11 пунктов ─────────── */

.can-grid {
  list-style: none;
  margin: 48px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 32px;
}
.can-item { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: start; }
.can-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--site-accent);
}
.can-ico svg { width: 20px; height: 20px; }
.can-item h3 { margin: 6px 0 6px; font-size: 1.05rem; line-height: 1.3; letter-spacing: -0.01em; }
.can-item p { margin: 0; font-size: 15px; color: var(--ink-soft); }

/* ─────────── Почему ProsaMD: 7 пунктов, спокойная сетка ─────────── */

.why-grid {
  list-style: none;
  margin: 44px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 48px;
}
.why-item { padding: 22px 0; border-top: 1px solid var(--line); }
.why-item h3 { margin: 0 0 6px; font-size: 1.12rem; letter-spacing: -0.01em; }
.why-item p { margin: 0; color: var(--ink-soft); font-size: 15.5px; }

/* ─────────── Скоро ─────────── */

.soon-grid {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.soon-item { padding: 22px 22px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.soon-ver {
  display: inline-block;
  margin-bottom: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--site-accent);
  font-size: 12px;
  font-weight: 700;
}
.soon-item h3 { margin: 0 0 6px; font-size: 1.05rem; }
.soon-item p { margin: 0; font-size: 14.5px; color: var(--ink-soft); }

.dl-fine { margin: 10px 0 0; font-size: 13px; color: var(--ink-muted); }

@media (max-width: 960px) {
  .can-grid, .soon-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .can-grid, .soon-grid, .why-grid { grid-template-columns: 1fr; }
  .mode-toast { bottom: 8px; font-size: 12px; }
  .tip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .demo-pointer, .fmt-bar { display: none; }
}

/* ─────────── Оглавление страницы (липкое, с текущим разделом) ───────────
   Под шапкой (64 + 1 px). Пункты — вкладки 48 px высотой; текущий раздел —
   чернила + черта киноварью снизу. На телефоне строка листается вбок,
   края затухают только там, где есть что листать. */

.home-toc-sentinel { display: block; height: 1px; margin-top: 8px; }

.home-toc {
  position: sticky;
  top: 65px;
  z-index: 40;
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .home-toc {
    background: color-mix(in srgb, var(--paper) 80%, transparent);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
  }
}
.home-toc.is-stuck { border-top-color: transparent; box-shadow: 0 10px 24px -18px rgba(24, 26, 35, 0.35); }

/* Якорь не уезжает под шапку + оглавление */
#top section[id] { scroll-margin-top: 128px; }

.home-toc-inner { position: relative; }

.home-toc-list {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.home-toc-list::-webkit-scrollbar { display: none; }

.home-toc a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  color: var(--ink-muted);
  font: 600 14.5px/1.2 "Noto Sans", sans-serif;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 8px;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.home-toc a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--site-accent);
  transform: scaleX(0);
  transition: transform 0.22s cubic-bezier(0.23, 1, 0.32, 1);
}
.home-toc a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.home-toc a[aria-current="location"] { color: var(--ink); }
.home-toc a[aria-current="location"]::after { transform: scaleX(1); }
.home-toc a:focus-visible { outline-offset: -3px; }

@media (max-width: 900px) {
  .home-toc-inner { padding: 0; }
  .home-toc-list { justify-content: flex-start; padding: 0 12px; scroll-padding-inline: 24px; }
  .home-toc a { padding: 0 12px; }
  .home-toc a::after { left: 12px; right: 12px; }
  .home-toc.fade-r .home-toc-list { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .home-toc.fade-l .home-toc-list { -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%); mask-image: linear-gradient(90deg, transparent, #000 15%); }
  .home-toc.fade-l.fade-r .home-toc-list { -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
}

/* ─────────── Поддержка проекта (только RU) ─────────── */

.support {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px 24px;
  margin: 36px 0 0;
  padding: 24px 28px;
  border: 1.5px solid color-mix(in srgb, var(--site-accent) 30%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--site-accent) 5%, var(--surface));
}
.support[hidden] { display: none; }
.support-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--site-accent) 12%, transparent);
  color: var(--site-accent);
}
.support-ico svg { width: 26px; height: 26px; }
.support-body h3 { margin: 0 0 4px; font-size: 1.2rem; letter-spacing: -0.01em; }
.support-body p { margin: 0; font-size: 15px; color: var(--ink-soft); max-width: 44em; }
.btn-support {
  gap: 8px;
  border-color: var(--site-accent);
  color: var(--site-accent);
  background: transparent;
  white-space: nowrap;
}
.btn-support:hover { background: var(--site-accent); color: #fff; }
:root[data-theme="dark"] .btn-support:hover { color: #111218; }

@media (max-width: 760px) {
  .support { grid-template-columns: 48px minmax(0, 1fr); padding: 20px; }
  .support-ico { width: 48px; height: 48px; }
  .btn-support { grid-column: 1 / -1; width: 100%; }
}
