/* Палитра — семейная, из ~/projects/brand/BRAND.md §2a; нейтральные — как в тренажёре.
   Шкала: отступы кратны 4px, радиусы 8 / 12 / 16 (BRAND.md §5). */
:root {
  --bg: #fafafa; --surface: #fff; --soft: #f5f7fb; --soft-3: #eef3fb;
  --text: #1f2a3d; --text-strong: #16233F; --muted: #5b6472; --muted-4: #6b7280;
  --border: #e3e7ee; --border-3: #eef0f4; --overlay: rgba(15, 24, 41, .45);
  --accent: #2F7EE4; --ink-hover: #22324f; --on-accent: #fff; --on-overlay: #fff;
  color-scheme: light;
}
/* Тёмная тема: по системе, пока пользователь не выбрал явно (data-theme ставит theme.js).
   Фон — Ink Navy из бренд-бука, акцент — его dark-вариант #529AF2 (BRAND.md §2a).
   Основная кнопка в тёмной теме светлая: --text-strong становится светлым, текст на ней — --bg. */
:root[data-theme="dark"] {
  --bg: #0f1829; --surface: #16233F; --soft: #1a2946; --soft-3: #1e2f50;
  --text: #dfe5ef; --text-strong: #f3f6fb; --muted: #a7b1c2; --muted-4: #8b95a7;
  --border: #2c3b5a; --border-3: #223251; --overlay: rgba(0, 0, 0, .6);
  --accent: #529AF2; --ink-hover: #d3dbe8; --on-accent: #0f1829;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1829; --surface: #16233F; --soft: #1a2946; --soft-3: #1e2f50;
    --text: #dfe5ef; --text-strong: #f3f6fb; --muted: #a7b1c2; --muted-4: #8b95a7;
    --border: #2c3b5a; --border-3: #223251; --overlay: rgba(0, 0, 0, .6);
    --accent: #529AF2; --ink-hover: #d3dbe8; --on-accent: #0f1829;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 16px; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1, h2, h3, .nav .brand, .price { font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; letter-spacing: -.01em; }

/* Ссылки — цвет текста, акцент только в подчёркивании: читаемо и не шумно. */
a { color: var(--text-strong); text-decoration-color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

.nav { padding: 12px 0; border-bottom: 1px solid var(--border-3); background: var(--surface); }
.nav .wrap { display: flex; align-items: center; gap: 16px; }
.nav .brand { font-weight: 700; font-size: 1.1rem; color: var(--text-strong); text-decoration: none; }
.nav .right { margin-left: auto; display: flex; gap: 16px; align-items: center; }
.nav .navlink { font-size: .9rem; text-decoration: none; }
.theme { background: transparent; border: 1px solid var(--border); border-radius: 8px; padding: 4px; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text); }
.theme:hover { border-color: var(--muted-4); }
.theme svg { width: 16px; height: 16px; }
/* Показываем то, куда переключит: в светлой — луна, в тёмной — солнце. */
.theme .sun { display: none; }
:root[data-theme="dark"] .theme .sun { display: block; }
:root[data-theme="dark"] .theme .moon { display: none; }
.lang { background: transparent; border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; cursor: pointer; font: inherit; font-size: .85rem; color: var(--text); }

/* Кнопки спокойные: основная — тёмная Ink Navy, без свечений и теней. */
.btn { display: inline-block; padding: 10px 20px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-strong); text-decoration: none; cursor: pointer; font: inherit; font-weight: 500; transition: border-color .15s, background-color .15s; }
.btn:hover { border-color: var(--muted-4); color: var(--text-strong); }
.btn.primary { background: var(--text-strong); border-color: var(--text-strong); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { background: var(--ink-hover); border-color: var(--ink-hover); color: var(--on-accent); }

.hero { padding: 64px 0 48px; text-align: center; }
.hero h1 { font-size: 2.3rem; line-height: 1.2; margin: 0 0 16px; color: var(--text-strong); }
.hero p.lead { font-size: 1.1rem; color: var(--muted); max-width: 620px; margin: 0 auto 28px; }
.hero .cta { display: flex; gap: 20px; justify-content: center; align-items: center; flex-wrap: wrap; }
.hero .more { font-size: .95rem; }
.hero p.lead:has(+ .role) { margin-bottom: 12px; }
.hero p.role { font-size: 1.05rem; font-weight: 700; max-width: 620px; margin: 0 auto 28px; }
.hero .note { margin-top: 16px; font-size: .85rem; color: var(--muted-4); }

section { padding: 40px 0; }
section h2 { font-size: 1.4rem; margin: 0 0 20px; color: var(--text-strong); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--border-3); border-radius: 12px; padding: 20px; }
.card h3 { margin: 0 0 8px; font-size: 1rem; color: var(--text-strong); }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }

.plans .plans-note { margin: -8px 0 20px; color: var(--muted); max-width: 620px; }
.plans .card.featured { border-color: var(--accent); }
.plans .price { font-size: 1.6rem; font-weight: 700; color: var(--text-strong); margin: 4px 0 12px; font-variant-numeric: tabular-nums; }
.plans ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: .93rem; }

footer { border-top: 1px solid var(--border-3); margin-top: 24px; padding: 28px 0 40px; color: var(--muted-4); font-size: .85rem; }
footer .links { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 12px; }
footer a { color: var(--muted); }

/* Баннер согласия: обе кнопки одного веса — не подталкиваем к «Разрешить». */

#consent { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); padding: 12px 0; }
#consent .wrap { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
#consent p { margin: 0; flex: 1 1 320px; font-size: .88rem; color: var(--muted); }
#consent .btn { padding: 8px 16px; font-size: .9rem; }
[hidden] { display: none !important; }

@media (max-width: 600px) { .hero { padding: 40px 0 32px; } .hero h1 { font-size: 1.75rem; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Текстовые страницы (privacy, support) */
.doc { padding: 32px 0 48px; }
.doc .wrap { max-width: 720px; }
.doc h1 { font-size: 1.8rem; margin: 0 0 8px; color: var(--text-strong); }
.doc h2 { font-size: 1.15rem; margin: 32px 0 8px; color: var(--text-strong); }
.doc p, .doc li { color: var(--muted); }
.doc .updated { font-size: .85rem; color: var(--muted-4); }
.doc ul { padding-left: 20px; }

/* Мелкий шрифт в футере: юридический дисклеймер */
footer .fine { font-size: .75rem; line-height: 1.5; color: var(--muted-4); margin: 8px 0 0; }
.hero h1 .fn-ref { font-size: .5em; vertical-align: super; line-height: 0; margin-left: 2px; }
.hero h1 .fn-ref a { color: var(--muted-4); text-decoration: none; }

/* Карусель скриншотов тренажёра + увеличение по клику */
.shots .shots-note { margin: -8px 0 20px; color: var(--muted); }
.carousel { position: relative; }
.carousel .track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding: 4px 2px 12px; scrollbar-width: thin; }
.carousel figure { flex: 0 0 min(420px, 82%); margin: 0; scroll-snap-align: start; }
.carousel .shot { display: block; width: 100%; padding: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); cursor: zoom-in; }
.carousel .shot img { display: block; width: 100%; height: auto; transition: transform .25s; }
.carousel .shot:hover img { transform: scale(1.04); }
.carousel figcaption { margin-top: 8px; font-size: .88rem; color: var(--muted); }
.carousel .nav-btn { position: absolute; top: calc(50% - 30px); z-index: 1; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text-strong); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.carousel .nav-btn:hover { border-color: var(--muted-4); }
.carousel .prev { left: -14px; } .carousel .next { right: -14px; }
.carousel .nav-btn:disabled { opacity: 0; pointer-events: none; }
@media (max-width: 600px) { .carousel .nav-btn { display: none; } }

#lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
#lightbox::backdrop { background: var(--overlay); backdrop-filter: blur(2px); }
#lightbox[open] { display: flex; align-items: center; justify-content: center; }
#lightbox figure { margin: 0; width: min(1400px, 92vw); text-align: center; }
#lightbox img { width: 100%; height: auto; max-height: 82vh; object-fit: contain; border-radius: 10px; background: var(--surface); }
#lightbox figcaption { margin-top: 10px; color: var(--on-overlay); font-size: .95rem; }
#lightbox button { position: fixed; background: var(--surface); color: var(--text-strong); border: 1px solid var(--border); border-radius: 50%; width: 40px; height: 40px; font-size: 1.5rem; line-height: 1; cursor: pointer; }
#lightbox .lb-close { top: 16px; right: 16px; }
#lightbox .lb-nav.prev { left: 16px; top: calc(50% - 20px); }
#lightbox .lb-nav.next { right: 16px; top: calc(50% - 20px); }

/* Статьи (/<lang>/blog/, генерирует build-langs.js) */
.doc .crumbs { margin: 0 0 12px; font-size: .88rem; }
.doc .crumbs a { color: var(--muted); }
.doc .lead { font-size: 1.05rem; }
.article h3 { font-size: 1rem; margin: 24px 0 6px; color: var(--text-strong); }
.article strong { color: var(--text); }
.article .table { overflow-x: auto; margin: 12px 0 20px; }
.article table { border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
.article th, .article td { border: 1px solid var(--border); padding: 6px 12px; text-align: left; color: var(--text); }
.article th { background: var(--soft); font-weight: 600; }
.article blockquote { margin: 16px 0; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border-3); border-radius: 10px; }
.article blockquote p { color: var(--text); }
.article .try { margin: 36px 0 16px; padding: 20px; background: var(--surface); border: 1px solid var(--border-3); border-radius: 12px; }
.article .try h2 { margin-top: 0; }
.article .sheet { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 20px 0; }
.article .sheet span { font-size: .9rem; color: var(--muted-4); }
/* Обложки статей: свои фотографии из covers/, соотношение 3:2. Карточка без внутренних
   отступов сверху — картинка вровень с краями, текст ниже. */
/* Обложка — рамка с фиксированной пропорцией, картинка заполняет её целиком и обрезается
   по краям (aspect fill), без полей сверху и снизу. */
.cover { display: block; position: relative; width: 100%; aspect-ratio: 3 / 2; overflow: hidden; background: var(--soft) center / cover no-repeat; }
/* Картинка позиционируется абсолютно: высота 100% в рамке с aspect-ratio считается
   неопределённой и схлопывается в auto — тогда сверху и снизу остаются поля. */
.cover img { position: absolute; inset: 0; display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: center; }
.cover.hero { aspect-ratio: 16 / 9; border-radius: 12px; margin: 4px 0 20px; }
@media (max-width: 600px) { .cover.hero { aspect-ratio: 3 / 2; border-radius: 10px; } }
.postmeta { margin: 10px 0 0; color: var(--muted-4); font-size: .82rem; font-variant-numeric: tabular-nums; }
.postmeta span { padding: 0 2px; }
.article .postmeta { margin: -8px 0 20px; }

.blog .posts { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.blog .posts li { padding: 0; }
.blog .posts a { display: block; text-decoration: none; background: var(--surface);
  border: 1px solid var(--border-3); border-radius: 12px; overflow: hidden; transition: border-color .15s; }
.blog .posts a:hover { border-color: var(--muted-4); }
.blog .posts h2 { margin: 0; font-size: 1.05rem; line-height: 1.35; color: var(--text-strong); }
.blog .posts p { margin: 6px 0 0; color: var(--muted); font-size: .92rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.blog .posts h2, .blog .posts p, .blog .posts .postmeta { padding: 0 16px; }
.blog .posts h2 { padding-top: 16px; }
.blog .posts .postmeta { padding-bottom: 16px; }

.latest .post { display: block; text-decoration: none; transition: border-color .15s; padding: 0; overflow: hidden; }
.latest .post:hover { border-color: var(--muted-4); }
.latest .post h3 { line-height: 1.35; margin: 16px 16px 8px; }
.latest .post p { margin: 0 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.latest .post .postmeta { margin: 10px 16px 16px; }
.latest .all { margin: 16px 0 0; }
/* Узкий экран: чуть меньше отступов в шапке. */
@media (max-width: 480px) { .nav .wrap { gap: 6px; } .nav .right { gap: 8px; } .nav .navlink { white-space: nowrap; font-size: .8rem; } .nav .brand { font-size: .95rem; } .lang { padding: 4px 2px; font-size: .8rem; } }
.article figure { margin: 20px 0 24px; }
.article figure.narrow { max-width: 360px; }
/* Вертикальные картинки и анимации: не растягиваем на всю колонку, ставим по центру. */
.article figure.narrow, .article figure.mid { margin-left: auto; margin-right: auto; }
.article figure.mid { max-width: 520px; }
/* Two small screenshots side by side (a screen and its result), as the home carousel: card, zoom on hover, lightbox
   on click (shots.js); stacked on a phone. */
.article .figpair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0 24px; }
.article .figpair figure { margin: 0; }
.article .figpair .shot { display: block; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); cursor: zoom-in; }
.article .figpair .shot img { border: 0; border-radius: 0; transition: transform .25s; }
.article .figpair .shot:hover img { transform: scale(1.04); }
.article .figpair figcaption { margin-top: 8px; font-size: .88rem; color: var(--muted); }
@media (max-width: 560px) { .article .figpair { grid-template-columns: 1fr; } }
.article figure img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.article figcaption { margin-top: 8px; font-size: .88rem; color: var(--muted-4); }
.article .article-cta { margin: 18px 0 24px; }
.shots .shots-cta { margin: 12px 0 0; }
.handbook .hb-btns { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; }
.plans .plans-cta { margin: 24px 0 0; text-align: center; }
