/* Estilos de animacion compartidos - Eventos y Sistemas */
:root {
  --brand: #033399;
  --cyan: #14B6C6;
  --tint: #EEF4FF;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
html { scroll-behavior: auto; }
body { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; color: #1f2937; background: #fff; overflow-x: hidden; }

#progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--brand), var(--cyan)); }

/* Navegacion */
#nav { transition: background .35s, box-shadow .35s, padding .35s; }
#nav.nav-scrolled { background: rgba(255,255,255,.88); backdrop-filter: blur(14px); box-shadow: 0 6px 30px -12px rgba(3,51,153,.25); }

/* Reveal */
[data-reveal] { opacity: 0; transition: opacity .9s var(--ease), transform 1s var(--ease), clip-path 1.1s var(--ease); will-change: transform, opacity; }
[data-reveal="up"] { transform: translateY(48px); }
[data-reveal="down"] { transform: translateY(-40px); }
[data-reveal="left"] { transform: translateX(-70px); }
[data-reveal="right"] { transform: translateX(70px); }
[data-reveal="zoom"] { transform: scale(.86); }
[data-reveal="clip"] { clip-path: inset(0 100% 0 0); opacity: 1; }
[data-reveal="clip-up"] { clip-path: inset(100% 0 0 0); opacity: 1; }
[data-reveal].is-in { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }

/* Texto dividido */
.split-word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .12em; margin-bottom: -.12em; }
.split-item { display: inline-block; transform: translateY(110%) rotate(5deg); opacity: 0; transition: transform 1s var(--ease), opacity .8s var(--ease); }
[data-split].is-in .split-item { transform: none; opacity: 1; }

/* Texto scrub */
.scrub-w { opacity: .16; transition: opacity .4s, color .4s; }
.scrub-w.on { opacity: 1; }

/* Numeros contorneados */
.outline-num { background: linear-gradient(135deg, var(--brand), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: .2; font-variant-numeric: lining-nums; }

/* Palabra rotativa */
[data-rotate] { display: inline-block; transition: transform .45s var(--ease), opacity .45s var(--ease); }
[data-rotate].rot-out { transform: translateY(-60%); opacity: 0; }
[data-rotate].rot-in { transform: translateY(60%); opacity: 0; transition: none; }

/* Zoom lento de fondo (Ken Burns) */
@keyframes kenburns { from { transform: scale(1.04); } to { transform: scale(1.18) translate(-1.5%, -1%); } }
.kenburns { animation: kenburns 22s ease-in-out infinite alternate; }

/* Flotacion */
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes float2 { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(12px) rotate(2deg); } }
.float { animation: float 6s ease-in-out infinite; }
.float-slow { animation: float2 9s ease-in-out infinite; }

/* Marquee */
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes marquee-rev { from { transform: translateX(-50%); } to { transform: translateX(0); } }
.marquee { display: flex; width: max-content; animation: marquee 50s linear infinite; }
.marquee-rev { animation-name: marquee-rev; }
.marquee:hover { animation-play-state: paused; }

/* Pulso */
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(20,182,198,.55); } 100% { box-shadow: 0 0 0 22px rgba(20,182,198,0); } }
.pulse { animation: pulse-ring 2s infinite; }

/* Linea de tiempo vertical */
.tl-line { position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: #dbe5ff; border-radius: 3px; }
.tl-line::after { content: ''; position: absolute; inset: 0; border-radius: 3px; background: linear-gradient(var(--brand), var(--cyan)); transform-origin: top; transform: scaleY(var(--p, 0)); }
.tl-node { transition: transform .6s var(--ease), background .4s, box-shadow .4s, color .4s; }
.tl-node.node-on { background: var(--cyan); color: #fff; transform: scale(1.15); box-shadow: 0 0 0 8px rgba(20,182,198,.18); }
@media (max-width: 767px) { .tl-line { left: 22px; } }

/* Linea de tiempo horizontal */
.hl-bar { transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--brand), var(--cyan)); }

/* Escenas con scroll fijo */
.step { opacity: 0; transform: translateY(40px); pointer-events: none; transition: opacity .7s var(--ease), transform .8s var(--ease); position: absolute; inset: 0; }
.step.step-on { opacity: 1; transform: none; pointer-events: auto; }
.step-img { opacity: 0; transform: scale(1.08); transition: opacity .9s var(--ease), transform 1.4s var(--ease); position: absolute; inset: 0; }
.step-img.step-on { opacity: 1; transform: scale(1); }
.dot { transition: all .5s var(--ease); }
.dot.dot-on { background: var(--cyan); width: 36px; }

/* Imagen con zoom al hover */
.zoom-wrap { overflow: hidden; }
.zoom-wrap img { transition: transform 1.2s var(--ease); }
.zoom-wrap:hover img { transform: scale(1.08); }

/* Subrayado animado */
.u-draw { background: linear-gradient(var(--cyan), var(--cyan)) no-repeat 0 92% / 0% 0.14em; transition: background-size 1.2s var(--ease) .5s; }
.u-draw.is-in { background-size: 100% 0.14em; }

/* Boton */
.btn { display: inline-flex; align-items: center; gap: .6rem; transition: transform .35s var(--ease), box-shadow .35s, background .3s; }
.btn:hover { box-shadow: 0 14px 30px -10px rgba(3,51,153,.45); }
.btn .arr { transition: transform .35s var(--ease); }
.btn:hover .arr { transform: translateX(6px); }

/* Indicador de scroll */
@keyframes scrolldot { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(16px); opacity: 0; } }
.scroll-dot { animation: scrolldot 1.6s infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  [data-reveal], .split-item { opacity: 1 !important; transform: none !important; clip-path: none !important; }
}
