/* XCommander — общий стиль сайта. Цвета — токены ниже; тёмная тема — по системной. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-soft: #f4f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --text-2: #4b5870;
  --text-3: #6b778c;
  --border: #e1e7ef;
  --accent: #2563eb;
  --accent-hover: #1d4fd7;
  --accent-text: #ffffff;
  --accent-soft: #e8f0fe;
  --accent-soft-text: #1e4fc2;
  --green: #15803d;
  --code-bg: #eef2f7;
  --shadow: 0 1px 2px rgb(15 23 42 / 6%), 0 8px 24px rgb(15 23 42 / 6%);
  --hero-glow: radial-gradient(60% 60% at 50% 0%, #dbe9ff 0%, transparent 70%);
  --radius: 14px;
  --max: 1120px;
  --gutter: 24px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --bg-soft: #10182b;
    --surface: #131c31;
    --text: #e6eaf2;
    --text-2: #a5b0c4;
    --text-3: #8592a8;
    --border: #243049;
    --accent: #4f8ff7;
    --accent-hover: #6aa2ff;
    --accent-text: #ffffff;
    --accent-soft: #172a4f;
    --accent-soft-text: #a9c8ff;
    --green: #4ade80;
    --code-bg: #1a2440;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
    --hero-glow: radial-gradient(60% 60% at 50% 0%, #15284d 0%, transparent 70%);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }

code, kbd {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
}
code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 5px; }
kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 0.05em 0.4em;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  text-align: center;
  line-height: 1.5;
  white-space: nowrap;
}

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

/* Текст только для экранного диктора и поисковиков. */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  vertical-align: -0.2em;
}

/* Шапка */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
}
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.site-nav { display: flex; gap: 22px; }
.site-nav a { color: var(--text-2); font-weight: 500; font-size: 15px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); text-decoration: none; }
.site-nav a[aria-current="page"] { font-weight: 600; }
/* Выбор языка — выпадающий список на <details>: ссылки на ту же страницу на каждом языке. */
.lang { margin-left: auto; position: relative; font-size: 14px; }
.lang summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 8px;
  color: var(--text-2);
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover, .lang[open] summary { background: var(--bg-soft); color: var(--text); }
.lang .icon { width: 16px; height: 16px; vertical-align: 0; }
.lang .chevron { width: 14px; height: 14px; transition: transform .15s; }
.lang[open] .chevron { transform: rotate(180deg); }
.lang ul {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 160px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.lang li a { display: block; padding: 7px 10px; border-radius: 7px; color: var(--text); }
.lang li a:hover { background: var(--bg-soft); text-decoration: none; }
.lang li a[aria-current] { background: var(--accent-soft); color: var(--accent-soft-text); font-weight: 600; }

@media (max-width: 600px) {
  :root { --gutter: 16px; }
  .site-header .container { flex-wrap: wrap; gap: 0 16px; padding-top: 8px; padding-bottom: 8px; }
  .site-nav { order: 3; width: 100%; gap: 20px; padding: 6px 0 2px; }
}

/* Кнопки */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.button:hover { text-decoration: none; }
.button-primary { background: var(--accent); color: var(--accent-text); }
.button-primary:hover { background: var(--accent-hover); }
.button-secondary { background: var(--accent-soft); color: var(--accent-soft-text); }
.button-secondary:hover { border-color: var(--accent); }
.button-large { padding: 15px 32px; font-size: 18px; }
.buttons { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* Главная */

.hero {
  background: var(--hero-glow);
  text-align: center;
  padding: 72px 0 56px;
}
.hero-icon { width: 144px; height: 144px; margin: 0 auto 8px; display: block; }
.hero h1 { font-size: clamp(44px, 8vw, 76px); margin: 0 0 12px; letter-spacing: -0.03em; }
.hero .lede {
  font-size: clamp(19px, 2.6vw, 24px);
  color: var(--text-2);
  max-width: 760px;
  margin: 0 auto 32px;
}
.hero .meta { margin-top: 18px; font-size: 14px; color: var(--text-3); }

.gallery {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 8px var(--gutter) 20px;
  max-width: 1200px;
  margin: 0 auto;
  scrollbar-width: thin;
}
.gallery figure {
  flex: 0 0 min(88%, 960px);
  scroll-snap-align: center;
  margin: 0;
}
.gallery a { display: block; cursor: zoom-in; }
.gallery img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  box-shadow: var(--shadow);
  background: var(--bg-soft);
}
.gallery figcaption { text-align: center; color: var(--text-2); font-size: 15px; margin-top: 12px; }
.gallery-hint { text-align: center; color: var(--text-3); font-size: 13px; margin: 0; }

.section { padding: 80px 0; }
.section-soft { background: var(--bg-soft); }
.section-head { text-align: center; max-width: 760px; margin: 0 auto 44px; }
.section-head h2 { font-size: clamp(30px, 4.4vw, 44px); margin: 0 0 12px; letter-spacing: -0.02em; }
.section-head p { font-size: 19px; color: var(--text-2); margin: 0; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card h3 { font-size: 19px; margin: 14px 0 8px; }
.card p { margin: 0; color: var(--text-2); font-size: 15.5px; }
.card ul { margin: 10px 0 0; padding-left: 18px; color: var(--text-2); font-size: 15px; }
.card li { margin: 3px 0; }
.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-soft-text);
}
.card-icon .icon { width: 24px; height: 24px; }
.protocol { border-top: 3px solid var(--accent); }
.protocol .tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--accent-soft-text);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: 2px;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chips span {
  font-size: 12.5px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-2);
}
.note-strip {
  margin: 28px auto 0;
  max-width: 900px;
  text-align: center;
  color: var(--text-2);
  font-size: 15.5px;
}

.cta { text-align: center; padding: 80px 0; }
.cta h2 { font-size: clamp(28px, 4vw, 40px); margin: 0 0 12px; }
.cta p { color: var(--text-2); font-size: 18px; margin: 0 0 28px; }

/* Страницы с текстом: магазин, поддержка, правовые */

.page-head { padding: 56px 0 24px; text-align: center; }
.page-head h1 { font-size: clamp(34px, 5vw, 52px); margin: 0 0 10px; letter-spacing: -0.02em; }
.page-head p { color: var(--text-2); font-size: 19px; margin: 0 auto; max-width: 680px; }

.prose { max-width: 760px; margin: 0 auto; padding: 0 var(--gutter) 80px; }
.prose h2 { font-size: 26px; margin: 44px 0 12px; }
.prose h3 { font-size: 19px; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--text); }
.prose .muted { color: var(--text-3); font-size: 14px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 6px 0; }

.price-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  max-width: 920px;
  margin: 8px auto 0;
}
.price-card {
  max-width: 460px;
  margin: 8px auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 36px 32px;
  text-align: center;
}
.price-card .plan { font-weight: 700; font-size: 15px; color: var(--text-2); letter-spacing: .04em; text-transform: uppercase; }
/* Сумму вписывает store.js из Paddle: пока её нет, высота строки та же — карточка не прыгает. */
.price-card .price { font-size: 60px; font-weight: 800; letter-spacing: -0.03em; margin: 6px 0 0; min-height: 1.6em; }
.price-card .price-note { color: var(--text-3); font-size: 14px; margin: 0 0 22px; }
.price-card ul { list-style: none; padding: 0; margin: 0 0 28px; text-align: left; }
.price-card li { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.price-card li:last-child { border-bottom: 0; }
.price-card li .icon { color: var(--green); margin-top: 3px; }
.price-card .button { width: 100%; }
.price-cards .price-card { max-width: none; margin: 0; }
.checkout-soon { display: none; margin: 14px 0 0; color: var(--text-3); font-size: 14px; }
.price-cards + .checkout-soon { text-align: center; }
/* Продление: /store/?renew=<номер> — store.js показывает номер лицензии. */
.renewal {
  max-width: 920px;
  margin: 0 auto 20px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-soft-text);
  text-align: center;
}
.renewal[hidden] { display: none; }
.checkout-soon.visible { display: block; }
.store-links { text-align: center; margin: 22px 0 0; color: var(--text-2); font-size: 15px; }

.faq details {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 0 20px;
  margin: 10px 0;
}
.faq summary { cursor: pointer; font-weight: 600; padding: 16px 0; }
.faq details p { margin: 0 0 16px; color: var(--text-2); }

.support-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); margin-top: 8px; }

/* Документация */

.docs { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; padding-top: 40px; padding-bottom: 80px; }
.docs-toc { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; font-size: 14.5px; }
.docs-toc summary { display: none; }
.docs-toc ol { list-style: none; margin: 0; padding: 0; }
.docs-toc li { margin: 0; }
.docs-toc a { display: block; padding: 5px 10px; border-radius: 7px; color: var(--text-2); }
.docs-toc a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.docs-body { max-width: 800px; }
.docs-body h1 { font-size: clamp(34px, 5vw, 46px); margin: 0 0 8px; letter-spacing: -0.02em; }
.docs-body > p.lede { color: var(--text-2); font-size: 19px; margin-top: 0; }
.docs-body h2 { font-size: 28px; margin: 56px 0 12px; padding-top: 8px; border-top: 1px solid var(--border); }
.docs-body h3 { font-size: 19px; margin: 28px 0 8px; }
.docs-body li { margin: 5px 0; }
.docs-body ul, .docs-body ol { padding-left: 22px; }
.tip {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 12px 16px;
  border-radius: 0 10px 10px 0;
  margin: 16px 0;
}
.tip p { margin: 0; }
.table-wrap { overflow-x: auto; margin: 14px 0; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; color: var(--text-2); font-size: 13.5px; text-transform: uppercase; letter-spacing: .03em; }

@media (max-width: 860px) {
  .docs { grid-template-columns: 1fr; gap: 16px; padding-top: 24px; }
  .docs-toc { position: static; max-height: none; border: 1px solid var(--border); border-radius: 12px; padding: 4px 8px; }
  .docs-toc summary { display: block; cursor: pointer; font-weight: 600; padding: 10px; }
  .docs-toc:not([open]) ol { display: none; }
}

/* Подвал */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-3);
  font-size: 14px;
  padding: 36px 0 44px;
}
.site-footer .container { display: grid; gap: 14px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-links a { color: var(--text-2); }
.site-footer p { margin: 0; }

.not-found { text-align: center; padding: 120px 0; }
.not-found h1 { font-size: 64px; margin: 0; }
.not-found p { color: var(--text-2); font-size: 18px; }

/* Активация: /activate/#ключ — activate.js показывает ключ и ведёт в программу. */
.activate .buttons { margin: 24px 0; }
.license-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  word-break: break-all;
  background: var(--code-bg);
  padding: 14px 16px;
  border-radius: 10px;
}

/* Китайский: системный шрифт Mac для иероглифов (PingFang SC), на Windows — Microsoft YaHei. Код и клавиши
   остаются моноширинными: шрифт задан телу и элементам с lang, а не каждому элементу. Заголовки — без
   отрицательного межбуквенного интервала: иероглифы слиплись бы. */
body:lang(zh), body [lang|="zh"] {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
:is(h1, h2, h3):lang(zh) { letter-spacing: 0; }
/* Курсива у иероглифов нет — браузер наклонил бы их сам. Названия пунктов меню выделяет начертание Medium. */
em:lang(zh) { font-style: normal; font-weight: 500; }
