/* ==========================================================================
   Capa visual "liquid" para todas las páginas (la portada tiene la suya en pages/home.fx.css).
   Solo efectos: no cambia distribución, maquetación ni contenido.
   Todo se apaga con prefers-reduced-motion.
   ========================================================================== */

body:not(.page-home) {
    --liquid: cubic-bezier(.22, 1.4, .36, 1);
    --liquid-soft: cubic-bezier(.3, 1.25, .4, 1);
    --fx-red: 233, 63, 52;
}

/* --------------------------------------------------------------------------
   1. Entradas con desenfoque y rebote suave
      - Elementos que ya traían animación (data-reveal)
      - Y el resto de bloques de la página (.fx-item, los marca fx.js)
   -------------------------------------------------------------------------- */
.js body:not(.page-home) main [data-reveal] {
    filter: blur(10px);
    transform: translate3d(0, 26px, 0) scale(.97);
    transition: opacity .9s var(--ease), transform 1s var(--liquid-soft), filter .9s var(--ease);
    transition-delay: var(--reveal-delay, 0ms);
}
.js body:not(.page-home) main [data-reveal].from-top { transform: translate3d(0, -26px, 0) scale(.97); }
.js body:not(.page-home) main [data-reveal="left"] { transform: translate3d(-40px, 0, 0) scale(.97); }
.js body:not(.page-home) main [data-reveal="right"] { transform: translate3d(40px, 0, 0) scale(.97); }
.js body:not(.page-home) main [data-reveal="zoom"] { transform: scale(.9); }
.js body:not(.page-home) main [data-reveal="fade"] { transform: scale(1.02); }
.js body:not(.page-home) main [data-reveal].is-revealed { opacity: 1; transform: none; filter: none; }

html.fx-ready body:not(.page-home) main .fx-item {
    opacity: 0; filter: blur(10px); transform: translate3d(0, 24px, 0) scale(.975);
    transition: opacity .85s var(--ease), transform .95s var(--liquid-soft), filter .85s var(--ease);
    transition-delay: var(--fx-delay, 0ms);
}
html.fx-ready body:not(.page-home) main .fx-item.from-top { transform: translate3d(0, -24px, 0) scale(.975); }
html.fx-ready body:not(.page-home) main .fx-item.fx-in { opacity: 1; filter: none; transform: none; }
/* mientras se ve la cortina de carga, todo espera */
html.pt-enter body:not(.page-home) main .fx-item.fx-in,
html.pt-enter body:not(.page-home) main [data-reveal] { opacity: 0; filter: blur(10px); transform: translate3d(0, 24px, 0); transition: none; }

/* --------------------------------------------------------------------------
   2. Luces rojas muy tenues que flotan detrás de algunas secciones
   -------------------------------------------------------------------------- */
body:not(.page-home) main .b-section:nth-of-type(3n+2)::before,
body:not(.page-home) main .b-section:nth-of-type(3n+4)::after {
    content: ''; position: absolute; z-index: -1; pointer-events: none;
    width: 500px; height: 500px; border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--fx-red), .14), rgba(var(--fx-red), 0) 68%);
    filter: blur(30px);
    animation: fx-morph 15s linear infinite, fx-drift 23s ease-in-out infinite;
}
body:not(.page-home) main .b-section:nth-of-type(3n+2)::before { top: -80px; right: 4%; }
body:not(.page-home) main .b-section:nth-of-type(3n+4)::after { bottom: -60px; left: -140px; animation-direction: reverse, normal; animation-duration: 18s, 27s; }

@keyframes fx-morph {
    0%, 100% { border-radius: 42% 58% 63% 37% / 45% 40% 60% 55%; }
    33% { border-radius: 60% 40% 35% 65% / 55% 62% 38% 45%; }
    66% { border-radius: 38% 62% 50% 50% / 62% 35% 65% 38%; }
}
@keyframes fx-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    30% { transform: translate(-70px, 50px) scale(1.12); }
    60% { transform: translate(40px, 90px) scale(.9); }
    85% { transform: translate(60px, -30px) scale(1.06); }
}

/* --------------------------------------------------------------------------
   3. Fotos de fondo (bloques de imagen): zoom suave al pasar y parallax al hacer scroll.
      La foto se dibuja en una capa interna; la caja y su tamaño no cambian.
   -------------------------------------------------------------------------- */
body:not(.page-home) main .b-box.b-media { overflow: hidden; isolation: isolate; }
body:not(.page-home) main .b-box.b-media::before {
    content: ''; position: absolute; inset: -2px; z-index: -1; border-radius: inherit;
    background-image: inherit; background-size: cover; background-position: inherit; background-repeat: no-repeat;
    transform: translate3d(0, var(--par, 0px), 0) scale(1.1);
    transition: transform 1.2s cubic-bezier(.2, .7, .2, 1);
    will-change: transform;
}
body:not(.page-home) main .b-box.b-media:hover::before { transform: translate3d(0, var(--par, 0px), 0) scale(1.16); }

/* Imágenes sueltas: entran con un leve zoom */
body:not(.page-home) main .b-figure img { transition: transform .8s var(--liquid-soft), filter .5s ease; }
body:not(.page-home) main .b-figure a:hover img, body:not(.page-home) main .b-zoom:hover img { transform: scale(1.03); filter: brightness(1.05); }

/* --------------------------------------------------------------------------
   4. Tarjetas oscuras (cajas con fondo y bordes redondeados): brillo que sigue al cursor
   -------------------------------------------------------------------------- */
body:not(.page-home) main .fx-card { isolation: isolate; }
body:not(.page-home) main .fx-card::after {
    content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -30%), rgba(var(--fx-red), .10), transparent 55%);
    opacity: 0; transition: opacity .5s ease;
}
body:not(.page-home) main .fx-card:hover::after { opacity: 1; }

/* Cajas con ícono: se elevan con resorte y el ícono flota */
body:not(.page-home) main .b-iconbox { transition: transform .55s var(--liquid), background-color .3s ease; }
body:not(.page-home) main .b-iconbox:hover { transform: translateY(-5px); }
body:not(.page-home) main .b-ib-icon { animation: fx-float 4.6s ease-in-out infinite; transition: transform .5s var(--liquid); }
body:not(.page-home) main .b-w:nth-child(2n) .b-ib-icon { animation-delay: -1.6s; }
body:not(.page-home) main .b-w:nth-child(3n) .b-ib-icon { animation-delay: -3.1s; }
body:not(.page-home) main .b-iconbox:hover .b-ib-icon { animation-play-state: paused; transform: scale(1.14) rotate(-6deg); }
@keyframes fx-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }

/* Listas con íconos: el ícono late al pasar el cursor */
body:not(.page-home) main .b-icon-list li { transition: transform .45s var(--liquid); }
body:not(.page-home) main .b-icon-list li:hover { transform: translateX(4px); }

/* --------------------------------------------------------------------------
   5. Botones: relleno líquido que nace donde entra el cursor + gelatina al tocar
   -------------------------------------------------------------------------- */
body:not(.page-home) main .b-btn, body:not(.page-home) main .btn { position: relative; overflow: hidden; isolation: isolate; }
body:not(.page-home) main .b-btn::before, body:not(.page-home) main .btn::before {
    content: ''; position: absolute; left: var(--bx, 50%); top: var(--by, 50%); z-index: -1;
    width: 0; height: 0; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none;
    background: rgba(255, 255, 255, .18);
    transition: width .6s var(--liquid-soft), height .6s var(--liquid-soft);
    animation: fx-morph 3.5s linear infinite paused;
}
body:not(.page-home) main .b-btn:hover::before, body:not(.page-home) main .btn:hover::before { width: 260%; height: 600%; animation-play-state: running; }
.fx-jelly { animation: fx-jelly .6s cubic-bezier(.22, 1.4, .36, 1) !important; }
@keyframes fx-jelly {
    0% { transform: scale(1, 1); } 25% { transform: scale(1.07, .93); } 45% { transform: scale(.95, 1.05); }
    62% { transform: scale(1.025, .975); } 80% { transform: scale(.995, 1.005); } 100% { transform: scale(1, 1); }
}

/* --------------------------------------------------------------------------
   6. Títulos: la palabra en rojo recibe un destello cuando aparece
   -------------------------------------------------------------------------- */
body:not(.page-home) main .fx-in .texto-rojo, body:not(.page-home) main .is-revealed .texto-rojo,
body:not(.page-home) main .fx-in.texto-rojo {
    background: linear-gradient(100deg, var(--c-red) 40%, #ff9d8c 50%, var(--c-red) 60%) no-repeat;
    background-size: 250% 100%; background-position: 100% 0;
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    animation: fx-text-sheen 1.8s var(--ease) .5s 1 both;
}
@keyframes fx-text-sheen { from { background-position: 100% 0; } to { background-position: 0% 0; } }

/* Separadores: la línea se dibuja de lado a lado al aparecer */
body:not(.page-home) main .fx-item .b-divider-wrap span { transform: scaleX(0); transform-origin: left center; transition: transform 1s var(--liquid-soft) .25s; }
body:not(.page-home) main .fx-item[style*="center"] .b-divider-wrap span,
body:not(.page-home) main .b-divider-wrap[style*="center"] span { transform-origin: center; }
body:not(.page-home) main .fx-in .b-divider-wrap span { transform: scaleX(1); }

/* --------------------------------------------------------------------------
   7. Acordeones, pestañas, galerías y carruseles
   -------------------------------------------------------------------------- */
body:not(.page-home) main .b-acc-item.is-open > .b-acc-content,
body:not(.page-home) main .accordion-item.is-open > .accordion-content { animation: fx-liquid-in .7s var(--liquid-soft); }
body:not(.page-home) main .b-tab-panel.is-active { animation: fx-liquid-in .7s var(--liquid-soft); }
body:not(.page-home) main .b-acc-header { transition: background-color .3s ease, color .3s ease, transform .45s var(--liquid); }
body:not(.page-home) main .b-acc-header:hover { transform: translateX(4px); }
body:not(.page-home) main .b-gallery-item { transition: transform .6s var(--liquid), box-shadow .5s ease; }
body:not(.page-home) main .b-gallery-item:hover { transform: translateY(-5px); box-shadow: 0 16px 34px rgba(0, 0, 0, .4); position: relative; z-index: 2; }
body:not(.page-home) main .b-carousel .slider-slide img { transition: transform .9s cubic-bezier(.2, .7, .2, 1), filter .5s ease; }
body:not(.page-home) main .b-carousel .slider-slide:hover img { transform: scale(1.04); filter: brightness(1.06); }
@keyframes fx-liquid-in {
    0% { opacity: 0; transform: translateY(18px) scale(.96); filter: blur(10px); }
    55% { opacity: 1; transform: translateY(-3px) scale(1.01); filter: blur(0); }
    78% { transform: translateY(1px) scale(.998); }
    100% { opacity: 1; transform: none; filter: none; }
}

/* --------------------------------------------------------------------------
   Pantallas táctiles: sin efectos que dependen del cursor
   -------------------------------------------------------------------------- */
@media (hover: none) {
    body:not(.page-home) main .fx-card::after { display: none; }
}
@media (max-width: 767px) {
    body:not(.page-home) main .b-section:nth-of-type(3n+2)::before,
    body:not(.page-home) main .b-section:nth-of-type(3n+4)::after { width: 300px; height: 300px; }
}

/* --------------------------------------------------------------------------
   Movimiento reducido: todo quieto y visible
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    body:not(.page-home) main *, body:not(.page-home) main *::before, body:not(.page-home) main *::after { animation: none !important; transition: none !important; }
    html.fx-ready body:not(.page-home) main .fx-item, .js body:not(.page-home) main [data-reveal] { opacity: 1 !important; filter: none !important; transform: none !important; }
    body:not(.page-home) main .b-section::before, body:not(.page-home) main .b-section::after { display: none !important; }
    body:not(.page-home) main .b-divider-wrap span { transform: none !important; }
}