/* =====================================================================
   БАЗА — сброс, типографика, общие элементы секций, анимации появления
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
svg { flex-shrink: 0; display: block; }
::selection { background: var(--violet); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 5px; border-radius: 4px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.icon-arrow { width: 16px; height: 16px; }

/* полоска под системной панелью телефона */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 90; background: var(--bg); }

/* зерно поверх фона */
.grain::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .07; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- общий каркас секций ---------- */
.section {
  position: relative;
  padding-block: clamp(90px, 12vw, 180px);
  padding-left: var(--pad-l);
  padding-right: var(--pad-r);
  overflow-x: clip; /* ничто внутри не создаст горизонтальную прокрутку; sticky при этом работает */
}
.sec-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
  padding-bottom: 22px; margin-bottom: clamp(40px, 6vw, 80px); border-bottom: 1px solid var(--line);
}
.sec-label {
  display: block; margin-bottom: 16px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.sec-title {
  font-family: var(--f-display); font-weight: 900; font-size: clamp(34px, 6.2vw, 96px);
  line-height: .95; letter-spacing: -.02em; text-transform: uppercase; text-wrap: balance;
}
.sec-num {
  font-family: var(--f-display); font-weight: 500; font-size: clamp(32px, 4.4vw, 64px); line-height: 1;
  color: transparent; -webkit-text-stroke: 1px var(--muted);
}
@media (width <= 699px) {
  .sec-head { align-items: flex-start; flex-direction: column-reverse; gap: 10px; }
}

/* ---------- появление (работает только с JS: класс .js ставит boot.js) ---------- */
.js [data-split] .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .06em; margin-bottom: -.06em; }
.js [data-split] .w > span { display: inline-block; transform: translateY(110%); transition: transform 1s var(--ease-out); transition-delay: calc(var(--i, 0) * 45ms); }
.js [data-split].is-in .w > span { transform: none; }

.js [data-reveal] { opacity: 0; transform: translateY(40px); transition: opacity .9s var(--ease-out), transform 1s var(--ease-out); transition-delay: var(--d, 0s); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- след за курсором ---------- */
.ink-trail { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 150; pointer-events: none; overflow: hidden; }
@media (pointer: coarse) { .ink-trail { display: none; } }

/* ---------- режим «без анимаций» (включается в config/site.js) ---------- */
.is-reduced *, .is-reduced *::before, .is-reduced *::after { animation: none !important; transition: none !important; }
.is-reduced .ink-trail { display: none; }
