/* =====================================================================
 *  Landing — movimiento ("flow").
 *  Mejora progresiva: todo lo que oculta contenido vive bajo html.motion,
 *  clase que solo pone landing-motion.js cuando el usuario NO pidió reducir
 *  movimiento. Sin JS, o con prefers-reduced-motion, la página es la estática.
 * ===================================================================== */

html { scroll-behavior: smooth; }
body.lp section[id] { scroll-margin-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ── Barra de lectura bajo el navbar ─────────────────────────────────── */
.lp-read { position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 1040;
           background: linear-gradient(90deg, var(--brand), var(--accent), #38bdf8);
           transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }

/* ── Aparición al hacer scroll ───────────────────────────────────────── */
html.motion [data-reveal] { opacity: 0; transform: translateY(28px);
    transition: opacity .8s cubic-bezier(.22,1,.36,1), transform .8s cubic-bezier(.22,1,.36,1);
    transition-delay: calc(var(--d, 0) * 90ms); will-change: opacity, transform; }
html.motion [data-reveal="left"]  { transform: translateX(-36px); }
html.motion [data-reveal="right"] { transform: translateX(36px); }
html.motion [data-reveal="zoom"]  { transform: scale(.94); }
html.motion [data-reveal].is-in   { opacity: 1; transform: none; }

/* ── Hero: entrada escalonada ────────────────────────────────────────── */
@keyframes lpUp   { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes lpMock { from { opacity: 0; transform: translateY(40px) rotate(2deg) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes lpBob  { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes lpBlob { 0%,100% { transform: translate(0,0) rotate(0deg); border-radius: 46% 54% 58% 42% / 52% 44% 56% 48%; }
                    50%     { transform: translate(-3%,4%) rotate(12deg); border-radius: 56% 44% 46% 54% / 44% 56% 48% 52%; } }

html.motion .lp-hero-text > * { animation: lpUp .9s cubic-bezier(.22,1,.36,1) both; }
html.motion .lp-hero-text > :nth-child(1) { animation-delay: .05s; }
html.motion .lp-hero-text > :nth-child(2) { animation-delay: .15s; }
html.motion .lp-hero-text > :nth-child(3) { animation-delay: .27s; }
html.motion .lp-hero-text > :nth-child(4) { animation-delay: .39s; }
html.motion .lp-hero-text > :nth-child(5) { animation-delay: .50s; }
html.motion .lp-hero-text > :nth-child(6) { animation-delay: .58s; }
html.motion .lp-hero-text > :nth-child(7) { animation-delay: .66s; }
html.motion .lp-mock { animation: lpMock 1.1s .25s cubic-bezier(.22,1,.36,1) both; }
html.motion .lp-mock-in { animation: lpBob 6s 1.4s ease-in-out infinite; }
html.motion .lp-float { animation: lpUp .8s 1s cubic-bezier(.22,1,.36,1) both, lpBob 5s 2s ease-in-out infinite; }
html.motion .lp-blob { animation: lpBlob 18s ease-in-out infinite; }

/* Cita que se confirma sola en el mock */
.lp-flip { transition: background-color .35s ease; }
@keyframes lpPop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
.lp-flip.is-pop { animation: lpPop .5s cubic-bezier(.34,1.56,.64,1); }

.lp-toast { position: absolute; right: -22px; top: -26px; z-index: 3; display: flex; align-items: center; gap: .6rem;
            background: #fff; border-radius: 14px; padding: .65rem .9rem; font-size: .82rem; line-height: 1.25;
            box-shadow: 0 12px 34px rgba(15,30,60,.18); border: 1px solid rgba(34,197,94,.35);
            opacity: 0; transform: translateY(10px) scale(.92); pointer-events: none;
            transition: opacity .45s ease, transform .55s cubic-bezier(.34,1.56,.64,1); }
.lp-toast.is-on { opacity: 1; transform: none; }
.lp-toast i { font-size: 1.35rem; color: #16a34a; }
.lp-toast b { display: block; color: var(--ink); font-weight: 600; }
.lp-toast span { color: var(--muted); }
@media (max-width: 575.98px) { .lp-toast { right: 8px; top: -30px; } }

/* ── Cinta infinita de especialidades ────────────────────────────────── */
.lp-marquee { overflow: hidden; margin-top: 1rem;
              -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
                      mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.lp-marquee-track { display: flex; gap: .5rem; width: max-content; }
.lp-marquee-track .badge { flex: none; }
/* Sin movimiento: la cinta vuelve a ser la fila centrada de siempre. */
html:not(.motion) .lp-marquee { -webkit-mask-image: none; mask-image: none; }
html:not(.motion) .lp-marquee-track { width: auto; flex-wrap: wrap; justify-content: center; }
html:not(.motion) .lp-marquee-track [aria-hidden="true"] { display: none; }
@keyframes lpMarquee { to { transform: translateX(calc(-50% - .25rem)); } }
html.motion .lp-marquee-track { animation: lpMarquee 32s linear infinite; }
html.motion .lp-marquee:hover .lp-marquee-track { animation-play-state: paused; }

/* ── Botón principal: destello que recorre la cápsula ────────────────── */
.lp-btn-fill, .lp-cta .btn-light, .lp-cta2 .btn-light { position: relative; overflow: hidden; isolation: isolate; }
@keyframes lpShine { 0%, 70% { transform: translateX(-130%) skewX(-20deg); } 100% { transform: translateX(260%) skewX(-20deg); } }
html.motion .lp-btn-fill::after, html.motion .lp-cta .btn-light::after, html.motion .lp-cta2 .btn-light::after {
    content: ""; position: absolute; inset: 0; width: 40%; z-index: -1; pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
    animation: lpShine 4.5s 2s ease-in-out infinite; }
html.motion .lp-cta .btn-light::after, html.motion .lp-cta2 .btn-light::after { background: linear-gradient(90deg, transparent, rgba(37,99,235,.18), transparent); }

/* ── WhatsApp: onda que invita sin estorbar ──────────────────────────── */
@keyframes lpPing { 0% { box-shadow: 0 0 0 0 rgba(37,211,102,.55); } 80%, 100% { box-shadow: 0 0 0 18px rgba(37,211,102,0); } }
html.motion .lp-wa { animation: lpPing 2.6s 3s ease-out infinite; }

/* ── Tarjetas de función: el icono responde al hover ─────────────────── */
.lp-feature .lp-feature-ic { transition: transform .45s cubic-bezier(.34,1.56,.64,1); }
.lp-feature:hover .lp-feature-ic { transform: scale(1.1) rotate(-6deg); }
