/* ============================================
   GHRC Website - Hero Section
   ============================================ */

.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

/* ── Background Photo Carousel ── */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: var(--z-behind);
}

.hero__bg-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  will-change: opacity, transform;
}

.hero__bg-slide.active {
  opacity: 1;
}

.hero__bg-slide:nth-child(1).active { animation: ken-burns-1 12s ease-in-out forwards; }
.hero__bg-slide:nth-child(2).active { animation: ken-burns-2 12s ease-in-out forwards; }
.hero__bg-slide:nth-child(3).active { animation: ken-burns-3 12s ease-in-out forwards; }
.hero__bg-slide:nth-child(4).active { animation: ken-burns-1 12s ease-in-out forwards; }
.hero__bg-slide:nth-child(5).active { animation: ken-burns-2 12s ease-in-out forwards; }
.hero__bg-slide:nth-child(6).active { animation: ken-burns-3 12s ease-in-out forwards; }
.hero__bg-slide:nth-child(7).active { animation: ken-burns-1 12s ease-in-out forwards; }

/* ── Overlay ── */
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0.4) 40%,
    rgba(29, 185, 84, 0.15) 100%
  );
  z-index: var(--z-base);
}

/* ── Runner Scene (icons + banners along bottom) ── */
.hero__silhouettes {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 180px;
  z-index: var(--z-above);
  pointer-events: none;
  overflow: hidden;
}

/* ── Start/Finish Banners ── */
.hero__banner {
  position: absolute;
  bottom: 12px;
  color: var(--color-primary);
  opacity: 0.22;
}

.hero__banner--start {
  left: 3%;
  width: 100px;
  height: 84px;
  animation: banner-sway 6s ease-in-out infinite;
}

.hero__banner--finish {
  right: 3%;
  width: 100px;
  height: 84px;
  animation: banner-sway 6s ease-in-out infinite;
  animation-delay: -3s;
}

/* Banner sway - gentle wind effect */
@keyframes banner-sway {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(0.8deg); }
  75% { transform: rotate(-0.6deg); }
}

/* ── Runner Figures (flat icon style) ── */
.hero__runner {
  position: absolute;
  bottom: 12px;
  color: var(--color-primary);
  opacity: 0.18;
  will-change: transform, opacity;
}

/* Runner 1 - Male sprinter (front of the pack, biggest) */
.hero__runner--1 {
  left: 50%;
  width: 72px;
  height: 90px;
  opacity: 0.22;
  animation: runner-bob-1 3s ease-in-out infinite;
}

/* Runner 2 - Female jogger (slightly behind, left) */
.hero__runner--2 {
  left: 36%;
  width: 58px;
  height: 82px;
  opacity: 0.18;
  animation: runner-bob-2 3.4s ease-in-out infinite;
  animation-delay: -0.5s;
}

/* Runner 3 - Male racer (right side) */
.hero__runner--3 {
  right: 22%;
  width: 64px;
  height: 85px;
  opacity: 0.2;
  animation: runner-bob-1 2.8s ease-in-out infinite;
  animation-delay: -1.2s;
}

/* Runner 4 - Female runner (left of center) */
.hero__runner--4 {
  left: 22%;
  width: 55px;
  height: 78px;
  opacity: 0.15;
  animation: runner-bob-2 3.6s ease-in-out infinite;
  animation-delay: -2s;
}

/* Runner 5 - Small distant runner (far back, smaller for depth) */
.hero__runner--5 {
  right: 36%;
  bottom: 16px;
  width: 38px;
  height: 54px;
  opacity: 0.1;
  animation: runner-bob-1 4s ease-in-out infinite;
  animation-delay: -3s;
}

/* Subtle bobbing - simulates the natural up/down of running */
@keyframes runner-bob-1 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes runner-bob-2 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* Speed lines on runner 1 pulse gently */
.hero__speed-line {
  animation: speed-line-pulse 2s ease-in-out infinite;
}

.hero__speed-line:nth-child(1) { animation-delay: 0s; }
.hero__speed-line:nth-child(2) { animation-delay: 0.3s; }
.hero__speed-line:nth-child(3) { animation-delay: 0.6s; }

@keyframes speed-line-pulse {
  0%, 100% { opacity: 0.15; transform: scaleX(1); }
  50% { opacity: 0.5; transform: scaleX(1.3) translateX(-3px); }
}

/* ── Road/Ground Line ── */
.hero__road-line {
  position: absolute;
  bottom: 10px;
  left: 2%;
  right: 2%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(29, 185, 84, 0.12) 10%,
    rgba(29, 185, 84, 0.2) 50%,
    rgba(29, 185, 84, 0.12) 90%,
    transparent 100%
  );
}

/* Road dashes */
.hero__road-line::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 15%;
  right: 15%;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 20px,
    rgba(29, 185, 84, 0.1) 20px,
    rgba(29, 185, 84, 0.1) 40px
  );
}

/* ── Content ── */
.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 var(--space-6);
  max-width: 900px;
}

/* ── Animated SVG Logo ── */
.hero__logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-8);
}

.hero__logo {
  width: 160px;
  height: auto;
  border-radius: 12px;
  filter: drop-shadow(0 0 30px rgba(29, 185, 84, 0.3));
}

.hero__logo .logo-outline {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 2;
  stroke-dasharray: 800;
  stroke-dashoffset: 800;
  animation: svg-draw 2s var(--ease-out) 0.5s forwards;
}

.hero__logo .logo-fill {
  opacity: 0;
  animation: logo-fill-in 0.8s var(--ease-out) 2s forwards;
}

@keyframes logo-fill-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Title & Subtitle ── */
.hero__title {
  font-size: var(--text-6xl);
  font-weight: var(--font-black);
  color: var(--color-white);
  margin-bottom: var(--space-4);
  line-height: var(--leading-tight);
  opacity: 0;
  transform: translateY(30px);
  animation: hero-text-in 0.8s var(--ease-out) 1s forwards;
}

.hero__title .highlight {
  color: var(--color-primary);
  text-shadow: 0 0 30px var(--color-primary-glow);
}

.hero__subtitle {
  font-size: var(--text-xl);
  color: rgba(255, 255, 255, 0.8);
  font-weight: var(--font-normal);
  margin-bottom: var(--space-10);
  opacity: 0;
  transform: translateY(20px);
  animation: hero-text-in 0.8s var(--ease-out) 1.4s forwards;
}

.hero__cta {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(20px);
  animation: hero-text-in 0.8s var(--ease-out) 1.8s forwards;
}

@keyframes hero-text-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Scroll Down Indicator ── */
.hero__scroll {
  position: absolute;
  bottom: var(--space-6);
  right: 14%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0;
  animation: hero-text-in 0.8s var(--ease-out) 2.5s forwards;
}

.hero__scroll-icon {
  width: 24px;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  position: relative;
}

.hero__scroll-icon::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  animation: scroll-indicator 1.5s ease-in-out infinite;
}

/* ── Particle/Dot Background ── */
.hero__particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.hero__particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--color-primary);
  border-radius: 50%;
  opacity: 0;
  animation: particle-float var(--particle-duration, 6s) var(--particle-delay, 0s) ease-in-out infinite;
}

@keyframes particle-float {
  0% {
    opacity: 0;
    transform: translateY(100vh) scale(0);
  }
  10% {
    opacity: 0.6;
    transform: translateY(80vh) scale(1);
  }
  90% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
    transform: translateY(-10vh) scale(0.5);
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .hero__runner,
  .hero__banner,
  .hero__speed-line {
    animation: none !important;
  }
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .hero__runner--1 { width: 60px; height: 75px; }
  .hero__runner--2 { width: 48px; height: 68px; }
  .hero__runner--3 { width: 54px; height: 72px; }
  .hero__runner--4 { width: 46px; height: 65px; }
  .hero__runner--5 { width: 32px; height: 45px; }
  .hero__banner--start { width: 80px; height: 68px; }
  .hero__banner--finish { width: 80px; height: 68px; }
}

@media (max-width: 768px) {
  .hero__title {
    font-size: var(--text-4xl);
  }

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

  .hero__logo {
    width: 110px;
    height: auto;
  }

  .hero__silhouettes {
    height: 130px;
  }

  .hero__runner--1 { width: 50px; height: 62px; left: 48%; }
  .hero__runner--2 { width: 42px; height: 58px; left: 30%; }
  .hero__runner--3 { width: 46px; height: 60px; right: 18%; }
  .hero__runner--4 { width: 40px; height: 55px; left: 14%; }
  .hero__runner--5 { display: none; }
  .hero__banner--start { width: 65px; height: 55px; left: 1%; }
  .hero__banner--finish { width: 65px; height: 55px; right: 1%; }

  .hero__cta {
    flex-direction: column;
    align-items: center;
  }

  .hero__scroll {
    right: 16%;
  }
}

@media (max-width: 480px) {
  .hero__title {
    font-size: var(--text-3xl);
  }

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

  .hero__silhouettes {
    height: 100px;
  }

  .hero__runner--1 { width: 40px; height: 50px; }
  .hero__runner--2 { width: 34px; height: 46px; }
  .hero__runner--3 { width: 36px; height: 48px; }
  .hero__runner--4 { display: none; }
  .hero__banner--start { width: 50px; height: 42px; }
  .hero__banner--finish { width: 50px; height: 42px; }

  .hero__scroll {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }
}
