/* Efectos visuales del portal AMN (todo se desactiva con "reducir movimiento") */

/* ---------- Pantalla de carga: sonar, olas, barra y salida en círculo ---------- */
.pl { overflow: hidden; clip-path: circle(150% at 50% 45%); transition: clip-path .9s cubic-bezier(.77, 0, .18, 1), visibility 0s linear .9s; }
.pl.is-done { opacity: 1; clip-path: circle(0% at 50% 45%); visibility: hidden; }
.pl.is-done .pl__inner { transform: scale(1.12); opacity: 0; transition: transform .7s ease, opacity .5s ease; }
.pl__crest { isolation: isolate; }
.pl__ripple { position: absolute; inset: 18px; border-radius: 50%; border: 1px solid rgba(224, 178, 60, .55); opacity: 0; animation: pl-sonar 2.4s cubic-bezier(.2, .6, .3, 1) infinite; z-index: -1; }
.pl__ripple:nth-child(2) { animation-delay: .8s; }
.pl__ripple:nth-child(3) { animation-delay: 1.6s; }
@keyframes pl-sonar { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(1.9); opacity: 0; } }
.pl__shield { animation: pl-in 1s cubic-bezier(.16, 1, .3, 1) both, pl-breathe 2.4s ease-in-out 1s infinite; }
@keyframes pl-in { from { transform: rotate(-120deg) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.pl__quote { animation: pl-up .7s ease .35s both; }
.pl__name { animation: pl-up .7s ease .55s both; }
@keyframes pl-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.pl__bar { width: 220px; height: 2px; margin: 22px auto 0; background: rgba(255, 255, 255, .12); border-radius: 2px; overflow: hidden; }
.pl__bar span { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, transparent, var(--gold), transparent); animation: pl-bar 1.2s ease-in-out infinite; }
@keyframes pl-bar { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.pl__waves, .hero__waves { position: absolute; left: 0; right: 0; bottom: 0; height: 120px; pointer-events: none; overflow: hidden; }
.pl__waves svg, .hero__waves svg { position: absolute; bottom: 0; left: 0; width: 200%; height: 100%; animation: wave-move 14s linear infinite; }
.pl__waves path { fill: rgba(47, 127, 184, .16); }
.pl__waves svg:nth-child(2) { animation-duration: 9s; animation-direction: reverse; opacity: .7; }
@keyframes wave-move { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Portada: brillo, olas animadas y entrada escalonada ---------- */
.hero::after { display: none; }
.hero__row { padding-bottom: 150px; }
.hero__glow { position: absolute; inset: -20% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px; border-radius: 50%; background: radial-gradient(circle, rgba(224, 178, 60, .16) 0%, rgba(47, 127, 184, .12) 35%, transparent 65%); animation: glow-drift 12s ease-in-out infinite alternate; pointer-events: none; }
@keyframes glow-drift { from { transform: translate(0, 0); } to { transform: translate(-8%, 6%); } }
.hero__waves { height: 110px; z-index: 1; }
.hero__waves path { fill: var(--white); }
.hero__waves svg:nth-child(1) { opacity: .25; animation-duration: 18s; }
.hero__waves svg:nth-child(2) { opacity: .45; animation-duration: 12s; animation-direction: reverse; }
.hero__waves svg:nth-child(3) { opacity: 1; animation-duration: 22s; }
.hero__crest { will-change: transform; }

.js [data-in] { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .9s cubic-bezier(.2, .8, .2, 1); }
.js .hero__crest[data-in] { transform: scale(.85) rotate(-25deg); transition-duration: 1.1s; }
.js body.is-ready [data-in] { opacity: 1; transform: none; }
.js body.is-ready [data-in="2"] { transition-delay: .12s; }
.js body.is-ready [data-in="3"] { transition-delay: .26s; }
.js body.is-ready [data-in="4"] { transition-delay: .4s; }
.hero h1 .hl { display: inline-block; }

/* Tarjetas: aparición escalonada y brillo al pasar */
.js .quick__grid .reveal:nth-child(2), .js .cmds .reveal:nth-child(4n+2), .js .vids .reveal:nth-child(3n+2) { transition-delay: .08s; }
.js .quick__grid .reveal:nth-child(3), .js .cmds .reveal:nth-child(4n+3), .js .vids .reveal:nth-child(3n) { transition-delay: .16s; }
.js .quick__grid .reveal:nth-child(4), .js .cmds .reveal:nth-child(4n) { transition-delay: .24s; }
.qcard { position: relative; overflow: hidden; }
.qcard::before { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(100deg, transparent, rgba(224, 178, 60, .14), transparent); transform: skewX(-20deg); transition: left .6s ease; pointer-events: none; }
.qcard:hover::before { left: 130%; }
.qcard__ico { transition: transform .3s ease, background .3s ease; }
.qcard:hover .qcard__ico { transform: rotate(-8deg) scale(1.08); background: var(--gold); color: var(--navy-900); }

/* Barra de progreso de lectura bajo la cabecera */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; background: var(--gold); transform-origin: 0 50%; transform: scaleX(0); z-index: 200; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
    .pl, .pl.is-done .pl__inner { transition: opacity .3s ease; clip-path: none; }
    .pl.is-done { opacity: 0; }
    .pl__ripple, .pl__bar span, .pl__waves svg, .hero__waves svg, .hero__glow, .pl__quote, .pl__name { animation: none; }
    .pl__shield { animation: none; }
    .js [data-in], .js .hero__crest[data-in] { opacity: 1; transform: none; transition: none; }
}

/* Fondo fotográfico de la portada (imagen generada con Gemini, optimizada) con zoom lento */
.hero__bg { position: absolute; inset: 0; background: url("img/hero-mar-1920.jpg") center 60% / cover no-repeat; background-image: image-set(url("img/hero-mar-1920.webp") type("image/webp"), url("img/hero-mar-1920.jpg") type("image/jpeg")); transform: scale(1.08); animation: kenburns 24s ease-out forwards; }
.hero__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(6, 20, 38, .94) 0%, rgba(7, 24, 46, .78) 42%, rgba(7, 24, 46, .25) 75%, rgba(6, 20, 38, .45) 100%), linear-gradient(0deg, rgba(6, 20, 38, .55) 0%, transparent 40%); }
@keyframes kenburns { to { transform: scale(1); } }
@media (max-width: 860px) {
    .hero__bg { background-image: image-set(url("img/hero-mar-1080.webp") type("image/webp"), url("img/hero-mar-1080.jpg") type("image/jpeg")); }
    .hero__bg::after { background: linear-gradient(180deg, rgba(6, 20, 38, .7) 0%, rgba(7, 24, 46, .88) 55%, rgba(6, 20, 38, .95) 100%); }
}
.hero__row, .hero__glow { position: relative; z-index: 1; }
.hero__glow { position: absolute; }
@media (prefers-reduced-motion: reduce) { .hero__bg { animation: none; transform: none; } }

/* Encabezados de página con fondo fotográfico (imágenes generadas con Gemini) */
.phero { position: relative; overflow: hidden; isolation: isolate; padding: 84px 0 76px; background-color: var(--navy-800); background-size: cover; background-position: center 55%; }
.phero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, rgba(6, 20, 38, .95) 0%, rgba(7, 24, 46, .82) 45%, rgba(7, 24, 46, .35) 100%); }
.pg-gente .phero { background-image: image-set(url("img/fondo-gente.webp") type("image/webp"), url("img/fondo-gente.jpg") type("image/jpeg")); }
.pg-servicios .phero, .pg-herramientas .phero { background-image: image-set(url("img/fondo-servicios.webp") type("image/webp"), url("img/fondo-servicios.jpg") type("image/jpeg")); }
.pg-institucion .phero, .pg-contacto .phero, .pg-multimedia .phero { background-image: image-set(url("img/fondo-institucion.webp") type("image/webp"), url("img/fondo-institucion.jpg") type("image/jpeg")); }
@media (max-width: 860px) {
    .pg-gente .phero { background-image: image-set(url("img/fondo-gente-1080.webp") type("image/webp"), url("img/fondo-gente-1080.jpg") type("image/jpeg")); }
    .pg-servicios .phero, .pg-herramientas .phero { background-image: image-set(url("img/fondo-servicios-1080.webp") type("image/webp"), url("img/fondo-servicios-1080.jpg") type("image/jpeg")); }
    .pg-institucion .phero, .pg-contacto .phero, .pg-multimedia .phero { background-image: image-set(url("img/fondo-institucion-1080.webp") type("image/webp"), url("img/fondo-institucion-1080.jpg") type("image/jpeg")); }
    .phero::before { background: linear-gradient(180deg, rgba(6, 20, 38, .8), rgba(6, 20, 38, .92)); }
}
