/* Movimiento de las páginas públicas. Solo se carga en el sitio, no en el portal /app.
   Todo se apaga con "reducir movimiento" y sin JavaScript la página se ve completa. */

/* ---------- Transiciones entre páginas (View Transitions entre documentos) ---------- */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-old(root) { animation: vt-out .28s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: vt-in .42s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-12px) scale(.985); filter: blur(4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(18px) scale(1.01); filter: blur(6px); } }

/* ---------- Logotipo animado ---------- */
.site-header .logo { position: relative; overflow: hidden; animation: logo-in .9s cubic-bezier(.34, 1.56, .64, 1) both; }
.site-header .logo::before { /* línea de "visto" que se dibuja dentro de la A */
  content: ""; position: absolute; left: 22%; bottom: 20%; width: 56%; height: 2px; border-radius: 2px;
  background: currentColor; transform: scaleX(0); transform-origin: left; animation: logo-line .5s .7s ease-out forwards; }
.site-header .logo::after { /* brillo que cruza */
  content: ""; position: absolute; inset: -40% auto -40% -60%; width: 40%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: logo-shine 3.6s 1.2s ease-in-out infinite; }
.site-header .brand:hover .logo { animation: logo-wiggle .6s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes logo-in { from { transform: rotate(-200deg) scale(.2); opacity: 0; border-radius: 50%; } }
@keyframes logo-line { to { transform: scaleX(1); } }
@keyframes logo-shine { 0%, 70% { left: -60%; } 100% { left: 130%; } }
@keyframes logo-wiggle { 30% { transform: rotate(-12deg) scale(1.12); } 60% { transform: rotate(8deg) scale(1.05); } }

/* ---------- Tipografía expresiva ---------- */
.kt .kt-w { display: inline-block; opacity: 0; transform: translateY(.55em) rotateX(-70deg); filter: blur(6px);
  transform-origin: 50% 100%; transition: opacity .6s, transform .8s cubic-bezier(.16, 1, .3, 1), filter .6s;
  transition-delay: calc(var(--i) * 55ms); }
.kt.kt-in .kt-w { opacity: 1; transform: none; filter: none; }
.kt-accent, .kt-accent .kt-w { background: linear-gradient(90deg, var(--brand), #22c55e, #0ea5e9, var(--brand)); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: kt-sweep 6s linear infinite; }
@keyframes kt-sweep { to { background-position: 300% 0; } }
.motion-off .kt-accent { animation: none; }

/* ---------- Aparición al hacer scroll ---------- */
.motion-ready:not(.motion-off) .st-item { opacity: 0; transform: translateY(26px) scale(.98);
  transition: opacity .55s, transform .7s cubic-bezier(.16, 1, .3, 1); transition-delay: calc(var(--i) * 70ms); }
.motion-ready .st-in .st-item { opacity: 1; transform: none; }
.motion-ready:not(.motion-off) [data-reveal] { opacity: 0; transform: translateY(30px); transition: opacity .7s, transform .9s cubic-bezier(.16, 1, .3, 1); }
.motion-ready [data-reveal].rv-in { opacity: 1; transform: none; }

/* ---------- Gráficos en movimiento 3D (profundidad tipo realidad aumentada) ---------- */
.hero-visual { position: relative; justify-self: center; perspective: 1100px; --rx: 0deg; --ry: 0deg; }
.hero-visual .stage { transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .5s cubic-bezier(.16, 1, .3, 1); }
.hero-visual .phone { transform: translateZ(0); }
.float-chip { position: absolute; z-index: 2; display: flex; align-items: center; gap: .45rem; padding: .55rem .8rem;
  border-radius: 14px; font-size: .82rem; font-weight: 700; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); box-shadow: 0 18px 40px -18px rgba(15, 40, 35, .45); white-space: nowrap;
  transform: translateZ(var(--z, 60px)); animation: chip-float 5s ease-in-out infinite; animation-delay: var(--d, 0s); }
.float-chip svg { flex: none; }
.float-chip.c1 { top: 16%; left: -14%; --z: 90px; }
.float-chip.c2 { bottom: 24%; right: -12%; --z: 70px; --d: -2.5s; }
.float-chip.c3 { top: 52%; left: -18%; --z: 40px; --d: -1.2s; }
.float-chip .ok { color: var(--ok); }
.float-chip .wa { color: var(--wa); }
@keyframes chip-float { 50% { translate: 0 -10px; } }
@media (max-width: 640px) {
  .float-chip { font-size: .72rem; padding: .4rem .6rem; }
  .float-chip.c1 { left: -4%; } .float-chip.c2 { right: -4%; } .float-chip.c3 { display: none; }
}

/* ---------- Scrollytelling con ilustración isométrica ---------- */
.scrolly { display: grid; gap: 2rem; margin-top: 2.5rem; }
@media (min-width: 860px) { .scrolly { grid-template-columns: 1fr 1fr; align-items: start; } }
.scrolly-visual { position: sticky; top: 4.5rem; display: grid; place-items: center; min-height: 280px; z-index: 1;
  background: radial-gradient(60% 60% at 50% 55%, var(--brand-soft), transparent 70%); border-radius: 24px; }
@media (max-width: 859px) { .scrolly-visual { min-height: 200px; top: 4.2rem; background-color: var(--bg); } }
.scrolly-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; counter-reset: s; }
.scrolly-steps li { counter-increment: s; min-height: 46vh; display: flex; flex-direction: column; justify-content: center;
  gap: .35rem; padding: 1.25rem 1.25rem 1.25rem 4rem; position: relative; border-radius: 18px; border: 1px solid var(--line);
  background: var(--surface); opacity: .45; transition: opacity .4s, transform .5s cubic-bezier(.16, 1, .3, 1), border-color .4s; }
@media (max-width: 859px) { .scrolly-steps li { min-height: 30vh; } }
.scrolly-steps li::before { content: counter(s); position: absolute; left: 1.1rem; top: 50%; translate: 0 -50%; width: 2.2rem; height: 2.2rem;
  border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 800;
  transition: background .4s, color .4s, scale .4s; }
.scrolly-steps li.is-active { opacity: 1; border-color: var(--brand); transform: translateX(6px); }
.scrolly-steps li.is-active::before { background: var(--brand); color: var(--brand-ink); scale: 1.12; }
.scrolly-steps b { font-size: 1.15rem; }
.scrolly-steps span { color: var(--muted); }
.motion-off .scrolly-steps li, html:not(.motion-ready) .scrolly-steps li { opacity: 1; min-height: 0; }

/* Isométrico: tres capas (planes, socios, cobros) que se levantan según el paso. */
.iso { position: relative; width: 220px; height: 220px; transform: rotateX(56deg) rotateZ(-45deg); transform-style: preserve-3d; }
.iso-layer { position: absolute; inset: 0; border-radius: 22px; display: grid; place-items: center; font-weight: 800; font-size: 1.05rem;
  color: #fff; transform: translateZ(calc(var(--n) * 26px)); transition: transform .8s cubic-bezier(.34, 1.56, .64, 1), opacity .5s, box-shadow .5s;
  box-shadow: -14px 14px 0 -2px rgba(0, 0, 0, .12); opacity: .35; }
.iso-layer span { transform: rotateZ(45deg); text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.iso-layer.l1 { --n: 0; background: linear-gradient(135deg, #0f766e, #14b8a6); }
.iso-layer.l2 { --n: 1; background: linear-gradient(135deg, #0369a1, #38bdf8); }
.iso-layer.l3 { --n: 2; background: linear-gradient(135deg, #15803d, #4ade80); }
.iso-ping { position: absolute; inset: 0; border-radius: 22px; border: 2px solid var(--brand); transform: translateZ(0); opacity: 0; }
[data-scrolly][data-active="1"] .l1, [data-scrolly][data-active="2"] .l1, [data-scrolly][data-active="2"] .l2,
[data-scrolly][data-active="3"] .iso-layer { opacity: 1; }
[data-scrolly][data-active="1"] .l1 { transform: translateZ(40px); box-shadow: -26px 26px 30px -10px rgba(15, 118, 110, .45); }
[data-scrolly][data-active="2"] .l2 { transform: translateZ(70px); box-shadow: -26px 26px 30px -10px rgba(3, 105, 161, .45); }
[data-scrolly][data-active="3"] .l3 { transform: translateZ(100px); box-shadow: -26px 26px 30px -10px rgba(21, 128, 61, .45); }
[data-scrolly][data-active="3"] .iso-ping { animation: iso-ping 1.6s ease-out infinite; }
@keyframes iso-ping { from { opacity: .8; transform: translateZ(100px) scale(1); } to { opacity: 0; transform: translateZ(100px) scale(1.35); } }
.iso-caption { position: absolute; bottom: .9rem; left: 0; right: 0; text-align: center; font-weight: 700; color: var(--brand); font-size: .95rem; }
.iso-caption [data-cap] { display: none; }
[data-scrolly]:not([data-active]) .iso-caption [data-cap="1"], [data-scrolly][data-active="1"] .iso-caption [data-cap="1"],
[data-scrolly][data-active="2"] .iso-caption [data-cap="2"], [data-scrolly][data-active="3"] .iso-caption [data-cap="3"] { display: inline; }
.motion-off .iso-layer, html:not(.motion-ready) .iso-layer { opacity: 1; }
@media (max-width: 859px) { .iso { width: 150px; height: 150px; } .iso-layer { font-size: .85rem; } }

/* ---------- Microinteracciones ---------- */
.btn { position: relative; overflow: hidden; transition: transform .15s ease, box-shadow .25s ease, background-color .2s; }
.btn:active { transform: scale(.96); }
.btn.primary:hover { box-shadow: 0 10px 24px -12px var(--brand); transform: translateY(-1px); }
.btn.primary::after { content: ""; position: absolute; inset: 0 auto 0 -70%; width: 45%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); transition: left .7s ease; pointer-events: none; }
.btn.primary:hover::after { left: 130%; }
.ripple { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: currentColor; opacity: .3;
  pointer-events: none; animation: ripple .65s ease-out forwards; }
@keyframes ripple { to { transform: scale(40); opacity: 0; } }
.feature, .price-card, .pain-item { transition: transform .35s cubic-bezier(.16, 1, .3, 1), box-shadow .35s, border-color .35s; }
@media (hover: hover) {
  .feature:hover, .pain-item:hover { transform: translateY(-4px); box-shadow: 0 18px 36px -24px rgba(15, 40, 35, .55); }
  .price-card:hover { transform: translateY(-6px) rotateX(2deg); box-shadow: 0 24px 44px -26px rgba(15, 40, 35, .6); }
}
.faq summary { transition: color .2s; }
.faq summary:hover { color: var(--brand); }
.faq details[open] > p { animation: faq-open .4s cubic-bezier(.16, 1, .3, 1); }
@keyframes faq-open { from { opacity: 0; transform: translateY(-6px); } }
.bump { display: inline-block; animation: bump .45s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes bump { 40% { transform: scale(1.18); color: var(--brand); } }

/* ---------- Reducir movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .kt .kt-w { opacity: 1; transform: none; filter: none; }
}
