/* Kovan Digital — movimiento y transiciones (v2, 14-11-2026). Todo cuelga de la clase .mo (la pone motion.js);
   con «reducir movimiento» no se activa. Sin nada inline (CSP). */

/* Transición entre páginas (navegadores compatibles; el resto navega como siempre) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: mo-sale 0.22s ease both; }
::view-transition-new(root) { animation: mo-entra 0.38s cubic-bezier(.2, .7, .2, 1) both; }
.site-header { view-transition-name: cabecera; }
::view-transition-group(cabecera) { animation-duration: 0s; }
@keyframes mo-sale { to { opacity: 0; transform: translateY(-10px); } }
@keyframes mo-entra { from { opacity: 0; transform: translateY(16px); } }

.mo { scroll-behavior: smooth; }

/* Aparición con desenfoque */
.mo .reveal { filter: blur(8px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(.2, .7, .2, 1), filter 0.8s ease; }
.mo .reveal.is-visible { filter: none; }

/* Títulos de sección: línea que se dibuja */
.mo .section-title { position: relative; padding-bottom: 14px; }
.mo .section-title::after { content: ''; position: absolute; left: 0; bottom: 0; width: 64px; height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.9s cubic-bezier(.2, .7, .2, 1) 0.25s; }
.mo .section-title.is-visible::after { transform: scaleX(1); }

/* Foco de luz que sigue al cursor en las tarjetas */
.mo .mo-spot { position: relative; isolation: isolate; }
.mo .mo-spot::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1; opacity: 0; transition: opacity 0.35s ease;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--card-hover), transparent 65%); }
.mo .mo-spot:hover::after { opacity: 1; }

/* La K en 3D (k3d.js): sustituye a la imagen fija de la cabecera */
.hero-art.k3d-on, .fx .hero-art.k3d-on { background-image: none; -webkit-mask-image: none; mask-image: none; opacity: 1; translate: none; rotate: none; animation: none; }
.k3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* Charco de luz (tema oscuro) o sombra (tema claro) bajo la K: la asienta en el espacio */
.hero-art.k3d-on::after { content: ''; position: absolute; left: 50%; bottom: 7%; width: 44%; height: 9%; translate: -50% 0; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--ink) 16%, transparent), transparent); filter: blur(6px); }

/* Cinta de sectores */
.mo-marquee { border-top: 1px solid var(--line); overflow: hidden; padding: 18px 0; background: var(--bg);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.mo-marquee-track { display: flex; gap: 48px; width: max-content; font-family: var(--font-head); font-size: 13px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.mo-marquee-track span::before { content: '·'; margin-right: 48px; color: var(--muted-2); }
.mo .mo-marquee-track { animation: mo-cinta 38s linear infinite; }
.mo .mo-marquee:hover .mo-marquee-track { animation-play-state: paused; }
@keyframes mo-cinta { to { transform: translateX(-50%); } }

/* Indicador de «sigue bajando» en el hero */
.mo-cue { position: absolute; left: 50%; bottom: 22px; width: 22px; height: 36px; margin-left: -11px; border: 1px solid var(--line-strong); border-radius: 12px; opacity: 0.7; z-index: 2; }
.mo-cue::after { content: ''; position: absolute; left: 50%; top: 7px; width: 2px; height: 7px; margin-left: -1px; border-radius: 2px; background: var(--ink); }
.mo .mo-cue::after { animation: mo-rueda 1.8s ease-in-out infinite; }
@keyframes mo-rueda { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(12px); opacity: 0; } 100% { transform: translateY(0); opacity: 0; } }
@media (max-width: 760px), (max-height: 620px) { .mo-cue { display: none; } }

/* Proceso compacto */
.process-lead { color: var(--ink-2); font-size: 17px; margin: 0; max-width: 44ch; }
.process-lead strong { color: var(--ink); font-weight: 600; }

/* Enlaces y botones: flecha que avanza */
.mo .btn svg { transition: transform 0.3s ease; }
.mo .btn:hover svg { transform: translateX(4px); }

/* Acordeón de preguntas: aparición suave de la respuesta */
.mo .faq-item.open .faq-a p { animation: mo-entra 0.4s ease both; }

/* ---------- Teléfono y pantallas táctiles: mismo carácter, menos coste ---------- */
.mo a, .mo button, .mo .imp-chip { -webkit-tap-highlight-color: transparent; }
.mo .btn:active, .mo .btn-ghost:active { transform: scale(0.97); }
@media (max-width: 900px), (pointer: coarse) {
  .mo .reveal { filter: none; transform: translateY(14px); transition: opacity 0.55s ease, transform 0.55s cubic-bezier(.2, .7, .2, 1); }   /* sin desenfoque: es lo más caro en móvil */
  .mo .reveal.is-visible { transform: none; }
  .mo .mo-spot::after { display: none; }                         /* el foco de luz es para ratón */
  .mo-marquee { padding: 14px 0; }
  .mo-marquee-track { gap: 28px; font-size: 11px; }
  .mo-marquee-track span::before { margin-right: 28px; }
  .mo .mo-marquee-track { animation-duration: 24s; }
  .mo .section-title::after { width: 48px; }
  ::view-transition-old(root) { animation-duration: 0.16s; }
  ::view-transition-new(root) { animation-duration: 0.26s; }
}
@media (max-width: 900px) {
  /* En el teléfono la K va arriba, lo primero que se ve, y el texto debajo */
  .hero-art.k3d-on { order: 0; height: 270px; height: clamp(230px, 32svh, 320px); }   /* svh: no cambia al esconderse la barra de Safari */
  .hero:has(.k3d-on) .hero-inner { padding-top: 0; padding-bottom: 44px; }
  .hero:has(.k3d-on) .hero-meta { display: none; }
  .hero:has(.k3d-on) .hero-cta { margin-top: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
