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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .35s ease, color .35s ease;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--pad); }
.section { padding: var(--section-y) 0; position: relative; }
.section--tight { padding: 74px 0; }

/* КОНТРАСТНАЯ секция — полоса во всю ширину, задающая ритм.
   Переопределяет токены текста внутри себя, поэтому вложенная разметка
   ничего не знает о том, на каком фоне стоит. */
.section--alt {
  background: var(--alt-bg);
  color: var(--alt-fg);
  --fg: var(--alt-fg);
  --fg-2: var(--alt-fg-2);
  --fg-3: var(--alt-fg-3);
  --line: var(--alt-line);
  --line-2: var(--alt-line);
  --bg: var(--alt-bg);
}

.muted { color: var(--fg-2); }
.dim   { color: var(--fg-3); }

/* ── Типографика ───────────────────────────────────────────────────── */
h1, h2, h3, h4 { margin: 0; font-weight: 560; letter-spacing: -0.02em; }

.h1 {
  font-size: clamp(34px, 5.2vw, 58px);
  line-height: 1.04; letter-spacing: -0.032em;
  max-width: 17ch; text-wrap: balance;
}
.h2 {
  font-size: clamp(27px, 3.4vw, 42px);
  line-height: 1.1; letter-spacing: -0.026em;
  max-width: 20ch; text-wrap: balance;
}
.h3 { font-size: 20px; line-height: 1.3; letter-spacing: -0.015em; }

.lede { font-size: clamp(16px, 1.4vw, 19px); line-height: 1.55; color: var(--fg-2); max-width: 52ch; }

.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--fg-3); margin: 0 0 18px;
}
.eyebrow--accent { color: var(--accent); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.not-mono { font-family: var(--sans) !important; letter-spacing: -0.02em; }

/* ── Кнопки ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 10px; border: 1px solid transparent;
  font-size: 15px; font-weight: 500; letter-spacing: -0.01em;
  cursor: pointer; white-space: nowrap;
  transition: transform .18s cubic-bezier(.2,.7,.3,1), background .18s, border-color .18s, opacity .18s;
}
.btn:active { transform: scale(.985); }
.btn--primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn--primary:hover:not(:disabled) { background: var(--btn-bg-hover); }
.btn--ghost { background: transparent; color: var(--fg); border-color: var(--line-2); }
.btn--ghost:hover { background: var(--bg-3); }
.btn--sm { height: 38px; padding: 0 16px; font-size: 14px; border-radius: 9px; }
.btn:disabled { opacity: .42; cursor: not-allowed; }

/* ── Появление ─────────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1);
  transition-delay: var(--d, 0ms);
}
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* Первый экран НЕ прячется за JS.
 * ⚠️ `.reveal` ставит `opacity:0` и снимает его наблюдателем пересечений. Для
 * текста НАД СГИБОМ это недопустимо: заминка со скриптом — и человек видит
 * пустой экран. `.rise` работает наоборот: элемент виден с первого кадра, а
 * появление делает CSS-анимация, которой не нужен ни JS, ни наблюдатель. */
.rise { animation: rise .75s cubic-bezier(.2,.7,.3,1) both; animation-delay: var(--d, 0ms); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@media (prefers-reduced-motion: reduce) { .rise { animation: none; } }

.hr { height: 1px; background: var(--line); border: 0; margin: 0; }
