/* ProsaMD — prosa.vkabaev.ru
   Бренд: киноварь #D9452B (знак, крупные акценты), чернила #1D1B26 (текст), бумага #FFFFFF.
   Мелкий текст — только чернилами: контраст киновари к белому 4,35:1 (см. kit/GUIDELINES.md). */

/* Шрифты подключены инлайном (без @import — он стоит лишнего round-trip).
   Кириллица с unicode-range: EN-посетители не качают кириллический файл. */
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../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("../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+FEFF, U+FFFD;
}

:root {
  --cinnabar: #D9452B;
  --cinnabar-deep: #C13A22;      /* фон крупных кнопок: контраст к белому 5,38:1 (AA) */
  --cinnabar-press: #A93319;     /* hover/active кнопок */
  --paper: #ffffff;
  --paper-tint: #f8f6f1;         /* тёплая бумага для чередования секций */
  --ink: #1d1b26;
  --ink-soft: #4d4a5c;
  --ink-muted: #6b6876;          /* 5,4:1 к белому — AA для мелкого текста */
  --line: rgba(29, 27, 38, 0.12);
  --line-strong: rgba(29, 27, 38, 0.22);
  --surface: #ffffff;
  --surface-sunken: #f4f2ec;
  --shadow-window: 0 24px 64px -16px rgba(29, 27, 38, 0.22), 0 4px 16px rgba(29, 27, 38, 0.08);
  --shadow-card: 0 1px 2px rgba(29, 27, 38, 0.05);
  --maxw: 1080px;
  --radius: 12px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #16141f;
  --paper-tint: #1b1926;
  --ink: #f1eff7;
  --ink-soft: #c6c3d4;
  --ink-muted: #918da3;
  --line: rgba(241, 239, 247, 0.14);
  --line-strong: rgba(241, 239, 247, 0.26);
  --surface: #1e1c29;
  --surface-sunken: #171521;
  --shadow-window: 0 24px 64px -12px rgba(0, 0, 0, 0.55), 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

img { display: block; }

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);
}

a { color: inherit; }

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

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
}

.brand { display: inline-flex; align-items: center; flex: none; }

.brand-logo { height: 26px; width: auto; }

.site-nav {
  display: flex;
  gap: 4px;
  margin-right: auto;
  min-width: 0;
}

.site-nav a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 8px;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.site-nav a:hover { color: var(--ink); background: var(--surface-sunken); }

.header-actions { display: flex; align-items: center; gap: 6px; flex: none; }

.gh-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--ink-soft);
  transition: color 0.15s, background 0.15s;
}

.gh-link:hover { color: var(--ink); background: var(--surface-sunken); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  font: 600 12.5px/1 "Noto Sans", sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.icon-btn:hover { color: var(--ink); background: var(--surface-sunken); }

:root:not([data-theme="dark"]) .ico-sun { display: none; }
:root[data-theme="dark"] .ico-moon { display: none; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 26px;
  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, transform 0.1s, box-shadow 0.15s;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--cinnabar-deep); /* киноварь 4,35:1 не проходит AA для 16px — берём глубокий тон */
  color: #fff;
  box-shadow: 0 6px 20px -6px rgba(193, 58, 34, 0.5);
}

.btn-primary:hover { background: var(--cinnabar-press); }

.btn-ghost {
  border: 1.5px solid var(--line-strong);
  color: var(--ink);
}

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

.btn-block { width: 100%; }

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

.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 40px;
}

.hero-watermark {
  position: absolute;
  top: -160px;
  right: -220px;
  width: 540px;
  opacity: 0.045;
  pointer-events: none;
  user-select: none;
}

.hero-watermark img { width: 100%; height: auto; }

.hero-inner { text-align: center; position: relative; }

.hero h1 {
  margin: 0 auto 20px;
  max-width: 15em;
  font-size: clamp(2.3rem, 5.2vw, 3.7rem);
  line-height: 1.12;
  letter-spacing: -0.022em;
  font-weight: 700;
}

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

.hero-lede {
  margin: 0 auto 34px;
  max-width: 40em;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--ink-soft);
}

.hero-lede code { font-size: 0.82em; }

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

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

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

.demo-wrap { margin-top: 64px; position: relative; }

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

.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; }

.window-title {
  font-size: 13px;
  color: var(--ink-muted);
  margin-right: auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.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 "Noto Sans", sans-serif;
  padding: 6px 12px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

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

.window-body { padding: 26px 30px 22px; min-height: 320px; }

/* визуальный режим */
.doc-rendered { font-size: 15.5px; line-height: 1.7; }

.doc-rendered .d-h1 {
  font-size: 1.55em;
  font-weight: 700;
  letter-spacing: -0.015em;
  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(--cinnabar);
  border-color: var(--cinnabar);
}

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

.doc-rendered .d-done { color: var(--ink-muted); }

.doc-rendered blockquote {
  margin: 0;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--cinnabar);
  color: var(--ink-soft);
  font-style: italic;
}

/* кодовый режим */
.doc-code {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-x: auto;
}

.doc-code .md-mark { color: var(--cinnabar); font-weight: 600; }
:root[data-theme="dark"] .doc-code .md-mark { color: #e86a50; } /* светлый тон киновари: 5,3:1 на тёмной поверхности */
.doc-code .md-bold { font-weight: 700; }
.doc-code .md-code {
  background: var(--surface-sunken);
  border-radius: 4px;
  padding: 0 3px;
}
.doc-code .md-quote { color: var(--ink-soft); 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: 18px auto 0;
  max-width: 46em;
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-muted);
}

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

.section { padding: 92px 0; }

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

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

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

.section h2, .feedback-inner h2 {
  margin: 0 0 14px;
  font-size: clamp(1.6rem, 3.2vw, 2.15rem);
  letter-spacing: -0.018em;
  line-height: 1.2;
}

.section-lede {
  margin: 0 0 36px;
  max-width: 38em;
  color: var(--ink-soft);
  font-size: 1.04rem;
}

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

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

.feature-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 24px 24px 20px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s, transform 0.15s;
}

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

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--surface-sunken);
  color: var(--cinnabar); /* знак/иконка — киноварь допустима */
  margin-bottom: 16px;
}

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

.feature-card h3 { margin: 0 0 8px; font-size: 1.06rem; letter-spacing: -0.01em; }

.feature-card p { margin: 0; font-size: 14.5px; color: var(--ink-soft); }

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

#download .container { max-width: 980px; }

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

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

.dl-platform {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.dl-platform > svg { color: var(--ink-soft); flex: none; }

.dl-card h3 { margin: 0; font-size: 1.08rem; }
.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);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

.dl-alt:hover { color: var(--ink); }

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

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

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

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

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

.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: 2px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.roadmap .done .rm-marker {
  background: var(--cinnabar);
  border-color: var(--cinnabar);
}

.roadmap h3 { margin: 0 0 3px; font-size: 1.02rem; }
.roadmap p { margin: 0; font-size: 14.5px; color: var(--ink-soft); }

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

.feedback-inner .hero-cta { justify-content: flex-start; }

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

.site-footer {
  background: #1d1b26; /* чернила — константа бренда, не зависит от темы */
  color: #f1eff7;
  padding: 56px 0 44px;
}

.footer-inner { text-align: center; }

.footer-logo { margin: 0 auto 14px; height: 28px; width: auto; }

.footer-tag { margin: 0 0 22px; font-size: 14.5px; color: rgba(241, 239, 247, 0.72); }

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 8px 26px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.footer-nav a {
  font-size: 14px;
  font-weight: 500;
  color: rgba(241, 239, 247, 0.85);
  text-decoration: underline;
  text-decoration-color: rgba(241, 239, 247, 0.3);
  text-underline-offset: 4px;
}

.footer-nav a:hover { text-decoration-color: var(--cinnabar); color: #fff; }

.footer-fine {
  margin: 0;
  font-size: 12.5px;
  color: rgba(241, 239, 247, 0.5);
}

.footer-dot { margin: 0 6px; }

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

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

@media (max-width: 640px) {
  .site-nav { display: none; }
  .hero { padding-top: 64px; }
  .features-grid { grid-template-columns: 1fr; }
  .window-body { padding: 20px 18px 16px; }
  .status-path { display: none; }
  .status-right { margin-left: auto; }
  .feedback-inner .hero-cta { flex-direction: column; align-items: stretch; }
}

/* ─────────── 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(--cinnabar);
  outline-offset: 2px;
  border-radius: 4px;
}
