/* eb5inc.com — motion. On while <body> has .motion-on (Appearance → Customize →
   eb5inc.com). Hero copy rises on load with an 80ms stagger; elements with
   .rise fade up as they scroll into view (CSS scroll-driven animation, where
   supported). Nothing is hidden by script, so content never stays invisible.
   Everything stops under prefers-reduced-motion. */

@keyframes eb5rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes eb5fade { from { opacity: 0; } to { opacity: 1; } }

.motion-on .hero-copy > .elementor-element { animation: eb5rise 700ms var(--eb-ease) both; }
.motion-on .hero-copy > .elementor-element:nth-child(2) { animation-delay: 80ms; }
.motion-on .hero-copy > .elementor-element:nth-child(3) { animation-delay: 160ms; }
.motion-on .hero-copy > .elementor-element:nth-child(4) { animation-delay: 240ms; }
.motion-on .hero-copy > .elementor-element:nth-child(5) { animation-delay: 320ms; }
.motion-on .hero-img, .motion-on .band { animation: eb5fade 900ms var(--eb-ease) 150ms both; }
.motion-on .modal[open] { animation: eb5rise 260ms var(--eb-ease) both; }

@supports (animation-timeline: view()) {
	.motion-on .rise {
		animation: eb5rise linear both;
		animation-timeline: view();
		animation-range: entry 0% entry 60%;
	}
}


/* ---------- v2 · Invista (23-11-2026): carga, scroll y hover ----------
   Clases puestas desde Avanzado → Clases CSS (parche v2/52): .hero-load en el contenedor de cada
   cabecera, .phase-link en los bloques de fases. Solo transform/opacity/scale; todo se anula con
   prefers-reduced-motion (regla de abajo) y con el interruptor de movimiento del Personalizador. */
@keyframes eb5settle { from { scale: 1.06; } to { scale: 1; } }
@keyframes eb5pop { from { scale: .4; opacity: 0; } to { scale: 1; opacity: 1; } }

/* Carga: el texto de la cabecera sube escalonado (titular, luego lo que le sigue). */
.motion-on .hero-load .elementor-widget-heading:has(h1) { animation: eb5rise 650ms var(--eb-ease) both; }
.motion-on .hero-load .elementor-widget-heading:has(h1) ~ * { animation: eb5rise 650ms var(--eb-ease) 120ms both; }
.motion-on .hero-load .elementor-widget-heading:has(h1) ~ * ~ * { animation-delay: 240ms; }
.motion-on .hero-load .eb5-photo-widget { animation: eb5fade 900ms var(--eb-ease) 150ms both; }

@supports (animation-timeline: view()) {
	/* Scroll: las fotos se asientan dentro de su marco (scale, compatible con el hover «Grow»). */
	.motion-on .eb5-photo-widget img { animation: eb5settle linear both; animation-timeline: view(); animation-range: entry 0% cover 45%; }
	.motion-on .hero-load .eb5-photo-widget img { animation: none; }
	/* Scroll: los marcadores del raíl aparecen con un pop. */
	.motion-on .rise > .elementor-widget-icon .elementor-icon { animation: eb5pop linear both; animation-timeline: view(); animation-range: entry 20% entry 80%; }
}

/* Hover: botones que se elevan 2 px; el enlace subrayado gana aire. */
.elementor-button { transition: background-color 200ms var(--eb-ease), color 200ms var(--eb-ease), border-color 200ms var(--eb-ease), transform 200ms var(--eb-ease); }
.elementor-button:hover { transform: translateY(-2px); }
.elementor-button:active { transform: translateY(0); }
.elementor-button, .elementor-widget-text-editor a { text-underline-offset: .2em; }
.elementor-button:hover, .elementor-widget-text-editor a:hover { text-underline-offset: .32em; }
.elementor-widget-text-editor a { transition: text-underline-offset 200ms var(--eb-ease), text-decoration-color 200ms var(--eb-ease), color 200ms var(--eb-ease); }

/* Hover: el marcador del raíl crece al pasar por su etapa. */
.rise > .elementor-widget-icon svg { transition: transform 220ms var(--eb-ease); }
.rise:hover > .elementor-widget-icon svg { transform: scale(1.3); }

/* Hover: los bloques de fases desplazan su texto hacia la derecha. */
.phase-link .elementor-widget-heading { transition: transform 220ms var(--eb-ease); }
.phase-link:hover .elementor-widget-heading, .phase-link:focus-visible .elementor-widget-heading { transform: translateX(6px); }

/* Transitions (hover states) are short; motion is removed entirely on request. */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; } /* user preference wins over every animation */
}
