/* ==========================================================================
   Animal Libre — capa v4
   Se carga al final. Corrige parpadeos, agrega scroll fluido, preloader
   cinematográfico, telón con golondrina y los momentos firma.
   ========================================================================== */

/* ---------- Scroll fluido (Lenis) ---------- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
html { scroll-behavior: auto; }

/* ---------- Sin parpadeos: estado inicial oculto ANTES del primer pintado.
   La clase al-js la pone un script en el <head>; si GSAP no llega,
   un seguro la quita a los 3 s y todo queda visible. ---------- */
html.al-js .mil-up,
html.al-js [data-cascada] > *,
html.al-js .al-entra { opacity: 0; }
html.al-js .al-linea > span { transform: translateY(115%); }
html.al-js .al-titulo { opacity: 0; }
html.al-js .mil-banner .mil-frame-top { opacity: 0; }

/* ---------- Preloader ---------- */
.mil-preloader { position: fixed; inset: 0; z-index: 1001; background: #000; display: block; }
html.al-visto .mil-preloader { display: none; }
.mil-preloader .mil-preloader-animation { opacity: 1; height: 100%; position: relative; }
.al-pre-palabras { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 28px; }
.al-pre-palabras p { margin: 0; opacity: 0; color: rgba(255,255,255,.9); font-family: 'Heuvel Grotesk','Outfit',sans-serif; font-size: clamp(1.8rem, 1.2rem + 2vw, 3rem); }
.al-pre-palabras p:nth-child(2) { font-weight: 600; }
.al-pre-palabras p:not(:nth-child(2)) { font-weight: 400; color: rgba(255,255,255,.55); }
@media (max-width: 700px) { .al-pre-palabras { flex-direction: column; gap: 8px; } }
.al-pre-marca { position: absolute; left: 0; right: 0; top: 50%; text-align: center; transform: translateY(70px); }
.al-pre-marca span { display: inline-block; opacity: 0; color: #fff; font-family: 'Heuvel Grotesk','Outfit',sans-serif; font-size: clamp(1.1rem, .9rem + .8vw, 1.6rem); font-weight: 500; letter-spacing: .5em; padding-left: .5em; }
#golondrina-draw-container { position: fixed; left: 50%; top: 50%; width: 120px; height: auto; margin-left: -60px; margin-top: -150px; transform: none; opacity: 0; z-index: 1002; pointer-events: none; overflow: visible; }
.al-pre-saltar { position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%); background: none; border: 0; color: rgba(255,255,255,.45); font: 500 .8rem 'Outfit', sans-serif; letter-spacing: .2em; text-transform: uppercase; cursor: pointer; }
.al-pre-saltar:hover { color: #fff; }

/* ---------- Telón entre páginas, con la golondrina ---------- */
.al-telon { position: fixed; inset: 0; z-index: 1000; pointer-events: none; background: #0b060e; transform: translateY(100%); display: flex; align-items: center; justify-content: center; }
.al-telon img { width: 56px; height: auto; opacity: 0; }
html.al-llegada .al-telon { transform: translateY(0); }
html.al-llegada .al-telon img { opacity: 1; }

/* ---------- Marco: 15 años junto al logo ---------- */
#al-15-anos-svg { height: 64px; width: auto; margin-left: 4px; opacity: 0; overflow: visible; transform: translateY(6px); }
.mil-frame.al-oscuro #al-15-anos-svg text { fill: url(#al-text-gradient); }
@media (max-width: 1200px) { #al-15-anos-svg { display: none; } }

/* ---------- Hero ---------- */
.al-hero { overflow: hidden; }
.al-hero .al-hero-contenido { position: relative; z-index: 2; height: 100%; display: flex; align-items: flex-end; }
.al-hero .mil-banner-content { width: 100%; }
.al-hero .al-hero-fondo-video { will-change: transform, filter; }
.al-hero--interna { height: auto; min-height: 92vh; display: flex; }
.al-hero--interna .mi-invert-fix { width: 100%; display: flex; }
.al-hero--interna .al-hero-contenido { padding-top: 190px; }
.al-hero--interna .al-hero-h1 { font-size: clamp(2.8rem, 1.6rem + 5vw, 6rem); }
.al-hero--interna .mil-circle-text { bottom: 60px; }
.al-nebulosa--suave { opacity: .5; mix-blend-mode: screen; }
.mil-video-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.45) 45%, rgba(0,0,0,.85) 100%); z-index: 1; pointer-events: none; }
.al-hero .al-hero-poster { opacity: .6; }
.al-migas { margin-bottom: 30px; }

/* ---------- Textos grandes que se iluminan ---------- */
.al-texto-grande { font-family: 'Heuvel Grotesk','Outfit',sans-serif; font-size: clamp(1.45rem, 1rem + 1.4vw, 2.1rem) !important; line-height: 1.3 !important; color: #000; font-weight: 500; letter-spacing: -0.01em; }
.al-texto-grande--claro { color: #fff; }
.al-palabra { display: inline-block; will-change: opacity; }

/* ---------- Momento firma: la noticia es la puerta ---------- */
.al-lectura .mi-invert-fix { min-height: 100vh; }
.al-lectura-escena { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding-top: 120px; padding-bottom: 80px; }
.al-lectura-cabeza { margin-bottom: 56px; max-width: 900px; }
.al-lectura-cabeza h2 { font-size: clamp(2.2rem, 1.4rem + 3vw, 4rem); line-height: 1.08; }
.al-casos { position: relative; min-height: 340px; }
.al-caso { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }
.al-caso-rotulo { display: block; margin-bottom: 18px; font-family: 'Outfit', sans-serif; font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; }
.al-caso-medio { color: rgba(255,255,255,.45); font-size: clamp(1.4rem, 1rem + 1.4vw, 2.2rem); line-height: 1.3; font-family: 'Heuvel Grotesk','Outfit',sans-serif; }
.al-caso-medio .al-caso-rotulo { color: rgba(255,255,255,.4); }
.al-caso-nuestra { color: #fff; font-size: clamp(1.6rem, 1.1rem + 1.9vw, 2.9rem); line-height: 1.2; font-family: 'Heuvel Grotesk','Outfit',sans-serif; font-weight: 500; }
.al-caso-nuestra .al-caso-rotulo { color: #d8b4f5; }
.al-caso-medio { position: relative; }
.al-caso-medio::after { content: ""; position: absolute; left: 0; bottom: -18px; height: 3px; width: 100%; background: linear-gradient(90deg, #7E17BE, #E93B24); transform: scaleX(var(--tachado, 0)); transform-origin: left; }
.al-casos-puntos { display: flex; gap: 10px; margin-top: 48px; }
.al-casos-puntos span { width: 36px; height: 3px; background: rgba(255,255,255,.18); border-radius: 3px; overflow: hidden; position: relative; }
.al-casos-puntos span::after { content: ""; position: absolute; inset: 0; background: #fff; transform: scaleX(var(--p, 0)); transform-origin: left; }
@media (max-width: 991px) {
  .al-lectura .mi-invert-fix, .al-lectura-escena { min-height: 0; }
  .al-casos { min-height: 0; display: grid; gap: 56px; }
  .al-caso { position: relative; grid-template-columns: 1fr; gap: 28px; }
  .al-casos-puntos { display: none; }
}

/* ---------- Proyectos (página) ---------- */
.al-proyecto-bloque { padding: 120px 0; position: relative; }
.al-proyecto-bloque:nth-of-type(even) { background: var(--al-niebla); }
.al-proyecto-bloque .al-descubre { aspect-ratio: 4 / 5; border-radius: 20px; overflow: hidden; position: relative; }
.al-proyecto-bloque .al-descubre img { width: 100%; height: 100%; object-fit: cover; }
.al-proyecto-bloque h2 { font-size: clamp(2.3rem, 1.4rem + 3.2vw, 4.2rem); line-height: 1.04; letter-spacing: -0.025em; }
.al-proyecto-bloque h2 .mil-thin { display: block; font-size: .62em; margin-top: 8px; }
.al-proyecto-bloque h4 { color: #333; line-height: 1.4; margin: 26px 0 18px; font-weight: 500; }
.al-proyecto-num { position: absolute; top: 18px; left: 22px; z-index: 2; font-family: 'Heuvel Grotesk','Outfit',sans-serif; font-size: 4.5rem; font-weight: 600; line-height: 1; color: #fff; mix-blend-mode: difference; }
.al-pronto { display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px; border-radius: 40px; border: 1px solid var(--al-accent-20); color: var(--al-accent); font-size: .9rem; }
.al-pronto::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #E93B24; animation: al-latido 1.6s ease-in-out infinite; }
@keyframes al-latido { 0%,100% { transform: scale(1); opacity: 1 } 50% { transform: scale(1.6); opacity: .4 } }
@media (max-width: 991px) { .al-proyecto-bloque { padding: 80px 0; } .al-proyecto-bloque .al-descubre { aspect-ratio: 4 / 3; margin-bottom: 40px; } }

/* Burbujas de Bajo las jaulas */
.al-jaulas canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.al-jaulas span { z-index: 1; }

/* Tarjetas de impacto con número */
.al-impact-card__num { display: block; margin-bottom: 22px; font-family: 'Heuvel Grotesk','Outfit',sans-serif; font-size: 2.6rem; font-weight: 600; line-height: 1; background: linear-gradient(100deg, #7E17BE, #E93B24); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Únete ---------- */
.al-impact-box { padding: 40px 36px; border-radius: 20px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(10px); margin-bottom: 30px; }
.al-impact-item { display: flex; gap: 18px; align-items: baseline; padding: 16px 0; border-top: 1px solid rgba(255,255,255,.1); }
.al-impact-num { font-family: 'Heuvel Grotesk','Outfit',sans-serif; font-weight: 600; color: #d8b4f5; }
.al-impact-item p { margin: 0; font-size: 1.05rem; }
.al-forma-num { font-family: 'Heuvel Grotesk','Outfit',sans-serif; font-size: 1rem; font-weight: 600; color: var(--al-accent); }
.al-section-title-large { font-size: clamp(2.6rem, 1.6rem + 3.6vw, 4.5rem); }

/* ---------- Tienda: insignia ---------- */
.al-showcase__details-link { margin-top: 6px; }

/* ---------- Blog / teasers ---------- */
a.al-teaser { display: block; color: inherit; text-decoration: none; }
.al-teaser .mil-cover-frame { border-radius: 20px; overflow: hidden; }
.al-teaser img { transition: transform 1s cubic-bezier(.2,.8,.2,1); }
.al-teaser:hover img { transform: scale(1.06); }
.al-teaser-overlay { display: flex; align-items: center; justify-content: center; }
.al-teaser-overlay .al-btn-coming-soon { background: #fff; }

/* ---------- Visor de fotos ---------- */
.al-zoom { border: 0; padding: 0; background: none; cursor: zoom-in; }
.al-visor { position: fixed; inset: 0; z-index: 990; display: flex; align-items: center; justify-content: center; background: rgba(8,4,10,.92); opacity: 0; pointer-events: none; }
.al-visor.al-abierto { pointer-events: all; }
.al-visor img { max-width: min(90vw, 1200px); max-height: 86vh; border-radius: 14px; box-shadow: 0 40px 80px rgba(0,0,0,.5); }
.al-visor button { position: absolute; top: 24px; right: 24px; width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: none; color: #fff; font-size: 1.4rem; cursor: pointer; }

/* ---------- Secciones con foto de fondo ---------- */
#sumate .mil-video-wrapper { overflow: hidden; }
#sumate .al-hero-poster { opacity: .35; height: 120%; top: -10%; }

/* ---------- Pulido general ---------- */
.mil-button, .al-showcase__cta { will-change: transform; }
.al-titulo { will-change: transform, opacity; }
img { -webkit-user-drag: none; }
::selection { background: #7E17BE; color: #fff; }
.al-proyecto-bloque .al-jaulas--grande { position: absolute; inset: 0; }
.al-jaulas-titulo { position: absolute; left: 30px; bottom: 30px; z-index: 2; color: #fff; font-family: 'Heuvel Grotesk','Outfit',sans-serif; font-weight: 600; font-size: clamp(2.6rem, 1.6rem + 3vw, 4.6rem); line-height: .95; letter-spacing: -0.03em; }
.al-proyecto-foto .al-jaulas { position: absolute; inset: 0; }
.al-proyecto-foto .al-jaulas span { font-size: 2.2rem; }
.al-pre-palabras { position: fixed; inset: 0; }
