/* ===========================================================================
   Arco · CAPA DE EFECTOS (aditiva) — Director de arte
   Motivo: "el arco que conecta pregunta y respuesta" (Arco = arc literal:
   un trazo limpio que une dos puntos = lo que pregunta alguien y la respuesta
   del asistente, al instante; "sin complicarte").
   Reglas: todo lo de MOVIMIENTO vive bajo `html.fx` (lo activa efectos.js solo
   si hay JS y NO hay prefers-reduced-motion). Sin JS o con reduce-motion el
   contenido se ve en su estado final estático. Paleta: la de Arco (brand.css).
   =========================================================================== */

/* Foco visible (accesibilidad) */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px;
}

/* ---- Fondo ambiental + profundidad (detrás de todo el contenido) ---- */
#fx-bg { position: fixed; inset: 0; z-index: -3; pointer-events: none; }
#fx-bg canvas { display: block; width: 100%; height: 100%; }
.fx-blob {
  position: fixed; z-index: -2; pointer-events: none; border-radius: 50%;
  filter: blur(72px); opacity: .55;
}
.fx-blob.a { width: 46vw; height: 46vw; left: -10vw; top: -8vw; opacity: .7;
  background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--primary) 42%, transparent), transparent 70%); }
.fx-blob.b { width: 42vw; height: 42vw; right: -12vw; bottom: -10vw; opacity: .7;
  background: radial-gradient(circle at 60% 40%, color-mix(in srgb, var(--accent) 36%, transparent), transparent 70%); }
/* scrim translúcido SUTIL: da legibilidad sin lavar el ambiente */
#fx-scrim { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 28%, transparent), color-mix(in srgb, var(--bg) 48%, transparent)); }

/* drift muy lento, SOLO con efectos activos */
html.fx .fx-blob.a { animation: fx-drift-a 28s ease-in-out infinite alternate; }
html.fx .fx-blob.b { animation: fx-drift-b 34s ease-in-out infinite alternate; }
@keyframes fx-drift-a { to { transform: translate(6vw, 4vw) scale(1.08); } }
@keyframes fx-drift-b { to { transform: translate(-5vw, -3vw) scale(1.06); } }

/* ---- Acento cromático firma recortado en texto (logo + cifras) ---- */
.fx-grad {
  background: linear-gradient(100deg, var(--primary), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---- Reveal al scroll (solo con efectos; sin .fx el contenido es visible) ---- */
html.fx .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
html.fx .reveal.in { opacity: 1; transform: none; }

/* ---- Hover de cards: lift + acento + detalle de luz (el "arco" de luz) ---- */
.card, .price, .demo-card { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.card:hover, .price:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: 0 14px 34px var(--primary-glow); }
.card { position: relative; overflow: hidden; }
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(140px 140px at var(--mx, 50%) var(--my, -20%), color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%);
  opacity: 0; transition: opacity .25s ease;
}
.card:hover::after { opacity: 1; }

/* ---- Showpiece del hero: mini-asistente que demuestra el claim ---- */
#fx-show {
  max-width: 380px; margin: 32px auto 0; text-align: left; overflow: hidden;
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(6px);
  border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 16px 44px rgba(17,35,63,.14);
  min-height: 190px; /* reserva altura para no causar layout shift */
}
#fx-show .fx-show-head { background: var(--primary); color: #fff; font-weight: 700; font-size: 14px; padding: 12px 15px; display: flex; gap: 8px; align-items: center; }
#fx-show .fx-show-head .dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; }
#fx-show .fx-show-body { position: relative; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-height: 130px; }
#fx-show .fx-arc { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
#fx-show .fx-q, #fx-show .fx-a { font-size: 14px; line-height: 1.45; padding: 10px 13px; border-radius: 14px; max-width: 86%; position: relative; z-index: 1; }
#fx-show .fx-q { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; min-height: 20px; }
#fx-show .fx-a { align-self: flex-start; background: var(--chip); color: var(--text); border-bottom-left-radius: 4px; min-height: 20px; }
.fx-cursor::after { content: "▍"; opacity: .55; animation: fx-blink 1s steps(1) infinite; }
@keyframes fx-blink { 50% { opacity: 0; } }

/* ---- Toggle de previsualización on/off ---- */
#fx-toggle {
  position: fixed; left: 14px; bottom: 14px; z-index: 70; cursor: pointer;
  background: var(--surface); color: var(--muted); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 13px; font: 600 12px/1 'Inter', system-ui, sans-serif;
  box-shadow: 0 4px 14px rgba(17,35,63,.12); opacity: .5; transition: opacity .2s ease;
}
#fx-toggle:hover { opacity: 1; }

/* ---- Seguridad accesibilidad: con reduce-motion nada se mueve...
   ...SALVO override explícito del usuario (html.fx-force, vía el toggle) ---- */
@media (prefers-reduced-motion: reduce) {
  html.fx:not(.fx-force) .fx-blob { animation: none; }
  html.fx:not(.fx-force) .reveal { opacity: 1 !important; transform: none !important; transition: none; }
  html:not(.fx-force) #fx-bg { display: none; }
  html:not(.fx-force) .fx-cursor::after { animation: none; }
}
