/* Animaciones — el contenido NUNCA queda invisible */

:root {
  --anim-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --anim-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Hero: única zona que puede empezar oculta (al cargar) ── */
html.animations-ready .hero [data-animate] {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.85s var(--anim-ease),
    transform 0.85s var(--anim-ease);
}

html.animations-ready .hero [data-animate].in-view {
  opacity: 1;
  transform: translateY(0);
}

html.animations-ready .hero-quote::before {
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.85s var(--anim-ease);
}

html.animations-ready .hero-quote.in-view::before {
  transform: scaleY(1);
}

html.animations-ready .q-line-accent.in-view em {
  animation: quoteGlow 5s ease-in-out 1.2s infinite;
}

@keyframes quoteGlow {
  0%, 100% { color: #b8f5d4; text-shadow: none; }
  50% { color: #d8ffe8; text-shadow: 0 0 18px rgba(184, 245, 212, 0.3); }
}

html.animations-ready .hero::before,
html.animations-ready .hero::after {
  content: '';
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
}

html.animations-ready .hero::before {
  top: -15%;
  right: -8%;
  width: min(480px, 65vw);
  height: min(480px, 65vw);
  background: radial-gradient(circle, rgba(62, 207, 142, 0.16) 0%, transparent 70%);
  animation: heroGlow 9s ease-in-out infinite;
}

html.animations-ready .hero::after {
  bottom: -20%;
  left: -5%;
  width: min(380px, 50vw);
  height: min(380px, 50vw);
  background: radial-gradient(circle, rgba(42, 171, 191, 0.12) 0%, transparent 70%);
  animation: heroGlow 11s ease-in-out infinite reverse;
}

@keyframes heroGlow {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

html.animations-ready .hero-grid {
  position: relative;
  z-index: 1;
}

/* ── Scroll: fade + desliz al entrar en pantalla ── */
html.animations-ready .reveal {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.85s var(--anim-ease),
    transform 0.85s var(--anim-ease);
}

html.animations-ready .reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

html.animations-ready [data-reveal-group].in-view .reveal:nth-child(1) { transition-delay: 0.05s; }
html.animations-ready [data-reveal-group].in-view .reveal:nth-child(2) { transition-delay: 0.12s; }
html.animations-ready [data-reveal-group].in-view .reveal:nth-child(3) { transition-delay: 0.19s; }
html.animations-ready [data-reveal-group].in-view .reveal:nth-child(4) { transition-delay: 0.26s; }
html.animations-ready [data-reveal-group].in-view .reveal:nth-child(5) { transition-delay: 0.33s; }
html.animations-ready [data-reveal-group].in-view .reveal:nth-child(6) { transition-delay: 0.4s; }

/* Línea bajo títulos de sección */
html.animations-ready .section-header.reveal.in-view h2::after {
  content: '';
  display: block;
  width: 52px;
  height: 3px;
  margin: 0.65rem auto 0;
  background: linear-gradient(135deg, #3ecf8e, #2aabbf);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  animation: lineGrow 0.7s var(--anim-ease) 0.15s forwards;
}

@keyframes lineGrow {
  to { transform: scaleX(1); }
}

/* Ícono de servicios: pop suave */
html.animations-ready .service-card.in-view .service-icon {
  animation: iconPop 0.6s var(--anim-spring) both;
}

@keyframes iconPop {
  from { transform: scale(0.9) translateY(8px); }
  to { transform: scale(1) translateY(0); }
}

/* Plan de trabajo: línea conectora (sin tocar el texto de las listas) */
html.animations-ready .routine-grid {
  position: relative;
}

html.animations-ready .routine-grid::before {
  content: '';
  position: absolute;
  top: 2.85rem;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(42, 171, 191, 0.4),
    rgba(62, 207, 142, 0.5),
    rgba(42, 171, 191, 0.4),
    transparent
  );
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s var(--anim-ease);
  z-index: 0;
  pointer-events: none;
}

html.animations-ready .routine-grid.in-view::before {
  transform: scaleX(1);
}

html.animations-ready .routine-card {
  position: relative;
  z-index: 1;
}

/* Plataforma: íconos de roles */
html.animations-ready .platform-role.in-view .platform-role-icon {
  animation: iconPop 0.6s var(--anim-spring) both;
}

html.animations-ready .platform-what.in-view .platform-what-icon {
  animation: iconPop 0.65s var(--anim-spring) 0.1s both;
}

html.animations-ready .platform-enfoque.in-view .platform-enfoque-inner::before {
  animation: heroGlow 8s ease-in-out infinite;
}

html.animations-ready .platform-feature.in-view .platform-feature-check {
  animation: iconPop 0.5s var(--anim-spring) both;
}

@media (max-width: 768px) {
  html.animations-ready .routine-grid::before {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.animations-ready .hero [data-animate],
  html.animations-ready .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  html.animations-ready .hero::before,
  html.animations-ready .hero::after,
  html.animations-ready .q-line-accent.in-view em,
  html.animations-ready .service-card.in-view .service-icon {
    animation: none !important;
  }

  html.animations-ready .platform-role.in-view .platform-role-icon,
  html.animations-ready .platform-what.in-view .platform-what-icon,
  html.animations-ready .platform-feature.in-view .platform-feature-check,
  html.animations-ready .platform-enfoque.in-view .platform-enfoque-inner::before {
    animation: none !important;
  }

  html.animations-ready .hero-quote::before,
  html.animations-ready .routine-grid::before {
    transform: none !important;
    transition: none !important;
  }

  html.animations-ready .section-header.reveal.in-view h2::after {
    transform: scaleX(1);
    animation: none;
  }
}
