/* Красные кеды · hero «красная крышка коробки» + бегущая строка
   Красный — это CSS-фон секции (--red), WebGL рисует поверх прозрачным холстом.
   Текст виден всегда: интро только сдвигает строки, без opacity. */

/* ---------- Секция ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
  display: flex;
  flex-direction: column;
  padding-top: calc(var(--header-h) + clamp(20px, 4.2vw, 64px));
  padding-bottom: clamp(18px, 2.4vw, 32px);
}

/* Холст на всю секцию, композиция смещается в .hero__stage средствами камеры */
.hero__scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero__canvas { width: 100%; height: 100%; }

.hero__inner {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  /* телефон и планшет: цифры доверия сразу под CTA, 3D-сцена закрывает hero над бегущей строкой */
  grid-template-areas: "content" "stats" "stage";
  align-content: start;
}

/* ---------- Текст ---------- */
.hero__content { grid-area: content; min-width: 0; }

/* мелкий текст на красном — цветом «Наконечника» (контраст) */
.hero__kicker {
  color: var(--s-accent);
  max-width: 44ch;
  margin-bottom: clamp(18px, 2.2vw, 28px);
}

.hero__title {
  /* Unbounded широкий: «потрогать» ≈ 7.4em — по нему считаем кегль, строк пять */
  font-size: clamp(2.375rem, 11.4vw, 3.75rem);
  line-height: .95;
  letter-spacing: -0.03em;
  text-wrap: initial;
}
/* строка-маска: внутренняя часть поднимается снизу */
.hero__line {
  display: block;
  overflow: hidden;
  padding: .06em .04em .1em 0;
  margin: -.06em -.04em -.1em 0;
}
.hero__line-in { display: inline-block; }
.hero__line--accent { color: var(--s-accent); }

.hero__lead {
  margin-top: clamp(20px, 2.4vw, 32px);
  max-width: 34rem;
  font-size: clamp(1.1875rem, 1.32vw, 1.3125rem);
  font-weight: 600;
  line-height: 1.45;
  color: var(--s-fg);
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(24px, 2.8vw, 36px);
}
/* белый текст на красном — не мельче 18 px полужирного (SPEC §5) */
.hero__more { font-size: 1.125rem; }
@media (min-width: 600px) { .hero__cta { font-size: 1.125rem; } }
.hero__note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  color: var(--s-accent);
}
.hero__nowrap { white-space: nowrap; }
.hero__note::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- Сцена (место для 3D) ---------- */
.hero__stage {
  grid-area: stage;
  position: relative;
  height: clamp(280px, 86vw, 380px);
  margin-top: clamp(14px, 3.6vw, 24px);
  border-radius: var(--r-m);
  overflow: hidden;
}
.hero__hint {
  position: absolute;
  right: 0;
  bottom: 6px;
  display: none;
  align-items: center;
  gap: 10px;
  color: var(--s-accent);
}
.hero--live .hero__hint { display: inline-flex; }
.hero__hint-dot {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid currentColor;
}
.hero__hint-dot::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  animation: hero-ping 2.4s var(--ease-out) infinite;
}

/* Запасной вид без WebGL / без JS: фирменный паттерн в окне сцены, текст на чистом красном */
.hero--static .hero__scene { display: none; }
.hero--static .hero__stage::before,
html:not(.js) .hero__stage::before {
  content: "";
  position: absolute;
  top: -500px;
  left: -500px;
  right: 0;
  bottom: 0;
  background: url("../img/brand/pattern-red.webp") 0 0 / 500px 500px repeat;
  animation: hero-drift 60s linear infinite;
}

/* ---------- Цифры ---------- */
.hero__stats {
  grid-area: stats;
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-top: clamp(24px, 6vw, 40px);
  border-top: 1px solid var(--s-line);
}
.hero__stat {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 4px 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--s-line);
  min-width: 0;
}
.hero__stat:last-child { border-bottom: 0; padding-bottom: 4px; }
.hero__stat-value {
  display: flex;
  align-items: baseline;
  gap: .22em;
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(1.75rem, 3.1vw, 3rem);
  line-height: 1;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.hero__stat-unit {
  font-size: max(.5em, 1.125rem);
  font-weight: 700;
  letter-spacing: 0;
}
.hero__stat-label {
  justify-self: end;
  text-align: right;
  font-size: var(--fs-small);
  font-weight: 500;
  line-height: 1.35;
  color: var(--s-accent);
}

/* ---------- Планшет ---------- */
@media (min-width: 600px) {
  .hero__title { font-size: clamp(3.5rem, 8.6vw, 5rem); }
  .hero__stage { height: clamp(340px, 54vw, 480px); }
  .hero__stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero__stat {
    grid-template-columns: minmax(0, 1fr);
    padding: 18px clamp(14px, 2vw, 28px) 2px;
    border-bottom: 0;
    border-left: 1px solid var(--s-line);
  }
  .hero__stat:first-child { border-left: 0; padding-left: 0; }
  .hero__stat:last-child { padding-bottom: 2px; }
  .hero__stat-label { justify-self: start; text-align: left; }
}

/* ---------- Десктоп: текст слева, сцена справа и «за» ним ---------- */
@media (min-width: 1024px) {
  .hero {
    min-height: min(100svh, 880px);
    padding-top: calc(var(--header-h) + clamp(16px, 2.4vw, 40px));
  }
  .hero__kicker { max-width: none; margin-bottom: clamp(16px, 1.6vw, 24px); }
  .hero__inner {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas: "content stage" "stats stats";
    column-gap: clamp(20px, 2.5vw, 40px);
  }
  .hero__content { align-self: center; padding-block: 8px; }
  .hero__title { font-size: clamp(3rem, min(5.2vw, 7.4svh), 4.6rem); }
  .hero__stage {
    height: auto;
    min-height: 380px;
    margin: 0;
    align-self: stretch;
    /* окно сцены уходит под правый край экрана */
    margin-right: calc(-1 * max(var(--gutter), (100vw - var(--wrap)) / 2 + var(--gutter)));
    border-radius: var(--r-m) 0 0 var(--r-m);
  }
  .hero__hint { right: max(var(--gutter), (100vw - var(--wrap)) / 2 + var(--gutter)); bottom: 10px; }
  .hero__lead { margin-top: clamp(18px, 1.8vw, 26px); }
  .hero__actions { margin-top: clamp(22px, 2.2vw, 30px); }
  .hero__stats { margin-top: clamp(18px, 2vw, 28px); }
  .hero__stat { padding-top: 16px; }
}

/* ---------- Интро текста: строки поднимаются из-под маски ---------- */
@keyframes hero-rise { from { transform: translateY(108%); } to { transform: none; } }
@keyframes hero-up { from { transform: translateY(28px); } to { transform: none; } }
@keyframes hero-ping { 0% { transform: scale(.4); opacity: .9; } 80%, 100% { transform: scale(1.5); opacity: 0; } }
@keyframes hero-drift { to { transform: translate(500px, 500px); } }

@media (prefers-reduced-motion: no-preference) {
  .hero__line-in { animation: hero-rise .95s var(--ease-out) both; }
  .hero__line:nth-child(1) .hero__line-in { animation-delay: .3s; }
  .hero__line:nth-child(2) .hero__line-in { animation-delay: .37s; }
  .hero__line:nth-child(3) .hero__line-in { animation-delay: .44s; }
  .hero__line:nth-child(4) .hero__line-in { animation-delay: .51s; }
  .hero__line:nth-child(5) .hero__line-in { animation-delay: .58s; }
  .hero__kicker { animation: hero-up .9s var(--ease-out) .22s both; }
  .hero__lead { animation: hero-up .9s var(--ease-out) .66s both; }
  .hero__actions { animation: hero-up .9s var(--ease-out) .74s both; }
  .hero__note { animation: hero-up .9s var(--ease-out) .8s both; }
  .hero__stats { animation: hero-up 1s var(--ease-out) .86s both; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__line-in, .hero__kicker, .hero__lead, .hero__actions, .hero__note, .hero__stats,
  .hero__hint-dot::after, .hero__stage::before { animation: none !important; }
}

/* ---------- Бегущая строка ---------- */
.hero-ticker {
  --hero-ticker-dur: 58s; /* 10 направлений вместо 8: прежняя скорость строки */
  position: relative;
  overflow: hidden;
  border-block: 1px solid var(--s-line);
  padding-block: clamp(14px, 1.8vw, 22px);
  user-select: none;
}
.hero-ticker__track {
  display: flex;
  width: max-content;
  will-change: transform;
}
.hero-ticker__list {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex: none;
  min-width: 100vw;
}
.hero-ticker__item {
  display: inline-flex;
  align-items: center;
  gap: clamp(18px, 2.2vw, 32px);
  padding-right: clamp(18px, 2.2vw, 32px);
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1rem, 1.9vw, 1.625rem);
  line-height: 1.1;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--s-fg);
}
.hero-ticker__star {
  flex: none;
  width: .78em;
  height: .78em;
  fill: var(--s-accent);
}
@keyframes hero-ticker-run { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: no-preference) {
  .hero-ticker__track { animation: hero-ticker-run var(--hero-ticker-dur) linear infinite; }
  .hero-ticker.is-paused .hero-ticker__track { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-ticker__track { animation: none !important; transform: none; }
}
@media (max-width: 599px) {
  .hero-ticker { --hero-ticker-dur: 42s; }
}
