.features {
  position: relative;
  padding-top: 0;
}

.features__scroll-container {
  height: 420vh;
  position: relative;
}

.features__sticky-wrapper {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: 1rem;
  overflow: hidden;
}

.features__header {
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 20;
  padding: 0 1.5rem;
  width: 100%;
}
.features__header h2 {
  font-size: clamp(1.5rem, 4vw, 3.25rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.5rem;
  line-height: 1.15;
}
.features__header p {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}

/* Viewport dos cards — contém os wrappers absolute */
.features__cards-viewport {
  position: relative;
  /* Largura limitada à viewport, com padding para não vazar */
  width: 100%;
  max-width: 1200px;
  height: clamp(360px, 50vh, 500px);
  /* Padding interno para os cards não encostar nas bordas */
  padding: 0 1.5rem;
  box-sizing: border-box;
  overflow: hidden; /* recorta só o que ultrapassar o viewport */
}

/* O wrapper precisa de fundo sólido para bloquear cards abaixo */
.feature-card-wrapper {
  border-radius: var(--radius-xl);
  background: var(--body-bg);
  /* Garante que o wrapper não ultrapasse a viewport */
  max-width: 100%;
  overflow: hidden;
}

.feature-card {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-xl);
  padding: clamp(1.25rem, 2.5vw, 2.5rem);
  border: 1px solid var(--card-border);
  background: var(--feature-card-bg, #0a1628);
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06),
              0 0 80px -20px var(--card-glow, transparent);
  box-sizing: border-box;
  overflow: hidden;
}

.feature-card__text {
  flex: 0 0 42%;
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 1.5vw, 1.5rem);
  min-width: 0; /* evita overflow de texto */
}

.feature-card__number {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--primary);
  text-transform: uppercase;
}

.feature-card__title {
  font-size: clamp(1.4rem, 2.8vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.feature-card__desc {
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 400px;
}

.feature-card__image {
  flex: 1;
  height: 100%;
  min-height: 140px;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-card__image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.feature-card__image-placeholder span {
  font-size: clamp(3.5rem, 8vw, 7rem);
  filter: drop-shadow(0 0 40px currentColor);
  animation: float-y 4s ease-in-out infinite;
}

/* Dots de progresso */
.features__progress {
  display: flex;
  gap: 8px;
  margin-top: 1.25rem;
  justify-content: center;
  position: relative;
  z-index: 20;
}
.features__progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: background 0.3s, transform 0.3s, width 0.3s;
}
.features__progress-dot.active {
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
  transform: scale(1.3);
  width: 20px;
  border-radius: 4px;
}

/* ── Responsivo ── */
@media (max-width: 1024px) {
  .feature-card { flex-direction: column; gap: 1.5rem; }
  .feature-card__text { flex: none; width: 100%; }
  .feature-card__image { width: 100%; }
}

@media (max-width: 768px) {
  .features__scroll-container { height: 500vh; }
  .features__cards-viewport {
    height: clamp(420px, 60vh, 560px);
    padding: 0 1rem;
  }
  .feature-card {
    flex-direction: column;
    gap: 0.875rem;
    padding: 1.25rem;
    border-radius: var(--radius-md);
  }
  .feature-card__text { flex: none; width: 100%; }
  .feature-card__image { min-height: 100px; width: 100%; flex: none; }
  .feature-card__image-placeholder span { font-size: 3.5rem; }
}

@media (max-width: 480px) {
  .features__scroll-container { height: 500vh; }
  .features__cards-viewport { height: clamp(460px, 65vh, 580px); }
  .features__sticky-wrapper { padding-top: 0.5rem; }
  .features__header { margin-bottom: 0.75rem; }
}
