/**
 * hero.css
 * БЭМ-блок: hero
 * Главный баннер на лендинге
 */

/* ===========================
   Block: hero
   =========================== */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  padding: var(--spacing-2xl) var(--spacing-md);
  text-align: center;
  overflow: hidden;

  /* Background image settings */
  /* Fallback: загружаем основное изображение сразу если JS не сработает */
  background-color: #f5f5f5;
  background-image: var(--hero-bg-image);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: scroll;
}

/* Overlay for hero background */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--hero-overlay-color);
  pointer-events: none;
  z-index: 0;
}

/* Modifier: loaded state (full image loaded) */
.hero--loaded {
  background-image: var(--hero-bg-image);
  transition: background-image 0.3s ease-in-out;
}

.hero_dark {
  background-color: var(--color-primary);
  color: var(--color-bg);
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

.hero__container {
  position: relative;
  z-index: 1;
}

/* ===========================
   Element: title
   =========================== */

.hero__title {
  margin-bottom: var(--spacing-md);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-primary);
}

.hero_dark .hero__title {
  color: var(--color-bg);
}

.hero__title-accent {
  color: var(--color-accent);
}

/* ===========================
   Element: subtitle
   =========================== */

.hero__subtitle {
  margin-bottom: var(--spacing-xl);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-muted);
}

.hero_dark .hero__subtitle {
  color: rgba(255, 255, 255, 0.8);
}

/* ===========================
   Element: cta (call to action)
   =========================== */

.hero__cta {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

/* ===========================
   Element: image
   =========================== */

.hero__image {
  position: relative;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
}

.hero__image img {
  width: 100%;
  height: auto;
  display: block;
}

/* ===========================
   Element: features (mini feature list)
   =========================== */

.hero__features {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-xl);
  text-align: left;
}

.hero__feature {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.hero_dark .hero__feature {
  color: rgba(255, 255, 255, 0.7);
}

.hero__feature-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--color-success);
  fill: currentColor;
}

/* ===========================
   Element: scroll indicator
   =========================== */

.hero__scroll {
  position: absolute;
  bottom: var(--spacing-xl);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--color-text-muted);
  animation: bounce 2s infinite;
}

.hero_dark .hero__scroll {
  color: rgba(255, 255, 255, 0.5);
}

.hero__scroll-text {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hero__scroll-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* ===========================
   Element: background decoration
   =========================== */

.hero__decoration {
  position: absolute;
  pointer-events: none;
  opacity: 0.1;
}

.hero__decoration_top {
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: var(--color-accent);
  border-radius: 50%;
}

.hero__decoration_bottom {
  bottom: -100px;
  left: -100px;
  width: 300px;
  height: 300px;
  background: var(--color-primary);
  border-radius: 50%;
}

.hero_dark .hero__decoration_bottom {
  background: var(--color-accent);
}

/* ===========================
   Media Queries
   =========================== */

/* Small devices (480px and up) */
@media (min-width: 480px) {
  .hero__title {
    font-size: var(--font-size-3xl);
  }

  .hero__subtitle {
    font-size: var(--font-size-lg);
  }

  .hero__cta {
    flex-direction: row;
    justify-content: center;
  }

  .hero__features {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-lg);
  }

  .hero__image {
    max-width: 320px;
  }
}

/* Medium devices (768px and up) */
@media (min-width: 768px) {
  .hero {
    min-height: calc(100vh - 70px);
    padding: var(--spacing-3xl) var(--spacing-xl);
  }

  .hero__inner {
    max-width: 720px;
  }

  .hero__title {
    margin-bottom: var(--spacing-lg);
  }

  .hero__subtitle {
    margin-bottom: var(--spacing-2xl);
  }

  .hero__image {
    max-width: 400px;
  }

  .hero__decoration_top {
    width: 300px;
    height: 300px;
  }

  .hero__decoration_bottom {
    width: 400px;
    height: 400px;
  }
}

/* Large devices (1024px and up) */
@media (min-width: 1024px) {
  .hero {
    flex-direction: row;
    text-align: left;
    padding: var(--spacing-3xl);
  }

  .hero__inner {
    flex: 1;
    max-width: 560px;
    margin-right: var(--spacing-2xl);
  }

  .hero__cta {
    justify-content: flex-start;
  }

  .hero__features {
    justify-content: flex-start;
  }

  .hero__image {
    flex: 1;
    max-width: 480px;
    margin: 0;
  }

  .hero__scroll {
    left: var(--spacing-xl);
    transform: translateX(0);
  }

  @keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
      transform: translateX(0) translateY(0);
    }
    40% {
      transform: translateX(0) translateY(-10px);
    }
    60% {
      transform: translateX(0) translateY(-5px);
    }
  }
}

/* Extra large devices (1280px and up) */
@media (min-width: 1280px) {
  .hero__inner {
    max-width: 640px;
  }

  .hero__title {
    font-size: 3rem;
  }

  .hero__image {
    max-width: 560px;
  }
}
