/* ============================================================
   Сбер — Система бренда · базовый слой (общий для всех страниц)
   Токены, сброс, плоские панели, верхняя навигация, подвал,
   кнопки, появления, курсор, тост.
   ============================================================ */

:root {
  /* Палитра */
  --green:    #21A038;
  --green-dk: #17812C;
  --yellow:   #F2E913;
  --lime:     #A3CD39;
  --sky:      #0FA8E0;
  --blue:     #0291EB;
  --graphite: #333F48;
  --paper:    #F5F4F0;
  --black:    #101314;
  --white:    #FFFFFF;

  /* Фирменный градиент: всегда жёлтый → зелёный → синий */
  --grad: linear-gradient(115deg, var(--yellow) 0%, var(--lime) 24%, var(--green) 50%, var(--sky) 76%, var(--blue) 100%);

  /* Типографика */
  --font: "SB Sans Text", "Onest", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  /* Сетка / ритм */
  --gutter:   clamp(20px, 4vw, 64px);
  --maxw:     1500px;
  --nav-h:    64px;

  /* Скругления */
  --r-tile:    24px;
  --r-pill:    999px;
  --r-control: 14px;

  /* Движение */
  --ease:        cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--black);
  background: var(--paper);
  overflow-x: clip;
  scroll-padding-top: var(--nav-h);
}

h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
input, textarea, select { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--green); color: #fff; }

/* ---------- Плоские панели ---------- */
.panel-green    { background: var(--green);    color: #fff; }
.panel-graphite { background: var(--graphite); color: #fff; }
.panel-yellow   { background: var(--yellow);   color: var(--black); }
.panel-blue     { background: var(--blue);     color: #fff; }
.panel-lime     { background: var(--lime);     color: var(--black); }
.panel-sky      { background: var(--sky);      color: #fff; }
.panel-paper    { background: var(--paper);    color: var(--black); }
.panel-white    { background: #fff;            color: var(--black); }
.panel-black    { background: var(--black);    color: #fff; }
.panel-gradient { background: var(--grad); background-size: 240% 100%; color: #fff; }

/* ============================================================
   Верхняя навигация (инжектится из app.js)
   ============================================================ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 var(--gutter);
  color: #fff;
  transition: background .35s var(--ease), color .35s var(--ease), box-shadow .35s var(--ease);
}
/* прозрачная над геройским экраном (только там, где выставлен data-nav-float) */
.nav[data-float="true"]:not(.is-solid) { background: transparent; }
.nav.is-solid {
  background: rgba(245, 244, 240, .82);
  color: var(--black);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  box-shadow: 0 1px 0 rgba(16,19,20,.08);
}
/* тёмная тема бара (для страниц/секций на светлом верхе) */
.nav[data-theme="dark"]:not(.is-solid) { color: var(--black); }

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -.02em;
  font-size: 17px;
  flex: 0 0 auto;
}
.nav__brand svg { width: 30px; height: 30px; flex: 0 0 auto; }
.nav__brand b { font-weight: 800; }
.nav__brand span { font-weight: 500; opacity: .62; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline: auto;
}
.nav__links a {
  position: relative;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 600;
  opacity: .8;
  transition: opacity .2s, background .2s;
  white-space: nowrap;
}
.nav__links a:hover { opacity: 1; background: rgba(128,128,128,.14); }
.nav__links a[aria-current="page"] { opacity: 1; font-weight: 800; }
.nav__links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 2px; height: 2px;
  background: currentColor; border-radius: 2px;
}

.nav__cta {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  border-radius: var(--r-pill);
  background: var(--green);
  color: #fff;
  font-weight: 800; font-size: 14px;
  transition: transform .25s var(--ease-spring), background .2s;
}
.nav__cta:hover { background: var(--green-dk); transform: translateY(-1px); }
.nav__cta svg { width: 16px; height: 16px; }

.nav__burger {
  display: none;
  width: 44px; height: 44px;
  margin-left: auto;
  border-radius: 12px;
  align-items: center; justify-content: center;
}
.nav__burger svg { width: 26px; height: 26px; }

/* мобильный ящик */
.drawer {
  position: fixed; inset: 0;
  z-index: 99;
  background: var(--black);
  color: #fff;
  padding: calc(var(--nav-h) + 24px) var(--gutter) 40px;
  display: flex; flex-direction: column; gap: 6px;
  transform: translateY(-100%);
  transition: transform .5s var(--ease);
  overflow-y: auto;
}
.drawer.is-open { transform: none; }
.drawer a {
  font-size: clamp(30px, 8vw, 52px);
  font-weight: 900; letter-spacing: -.03em;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: space-between;
}
.drawer a[aria-current="page"] { color: var(--lime); }
.drawer a .idx { font-family: var(--mono); font-size: 14px; font-weight: 500; opacity: .5; }
.drawer__foot { margin-top: auto; padding-top: 30px; font-size: 13px; color: rgba(255,255,255,.5); }

/* ============================================================
   Кнопки / пилюли (общие)
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 28px;
  border-radius: var(--r-pill);
  font-weight: 800; font-size: 16px;
  transition: transform .25s var(--ease-spring), background .2s, box-shadow .25s;
  will-change: transform;
}
.btn svg { width: 18px; height: 18px; }
.btn--green { background: var(--green); color: #fff; }
.btn--green:hover { background: var(--green-dk); transform: translateY(-2px); }
.btn--light { background: #fff; color: var(--green-dk); }
.btn--light:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -12px rgba(0,0,0,.35); }
.btn--outline { border: 2px solid currentColor; }
.btn--outline:hover { transform: translateY(-2px); }

/* ============================================================
   Общие блоки страниц-разделов
   ============================================================ */
.page { padding-top: var(--nav-h); }

/* геройская шапка раздела */
.phero {
  min-height: min(78vh, 720px);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: clamp(40px, 10vh, 120px) var(--gutter) clamp(40px, 7vh, 80px);
  position: relative; overflow: clip;
}
.phero__eyebrow {
  font-family: var(--mono);
  font-size: 13px; letter-spacing: .18em; text-transform: uppercase;
  opacity: .8; margin-bottom: 18px;
}
.phero__title {
  font-size: clamp(56px, 13vw, 200px);
  font-weight: 900; line-height: .9; letter-spacing: -.045em;
}
.phero__sub {
  margin-top: 24px;
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 600; line-height: 1.4; max-width: 40ch;
}

/* обычная секция контента */
.sec { padding: clamp(56px, 10vh, 130px) var(--gutter); }
.sec__inner { max-width: var(--maxw); margin-inline: auto; }
.sec--narrow .sec__inner { max-width: 1040px; }

.kicker {
  font-family: var(--mono);
  font-size: 13px; letter-spacing: .16em; text-transform: uppercase;
  opacity: .6; margin-bottom: 20px;
}
.h2 {
  font-size: clamp(34px, 5.4vw, 76px);
  font-weight: 900; line-height: 1; letter-spacing: -.035em;
  text-wrap: balance;
}
.h3 {
  font-size: clamp(22px, 2.6vw, 34px);
  font-weight: 800; letter-spacing: -.02em; line-height: 1.1;
}
.lead {
  font-size: clamp(18px, 1.9vw, 24px);
  font-weight: 600; line-height: 1.45; max-width: 52ch;
}
.prose p { max-width: 62ch; line-height: 1.6; }
.prose p + p { margin-top: 1em; }

/* межстраничная навигация «дальше» */
.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  background: rgba(128,128,128,.2);
}
.pager a {
  padding: clamp(28px, 5vw, 56px) var(--gutter);
  background: var(--paper);
  display: flex; flex-direction: column; gap: 8px;
  transition: background .3s;
}
.pager a:hover { background: #fff; }
.pager a.pager--next { align-items: flex-end; text-align: right; }
.pager .pager__label { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; opacity: .55; }
.pager .pager__name { font-size: clamp(24px, 3.4vw, 44px); font-weight: 900; letter-spacing: -.03em; display: flex; align-items: center; gap: 12px; }

/* подвал */
.foot {
  background: var(--black); color: rgba(255,255,255,.6);
  padding: clamp(48px, 8vh, 90px) var(--gutter) 40px;
}
.foot__inner { max-width: var(--maxw); margin-inline: auto; }
.foot__word {
  font-size: clamp(64px, 18vw, 240px);
  font-weight: 900; line-height: .8; letter-spacing: -.05em;
  color: transparent; -webkit-text-stroke: 1.5px rgba(255,255,255,.2);
  margin-bottom: 40px; user-select: none;
}
.foot__grid {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px;
  border-top: 1px solid rgba(255,255,255,.14); padding-top: 28px;
  font-size: 13.5px;
}
.foot__grid a { color: #fff; opacity: .8; }
.foot__grid a:hover { opacity: 1; }
.foot__grid p { max-width: 56ch; }
.foot__links { display: flex; gap: 22px; flex-wrap: wrap; }

/* ---------- Кастомный курсор ---------- */
.cursor {
  position: fixed; top: 0; left: 0;
  width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%; background: #fff;
  mix-blend-mode: difference; pointer-events: none; z-index: 300;
  transform: translate(-100px, -100px);
  transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease);
}
.cursor.is-hover { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
@media (hover: none), (prefers-reduced-motion: reduce) { .cursor { display: none; } }

/* ---------- Тост ---------- */
.toast {
  position: fixed; left: 50%; bottom: 30px;
  transform: translate(-50%, 16px);
  padding: 14px 26px; border-radius: var(--r-pill);
  background: var(--black); color: #fff;
  font-size: 15px; font-weight: 700;
  opacity: 0; pointer-events: none; z-index: 200;
  transition: opacity .3s, transform .3s var(--ease);
  box-shadow: 0 14px 40px -10px rgba(0,0,0,.5);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Появления ---------- */
.reveal {
  opacity: 0; transform: translateY(34px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  transition-delay: calc(var(--rd, 0) * 80ms);
}
.reveal.is-in { opacity: 1; transform: none; }

[data-split] .ch {
  display: inline-block; transform: translateY(110%);
  transition: transform .7s var(--ease);
  transition-delay: calc(var(--ci) * 32ms);
}
[data-split] { clip-path: inset(0 0 -12% 0); }
[data-split].is-in .ch { transform: none; }

[data-draw] {
  stroke-dashoffset: var(--len, 600);
  transition: stroke-dashoffset 1.3s var(--ease) .15s;
}
.is-in [data-draw], [data-draw].is-in { stroke-dashoffset: 0; }

/* ---------- 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;
  }
  .reveal, [data-split] .ch { opacity: 1; transform: none; }
  [data-draw] { stroke-dashoffset: 0 !important; }
}

/* ---------- Адаптив навигации ---------- */
@media (max-width: 1080px) {
  .nav__links, .nav__cta { display: none; }
  .nav__burger { display: inline-flex; }
}
@media (max-width: 720px) {
  .pager { grid-template-columns: 1fr; }
}
