/* ============================================================
   Саратовский шафран — базовая система дизайна
   Токены, реset, типографика, общие компоненты, движение.
   Секционные стили НЕ здесь — в assets/css/sections/*.css
   ============================================================ */

:root {
  --bg-0: #0D0B08;
  --bg-1: #14110C;
  --bg-2: #1C1812;
  --ivory: #F2ECDF;
  --ivory-70: rgba(242, 236, 223, .70);
  --ivory-50: rgba(242, 236, 223, .50);
  --ivory-35: rgba(242, 236, 223, .35);
  --gold: #E3A429;
  --gold-bright: #F6C45C;
  --gold-deep: #A96B14;
  --crimson: #C34A2A;
  --violet: #8B72C9;
  --line: rgba(242, 236, 223, .12);
  --line-gold: rgba(227, 164, 41, .25);
  --grad-gold: linear-gradient(105deg, #F6C45C 0%, #E3A429 45%, #A96B14 100%);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --font-display: "Cormorant", "Times New Roman", serif;
  --font-body: "Manrope", -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", monospace;
  --container: 1360px;
  --pad-x: clamp(20px, 5vw, 72px);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html:focus-within { scroll-behavior: smooth; }
body {
  background: var(--bg-0);
  color: var(--ivory);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(1rem, 1.1vw, 1.15rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  min-height: 100vh;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
::selection { background: rgba(227, 164, 41, .3); color: var(--ivory); }

/* ---------- Глобальные текстуры: зерно + виньетка ---------- */
body::before {
  content: "";
  position: fixed; inset: 0;
  z-index: 999; pointer-events: none;
  opacity: .05;
  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%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 240px;
  mix-blend-mode: overlay;
}
body::after {
  content: "";
  position: fixed; inset: 0;
  z-index: 998; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(6, 5, 3, .5) 100%);
}

/* ---------- Layout ---------- */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--pad-x); }
.section { position: relative; padding-block: clamp(96px, 14vh, 180px); }
.rule { border: 0; border-top: 1px solid var(--line); }

/* ---------- Типографика ---------- */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.06;
  letter-spacing: -.01em;
  text-wrap: balance;
}
h1 { font-size: clamp(3.2rem, 9vw, 8.5rem); }
h2 { font-size: clamp(2.4rem, 5.5vw, 4.8rem); }
h3 { font-size: clamp(1.5rem, 2.4vw, 2.2rem); font-weight: 400; }
p { max-width: 62ch; color: var(--ivory-70); }
strong { font-weight: 600; color: var(--ivory); }
em, .accent-gold {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: .06em; /* курсивные хвосты не режутся clip'ом */
}

/* Mono-лейбл секции */
.label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
}
.label::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--grad-gold);
  box-shadow: 0 0 12px rgba(227, 164, 41, .8);
  flex: none;
}

/* Голова секции — единый паттерн */
.section-head { margin-bottom: clamp(48px, 7vh, 88px); }
.section-head .label { margin-bottom: 24px; }
.section-head h2 { max-width: 18ch; }
.section-head .lead {
  margin-top: 28px;
  font-size: clamp(1.05rem, 1.3vw, 1.3rem);
  font-weight: 300;
  line-height: 1.65;
  max-width: 56ch;
}

/* Большие цифры-статистика */
.stat-num {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3.5rem, 7vw, 6.5rem);
  line-height: 1;
  letter-spacing: -.02em;
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-cap {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ivory-50);
  line-height: 1.7;
}

/* ---------- Кнопки ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 36px;
  border-radius: 999px;
  border: 1px solid var(--line-gold);
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ivory);
  overflow: hidden;
  isolation: isolate;
  transition: color .5s var(--ease), border-color .5s var(--ease), transform .5s var(--ease);
}
.btn::before {
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  background: var(--grad-gold);
  transform: translateY(101%);
  transition: transform .5s var(--ease);
}
.btn:hover { color: var(--bg-0); border-color: transparent; }
.btn:hover::before { transform: translateY(0); }
.btn--solid { color: var(--bg-0); border-color: transparent; }
.btn--solid::before { transform: translateY(0); }
.btn--solid:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- Карточки ---------- */
.card {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(28px, 3vw, 44px);
  transition: transform .5s var(--ease), border-color .5s var(--ease);
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(420px 260px at 20% 0%, rgba(227, 164, 41, .08), transparent 70%);
  opacity: 0;
  transition: opacity .5s var(--ease);
  pointer-events: none;
}
.card:hover { transform: translateY(-4px); border-color: var(--line-gold); }
.card:hover::before { opacity: 1; }

/* ---------- Движение (main.js вешает .is-in) ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(6px);
  transition: opacity .9s var(--ease), transform .9s var(--ease), filter .9s var(--ease);
}
[data-reveal].is-in { opacity: 1; transform: none; filter: none; }
[data-reveal-delay="1"] { transition-delay: .09s; }
[data-reveal-delay="2"] { transition-delay: .18s; }
[data-reveal-delay="3"] { transition-delay: .27s; }
[data-reveal-delay="4"] { transition-delay: .36s; }
[data-reveal-delay="5"] { transition-delay: .45s; }
[data-reveal-delay="6"] { transition-delay: .54s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  [data-reveal] { opacity: 1; transform: none; filter: none; }
}

/* ---------- Фото-обработка ---------- */
.ph {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  isolation: isolate;
}
.ph img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(.85) contrast(1.05) brightness(.9) sepia(.08);
}
.ph::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(13, 11, 8, .12), transparent 35%, transparent 60%, rgba(13, 11, 8, .55));
  pointer-events: none;
}

/* ---------- Утилиты ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
