/* base.css — сброс, типографика, контейнер, кнопки, утилиты */

/* ── Сброс ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ── Типографика — редакторская ────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.025em;
  color: inherit;
}
h1 { font-size: clamp(38px, 6.4vw, 82px); font-weight: 600; letter-spacing: -0.035em; }
h2 { font-size: clamp(28px, 4vw, 50px); letter-spacing: -0.03em; }
h3 { font-size: clamp(20px, 2vw, 25px); }
h4 { font-size: 18px; }

.mono { font-family: var(--font-mono); font-feature-settings: 'tnum' 1; }
small, .small { font-size: 14px; }

/* ── Контейнер / секции ────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); }
.section--surface { background: var(--paper-2); }
.section--dark {
  background: var(--graphite-900);
  color: var(--invert);
}

/* ── Индекс-метка секции (инженерный «чертёжный» приём) ─ */
.index {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.index::before {
  content: "";
  width: 34px; height: 1px;
  background: var(--line-2);
}
.index--water  { color: var(--water-ink); }
.index--water::before  { background: var(--water); }
.index--current { color: var(--current-ink); }
.index--current::before { background: var(--current); }
.section--dark .index { color: var(--invert-muted); }
.section--dark .index::before { background: var(--line-invert); }

.lead { font-size: clamp(17px, 1.5vw, 20px); color: var(--muted); line-height: 1.55; }
.text-muted { color: var(--muted); }
.section--dark .text-muted,
.section--dark .lead { color: var(--invert-muted); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--water); outline-offset: 3px; }

/* ── Кнопки — архитектурные, острые ────────────────── */
.btn {
  --btn-bg: var(--graphite-900);
  --btn-fg: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 26px;
  border-radius: var(--r-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  letter-spacing: -0.01em;
  border: 1px solid var(--btn-bg);
  transition: transform .16s ease, background-color .16s ease, border-color .16s ease, color .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* Основная — графит */
.btn--solid { --btn-bg: var(--graphite-900); --btn-fg: var(--paper); }
.btn--solid:hover { --btn-bg: #000; }

/* Контурная */
.btn--outline {
  --btn-bg: transparent; --btn-fg: var(--ink);
  border-color: var(--line-2);
}
.btn--outline:hover { border-color: var(--graphite-900); }
.section--dark .btn--outline { --btn-fg: var(--invert); border-color: var(--line-invert); }
.section--dark .btn--outline:hover { border-color: var(--invert); }

/* Акцентные (дозированно, для расчёта по направлениям) */
.btn--water   { --btn-bg: var(--water); --btn-fg: #fff; border-color: var(--water); }
.btn--water:hover   { --btn-bg: var(--water-ink); border-color: var(--water-ink); }
.btn--current { --btn-bg: var(--current); --btn-fg: var(--graphite-900); border-color: var(--current); }
.btn--current:hover { --btn-bg: var(--current-ink); border-color: var(--current-ink); }

.btn--sm { padding: 11px 18px; font-size: 15px; }
.btn--lg { padding: 18px 30px; font-size: 17px; }

/* На белом фоне у графитовой кнопки тонкая двухцветная «подпись» снизу */
.btn--accentline { position: relative; overflow: hidden; }
.btn--accentline::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--water) 0 50%, var(--current) 50% 100%);
}
