/* ============================================================
   EMECSA — Hero Sequence Styles
   ============================================================ */

/* ---- Wrapper: provides the scroll runway for the sticky hero ---- */
#heroSequenceWrapper {
  position: relative;
  height: 520vh; /* 100vh sticky stage + 420vh scroll room */
}

/* ---- Sticky stage ---- */
#hero {
  position: absolute;
  top: 0;
  left: 0;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  background: var(--navy); /* fallback while frame 0 loads */
  z-index: 10;
}

#hero.hero-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
}

#hero.hero-complete {
  position: absolute;
  top: auto;
  bottom: 0;
  left: 0;
}

/* ---- Sequence canvas ---- */
#seqCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

/* ---- Subtle radial vignette — helps initial text readability ---- */
.hero-seq-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 58% 50% at 50% 50%,
      rgba(255, 255, 255, 0.82) 0%,
      rgba(255, 255, 255, 0.58) 35%,
      rgba(255, 255, 255, 0.18) 68%,
      transparent 82%
    ),
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.08),
      rgba(255, 255, 255, 0.24)
    );
  z-index: 1;
  pointer-events: none;
}

/* ---- Hero initial content (logo / headline / CTAs) ---- */
#heroContent {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.8rem;
  padding: 6rem 1.5rem 2rem;
  text-align: center;
  will-change: opacity, transform;
  transition: none; /* rAF handles all motion */
}

#heroContent::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 51%;
  z-index: 0;
  width: min(900px, 92vw);
  height: min(480px, 64vh);
  border-radius: 999px;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.88) 0%,
    rgba(255, 255, 255, 0.68) 44%,
    rgba(255, 255, 255, 0) 74%
  );
  transform: translate(-50%, -50%);
  pointer-events: none;
}

#heroContent > * {
  position: relative;
  z-index: 1;
}

.hero-offer-title {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: min(92vw, 1200px);
  text-align: center;
  font-size: 9rem;
  font-weight: 900;
  line-height: 0.9;
  color: rgba(13, 31, 60, 0.9);
  letter-spacing: 0;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.72);
  text-shadow: 0 18px 55px rgba(255, 255, 255, 0.46);
  will-change: opacity, transform;
}

/* ============================================================
   SERVICE CARDS (overlaid on canvas)
   ============================================================ */
.hsvc-review-grid {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.hsvc-card {
  position: absolute;
  width: clamp(300px, 30vw, 420px);
  opacity: 0;
  will-change: opacity, transform;
  pointer-events: none;

  /* Card visual */
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-radius: 16px;
  padding: 2rem 2.25rem 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 24px 64px -12px rgba(13, 31, 60, 0.22),
    0 4px 14px -4px rgba(0, 0, 0, 0.08);
}

#hsvc-0 {
  right: clamp(1.5rem, 5vw, 5.5rem);
  bottom: clamp(2.5rem, 8vh, 6rem);
}

#hsvc-1 {
  left: clamp(1.5rem, 5vw, 5.5rem);
  top: clamp(6.5rem, 15vh, 9.5rem);
}

#hsvc-2 {
  right: clamp(1.5rem, 6vw, 7rem);
  top: clamp(7rem, 17vh, 10.5rem);
}

#hsvc-3 {
  left: clamp(1.5rem, 7vw, 8rem);
  bottom: clamp(2.5rem, 9vh, 6.5rem);
}

#hero.services-review .hsvc-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(270px, 420px));
  gap: clamp(0.85rem, 1.4vw, 1.25rem);
  align-content: center;
  justify-content: center;
  padding: 5.75rem clamp(1.25rem, 4vw, 4rem) 4rem;
  overflow-y: auto;
  pointer-events: auto;
}

#hero.services-review .hsvc-card {
  position: relative;
  inset: auto;
  width: 100%;
  max-width: 420px;
  min-height: 0;
  padding: 1.45rem 1.55rem 1.3rem;
}

/* Green accent top bar */
.hsvc-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--green-light));
  border-radius: 16px 16px 0 0;
}

.hsvc-number {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 1.1rem;
}

.hsvc-number::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--green-dim);
}

.hsvc-icon {
  width: 48px;
  height: 48px;
  background: var(--green-dim);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.2rem;
}

.hsvc-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--green);
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.hsvc-title {
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
  letter-spacing: 0;
  margin-bottom: 0.6rem;
}

.hsvc-desc {
  font-size: 0.87rem;
  color: var(--gray-600);
  line-height: 1.65;
}

.hsvc-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.2rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
  letter-spacing: 0;
}

.hsvc-link svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 0.2s;
}

.hsvc-link:hover svg { transform: translateX(4px); }

/* ============================================================
   SEQUENCE UI — progress bar
   ============================================================ */

/* Thin progress bar at the very bottom of the canvas */
.seq-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(0, 0, 0, 0.06);
  z-index: 5;
  pointer-events: none;
}

.seq-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--green-light));
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .hsvc-card {
    width: min(360px, calc(100vw - 3rem));
    padding: 1.6rem 1.65rem 1.35rem;
  }

  #hsvc-0,
  #hsvc-2 {
    right: 1.5rem;
  }

  #hsvc-1,
  #hsvc-3 {
    left: 1.5rem;
  }

  #hsvc-1,
  #hsvc-2 {
    top: 6.25rem;
  }

  #hsvc-0,
  #hsvc-3 {
    bottom: 5.25rem;
  }
}

@media (max-width: 768px) {
  #heroSequenceWrapper {
    height: 620vh; /* extra room on mobile for smoother touch scrolling */
  }

  .hsvc-card {
    left: 1rem;
    right: 1rem;
    width: auto;
    max-height: min(56vh, 390px);
    overflow-y: auto;
    padding: 1.5rem 1.5rem 1.25rem;
  }

  #hero.services-review .hsvc-review-grid {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    justify-content: stretch;
    gap: 0.85rem;
    padding: 5.4rem 1rem 4.5rem;
  }

  #hero.services-review .hsvc-card {
    width: 100%;
    max-width: none;
    max-height: none;
    overflow: visible;
    padding: 1.15rem 1.2rem 1rem;
  }

  #hsvc-0,
  #hsvc-2 {
    top: auto;
    bottom: 4.75rem;
  }

  #hsvc-1,
  #hsvc-3 {
    top: 5.75rem;
    bottom: auto;
  }

  #heroContent { padding: 5rem 1.5rem 2rem; }

  .hero-offer-title {
    font-size: 5.4rem;
    top: 48%;
  }
}

@media (max-width: 480px) {
  .hsvc-card {
    left: 0.85rem;
    right: 0.85rem;
    padding: 1.25rem;
  }

  .hsvc-title { font-size: 1.1rem; }
  .hsvc-desc  { font-size: 0.82rem; }

  #hero.services-review .hsvc-review-grid {
    padding: 5rem 0.85rem 4.25rem;
    gap: 0.75rem;
  }

  #hero.services-review .hsvc-card {
    padding: 1rem;
  }

  .hero-offer-title {
    font-size: 3.25rem;
  }
}
