/* Consulat — лендинг.
   Метафора: консульская печать. Отсюда чернильно-синий фон, золото сургуча
   и антиква в заголовках; технические строки — моноширинным, как в паспорте.
   Внешних библиотек нет намеренно: чужой CDN на своём домене — лишний
   владелец нашего фронта. */

:root {
  --ink:        #070a12;
  --ink-2:      #0c1120;
  --ink-3:      #131a2e;
  --line:       #23304f;
  --text:       #e8ecf6;
  --muted:      #94a1bd;
  --gold:       #d9b26a;
  --gold-soft:  #f0d9a8;
  --blue:       #6f9cff;

  --sans: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --pad: clamp(20px, 5vw, 96px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Зерно поверх всего: без него большие тёмные плоскости выглядят как
   пустой div, а не как бумага. */
.grain {
  position: fixed; inset: 0; z-index: 9; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; margin: 0; }
h1 { font-size: clamp(38px, 6.4vw, 82px); line-height: 1.06; }
h2 { font-size: clamp(30px, 4.2vw, 54px); line-height: 1.12; }
h3 { font-size: 21px; line-height: 1.3; }

.eyebrow {
  font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 18px; font-weight: 500;
}

.lede { font-size: clamp(16px, 1.5vw, 19px); color: var(--muted); max-width: 62ch; margin: 0 0 20px; }
.lede--accent { color: var(--text); }
.footnote { font-size: 14px; color: var(--muted); max-width: 52ch; }

/* ── Кнопки ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 26px; border-radius: 2px; text-decoration: none;
  font-size: 15px; font-weight: 500; letter-spacing: .01em;
  border: 1px solid transparent; transition: .25s ease;
}
.btn--gold { background: var(--gold); color: #17110a; }
.btn--gold:hover { background: var(--gold-soft); transform: translateY(-1px); }
.btn--ghost { border-color: var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }

/* ── Шапка ──────────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; gap: 28px;
  padding: 16px var(--pad);
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--ink) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.is-stuck { border-bottom-color: var(--line); }
.nav__brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: 22px; letter-spacing: .02em;
  text-decoration: none; margin-right: auto;
}
.nav__seal { width: 26px; height: 26px; color: var(--gold); }
.nav__links { display: flex; gap: 26px; }
.nav__links a {
  font-size: 14px; color: var(--muted); text-decoration: none; transition: color .2s;
}
.nav__links a:hover { color: var(--text); }
.nav__cta { padding: 9px 18px; font-size: 14px; }

/* ── Экран печати ───────────────────────────────────────────────────── */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center;
  padding: 120px var(--pad) 80px;
  overflow: hidden;
}
.hero__glow {
  position: absolute; width: 900px; height: 900px; right: -180px; top: -220px;
  background: radial-gradient(circle, rgba(111,156,255,.16), transparent 62%);
  filter: blur(30px);
}
.hero__seal {
  position: absolute; right: -6vw; top: 50%; transform: translateY(-50%);
  width: min(66vh, 620px); aspect-ratio: 1; opacity: .5;
  color: var(--gold);
}
.hero__seal svg { width: 100%; height: 100%; }
.seal__line { fill: none; stroke: currentColor; stroke-width: 1; opacity: .55; }
.seal__line--thin { stroke-width: .5; opacity: .35; }
.seal__text { font-family: var(--sans); font-size: 13px; letter-spacing: .32em; fill: currentColor; opacity: .8; }
.seal__spin { transform-origin: 160px 160px; animation: spin 68s linear infinite; }
.seal__star { fill: currentColor; opacity: .12; }
.seal__core { transform-origin: 160px 160px; animation: breathe 7s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%,100% { transform: scale(1); opacity: .9 } 50% { transform: scale(1.035); opacity: 1 } }

.hero__body { position: relative; max-width: 760px; }
.hero__title { margin: 0 0 22px; }
.hero__lead { font-size: clamp(17px, 1.8vw, 21px); color: var(--muted); max-width: 54ch; margin-bottom: 34px; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 56px; }

.hero__facts { display: flex; gap: 46px; margin: 0; flex-wrap: wrap; }
.hero__facts div { display: flex; flex-direction: column; }
.hero__facts dt { font-family: var(--serif); font-size: 44px; line-height: 1; color: var(--gold); }
.hero__facts dd { margin: 6px 0 0; font-size: 13px; color: var(--muted); letter-spacing: .04em; }

.hero__scroll {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  width: 1px; height: 56px; background: linear-gradient(var(--line), transparent);
}
.hero__scroll span {
  position: absolute; top: 0; left: -1px; width: 3px; height: 14px; border-radius: 2px;
  background: var(--gold); animation: drop 2.4s ease-in-out infinite;
}
@keyframes drop { 0% { top: 0; opacity: 0 } 30% { opacity: 1 } 100% { top: 46px; opacity: 0 } }

/* ── Секции ─────────────────────────────────────────────────────────── */
.section { padding: clamp(80px, 11vw, 150px) var(--pad); position: relative; }
.section__head { max-width: 760px; margin: 0 0 56px; }
.section__head h2 { margin-bottom: 20px; }

.section--split {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 80px);
  border-top: 1px solid var(--line);
}
.split__left h2 { margin-top: 6px; }

.pains { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 14px; }
.pains li {
  padding: 16px 20px; border-left: 2px solid var(--line);
  background: linear-gradient(90deg, rgba(35,48,79,.22), transparent 70%);
  font-size: 15.5px; color: var(--muted); transition: border-color .3s;
}
.pains li:hover { border-left-color: var(--gold); }
.pains b { color: var(--text); font-weight: 500; }

/* ── Провайдеры и псевдонимы ────────────────────────────────────────── */
.providers { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 54px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 9px 16px; border: 1px solid var(--line); border-radius: 2px;
  font-size: 14px; color: var(--muted); background: var(--ink-2);
}
.chip em { font-style: normal; color: var(--gold); font-family: var(--mono); font-size: 13px; }

.aliases__note { max-width: 58ch; color: var(--muted); margin: 0 0 26px; }
.alias-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.alias {
  padding: 26px 24px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 3px;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), border-color .3s, background .3s;
}
.alias:hover { transform: translateY(-4px); border-color: var(--gold); background: var(--ink-3); }
.alias h3 { font-family: var(--mono); font-size: 17px; color: var(--gold); margin-bottom: 10px; }
.alias p { margin: 0 0 14px; font-size: 15px; color: var(--muted); }
.alias code {
  display: block; font-family: var(--mono); font-size: 11.5px; color: #7d8cad;
  line-height: 1.7; word-break: break-word;
}

/* ── Голос ──────────────────────────────────────────────────────────── */
.section--voice {
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 70px); align-items: center;
}
.voice__wave { position: relative; aspect-ratio: 1; max-height: 460px; }
.voice__wave canvas { width: 100%; height: 100%; display: block; }
/* h2 здесь не внутри .section__head, поэтому отступ под заголовком
   задаём явно — иначе текст прилипает к заголовку. */
.voice__body { max-width: 60ch; }
.voice__body h2 { margin-bottom: 20px; }
.voice__body .code { margin-top: 26px; }
.voice__body .footnote { margin-top: 16px; }

/* ── Документы ──────────────────────────────────────────────────────── */
.section--papers { border-top: 1px solid var(--line); }
.papers { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 18px; }
.paper {
  position: relative; padding: 30px 26px 28px;
  background: linear-gradient(160deg, var(--ink-2), var(--ink));
  border: 1px solid var(--line); border-radius: 3px; overflow: hidden;
}
.paper h3 { margin-bottom: 10px; }
.paper p { margin: 0; font-size: 15px; color: var(--muted); }
.paper__stamp {
  position: absolute; right: -30px; top: -30px; width: 120px; height: 120px;
  border: 2px solid var(--gold); border-radius: 50%; opacity: .08;
  transition: opacity .4s, transform .5s;
}
.paper:hover .paper__stamp { opacity: .2; transform: scale(1.1) rotate(-12deg); }
.papers__why { margin: 40px 0 0; max-width: 68ch; color: var(--muted); font-size: 15.5px; }

/* ── Начать ─────────────────────────────────────────────────────────── */
.section--start { border-top: 1px solid var(--line); }
.start { max-width: 840px; }
.start__tabs { display: flex; gap: 4px; margin-bottom: -1px; }
.tab {
  padding: 10px 20px; font-family: var(--mono); font-size: 13px; cursor: pointer;
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-bottom-color: transparent; border-radius: 3px 3px 0 0;
  transition: color .2s, background .2s;
}
.tab:hover { color: var(--text); }
.tab--on { color: var(--gold); background: var(--ink-2); }

.code {
  margin: 0; padding: 22px 24px; background: var(--ink-2);
  border: 1px solid var(--line); border-radius: 0 3px 3px 3px;
  overflow-x: auto;
}
.code code { font-family: var(--mono); font-size: 13.5px; line-height: 1.75; color: #b9c6e2; white-space: pre; }
.code--tall { min-height: 232px; }
.is-hidden { display: none; }

.start__cta { margin-top: 34px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }

/* ── Подвал ─────────────────────────────────────────────────────────── */
.foot {
  padding: 56px var(--pad); border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 10px;
}
.foot__brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 20px; }
.foot__line { margin: 0; font-size: 14px; color: var(--muted); }
.foot__line--dim a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }
.foot__line--dim a:hover { color: var(--gold); }

/* ── Появление при прокрутке ──────────────────────────────────────────
   Прячем блоки ТОЛЬКО при html.js — класс ставит встроенный скрипт в <head>.
   Без этой оговорки страница с отключённым или упавшим скриптом остаётся
   пустой ниже первого экрана: содержимое есть, но прозрачное. Правило
   «сначала видно, потом красиво», а не наоборот. */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); transition-delay: var(--d, 0s); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ── Узкий экран ────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .hero__seal { opacity: .18; right: -22vw; width: min(80vw, 520px); }
  .section--split, .section--voice { grid-template-columns: 1fr; }
  .voice__wave { max-height: 220px; order: 2; }
  .hero__facts { gap: 28px; }
  .hero__facts dt { font-size: 34px; }
}

/* Движение — приятно, но не за счёт тех, кому от него плохо. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .seal__spin, .seal__core, .hero__scroll span { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
