/* ==========================================================================
   Герой-экран: полноэкранная видео-панорама
   ========================================================================== */

.hero {
  position: relative;
  margin-top: calc(-1 * var(--nav-height));
  min-height: 640px;
  height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: #fff;
  background: #0a0a0a;
}

/* Медиа-слой */
.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  /* LQIP подставляется инлайн-стилем в шаблоне */
  background-size: cover;
  background-position: center;
}

/* Резкий постер (webp с jpg-фолбэком) */
.hero__poster {
  position: absolute;
  inset: 0;
  background-image: image-set(
    url("../img/hero-poster.63cb57cbc97f.webp") type("image/webp"),
    url("../img/hero-poster.1a37ac807979.jpg") type("image/jpeg")
  );
  background-size: cover;
  background-position: center;
}

.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s var(--ease-fade);
}
.hero__video.is-playing {
  opacity: 1;
}

/* Затемнение для читаемости навбара и текста */
.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.45) 0,
      rgba(0, 0, 0, 0) 22%,
      rgba(0, 0, 0, 0) 45%,
      rgba(0, 0, 0, 0.65) 100%
    );
}

.hero__content {
  position: relative;
  z-index: 2;
  width: var(--grid-width);
  margin-inline: auto;
  padding-bottom: clamp(var(--space-l), 8vh, var(--space-xxl));
  padding-top: calc(var(--nav-height) + var(--space-l));
}

/* Текстовый блок с еле заметной мягкой тенью для читаемости на светлых кадрах */
.hero__text {
  position: relative;
  max-width: 62ch;
}
.hero__text::before {
  content: "";
  position: absolute;
  inset: -8% -12%;
  z-index: -1;
  background: radial-gradient(
    ellipse at 30% 50%,
    rgba(0, 0, 0, 0.28) 0%,
    rgba(0, 0, 0, 0.16) 40%,
    rgba(0, 0, 0, 0) 72%
  );
  filter: blur(22px);
  pointer-events: none;
}

.hero__title {
  color: #fff;
  max-width: 26ch;
  font-size: clamp(1.6rem, 1.15rem + 1.8vw, 2.6rem);
  font-weight: 500;
  line-height: 1.15;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.22);
}

.hero__lead {
  margin-top: var(--space-s);
  max-width: 52ch;
  font-size: clamp(0.95rem, 0.9rem + 0.35vw, 1.1rem);
  color: rgba(255, 255, 255, 0.88);
  font-weight: 400;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.2);
}

.hero__actions {
  margin-top: clamp(var(--space-m), 4vh, var(--space-l));
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

/* Мягкий вход контента героя */
.hero__title,
.hero__lead,
.hero__actions {
  animation: hero-in 0.9s var(--ease-move) both;
}
.hero__lead {
  animation-delay: 0.12s;
}
.hero__actions {
  animation-delay: 0.24s;
}
@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Индикатор прокрутки */
.hero__scroll {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: var(--space-m);
  transform: translateX(-50%);
  width: 26px;
  height: 40px;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  display: flex;
  justify-content: center;
  padding-top: 7px;
}
.hero__scroll::before {
  content: "";
  width: 3px;
  height: 8px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.8);
  animation: hero-scroll 1.8s var(--ease-move) infinite;
}
@keyframes hero-scroll {
  0% { transform: translateY(0); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(12px); opacity: 0; }
}

@media (max-width: 600px) {
  .hero__scroll { display: none; }
}

/* Кнопки героя на всю ширину на узких экранах */
@media (max-width: 480px) {
  .hero__actions {
    width: 100%;
    gap: var(--space-xxs);
  }
  .hero__actions .btn {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__video { transition: none; }
  .hero__scroll::before { animation: none; }
  .hero__title,
  .hero__lead,
  .hero__actions { animation: none; }
}
