/* ==========================================================================
   FX – animaciones y movimiento. Todo se desactiva con prefers-reduced-motion.
   ========================================================================== */

/* ---------------------------------------------------------------- Barra de progreso de scroll */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 100; pointer-events: none; }
.scroll-progress span { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--cyan), var(--pink), var(--orange)); box-shadow: 0 0 12px rgba(18, 168, 198, .7); }

/* ---------------------------------------------------------------- Navegación dinámica */
.nav { transition: background .35s, box-shadow .35s, height .35s; }
.nav-in { transition: height .35s; }
.nav.scrolled { background: rgba(7, 28, 74, .97); box-shadow: 0 8px 30px rgba(0, 0, 0, .25); }
.nav.scrolled .nav-in { height: 58px; }
#menu a:not(.btn) { position: relative; }
#menu a:not(.btn)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--cyan); transform: scaleX(0); transition: transform .3s; border-radius: 2px; }
#menu a:not(.btn):hover::after, #menu a.current::after { transform: scaleX(1); }
#menu a.current { color: #fff; }
.brand img { transition: transform .6s cubic-bezier(.34, 1.56, .64, 1); }
.brand:hover img { transform: rotate(360deg) scale(1.1); }

/* ---------------------------------------------------------------- Hero */
.hero { min-height: min(calc(100vh - 68px), 960px); display: flex; flex-direction: column; justify-content: center; }
.hero-bg { inset: -15% 0 0 0; will-change: transform; background: none; overflow: hidden; }
.hero-bg::before { content: ""; position: absolute; inset: 0; background: url("../img/parque-borde-rio.jpg") center / cover no-repeat; animation: kenburns 30s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1.05); } to { transform: scale(1.2) translate(-2%, -1%); } }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at var(--mx, 70%) var(--my, 40%), rgba(18, 168, 198, .35), transparent 45%), linear-gradient(100deg, rgba(7, 28, 74, .96) 0%, rgba(11, 42, 107, .86) 45%, rgba(18, 168, 198, .55) 100%); }

.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #4ade80; margin-right: .6em; vertical-align: middle; box-shadow: 0 0 0 0 rgba(74, 222, 128, .7); animation: ping 1.8s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }

/* Título que entra palabra por palabra */
.hero-title > span, .hero-title .h1-stack > span { display: block; opacity: 0; transform: translateY(40px) rotateX(-60deg); transform-origin: 50% 100%; animation: rise .9s cubic-bezier(.2, .9, .3, 1.2) forwards; animation-delay: calc(var(--i) * .13s + .15s); }
.hero-title { perspective: 600px; }
.hero-title .roman { animation-name: riseRoman; animation-duration: 1.1s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes riseRoman { 0% { opacity: 0; transform: translateX(-60px) scale(.8); filter: blur(10px); } 100% { opacity: 1; transform: none; filter: none; } }
.hero-title .cyan { background: linear-gradient(90deg, #12a8c6, #6ee0f2, #12a8c6); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: rise .9s cubic-bezier(.2, .9, .3, 1.2) forwards, shimmer 4s linear infinite 1.5s; animation-delay: calc(var(--i) * .13s + .15s), 1.5s; }
@keyframes shimmer { to { background-position: -200% 0; } }

.hero-copy > .pill, .hero-copy > .lead, .hero-meta, .hero-cta, .countdown { opacity: 0; animation: fadeUp .8s ease forwards; }
.hero-copy > .pill { animation-delay: .05s; }
.hero-copy > .lead { animation-delay: .8s; }
.hero-meta { animation-delay: .95s; }
.hero-cta { animation-delay: 1.1s; }
.countdown { animation-delay: 1.25s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.countdown div { position: relative; overflow: hidden; transition: transform .3s; }
.countdown div:hover { transform: translateY(-4px) scale(1.04); }
.countdown b.tick { animation: flip .45s ease; }
@keyframes flip { 0% { transform: translateY(-60%); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* Afiche 3D */
.hero-poster { position: relative; perspective: 1000px; opacity: 0; animation: posterIn 1.2s cubic-bezier(.2, .9, .3, 1.1) .4s forwards; }
@keyframes posterIn { from { opacity: 0; transform: translateY(60px) rotate(8deg) scale(.9); } to { opacity: 1; transform: none; } }
.hero-poster img { transform: rotate(2.5deg) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .25s ease-out, box-shadow .3s; animation: float 6s ease-in-out infinite 1.6s; }
.hero-poster:hover img { box-shadow: 0 40px 80px rgba(0, 0, 0, .55); }
@keyframes float { 50% { translate: 0 -14px; } }
.poster-badge { position: absolute; z-index: 2; top: -14px; left: -18px; background: var(--pink); color: #fff; font-weight: 700; font-size: .85rem; padding: .55rem 1rem; border-radius: 999px; box-shadow: 0 10px 25px rgba(239, 127, 143, .55); transform: rotate(-8deg); animation: wiggle 2.8s ease-in-out infinite; }
@keyframes wiggle { 0%, 100% { transform: rotate(-8deg) scale(1); } 50% { transform: rotate(-3deg) scale(1.08); } }

/* Burbujas */
.bubbles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.bubbles i { position: absolute; bottom: -40px; width: var(--s, 12px); height: var(--s, 12px); border-radius: 50%; background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .7), rgba(255, 255, 255, .08)); border: 1px solid rgba(255, 255, 255, .25); animation: bubble var(--d, 12s) linear infinite; animation-delay: var(--dl, 0s); left: var(--x, 50%); }
@keyframes bubble { 0% { transform: translate(0, 0); opacity: 0; } 10% { opacity: .9; } 50% { transform: translate(30px, -50vh); } 100% { transform: translate(-20px, -105vh); opacity: 0; } }

/* Olas en capas + kayak navegando */
.waves { position: absolute; left: 0; right: 0; bottom: -1px; height: 110px; overflow: hidden; pointer-events: none; }
.waves .wave { position: absolute; bottom: 0; left: 0; width: 200%; height: 100%; }
.waves .w1 { fill: rgba(255, 255, 255, .25); animation: waveMove 16s linear infinite; height: 100%; }
.waves .w2 { fill: rgba(255, 255, 255, .45); animation: waveMove 11s linear infinite reverse; height: 85%; }
.waves .w3 { fill: #fff; animation: waveMove 8s linear infinite; height: 70%; }
@keyframes waveMove { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.kayak-glide { position: absolute; bottom: 52px; left: -140px; width: 120px; z-index: 1; animation: glide 22s linear infinite, bob 2.2s ease-in-out infinite; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .25)); }
.kayak-glide .paddle { transform-origin: 60px 20px; animation: paddle 1.1s ease-in-out infinite; }
@keyframes glide { from { left: -140px; } to { left: calc(100% + 140px); } }
@keyframes bob { 50% { translate: 0 6px; rotate: 2deg; } }
@keyframes paddle { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(14deg); } }

.scroll-cue { position: absolute; bottom: 120px; left: 50%; transform: translateX(-50%); width: 28px; height: 46px; border: 2px solid rgba(255, 255, 255, .7); border-radius: 20px; z-index: 3; }
.scroll-cue span { position: absolute; top: 8px; left: 50%; width: 4px; height: 9px; margin-left: -2px; border-radius: 2px; background: #fff; animation: cue 1.6s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(16px); } }

/* ---------------------------------------------------------------- Marquee */
.marquee { overflow: hidden; background: linear-gradient(90deg, var(--navy), var(--navy-2)); color: #fff; margin-top: 3.5rem; padding: .9rem 0; transform: rotate(-1.2deg) scale(1.02); box-shadow: 0 10px 30px rgba(11, 42, 107, .2); }
.marquee-track { display: flex; gap: 3rem; width: max-content; animation: marquee 35s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font-family: var(--display); font-size: 1.6rem; letter-spacing: 1.5px; white-space: nowrap; }
.marquee span:nth-child(even) { color: var(--cyan); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------------------------------------------------------------- Aparición al hacer scroll */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .2, 1); transition-delay: var(--d, 0s); }
.reveal.from-left { transform: translateX(-50px); }
.reveal.from-right { transform: translateX(50px); }
.reveal.zoom { transform: scale(.88); }
.reveal.in { opacity: 1; transform: none; }
.reveal:not(.done) { transition-property: opacity, transform !important; transition-duration: .8s !important; transition-delay: var(--d, 0s) !important; }

/* Títulos con subrayado animado */
h2.reveal::after, .h2.reveal::after { content: ""; display: block; width: 70px; height: 5px; margin-top: .35em; border-radius: 3px; background: linear-gradient(90deg, var(--cyan), var(--pink)); transform: scaleX(0); transform-origin: 0 50%; transition: transform .9s cubic-bezier(.2, .8, .2, 1) .35s; }
h2.reveal.in::after, .h2.reveal.in::after { transform: scaleX(1); }
.section-navy h2.reveal::after { background: linear-gradient(90deg, var(--cyan), #fff); }

/* ---------------------------------------------------------------- Tarjetas interactivas */
.card, .stat, .etapas li { transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s, border-color .35s, opacity .8s ease; position: relative; overflow: hidden; }
.card::before, .stat::before, .etapas li::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), rgba(18, 168, 198, .16), transparent 60%); }
.card:hover::before, .stat:hover::before, .etapas li:hover::before { opacity: 1; }
.cards-4 .card:hover, .cards-3 .card:hover, .side-cards .card:hover, .stat:hover { transform: translateY(-8px); box-shadow: 0 22px 45px rgba(11, 42, 107, .16); }
.etapas li:hover { transform: translateY(-8px); border-color: var(--cyan); background: rgba(18, 168, 198, .12); }
.card-ico { display: inline-block; transition: transform .5s cubic-bezier(.34, 1.56, .64, 1); }
.card:hover .card-ico { transform: scale(1.3) rotate(-10deg); }
.etapas b { display: inline-block; transition: transform .3s; }
.etapas li:hover b { transform: translateX(6px); }

/* Etapas conectadas */
.etapas li::after { content: "→"; position: absolute; right: -14px; top: 50%; color: var(--cyan); font-size: 1.2rem; display: none; }

/* ---------------------------------------------------------------- Botones */
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn::after { content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%; background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .45), transparent); transform: skewX(-20deg); z-index: -1; transition: left .7s; }
.btn:hover::after { left: 140%; }
.btn-pink.btn-lg { animation: pulse 2.6s ease-in-out infinite 2s; }
@keyframes pulse { 0%, 100% { box-shadow: 0 6px 18px rgba(239, 127, 143, .45), 0 0 0 0 rgba(239, 127, 143, .5); } 50% { box-shadow: 0 6px 18px rgba(239, 127, 143, .45), 0 0 0 14px rgba(239, 127, 143, 0); } }
.ripple { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .5); transform: scale(0); animation: ripple .6s ease-out; pointer-events: none; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ---------------------------------------------------------------- Ruta animada */
.route { position: relative; margin: 2.2rem 0 .5rem; background: radial-gradient(ellipse at 50% 120%, rgba(18, 168, 198, .25), transparent 60%), rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .1); border-radius: 24px; padding: 1.5rem 1.5rem 3rem; }
.route svg { width: 100%; height: auto; overflow: visible; }
.route-river { fill: none; stroke: rgba(18, 168, 198, .25); stroke-width: 26; stroke-linecap: round; }
.route-line { fill: none; stroke: url(#rio); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 10 10; }
.route-pin circle { fill: var(--navy-d); stroke: var(--cyan); stroke-width: 4; }
.route-pin.pin-boya circle { stroke: var(--orange); }
.route-pin.pin-meta circle { stroke: var(--pink); fill: var(--pink); animation: beacon 1.8s ease-in-out infinite; }
@keyframes beacon { 50% { stroke-width: 12; stroke-opacity: .3; } }
.route-pin text { fill: #fff; font: 600 15px Inter, sans-serif; text-anchor: middle; }
.route-pin.pin-meta text { text-anchor: end; }
.route-kayak { filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .4)); transition: transform .15s linear; }
.route-km { position: absolute; right: 1.5rem; bottom: 1rem; color: #cfe0ff; font-size: .9rem; }
.route-km b { font-family: var(--display); font-weight: 400; font-size: 2rem; color: var(--cyan); margin-right: .2rem; }

/* Imágenes con zoom suave */
.maps figure img, .photo-card img { transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
.maps figure:hover img, .photo-card:hover img { transform: scale(1.05); }
.maps figure, .photo-card { overflow: hidden; border-radius: var(--radius); }

/* ---------------------------------------------------------------- Cronograma que se dibuja */
.timeline { position: relative; border-left-color: transparent; }
.timeline::before { content: ""; position: absolute; left: -3px; top: 0; bottom: 0; width: 3px; background: var(--cyan-l); }
.timeline::after { content: ""; position: absolute; left: -3px; top: 0; width: 3px; height: calc(var(--fill, 0) * 100%); background: linear-gradient(var(--cyan), var(--pink)); border-radius: 3px; transition: height .1s linear; }
.timeline li::before { z-index: 1; transform: scale(.6); transition: transform .4s cubic-bezier(.34, 1.56, .64, 1), background .3s; }
.timeline li.lit::before { transform: scale(1); background: var(--pink); box-shadow: 0 0 0 2px var(--pink), 0 0 14px rgba(239, 127, 143, .7); }
.timeline li { transition: transform .3s; }
.timeline li:hover { transform: translateX(8px); }

/* ---------------------------------------------------------------- FAQ */
.faq details { transition: border-color .3s, box-shadow .3s, transform .3s; }
.faq details:hover { border-color: var(--cyan); transform: translateX(4px); }
.faq details[open] { box-shadow: 0 10px 30px rgba(11, 42, 107, .1); border-color: var(--cyan); }
details[open] > *:not(summary) { animation: fadeUp .4s ease; }

/* ---------------------------------------------------------------- Formulario */
.wizard .step:not([hidden]) { animation: stepIn .5s cubic-bezier(.2, .8, .2, 1); }
.wizard .step.back:not([hidden]) { animation-name: stepBack; }
@keyframes stepIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes stepBack { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
.steps { position: relative; }
.steps li::before { transition: background .4s, border-color .4s, transform .4s cubic-bezier(.34, 1.56, .64, 1); }
.steps li.active::before { transform: translateX(-50%) scale(1.18); box-shadow: 0 0 0 6px rgba(18, 168, 198, .18); }
.wizard-progress { height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; margin: -1rem 0 1.6rem; }
.wizard-progress span { display: block; height: 100%; width: var(--w, 0%); background: linear-gradient(90deg, var(--cyan), var(--pink)); transition: width .6s cubic-bezier(.2, .8, .2, 1); border-radius: 3px; }
.choice span { transition: transform .25s, border-color .2s, background .2s, box-shadow .2s; }
.choice:hover span { transform: translateY(-3px); border-color: var(--cyan); }
.choice input:checked + span { animation: pop .35s cubic-bezier(.34, 1.56, .64, 1); }
.field.invalid input, .field.invalid select, .field.invalid textarea { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.field.valid input { border-color: #34d399; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='3'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .8rem center; background-size: 1.1rem; padding-right: 2.4rem; }
.minor-box:not([hidden]) { animation: fadeUp .45s ease; }
.form-section { overflow: hidden; }
.form-section::before, .form-section::after { content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .45; pointer-events: none; }
.form-section::before { width: 420px; height: 420px; background: var(--cyan); top: -120px; left: -140px; animation: blob 14s ease-in-out infinite alternate; }
.form-section::after { width: 360px; height: 360px; background: var(--pink); bottom: -120px; right: -100px; animation: blob 18s ease-in-out infinite alternate-reverse; }
@keyframes blob { 50% { transform: translate(80px, 60px) scale(1.2); } 100% { transform: translate(-40px, 120px) scale(.9); } }
.form-section .wrap { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- Confeti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; }

/* ---------------------------------------------------------------- Botón volver arriba */
.to-top { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 60; width: 50px; height: 50px; border-radius: 50%; border: 0; background: var(--pink); color: #fff; font-size: 1.4rem; cursor: pointer; box-shadow: 0 10px 25px rgba(239, 127, 143, .5); opacity: 0; transform: translateY(20px) scale(.8); transition: opacity .3s, transform .3s; pointer-events: none; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { transform: translateY(-4px); }

@media (max-width: 860px) {
  .hero { min-height: auto; }
  .scroll-cue { display: none; }
  .route-pin text { font-size: 22px; }
  .marquee span { font-size: 1.25rem; }
}

/* ---------------------------------------------------------------- Accesibilidad: sin movimiento */
@media (prefers-reduced-motion: reduce) {
  .reveal, .hero-title > span, .hero-title .h1-stack > span, .hero-copy > *, .hero-meta, .hero-cta, .countdown, .hero-poster { opacity: 1 !important; transform: none !important; }
  .bubbles, .kayak-glide, .scroll-cue { display: none; }
  .marquee-track { animation: none; }
}

/* Evitar desborde horizontal por elementos rotados/desenfocados (clip no rompe el nav sticky) */
html, body { overflow-x: clip; }
