/* Kvanto — общие стили всех страниц: токены, база, кнопки, шапка, подвал, оболочка внутренних страниц */
:root {
  --bg: #05060b;
  --bg-2: #0a0d18;
  --line: #1a2140;
  --line-2: #2b3866;
  --text: #eef1fa;
  --text-2: #c3cbe0;
  --muted: #8a93ad;
  --accent: #3a68ff;
  --accent-hover: #5580ff;
  --accent-ink: #9db8ff;
  --ok: #7fe0a9;
  --warn: #f4b740;
  --display: "Unbounded", "Onest", "Arial Black", sans-serif; /* ₽ берётся из Onest */
  --body: "Onest", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --gutter: 16px;
  --max: 1160px;
  --r: 14px;

  /* совместимость со стилями внутренних страниц */
  --surface: var(--bg-2);
  --surface-hover: #10152b;
  --border: var(--line);
  --border-hover: var(--line-2);
  --accent-2: var(--accent-ink);
  --glow: rgba(58, 104, 255, .35);
  --radius: var(--r);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; padding: 8px 12px; background: var(--accent); color: #fff; border-radius: 8px; }
.skip:focus { left: 8px; }
.ico { width: 18px; height: 18px; fill: currentColor; flex: none; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border: 1px solid transparent; border-radius: 12px;
  font: 600 1rem/1 var(--body); text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color .15s, border-color .15s, color .15s;
}
.btn--sm { min-height: 40px; padding: 0 14px; font-size: .9375rem; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost { border-color: var(--line-2); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--accent-ink); }
.btn--block { width: 100%; }

/* ---------- Шапка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(5, 6, 11, 0.88);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
}
.topbar__inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__mark { width: 32px; height: 32px; object-fit: contain; }
.brand__name { font: 700 1.25rem/1 var(--display); letter-spacing: -0.02em; }
.nav { display: flex; gap: 6px; margin-left: auto; }
.nav a { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; text-decoration: none; }
.nav a:hover { color: var(--text); background: var(--bg-2); }
.nav a[aria-current="page"] { color: var(--text); background: var(--bg-2); }
.topbar__actions { display: flex; align-items: center; gap: 8px; }

.menu { position: relative; display: none; }
.menu summary {
  list-style: none; display: grid; place-content: center; gap: 5px;
  width: 40px; height: 40px; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary span { display: block; width: 16px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s; }
.menu[open] summary span:first-child { transform: translateY(3.5px) rotate(45deg); }
.menu[open] summary span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
.menu__panel {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px;
  display: flex; flex-direction: column; padding: 6px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
}
.menu__panel a { padding: 12px 14px; border-radius: 10px; text-decoration: none; font-weight: 500; }
.menu__panel a:hover, .menu__panel a[aria-current="page"] { background: rgba(58, 104, 255, .12); }

/* ---------- Общая типографика ---------- */
.kicker {
  margin: 0 0 14px; color: var(--accent-ink);
  font: 600 .8125rem/1.3 var(--body); letter-spacing: .14em; text-transform: uppercase;
}
.h2 { margin: 0 0 28px; font: 700 clamp(1.625rem, 4.6vw, 2.375rem)/1.1 var(--display); letter-spacing: -0.03em; text-wrap: balance; }
.h2--sm { font-size: clamp(1.25rem, 3.6vw, 1.5rem); margin-bottom: 16px; }
.text { margin: 0 0 14px; color: var(--text-2); max-width: 38em; }
.muted { margin: 12px 0 0; color: var(--muted); font-size: .9375rem; }
.muted a { color: var(--accent-ink); text-underline-offset: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li { padding: 9px 14px; border: 1px solid var(--line-2); border-radius: 10px; font-weight: 500; font-size: .9375rem; }

/* ---------- Внутренние страницы ---------- */
.page {
  position: relative;
  width: 100%;
  max-width: calc(var(--col, 760px) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 48px var(--gutter) 0;
  display: flex;
  flex-direction: column;
}
main.page::before, .buy-hero::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 420px; z-index: -1; pointer-events: none;
  background: radial-gradient(50% 70% at 50% 0%, rgba(58, 104, 255, .16), transparent 72%);
}
.bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(50% 40% at 50% 0%, rgba(58, 104, 255, .14), transparent 70%), var(--bg);
}
.page h1, .page h2 { font-family: var(--display); letter-spacing: -0.03em; text-wrap: balance; }
.page h3 { font-family: var(--body); }

/* Ссылки-кнопки внутренних страниц (старый класс .link) — в новом стиле */
.link {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 52px; padding: 12px 18px;
  border: 1px solid var(--line-2); border-radius: 12px;
  background: transparent; color: var(--text);
  font: 600 1rem/1.2 var(--body); text-align: left; text-decoration: none;
  cursor: pointer; transition: border-color .15s, background-color .15s;
}
.link:hover { border-color: var(--accent-ink); }
.link--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.link--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.link__icon { width: 20px; height: 20px; fill: currentColor; flex: none; color: var(--accent-ink); }
.link--primary .link__icon { color: #fff; }
.link__label { flex: 1; min-width: 0; }
.link__arrow { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }

/* ---------- Подвал ---------- */
.foot { margin-top: 80px; padding: 28px 0 max(28px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.foot__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; }
.brand--foot .brand__name { font-size: 1.0625rem; }
.foot__links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot__links a { color: var(--muted); text-decoration: none; font-size: .9375rem; }
.foot__links a:hover { color: var(--text); }
.foot__copy { margin: 0 0 0 auto; color: var(--muted); font-size: .875rem; }

@media (max-width: 859px) {
  .nav { display: none; }
  .menu { display: block; }
  .topbar__actions { margin-left: auto; }
  .page { padding-top: 32px; }
}

@media (max-width: 380px) {
  .kicker { font-size: .75rem; letter-spacing: .1em; }
  .btn__text { display: none; }
  .btn--sm { padding: 0 11px; }
}

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