/* ==========================================================
   Home Tech Scroll - scrollytelling da transformação Rooted
   ========================================================== */

.home-tech-scroll {
  --home-tech-bg: #0b0e14;
  --home-tech-yellow: #ffd700;
  position: relative;
  width: 100%;
  min-height: clamp(560px, 100svh, 1080px);
  margin: 0;
  padding: 0;
  overflow: clip;
  background: var(--home-tech-bg);
  isolation: isolate;
}

.home-tech-scroll.is-enhanced {
  height: 420vh;
  min-height: 0;
}

.home-tech-scroll.is-enhanced.is-fallback {
  height: auto;
  min-height: clamp(560px, 100svh, 1080px);
}

.home-tech-sticky {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: var(--home-tech-bg);
}

.home-tech-scroll.is-enhanced .home-tech-sticky {
  position: sticky;
  top: 0;
}

.home-tech-scroll.is-enhanced.is-fallback .home-tech-sticky {
  position: relative;
}

.home-tech-poster,
#home-tech-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.home-tech-poster {
  z-index: 0;
  object-fit: contain;
  object-position: center;
  background: var(--home-tech-bg);
}

#home-tech-canvas {
  z-index: 1;
  opacity: 0;
  background: var(--home-tech-bg);
  transition: opacity 320ms ease;
}

.home-tech-scroll.is-canvas-ready #home-tech-canvas {
  opacity: 1;
}

.home-tech-visual-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(11, 14, 20, 0.42) 0%, transparent 24%, transparent 62%, rgba(11, 14, 20, 0.88) 100%),
    radial-gradient(circle at 50% 46%, transparent 38%, rgba(11, 14, 20, 0.34) 100%);
}

.home-tech-visual-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.15;
  background-image:
    linear-gradient(rgba(255, 215, 0, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 8%, #000 35%, #000 72%, transparent 96%);
  mask-image: linear-gradient(to bottom, transparent 8%, #000 35%, #000 72%, transparent 96%);
}

.home-tech-visual-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 140px rgba(0, 0, 0, 0.46);
}

.home-tech-content {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.home-tech-phase {
  position: absolute;
  left: 50%;
  bottom: clamp(74px, 10vh, 120px);
  width: min(900px, calc(100% - 48px));
  padding: 18px 28px 20px;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 22px);
  text-align: center;
  background: linear-gradient(90deg, transparent, rgba(11, 14, 20, 0.74) 18%, rgba(11, 14, 20, 0.74) 82%, transparent);
  transition:
    opacity 460ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 460ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 460ms;
}

.home-tech-phase::before {
  content: '';
  display: block;
  width: 54px;
  height: 2px;
  margin: 0 auto 14px;
  background: var(--home-tech-yellow);
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.5);
}

.home-tech-phase.is-active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.home-tech-phase.is-before {
  transform: translate(-50%, -18px);
}

.home-tech-phase h2,
.home-tech-phase .home-tech-title {
  margin: 0;
  color: #fff;
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(2.15rem, 4.4vw, 4.5rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-wrap: balance;
  text-shadow: 0 3px 24px rgba(0, 0, 0, 0.72);
}

.home-tech-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  height: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.home-tech-progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: var(--home-tech-yellow);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.52);
  will-change: transform;
}

.home-tech-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  padding: 9px 16px;
  border: 1px solid rgba(255, 215, 0, 0.28);
  border-radius: 999px;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -50%);
  color: var(--home-tech-yellow);
  background: rgba(11, 14, 20, 0.82);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 220ms;
}

.home-tech-loader.is-visible {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 991px) {
  .home-tech-scroll.is-enhanced {
    height: 390vh;
  }

  .home-tech-sticky {
    min-height: 620px;
  }

  .home-tech-poster {
    object-fit: contain;
    object-position: center 38%;
  }

  .home-tech-visual-overlay {
    background:
      linear-gradient(180deg, rgba(11, 14, 20, 0.18) 0%, transparent 42%, rgba(11, 14, 20, 0.92) 76%, var(--home-tech-bg) 100%),
      radial-gradient(circle at 50% 38%, transparent 30%, rgba(11, 14, 20, 0.26) 100%);
  }

  .home-tech-visual-overlay::before {
    opacity: 0.1;
    background-size: 44px 44px;
  }

  .home-tech-phase {
    bottom: clamp(42px, 7vh, 72px);
    width: calc(100% - 30px);
    padding: 15px 16px 18px;
    text-align: left;
    background: linear-gradient(90deg, rgba(11, 14, 20, 0.92), rgba(11, 14, 20, 0.62) 82%, transparent);
  }

  .home-tech-phase::before {
    width: 42px;
    margin-right: auto;
    margin-left: 0;
  }

  .home-tech-phase h2,
  .home-tech-phase .home-tech-title {
    font-size: clamp(1.75rem, 7.8vw, 3.3rem);
    line-height: 1.08;
  }
}

@media (max-height: 640px) and (min-width: 768px) {
  .home-tech-sticky {
    min-height: 520px;
  }

  .home-tech-phase {
    bottom: 38px;
  }

  .home-tech-phase h2,
  .home-tech-phase .home-tech-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-tech-scroll,
  .home-tech-scroll.is-enhanced {
    height: auto;
    min-height: clamp(560px, 100svh, 900px);
  }

  .home-tech-scroll.is-enhanced .home-tech-sticky,
  .home-tech-sticky {
    position: relative;
    top: auto;
    height: clamp(560px, 100svh, 900px);
  }

  #home-tech-canvas,
  .home-tech-progress,
  .home-tech-loader {
    display: none;
  }

  .home-tech-phase {
    display: none;
    transition: none;
  }

  .home-tech-phase[data-phase='4'] {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
  }

  .home-tech-visual-overlay::before {
    display: none;
  }
}
