/* ══════════════════════════════════════════
   HERO CAROUSEL
   ══════════════════════════════════════════ */

#hero {
  position: relative;
  overflow: hidden;
  height: min(90vh, 820px);
  background: var(--em-deep);
}

/* ─── Slides ────────────────────────────── */
.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.85s cubic-bezier(0.65,0,0.35,1);
  will-change: transform;
  touch-action: pan-y pinch-zoom;
}

.carousel-slide {
  flex: 0 0 100%;
  position: relative;
  overflow: hidden;
}

.carousel-slide__bg {
  position: absolute;
  inset: 0;
}

.carousel-slide__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  transform: scale(1.0);
  transition: transform 8s ease;
}

/* Inactive slides are slightly zoomed-in so they animate outward when activated */
.carousel-slide:not(.active) .carousel-slide__bg img {
  transform: scale(1.06);
}

/* Overlay */
.carousel-slide__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    rgba(10,36,22,0.82) 0%,
    rgba(10,36,22,0.55) 45%,
    rgba(10,36,22,0.15) 100%
  );
}

/* Content */
.carousel-slide__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 80px;
  max-width: 760px;
}

.slide-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease 0.05s;
}

.slide-tag::before {
  content: '';
  width: 28px;
  height: 1.5px;
  background: var(--gold);
  display: block;
}

.slide-title {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 600;
  color: var(--white);
  line-height: 1.02;
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease 0.1s;
}

.slide-title em {
  color: #4ade80;
  font-style: italic;
}

.slide-desc {
  font-size: 16px;
  color: rgba(255,255,255,0.65);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 480px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease 0.2s;
}

.slide-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease 0.3s;
}

/* Animate in active slide */
.carousel-slide.active .slide-tag,
.carousel-slide.active .slide-title,
.carousel-slide.active .slide-desc,
.carousel-slide.active .slide-actions {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Navigation Arrows ─────────────────── */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  color: var(--white);
  transition: all var(--t);
  backdrop-filter: blur(8px);
}

.carousel-arrow:hover {
  background: var(--em);
  border-color: var(--em);
  transform: translateY(-50%) scale(1.08);
}

#carousel-prev { left: 24px; }
#carousel-next { right: 24px; }

.carousel-arrow svg {
  width: 22px;
  height: 22px;
}

/* ─── Dots ──────────────────────────────── */
.carousel-dots {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

/*
 * Composited dot animation — avoids the "non-composited animation" Lighthouse warning.
 * All dots are 28px wide (the active size); inactive ones are scaled down to 6/28 ≈ 0.214
 * so the width transition never runs — only GPU-composited transform & opacity change.
 */
.carousel-dot {
  width: 28px;
  height: 6px;
  border-radius: 100px;
  background: rgba(255,255,255,0.35);
  cursor: pointer;
  border: none;
  padding: 0;
  transform: scaleX(0.214);
  transform-origin: center;
  transition: transform 0.35s ease, background 0.35s ease, opacity 0.35s ease;
  will-change: transform;
}

.carousel-dot.active {
  transform: scaleX(1);
  background: var(--white);
}

/* ─── Slide Counter ─────────────────────── */
.carousel-counter {
  position: absolute;
  bottom: 24px;
  right: 32px;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 1px;
  z-index: 10;
}

.carousel-counter .current { color: var(--white); font-size: 18px; font-family: var(--font-serif); }

/* ─── Side Image Split (optional 2-image) ─ */
.hero-split {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 38%;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  overflow: hidden;
}

.hero-split__img {
  overflow: hidden;
}

.hero-split__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}

.hero-split__img:hover img { transform: scale(1.05); }

/* ─── Responsive ────────────────────────── */
@media (max-width: 1024px) {
  #hero { height: 80vh; }
  .carousel-slide__content { padding: 0 48px; }
  .hero-split { display: none; }
}

@media (max-width: 640px) {
  #hero { height: 92svh; min-height: 540px; max-height: 800px; }

  /* Keep image subjects in the upper area, away from the bottom text band */
  .carousel-slide__bg img {
    object-position: center 22%;
  }

  /* Heavy bottom-to-top gradient guarantees white text readability */
  .carousel-slide__overlay {
    background: linear-gradient(
      to top,
      rgba(10,36,22,0.98) 0%,
      rgba(10,36,22,0.92) 22%,
      rgba(10,36,22,0.55) 52%,
      rgba(10,36,22,0.05) 100%
    );
  }

  /* Content anchored to the bottom-left */
  .carousel-slide__content {
    position: absolute;
    inset: auto 0 0 0;
    padding: 64px 28px 80px;
    max-width: 100%;
    justify-content: flex-end;
    align-items: flex-start;
    text-align: left;
  }

  .slide-tag {
    display: none !important;
    font-size: 10px;
    letter-spacing: 4px;
    margin-bottom: 14px;
    justify-content: flex-start;
    gap: 8px;
  }
  .slide-tag::before { width: 22px; height: 1.5px; }

  .slide-title {
    font-size: clamp(2.4rem, 10vw, 3rem);
    margin-bottom: 14px;
    line-height: 1.05;
  }

  .slide-desc {
    font-size: 14.5px;
    line-height: 1.6;
    margin-bottom: 26px;
    max-width: 100%;
    padding: 0;
    color: rgba(255,255,255,0.72);
  }

  /* Stack buttons full-width for easy tapping */
  .slide-actions {
    flex-direction: column;
    gap: 12px;
    width: 100%;
    align-items: stretch;
  }
  /* Show only primary button on mobile */
  .slide-actions .btn-ghost {
    display: none !important;
  }
  .slide-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 14px 24px;
    font-size: 13px;
    min-height: 48px;
    border-radius: 8px;
    letter-spacing: 0.6px;
  }

  .carousel-arrow { width: 38px; height: 38px; }
  #carousel-prev { left: 8px; }
  #carousel-next { right: 8px; }

  .carousel-counter { display: none; }

  .carousel-dots {
    bottom: 20px;
  }
  /* Mobile: active dot is 24px wide; inactive = 7/24 ≈ 0.292 */
  .carousel-dot {
    width: 24px;
    height: 7px;
    transform: scaleX(0.292);
  }
  .carousel-dot.active {
    transform: scaleX(1);
  }
}

/* Extra-tight screens */
@media (max-width: 380px) {
  .carousel-slide__content {
    padding: 52px 22px 68px;
  }
  .slide-title {
    font-size: 2.1rem;
  }
  .slide-desc {
    font-size: 13.5px;
    padding: 0;
  }
  .slide-actions .btn {
    padding: 13px 22px;
    min-height: 46px;
  }
}

/* Hide arrows - autoplay only */
.carousel-arrow { display: none !important; }
