/* Страница «Скачать» (/download.html).
   Отдельный файл, чтобы не тянуть стили лендингов и не влиять на соседние
   страницы: все селекторы живут внутри .dl-page или .dl-*.
   Палитра и шрифты — те же, что у сайта: tokens из brand.css/contacts.css,
   локальные начертания из fonts-local.css (Onest для заголовков, Inter для текста). */

:root {
  color-scheme: dark;
  --bg: #0f1117;
  --text: #e7ecf7;
  --text2: #b4bdd2;
  --accent: #6366f1;
  --accent2: #a5b4fc;
  --border: #2b3044;
  --dl-surface: #151823;
  --dl-surface-2: #1b1f2c;
  --dl-line: #2b3044;
  --dl-line-soft: #232839;
  --dl-muted: #b4bdd2;
  --dl-focus: #c7c9ff;
  --dl-radius: 18px;
  --dl-radius-sm: 12px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.dl-page { overflow-x: clip; }

/* Размеры считаем от границы: иначе width:100% у кнопки складывается с её padding. */
.dl-page,
.dl-page *,
.dl-page *::before,
.dl-page *::after { box-sizing: border-box; }

.dl-page :where(a) { color: var(--accent2); text-underline-offset: 3px; }
.dl-page :where(a):hover { color: #cdd5ff; }
.dl-page :focus-visible {
  outline: 2px solid var(--dl-focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.dl-wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }

/* ── Hero ─────────────────────────────────────────────────────────────── */
.dl-hero {
  padding: clamp(44px, 7vw, 76px) 0 clamp(28px, 4vw, 40px);
  background: radial-gradient(ellipse 80% 90% at 50% -20%, rgba(99, 102, 241, .22), transparent 70%);
}

.dl-hero h1 {
  margin: 0 0 14px;
  font-family: "Onest", "Inter", system-ui, sans-serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.03em;
  color: #f2f5ff;
}

.dl-hero p {
  margin: 0;
  max-width: 62ch;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--dl-muted);
}

.dl-kicker {
  margin: 0 0 12px;
  font-family: "Onest", "Inter", system-ui, sans-serif;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent2);
}

/* ── Сетка карточек ───────────────────────────────────────────────────── */
.dl-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
  margin-block: clamp(24px, 3vw, 36px) clamp(36px, 5vw, 56px);
}

.dl-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(20px, 2.4vw, 28px);
  background: var(--dl-surface);
  border: 1px solid var(--dl-line);
  border-radius: var(--dl-radius);
  min-width: 0;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.dl-card:hover,
.dl-card:focus-within {
  border-color: #3a4160;
  box-shadow: 0 18px 40px -28px rgba(10, 12, 24, .9);
}

.dl-card-head { display: flex; align-items: flex-start; gap: 14px; }

.dl-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  border: 1px solid var(--dl-line);
  border-radius: 14px;
  background: linear-gradient(155deg, #1e2335, #151823 70%);
}

.dl-icon img { display: block; width: 32px; height: 32px; }

.dl-card h2 {
  margin: 0 0 4px;
  font-family: "Onest", "Inter", system-ui, sans-serif;
  font-size: 1.28rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -.01em;
  color: #f2f5ff;
}

.dl-compat { margin: 0; font-size: .88rem; color: var(--dl-muted); }

.dl-about { margin: 0; font-size: .95rem; color: var(--dl-muted); }

/* ── Метаданные версии ────────────────────────────────────────────────── */
.dl-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 14px;
  margin: 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--dl-line-soft);
  font-size: .88rem;
}

.dl-meta dt { color: var(--dl-muted); }
.dl-meta dd {
  margin: 0;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ── Кнопка + QR ──────────────────────────────────────────────────────── */
.dl-download { display: flex; align-items: center; gap: 16px; margin-top: auto; }

.dl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 48px;
  padding: 13px 20px;
  border: 1px solid transparent;
  border-radius: var(--dl-radius-sm);
  background: #5b57e6;
  color: #fff;
  font-family: "Onest", "Inter", system-ui, sans-serif;
  font-size: .98rem;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}

.dl-btn:hover { background: #6a66ee; color: #fff; }
.dl-btn:active { transform: translateY(1px); }
.dl-btn svg { flex: none; }

.dl-btn--ghost {
  flex: 0 0 auto;
  background: transparent;
  border-color: #414a6b;
  color: var(--text);
}

.dl-btn--ghost:hover { background: #1d2233; border-color: #5a6590; color: #fff; }

.dl-qr {
  flex: none;
  display: grid;
  gap: 6px;
  justify-items: center;
  margin: 0;
  width: 88px;
}

.dl-qr img {
  display: block;
  box-sizing: border-box;
  width: 88px;
  height: 88px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--dl-line);
  border-radius: 10px;
}

.dl-qr figcaption {
  font-size: .68rem;
  line-height: 1.3;
  color: var(--dl-muted);
  text-align: center;
}

/* ── Раскрывающиеся блоки ─────────────────────────────────────────────── */
.dl-more { margin-top: 0; }

.dl-more details {
  border-top: 1px solid var(--dl-line-soft);
}

.dl-more summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 12px 2px;
  cursor: pointer;
  font-family: "Onest", "Inter", system-ui, sans-serif;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}

.dl-more summary::-webkit-details-marker { display: none; }

.dl-more summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-right: 1.8px solid var(--accent2);
  border-bottom: 1.8px solid var(--accent2);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .2s ease;
}

.dl-more details[open] summary::after { transform: rotate(225deg) translateY(-2px); }

.dl-more summary:hover { color: #cdd5ff; }

.dl-more ol,
.dl-more ul {
  margin: 0 0 16px;
  padding-inline-start: 1.2rem;
  font-size: .9rem;
  color: var(--dl-muted);
}

.dl-more li + li { margin-top: 6px; }
.dl-more strong { color: var(--text); font-weight: 600; }

.dl-note {
  margin: 0;
  font-size: .82rem;
  line-height: 1.55;
  color: var(--dl-muted);
}

.dl-note code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .78rem;
  color: #d7dcf0;
  overflow-wrap: anywhere;
}

.dl-spec { display: grid; gap: 4px; margin: 0 0 16px; padding: 0; list-style: none; font-size: .9rem; color: var(--dl-muted); }
.dl-more .dl-spec { padding-inline-start: 0; }
.dl-spec li { display: flex; gap: 8px; }
.dl-spec li::before { content: "—"; color: #5c658a; flex: none; }

/* ── Широкий блок «в браузере» ────────────────────────────────────────── */
.dl-wide {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  padding: clamp(22px, 3vw, 32px);
  margin-bottom: clamp(40px, 6vw, 64px);
  background: linear-gradient(145deg, #1a1e2e, #14171f 72%);
  border: 1px solid var(--dl-line);
  border-radius: var(--dl-radius);
}

.dl-wide h2 {
  margin: 0 0 6px;
  font-family: "Onest", "Inter", system-ui, sans-serif;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 650;
  letter-spacing: -.01em;
  color: #f2f5ff;
}

.dl-wide p { margin: 0; max-width: 62ch; font-size: .95rem; color: var(--dl-muted); }

.dl-wide > div { flex: 1 1 420px; }

.dl-wide-list {
  display: grid;
  gap: 6px;
  margin: 14px 0 0;
  padding-left: 18px;
  font-size: .92rem;
  color: var(--dl-muted);
}

.dl-wide .dl-btn { flex: 0 0 auto; }

/* ── FAQ ──────────────────────────────────────────────────────────────── */
.dl-faq { max-width: 880px; padding-bottom: clamp(40px, 6vw, 72px); }

.dl-faq h2 {
  margin: 0 0 18px;
  font-family: "Onest", "Inter", system-ui, sans-serif;
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  font-weight: 650;
  letter-spacing: -.015em;
  color: #f2f5ff;
}

.dl-faq details { border-bottom: 1px solid var(--dl-line-soft); }

.dl-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 14px 2px;
  cursor: pointer;
  font-family: "Onest", "Inter", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}

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

.dl-faq summary::after {
  content: "+";
  flex: none;
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1;
  color: var(--accent2);
}

.dl-faq details[open] summary::after { content: "–"; }
.dl-faq summary:hover { color: #cdd5ff; }

.dl-faq details p {
  margin: 0 0 18px;
  max-width: 78ch;
  font-size: .93rem;
  color: var(--dl-muted);
}

.dl-faq details p + p { margin-top: -6px; }

/* ── Адаптивность ─────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .dl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dl-card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .dl-grid { grid-template-columns: minmax(0, 1fr); }
  .dl-card:last-child { grid-column: auto; }
  .dl-wide { flex-direction: column; align-items: flex-start; }
  .dl-wide .dl-btn { width: 100%; }
  /* на телефоне QR со своего же экрана бесполезен — прячем, остаются кнопки */
  .dl-qr { display: none; }
}

@media (max-width: 420px) {
  .dl-download { flex-direction: column; align-items: stretch; }
  .dl-qr { width: 100%; }
  .dl-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .dl-card,
  .dl-btn,
  .dl-more summary::after { transition: none; }
}
