/* WEB DE UN MILLÓN · efectos con medida (va junto a efectos.js)
   Solo actúan cuando efectos.js pone la clase .fx en <html>: si el JS falla, todo se ve normal. */

/* 1 · Entrada uno a uno al bajar */
.fx [data-reveal],
.fx [data-stagger] > * {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity .7s ease, transform .9s cubic-bezier(.22, 1, .36, 1);
  transition-delay: calc(var(--fx-i, 0) * 90ms);
}
.fx [data-reveal].fx-in,
.fx [data-stagger].fx-in > * { opacity: 1; transform: none; }

/* 2 · Botón magnético */
.fx [data-magnet] { display: inline-flex; transition: transform .45s cubic-bezier(.22, 1, .36, 1); will-change: transform; }
.fx [data-magnet] .fx-mag-in { display: inline-block; transition: transform .45s cubic-bezier(.22, 1, .36, 1); pointer-events: none; }
.fx [data-magnet].fx-mag-on, .fx [data-magnet].fx-mag-on .fx-mag-in { transition-duration: .12s; }

/* 3 · Texto que se escribe solo */
.fx [data-type]::after { content: ""; display: inline-block; width: .06em; height: .9em; margin-left: .08em; vertical-align: -.08em; background: currentColor; animation: fx-caret 1s steps(1) infinite; }
.fx [data-type].fx-done:not([data-loop])::after { animation: fx-caret 1s steps(1) 3 forwards; }
@keyframes fx-caret { 50% { opacity: 0; } }

/* 4 · Parallax */
.fx [data-parallax] { will-change: transform; }

/* 5 · Cursor personalizado (solo con ratón) */
.fx-cursor, .fx-ring { position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; border-radius: 50%; opacity: 0; transition: opacity .3s, width .3s, height .3s, margin .3s, background .3s, border-color .3s; }
.fx-cursor { width: 8px; height: 8px; margin: -4px 0 0 -4px; background: var(--fx-cursor, #111); }
.fx-ring { width: 36px; height: 36px; margin: -18px 0 0 -18px; border: 1px solid var(--fx-cursor, #111); }
.fx-has-cursor .fx-cursor, .fx-has-cursor .fx-ring { opacity: 1; }
.fx-has-cursor.fx-hover .fx-ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: color-mix(in srgb, var(--fx-cursor, #111) 12%, transparent); }
.fx-has-cursor, .fx-has-cursor a, .fx-has-cursor button { cursor: none; }
.fx-has-cursor input, .fx-has-cursor textarea, .fx-has-cursor select { cursor: text; }

/* Quien prefiere menos movimiento: todo quieto y visible */
@media (prefers-reduced-motion: reduce) {
  .fx [data-reveal], .fx [data-stagger] > * { opacity: 1; transform: none; transition: none; }
  .fx [data-type]::after { display: none; }
}

/* 6 · Pestañas con crossfade: lo viejo se desvanece mientras lo nuevo aparece, a la vez */
.fx .fx-paneles { display: grid; }
.fx [data-panel] { grid-area: 1 / 1; transition: opacity .45s ease, visibility 0s linear .45s; }
.fx [data-panel]:not(.fx-activo) { opacity: 0; visibility: hidden; pointer-events: none; }
.fx [data-panel].fx-activo { opacity: 1; visibility: visible; transition: opacity .45s ease, visibility 0s; }

/* 7 · Elemento compartido: la guía que se abre */
.fx-guia { position: fixed; inset: 0; z-index: 9000; overflow: auto; background: var(--fx-fondo, #fff); color: inherit; }
.fx-guia[hidden] { display: none; }
::view-transition-group(fx-titulo) { animation-duration: .55s; animation-timing-function: cubic-bezier(.22, 1, .36, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }

/* 8 · Magnificación: menú de abajo tipo lupa (solo con ratón) */
.fx [data-dock] > * { transform-origin: 50% 100%; transition: transform .14s ease-out; will-change: transform; }

/* 9 · Desenfoque: todo borroso menos la cifra que importa */
.fx [data-focus] > * { transition: filter .5s ease, opacity .5s ease, transform .5s cubic-bezier(.22, 1, .36, 1); }
.fx [data-focus].fx-enfoque > :not(.fx-nitido) { filter: blur(4px); opacity: .45; }
.fx [data-focus].fx-enfoque > .fx-nitido { transform: scale(1.05); }

@media (prefers-reduced-motion: reduce) {
  .fx [data-panel], .fx [data-panel].fx-activo, .fx [data-panel]:not(.fx-activo), .fx [data-dock] > *, .fx [data-focus] > * { transition: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
