/* =========================================================
   INESUR · efectos y movimiento (código propio, sin librerías)
   Se activan solo si efectos.js agregó la clase .efx al <html>
   ========================================================= */

/* ---------- Precarga con el logo ---------- */
html.efx body::before {
  content: ""; position: fixed; inset: 0; z-index: 9998;
  background: radial-gradient(circle at 50% 45%, #0d4a94, #0a2f60 70%);
  transition: opacity .5s ease .1s, visibility .5s ease .1s;
}
html.efx body::after {
  content: ""; position: fixed; left: 50%; top: 50%; z-index: 9999;
  width: 170px; height: 100px; margin: -50px 0 0 -85px; border-radius: 18px;
  background: #fff url(../img/logo.png) center / 82% auto no-repeat;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
  animation: efx-rebote 1s ease-in-out infinite;
  transition: opacity .35s ease, visibility .35s ease;
}
html.efx.cargado body::before, html.efx.cargado body::after { opacity: 0; visibility: hidden; }
@keyframes efx-rebote { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-18px) scale(1.04); } }

/* ---------- Barra de avance de lectura ---------- */
.efx-avance { position: fixed; left: 0; top: 0; z-index: 100; height: 3px; width: 100%; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--amarillo), var(--verde)); pointer-events: none; }

/* ---------- Cursor con bolita ---------- */
.efx-cursor, .efx-punto { position: fixed; left: 0; top: 0; z-index: 9997; pointer-events: none; border-radius: 50%; opacity: 0; transition: opacity .3s, width .25s, height .25s, margin .25s, background .25s, border-color .25s; }
.efx-cursor { width: 38px; height: 38px; margin: -19px 0 0 -19px; border: 2px solid rgba(13, 74, 148, .55); }
.efx-punto { width: 8px; height: 8px; margin: -4px 0 0 -4px; background: var(--amarillo); }
.efx-cursor.activo, .efx-punto.activo { opacity: 1; }
.efx-cursor.sobre { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: rgba(245, 197, 24, .22); border-color: var(--amarillo); }
.efx-cursor.claro { border-color: rgba(255, 255, 255, .7); }

/* ---------- Entradas al hacer scroll (direcciones y escalonado) ---------- */
html.efx .revelar { transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1); }
html.efx .dos-col > .revelar:first-child { transform: translateX(-60px); }
html.efx .dos-col > .revelar:last-child { transform: translateX(60px); }
html.efx .banda-campus.revelar, html.efx .collage.revelar { transform: scale(.94) translateY(30px); }
html.efx .revelar.visto, html.efx .dos-col > .revelar.visto:first-child, html.efx .dos-col > .revelar.visto:last-child { transform: none; }
html.efx .grid-3 > .revelar:nth-child(2), html.efx .grid-5 > .revelar:nth-child(2), html.efx .grid-instructores > .revelar:nth-child(2) { transition-delay: .12s; }
html.efx .grid-3 > .revelar:nth-child(3), html.efx .grid-5 > .revelar:nth-child(3), html.efx .grid-instructores > .revelar:nth-child(3) { transition-delay: .24s; }
html.efx .grid-5 > .revelar:nth-child(4), html.efx .grid-instructores > .revelar:nth-child(4) { transition-delay: .36s; }
html.efx .grid-5 > .revelar:nth-child(5), html.efx .grid-instructores > .revelar:nth-child(5) { transition-delay: .48s; }
html.efx .grid-3 > .revelar:nth-child(n+4) { transition-delay: .1s; }
html.efx .lista-areas li { opacity: 0; transform: translateX(30px); transition: opacity .6s ease, transform .6s ease; }
html.efx .visto .lista-areas li { opacity: 1; transform: none; }
html.efx .visto .lista-areas li:nth-child(1) { transition-delay: .35s; }
html.efx .visto .lista-areas li:nth-child(2) { transition-delay: .5s; }
html.efx .visto .lista-areas li:nth-child(3) { transition-delay: .65s; }

/* ---------- Títulos que giran en 3D al aparecer ---------- */
.t3d .pal { display: inline-block; white-space: pre; transform-origin: 50% 0; }
html.efx .t3d .pal { opacity: 0; transform: perspective(400px) translateY(40px) rotateX(-80deg);
  transition: opacity .7s ease, transform .9s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--i) * 60ms + .1s); }
html.efx .visto .t3d .pal, html.efx .t3d.visto .pal { opacity: 1; transform: none; }

/* ---------- Encabezado de páginas internas: entrada al cargar ---------- */
html.efx .cabecera-pagina p { opacity: 0; transform: translateY(30px); transition: opacity .8s ease .55s, transform .8s cubic-bezier(.2, .7, .2, 1) .55s; }
html.efx.cargado .cabecera-pagina p { opacity: 1; transform: none; }

/* ---------- Slider: el título de la diapositiva activa gira palabra por palabra ---------- */
html.efx .slide .t3d .pal { transition-delay: calc(var(--i) * 70ms + .4s); }
html.efx .slide.activa .t3d .pal { opacity: 1; transform: none; }
html.efx:not(.cargado) .slide.activa .slide-chips, html.efx:not(.cargado) .slide.activa .bajada,
html.efx:not(.cargado) .slide.activa .acciones, html.efx:not(.cargado) .slide.activa .slide-circulo,
html.efx:not(.cargado) .slide.activa .sello-circulo, html.efx:not(.cargado) .slide.activa .t3d .pal { opacity: 0; transition: none; }
html.efx:not(.cargado) .slide.activa .sello-circulo { transform: scale(0); }

/* Tarjetas y formas flotando + seguimiento del mouse (usa "translate", no pisa "transform") */
.hero-tarjeta { animation: efx-flotar 5s ease-in-out infinite; transition: translate .4s ease-out; }
.hero-tarjeta.t2 { animation-delay: -2.5s; }
.forma { transition: translate .6s ease-out; }
.forma.f1 { animation: efx-girar 18s linear infinite; }
.forma.f2 { animation: efx-flotar 4s ease-in-out infinite; }
.forma.f3 { animation: efx-latir 2.6s ease-in-out infinite; }
.hero-foto { transition: translate .5s ease-out; }
.hero-foto img { animation: efx-respirar 12s ease-in-out infinite alternate; }
.hero .forma.f4 { width: 70px; height: 70px; right: 4%; top: 110px; border: 2px dashed rgba(255, 255, 255, .35); animation: efx-girar 22s linear infinite reverse; }
.hero .forma.f5 { width: 26px; height: 26px; left: 46%; bottom: 150px; border-radius: 6px; border: 3px solid rgba(140, 198, 63, .7); animation: efx-girar 9s linear infinite; }
@keyframes efx-flotar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes efx-girar { to { transform: rotate(360deg); } }
@keyframes efx-latir { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.6); } }
@keyframes efx-respirar { from { transform: scale(1); } to { transform: scale(1.08); } }

/* ---------- Cinta de texto en movimiento ---------- */
.cinta { position: relative; z-index: 2; overflow: hidden; background: var(--amarillo); color: var(--azul-osc); padding: 16px 0; transform: rotate(-1.2deg); margin: -10px -20px 0; box-shadow: 0 10px 30px rgba(13, 50, 100, .12); }
.cinta-pista { display: flex; width: max-content; animation: efx-cinta 38s linear infinite; }
.cinta:hover .cinta-pista { animation-play-state: paused; }
.cinta ul { display: flex; align-items: center; gap: 34px; margin: 0; padding: 0 34px 0 0; list-style: none; }
.cinta li { display: flex; align-items: center; gap: 34px; font-weight: 800; font-size: clamp(1rem, 2vw, 1.35rem); text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; }
.cinta li::after { content: ""; width: 18px; height: 18px; background: var(--azul); clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); }
@keyframes efx-cinta { to { transform: translateX(-50%); } }

/* ---------- Tarjetas: inclinación 3D y zoom de imagen ---------- */
.efx-incl { transform-style: preserve-3d; will-change: transform; }
.curso-img img, .instructor .foto img, .noticia .img img, .collage img { transition: transform .8s cubic-bezier(.2, .7, .2, 1); }
.curso:hover .curso-img img, .instructor:hover .foto img, .noticia:hover .img img, .collage:hover img { transform: scale(1.08); }
.curso-img, .instructor .foto, .noticia .img, .collage .grande { overflow: hidden; }
.categoria .ico { transition: transform .5s cubic-bezier(.3, 1.6, .5, 1); }
.categoria:hover .ico { transform: rotateY(180deg) scale(1.08); }
.lista-areas .ico { transition: transform .4s ease, background .3s; }
.lista-areas li:hover .ico { transform: translateY(-4px) rotate(-8deg); }

/* ---------- Botones con brillo que cruza ---------- */
.boton { position: relative; overflow: hidden; isolation: isolate; }
.boton::before { content: ""; position: absolute; z-index: -1; top: 0; left: -75%; width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent); transform: skewX(-20deg); }
.boton:hover::before { animation: efx-brillo .75s ease; }
.boton svg { transition: transform .25s ease; }
.boton:hover svg:last-child { transform: translateX(4px); }
@keyframes efx-brillo { to { left: 130%; } }

/* ---------- Sello "+10 años" ---------- */
.sello { animation: efx-flotar 6s ease-in-out infinite; }

/* ---------- Encabezado al bajar ---------- */
.cabecera .marca img { transition: height .3s ease, width .3s ease; }
.cabecera.con-sombra .contenedor { min-height: 70px; transition: min-height .3s; }

/* ---------- Accesibilidad: sin movimiento si el sistema lo pide ---------- */
@media (prefers-reduced-motion: reduce) {
  html.efx body::before, html.efx body::after, .efx-cursor, .efx-punto { display: none; }
  .cinta-pista, .hero-tarjeta, .forma, .hero-foto img, .sello { animation: none !important; }
  html.efx .t3d .pal, html.efx .revelar, html.efx .lista-areas li, html.efx .cabecera-pagina p,
  .slide.activa .slide-chips, .slide.activa .bajada, .slide.activa .acciones, .slide.activa .slide-circulo { opacity: 1 !important; transform: none !important; }
}
@media (max-width: 900px) {
  .cinta { transform: none; margin: 0; padding: 12px 0; }
}
main { overflow-x: clip; }
