/* ═══════════════════════════════════════════════════════════════════════
   Hero v2 — swarm как фон + центрированный текст + ротация болей
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Hero контейнер ─── */
.hero-v2 {
  position: relative;
  overflow: hidden;
  display: block;
  padding: 88px 0 96px;
}

/* ─── Swarm-фон: full-bleed, лёгкий, не мешает тексту ─── */
.hero-swarm-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.28;
  z-index: 1;
  pointer-events: none;
  /* Фейды по верх/низу/боковой ── чтобы swarm не уходил в подвал в чёткой кромке */
  -webkit-mask-image:
    linear-gradient(180deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
          mask-image:
    linear-gradient(180deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
}

/* ─── Hero copy: центрированный столбец, текст по центру ─── */
.hero-copy-center {
  position: relative;
  z-index: 2;
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}

/* Eyebrow и subheadline тоже центрированы, кнопки в ряд по центру */
.hero-v2 .eyebrow {
  justify-content: center;
}
.hero-v2 .hero-sub {
  margin-left: auto;
  margin-right: auto;
}
.hero-v2 .hero-cta {
  justify-content: center;
}

/* Уменьшаем h1 на desktop — было clamp(48,7.2vw,104) — слишком большой
   на широком viewport, текст узкими 1-2 словами на строку. */
.hero-v2 .hero-rotator {
  font-size: clamp(40px, 5.4vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.025em;
}

/* ─── Headline ротатор ─── */
.hero-rotator {
  position: relative;
  min-height: 4em;
  display: block;
  margin-top: 20px;
}

.hero-rot-slot {
  display: block;
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(14px);
  /* Incoming fades in slow (0.55s) — readable. */
  transition: opacity .55s cubic-bezier(.4, 0, .2, 1),
              transform .55s cubic-bezier(.4, 0, .2, 1);
  pointer-events: none;
  will-change: opacity, transform;
}

.hero-rot-slot.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  z-index: 2;
}

/* Leaving snaps out fast (0.18s) — избегаем визуального overlap двух slots */
.hero-rot-slot.is-leaving {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .18s ease-in,
              transform .18s ease-in;
  z-index: 1;
}

/* ─── Hero subheadline: более крупный, без max-width-обрезки ─── */
.hero-v2 .hero-sub {
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.5;
  margin-top: 28px;
  max-width: 56ch;
  color: var(--fg-2);
}

.hero-v2 .hero-sub strong {
  font-weight: 600;
  color: var(--fg);
}

/* ─── CTAs остаются flex ─── */
.hero-v2 .hero-cta {
  margin-top: 36px;
}

/* ─── Reduced motion: ротация stop, slot 1 виден ─── */
@media (prefers-reduced-motion: reduce) {
  .hero-rot-slot,
  .hero-rot-slot.is-active,
  .hero-rot-slot.is-leaving {
    transition: none;
  }
  .hero-swarm-bg {
    display: none;
  }
}

/* ─── Mobile / tablet ─── */
@media (max-width: 720px) {
  .hero-v2 {
    min-height: auto;
    padding: 64px 0 48px;
  }
  .hero-rotator {
    font-size: clamp(30px, 8.5vw, 44px);
    line-height: 1.04;
    letter-spacing: -0.025em;
    min-height: 5.5em;
  }
  .hero-v2 .hero-sub {
    font-size: 16px;
    line-height: 1.5;
  }
  .hero-swarm-bg {
    opacity: 0.14;
  }
}

@media (max-width: 420px) {
  .hero-rotator {
    font-size: clamp(24px, 7.8vw, 34px);
    min-height: 6.5em;
  }
}

/* ─── Nav на узком экране: меньше padding, чтобы CTA помещался ─── */
@media (max-width: 480px) {
  .nav .btn {
    padding: 9px 12px;
    font-size: 13px;
  }
  .nav .nav-cta {
    gap: 6px;
  }
  .nav .brand {
    font-size: 16px;
  }
}

@media (max-width: 380px) {
  .nav .nav-cta .btn-primary .arrow {
    display: none;
  }
}
