/* Первый экран v2: рой частиц (WebGL) + огромный наклонный заголовок + история состава, где рой перестраивается.
   Холст «прилипает» к экрану внутри .swarm-zone (position: sticky) — виден только в герое и истории. */

.swarm-zone{position:relative;isolation:isolate;overflow:clip; /* холст с margin-bottom:-100vh не вылезает в следующую главу; clip не ломает sticky */
  background:
  radial-gradient(70% 60% at 72% 42%,rgba(0,102,255,.16),rgba(2,8,22,0) 70%),
  radial-gradient(50% 40% at 15% 85%,rgba(249,63,40,.08),rgba(2,8,22,0) 70%),
  #020816}
.swarm-canvas{
  position:sticky;top:0;display:block;width:100%;height:100vh;height:100svh;margin-bottom:-100vh;margin-bottom:-100svh;
  z-index:0;pointer-events:none;
}
/* Без WebGL / при «уменьшить движение» — бутылка-картинка на месте роя */
.swarm-fallback{display:none}
.no-webgl .swarm-canvas{display:none}
.no-webgl .swarm-fallback{
  display:block;position:absolute;right:12vw;top:14vh;width:auto;height:min(70vh,640px);z-index:0;
  filter:drop-shadow(0 30px 60px rgba(0,102,255,.35));opacity:.9;
}

/* ---------- Герой ---------- */
.hero{
  position:relative;z-index:1;min-height:100vh;min-height:100svh;
  display:grid;grid-template-rows:1fr auto;grid-template-columns:minmax(0,1fr); /* minmax(0,…): длинная строка заголовка не растягивает колонку */
  padding:calc(clamp(110px,16vh,170px) + env(safe-area-inset-top,0px)) var(--gut) 0;
}
.hero-inner{
  align-self:center;width:100%;max-width:1320px;margin-inline:auto;
  display:grid;justify-items:start;gap:clamp(20px,2.6vh,30px);
}
.hero-pill > span{text-transform:uppercase}

.hero-title{
  font-family:var(--f-display);font-style:italic;font-weight:800;text-transform:uppercase;color:#f6f8fc;
  font-size:clamp(44px,7.4vw,124px);line-height:.9;letter-spacing:-.015em;margin:0;
  max-width:min(1320px,100%);
}
.hero-title .line{display:block;white-space:nowrap}
.hero-title .line-sport{color:#f2b380}
.hero-title .dot{color:#f93f28}
.sport{
  font:inherit;color:inherit;letter-spacing:inherit;line-height:inherit;text-transform:inherit;cursor:pointer;
  display:inline-block;position:relative;vertical-align:top;overflow:hidden;padding:.06em .04em .12em 0;margin:-.06em -.04em -.12em 0;
}
.sport-word{display:inline-block;will-change:transform}
.sport-word .ch{display:inline-block;will-change:transform}
.sport::after{
  content:"";position:absolute;left:0;right:.1em;bottom:.04em;height:.06em;background:currentColor;
  transform:scaleX(0);transform-origin:0 50%;transition:transform .5s var(--ease-expo);
}
@media (hover:hover){.sport:hover::after{transform:scaleX(1)}}
.sport:focus-visible::after{transform:scaleX(1)}

.hero-lede{max-width:46ch;font-size:clamp(16px,1.3vw,19px);line-height:1.5;color:var(--body);text-wrap:pretty}
.hero-cta{display:flex;flex-wrap:wrap;gap:10px}
.hero-cta .btn{height:56px;font-size:13.5px}
.magnetic{will-change:transform}

.hero-foot{
  width:100%;max-width:1320px;margin-inline:auto;display:flex;justify-content:space-between;align-items:center;gap:16px;
  padding:28px 0 calc(28px + env(safe-area-inset-bottom,0px));color:var(--muted);border-top:1px solid var(--line);
}
.hero-scroll{display:inline-flex;align-items:center;gap:12px}
.hero-scroll i{display:block;width:1.9px;height:28px;background:var(--line-strong);position:relative;overflow:hidden}
.hero-scroll i::after{content:"";position:absolute;left:0;right:0;top:-40%;height:40%;background:#f2b380;animation:scroll-cue 1.8s var(--ease-shutter) infinite}
@keyframes scroll-cue{to{top:100%}}

/* Десктоп: текст слева, рой справа */
@media (min-width:1024px){
  .hero-inner{padding-right:min(30vw,440px)}
  .hero-title{max-width:none}
}

/* ---------- История состава: шаги по 100vh, подписи слева, рой справа ---------- */
.story{position:relative;z-index:1}
.story-steps{max-width:1320px;margin-inline:auto;padding:0 var(--gut)}
.story-step{
  min-height:100vh;min-height:100svh;display:grid;align-content:center;justify-items:start;gap:16px;
  max-width:560px;padding:12vh 0;
}
.story-index{color:#f2b380}
.story-big{
  font-family:var(--f-display);font-style:italic;font-weight:800;color:#f6f8fc; /* без uppercase: Na, Ca, Mg — химические символы */
  font-size:clamp(30px,3.6vw,54px);line-height:1;letter-spacing:-.01em;display:flex;flex-wrap:wrap;gap:.1em .5em;
}
.story-big.story-huge{font-size:clamp(96px,15vw,220px);line-height:.85}
.story-unit{color:var(--muted)}
.story-text{font-size:clamp(17px,1.4vw,20px);line-height:1.55;color:var(--body);max-width:44ch;text-wrap:pretty}
/* Подпись — стеклянная плашка, чтобы читалась поверх частиц на узких экранах */
@media (max-width:1023.98px){
  .story-step{max-width:none;align-content:end;padding:0 0 10vh}
  .story-step > *{position:relative}
  .story-step{
    --pad:22px;
  }
  .story-step .story-text,.story-step .story-unit,.story-step .story-index,.story-step .story-big{text-shadow:0 2px 18px rgba(2,8,22,.9)}
}

/* ---------- Планшет и телефон: рой выше текста, под текстом — затемнение для читаемости ---------- */
@media (max-width:1023.98px){
  .hero{background:linear-gradient(180deg,rgba(2,8,22,0) 0%,rgba(2,8,22,0) 34%,rgba(2,8,22,.72) 56%,rgba(2,8,22,.9) 100%)}
  .hero-title,.hero-lede{text-shadow:0 2px 24px rgba(2,8,22,.85)}
}

/* ---------- Телефон ---------- */
@media (max-width:767.98px){
  .hero{padding-top:calc(clamp(92px,13vh,120px) + env(safe-area-inset-top,0px))}
  .hero-inner{align-self:end;padding-bottom:6vh}
  .hero-title{font-size:clamp(34px,10.4vw,56px)}
  .hero-title .line{white-space:normal}
  .hero-cta{width:100%}
  .hero-cta .btn{flex:1 1 auto;justify-content:center;height:52px;font-size:12px;padding-inline:16px}
  .hero-cta .btn.b2 svg{margin-right:14px}
  .hero-foot .hero-scroll{display:none}
  .no-webgl .swarm-fallback{right:50%;transform:translateX(50%);top:12vh;height:42vh}
}

/* Пока идёт вступление — элементы героя скрыты (их проявляют твины hero.js) */
.intro .hero-pill,.intro .hero-title,.intro .hero-lede,.intro .hero-cta .btn,.intro .hero-foot{opacity:0}

@media (prefers-reduced-motion:reduce){
  .hero-scroll i::after{animation:none;top:0;height:100%}
}
