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

:root {
  /* Палитра: тёплая бумага, чернила, сдержанный акцент */
  --paper: #F4F1EA;
  --paper-soft: #ECE8DE;
  --card: #FBF9F3;
  --ink: #1D1B17;
  --ink-soft: #504B42;
  --ink-faint: #837D71;
  --line: rgba(29, 27, 23, 0.16);
  --line-strong: rgba(29, 27, 23, 0.5);

  --coal: #1D1B17;
  --coal-soft: #262320;
  --paper-on-dark: #F4F1EA;
  --ink-on-dark: rgba(244, 241, 234, 0.66);
  --line-on-dark: rgba(244, 241, 234, 0.16);

  --accent: #9A3825;
  --accent-strong: #7F2E1F;
  --accent-on-dark: #C97F5F;

  --font-display: "Prata", Georgia, "Times New Roman", serif;
  --font-body: "Golos Text", "Segoe UI", Helvetica, sans-serif;

  --header-h: 76px;
  --radius: 3px;
  --container: 1200px;
  --gutter: clamp(20px, 5vw, 64px);

  --shadow-card: 0 18px 40px -18px rgba(29, 27, 23, 0.22);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Сброс ---------- */

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

html {
  scroll-padding-top: calc(var(--header-h) + 24px);
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(15px, 0.4vw + 14.4px, 17px);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, h3, h4, p, ul, ol, figure, blockquote {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

address {
  font-style: normal;
}

/* ---------- Типографика ---------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.16;
  letter-spacing: 0.005em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.35rem, 4.6vw + 0.6rem, 4.4rem);
}

h2 {
  font-size: clamp(1.8rem, 2.6vw + 0.6rem, 3rem);
}

h3 {
  font-size: clamp(1.15rem, 0.6vw + 0.95rem, 1.3rem);
  line-height: 1.35;
}

/* Верхний маркер-рубрика */
.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: clamp(14px, 2vw, 22px);
}

.section-dark .eyebrow {
  color: var(--accent-on-dark);
}

/* ---------- Утилиты раскладки ---------- */

.container {
  width: min(var(--container), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

.section {
  padding-block: clamp(72px, 10vw, 128px);
}

.section-tight {
  padding-block: clamp(56px, 8vw, 104px);
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(36px, 5vw, 64px);
}

.section-lead {
  margin-top: clamp(14px, 2vw, 20px);
  color: var(--ink-soft);
  max-width: 56ch;
}

/* Пропуск навигации */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  font-size: 0.85rem;
}

.skip-link:focus-visible {
  top: 12px;
}

/* ---------- Focus-состояния ---------- */

:where(a, button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Появление при скролле ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Без анимации движения: только плавная прозрачность */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    transform: none;
    transition: opacity 0.4s ease;
  }
}

/* Если JS выключен — контент виден всегда */
.no-js .reveal {
  opacity: 1;
  transform: none;
}