/* ============================================================
   base.css — reset, дизайн-токены, базовая типографика
   Порядок подключения: fonts → base → layout → components →
   pages → animations → responsive
   ============================================================ */

/* ---------- Дизайн-токены (контракт §13) ---------- */
:root {
  /* Палитра — тёмная редакционная «тихая роскошь» */
  --bg-main: #0b0b0e;
  --bg-soft: #101015;
  --bg-card: #15151b;
  --bg-accent: rgba(198, 161, 91, .12);
  --rose: #c6a15b;
  --sand: #55503f;
  --taupe: #c6a15b;
  --text-main: #f2efe8;
  --text-secondary: #a09c94;
  --border: rgba(242, 239, 232, .12);

  /* Производные оттенки */
  --rose-soft: rgba(198, 161, 91, .2);
  --sand-soft: rgba(85, 80, 63, .5);
  --taupe-deep: #d8bc84;
  --taupe-ink: #c6a15b;

  /* Типографика */
  --font-display: 'Lora', Georgia, serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

  /* Геометрия */
  --radius: 24px;
  --radius-sm: 16px;
  --radius-lg: 32px;
  --radius-pill: 999px;

  /* Тени — глубокие, холодно-графитовые */
  --shadow-soft: 0 20px 40px -24px rgba(0, 0, 0, .55);
  --shadow-hover: 0 28px 56px -28px rgba(0, 0, 0, .65);
  --shadow-tiny: 0 8px 20px -12px rgba(0, 0, 0, .5);
  --shadow-mock: 0 40px 80px -40px rgba(0, 0, 0, .7);

  /* Ритм */
  --container: 1200px;
  --header-h: 84px;
  --section-gap: clamp(29px, 3.6vw, 48px);

  /* Движение */
  --ease-out: cubic-bezier(.22, .61, .36, 1);
  --ease-soft: cubic-bezier(.33, 1, .68, 1);
  --dur-fast: .18s;
  --dur-med: .35s;
  --dur-slow: .6s;
}

/* ---------- Reset ---------- */
*,
*::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);
}

body {
  min-height: 100vh;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

ul[role='list'],
ol[role='list'] {
  list-style: none;
}

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

::selection {
  background: var(--rose);
  color: #0b0b0e;
}

:focus-visible {
  outline: 2px solid var(--taupe);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Базовая типографика ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -.01em;
  color: var(--text-main);
  text-wrap: balance;
}

h1 { font-size: clamp(2.6rem, 5.4vw, 4.4rem); }
h2 { font-size: clamp(2rem, 3.8vw, 3.1rem); }
h3 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); }
h4 { font-size: 1.2rem; }

p {
  color: var(--text-secondary);
  max-width: 68ch;
}

p + p { margin-top: 1em; }

strong, b {
  font-weight: 700;
  color: var(--text-main);
}

em, i {
  font-family: var(--font-display);
  font-size: 1.06em;
}

small { font-size: .85em; }

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

/* ---------- Утилиты каркаса (контракт §13b) ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 40px);
}

.section {
  padding-block: var(--section-gap);
  position: relative;
}

.section--soft { background-color: var(--bg-soft); }
.section--accent { background-color: var(--bg-accent); }

.section__head {
  max-width: 720px;
  margin-bottom: clamp(16px, 2vw, 26px);
}

.section__head.is-center {
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-sans);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--taupe);
  margin-bottom: 18px;
}

.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--taupe);
  opacity: .55;
  flex: none;
}

.section__head.is-center .eyebrow::after {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--taupe);
  opacity: .55;
  flex: none;
}

.section__title {
  font-size: clamp(2rem, 3.8vw, 3.1rem);
  margin-bottom: 0;
}

.section__title + .section__subtitle { margin-top: 18px; }

.section__subtitle {
  font-size: 1.06rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

/* ---------- Сетки (контракт §13b) ---------- */
.grid {
  display: grid;
  gap: clamp(20px, 2.6vw, 32px);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.columns-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

/* ---------- Служебные ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 12px 20px;
  background: var(--text-main);
  color: var(--bg-card);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .9rem;
  transition: top var(--dur-fast) var(--ease-out);
}

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

/* Бумажное зерно — едва заметная плёночная текстура поверх всего сайта */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 120;
  pointer-events: none;
  opacity: .038;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 240px 240px;
}

/* ---------- Декоративные примитивы (контракт §13b) ---------- */
.arch {
  border-radius: 999px 999px 0 0;
  background: var(--bg-accent);
}

.circle {
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, var(--bg-card) 0%, var(--rose) 58%, var(--taupe) 130%);
}

.line-h {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--border);
  border: 0;
}

.dots-pattern {
  background-image: radial-gradient(var(--sand) 1.4px, transparent 1.4px);
  background-size: 18px 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--taupe-deep);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Уважение к reduced-motion на уровне всего документа */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
