/* =========================================================
   Sistema de animaciones PREMIUM · Colegio NSD
   - marquee, magnetic, tilt, gradient shift, blob morph
   - waves, shimmer, float, glow, stagger reveals
   ========================================================= */

/* ===== Reveal premium con stagger ===== */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity .45s cubic-bezier(.2,.8,.2,1),
    transform .45s cubic-bezier(.2,.8,.2,1),
    filter .45s cubic-bezier(.2,.8,.2,1);
  filter: blur(4px);
  will-change: opacity, transform, filter;
}
[data-reveal="fade"] { transform: none; }
[data-reveal="left"] { transform: translateX(-32px); }
[data-reveal="right"] { transform: translateX(32px); }
[data-reveal="zoom"] { transform: scale(.9); }
[data-reveal].is-visible {
  opacity: 1;
  transform: translate(0,0) scale(1);
  filter: blur(0);
}
[data-reveal-delay="1"]  { transition-delay: .05s; }
[data-reveal-delay="2"]  { transition-delay: .10s; }
[data-reveal-delay="3"]  { transition-delay: .15s; }
[data-reveal-delay="4"]  { transition-delay: .20s; }
[data-reveal-delay="5"]  { transition-delay: .25s; }
[data-reveal-delay="6"]  { transition-delay: .30s; }
[data-reveal-delay="7"]  { transition-delay: .35s; }
[data-reveal-delay="8"]  { transition-delay: .40s; }

/* ===== Marquee infinito ===== */
.marquee {
  position: relative;
  overflow: hidden;
  background: var(--brand-900);
  color: #fff;
  padding: 18px 0;
  border-top: 1px solid rgba(255,255,255,.05);
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.marquee::before, .marquee::after {
  content: "";
  position: absolute; top: 0; bottom: 0; width: 80px;
  z-index: 2; pointer-events: none;
}
.marquee::before { left: 0;  background: linear-gradient(90deg, var(--brand-900), transparent); }
.marquee::after  { right: 0; background: linear-gradient(-90deg, var(--brand-900), transparent); }

.marquee--soft {
  background: var(--ink-50); color: var(--ink-900);
  border-color: var(--ink-100);
}
.marquee--soft::before { background: linear-gradient(90deg, var(--ink-50), transparent); }
.marquee--soft::after  { background: linear-gradient(-90deg, var(--ink-50), transparent); }

.marquee__track {
  display: flex; gap: 48px;
  width: max-content;
  animation: marquee 38s linear infinite;
  /* GPU-acceleration: forzar capa de composición propia */
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  contain: layout style paint;
}
.marquee:hover .marquee__track { animation-play-state: paused; }

.marquee__item {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: -.01em;
  white-space: nowrap;
}
.marquee__star {
  width: 22px; height: 22px;
  background: var(--yellow-500); flex: none;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 0c.5 6 5.5 11 11 11-6 .5-11 5.5-11 11-.5-6-5.5-11-11-11 6-.5 11-5.5 11-11z'/></svg>") no-repeat center/contain;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 0c.5 6 5.5 11 11 11-6 .5-11 5.5-11 11-.5-6-5.5-11-11-11 6-.5 11-5.5 11-11z'/></svg>") no-repeat center/contain;
  animation: spin 6s linear infinite;
  will-change: transform;
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Magnetic button (potenciado por JS) ===== */
.magnetic {
  display: inline-flex;
  transform-style: preserve-3d;
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}

/* ===== Shine sweep en cards ===== */
.shine {
  position: relative;
  overflow: hidden;
}
/* El reflejo se mueve con la posición del degradado, no con
   translate: así no se sale de la tarjeta aunque esta tenga
   overflow visible (la destacada lo necesita para su halo). */
.shine::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  /* Sobre una tarjeta clara, una banda blanca sola no se ve: lleva a
     los lados un velo apenas oscuro para que el reflejo se note. */
  background: linear-gradient(115deg,
    transparent 0%,
    transparent 36%,
    color-mix(in srgb, var(--ink-900) 5%, transparent) 43%,
    rgba(255,255,255,.92) 50%,
    color-mix(in srgb, var(--ink-900) 5%, transparent) 57%,
    transparent 64%,
    transparent 100%);
  background-size: 300% 100%;
  background-position: -60% 0;
  transition: background-position .9s cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}
.shine:hover::before { background-position: 160% 0; }

/* ===== 3D Tilt cards (controlado por JS) ===== */
.tilt {
  transform-style: preserve-3d;
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}
.tilt > * { transform: translateZ(0); }
.tilt__lift { transform: translateZ(28px); transition: transform .4s cubic-bezier(.2,.8,.2,1); }

/* ===== Blob morph background ===== */
.morph-blob {
  position: absolute; pointer-events: none;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .55;
  animation: morph 14s ease-in-out infinite alternate;
  will-change: transform, border-radius;
  transform: translateZ(0);
}
@keyframes morph {
  0%   { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; transform: translate(0,0) rotate(0deg); }
  50%  { border-radius: 30% 70% 60% 40% / 50% 60% 30% 60%; transform: translate(20px,-20px) rotate(40deg); }
  100% { border-radius: 50% 50% 40% 60% / 40% 50% 60% 50%; transform: translate(-20px,20px) rotate(-40deg); }
}

/* ===== Animated gradient text ===== */
.text-gradient-anim {
  background: linear-gradient(120deg, #0A4A1E 0%, #BF8C00 30%, #D4A010 50%, #0A4A1E 75%, #BF8C00 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradShift 7s ease-in-out infinite;
  will-change: background-position;
}

@keyframes gradShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* ===== SVG wave divider ===== */
.divider-wave {
  display: block; width: 100%; height: 80px;
  fill: var(--ink-50);
}
.divider-wave--invert { transform: scaleY(-1); }

/* ===== Marquee galería (vida del cole) ===== */
.gallery-marquee {
  display: flex; gap: 18px; width: max-content;
  animation: marquee 60s linear infinite;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  contain: layout style paint;
}
.gallery-marquee--reverse { animation-direction: reverse; animation-duration: 80s; }
.gallery-marquee:hover { animation-play-state: paused; }

.gallery-tile {
  width: 280px; height: 200px; border-radius: 22px;
  position: relative; overflow: hidden;
  background: var(--ink-100) center/cover;
  transition: transform .4s cubic-bezier(.2,.8,.2,1), box-shadow .4s;
  flex: none;
}
.gallery-tile:hover { transform: scale(1.04); box-shadow: var(--shadow-lg); z-index: 2; }

/* Overlay oscuro + descripción al hacer hover */
.gallery-tile::after {
  content: attr(data-desc);
  position: absolute; inset: 0;
  background: rgba(0,0,0,0);
  color: transparent;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 18px 20px;
  font-size: .74rem; font-weight: 500; line-height: 1.55;
  border-radius: 22px;
  z-index: 2;
  transition: background .3s ease, color .25s ease .06s;
  pointer-events: none;
}
.gallery-tile:hover::after {
  background: rgba(0, 0, 0, .58);
  color: rgba(255, 255, 255, .92);
}

/* Ocultar la etiqueta-píldora al hacer hover (la sustituye la descripción) */
.gallery-tile span:not(.gallery-tile__icon) {
  position: absolute; left: 14px; bottom: 14px;
  background: rgba(0,0,0,.85); color: #fff;
  padding: 6px 12px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  backdrop-filter: blur(8px);
  transition: opacity .2s ease;
  z-index: 3;
}
.gallery-tile:hover span:not(.gallery-tile__icon) { opacity: 0; }

/* ===== Sticky bottom CTA (mobile) — GRID 2 columnas idénticas ===== */
.mobile-cta-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--ink-100);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  display: none;
  z-index: 40;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
  /* GRID: dos columnas idénticas, sin variaciones */
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  box-sizing: border-box;
}
.mobile-cta-bar.is-visible { transform: translateY(0); }
.mobile-cta-bar a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  height: 48px;
  border-radius: 4px;
  font-weight: 700;
  font-size: .9rem;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
  border: 0;
  background-clip: padding-box;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
.mobile-cta-bar a i {
  font-size: 1.05rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.mobile-cta-bar a span {
  display: inline-block;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-cta-bar .cta-call {
  background: var(--ink-50); color: var(--ink-900);
  border: 1.5px solid var(--ink-100);
}
.mobile-cta-bar .cta-visit {
  background: linear-gradient(135deg, var(--brand-700), var(--brand-900));
  color: #fff;
  box-shadow: 0 8px 18px -8px var(--green-700);
}
@media (max-width: 720px) {
  .mobile-cta-bar { display: grid; }
  body { padding-bottom: 76px; }
}
@media (max-width: 380px) {
  .mobile-cta-bar a { font-size: .82rem; padding: 0 10px; gap: 6px; }
  .mobile-cta-bar a i { font-size: .95rem; }
}

/* ===== Hamburger premium → X ===== */
@keyframes burgerPulse {
  0%   { transform: scale(1); }
  30%  { transform: scale(.82); }
  65%  { transform: scale(1.12); }
  85%  { transform: scale(.96); }
  100% { transform: scale(1); }
}
@keyframes burgerRing {
  0%   { opacity: .7; transform: translate(-50%,-50%) scale(1); }
  100% { opacity: 0;  transform: translate(-50%,-50%) scale(2.6); }
}

/* Solo aparece cuando la navegación inline se oculta (<= 980px).
   Si no, se ve el menú completo y el botón a la vez. */
.hamburger-x {
  width: 48px; height: 48px;
  display: none;
  border: 1.5px solid var(--ink-100);
  background: var(--surface-raised); border-radius: var(--radius);
  position: relative; cursor: pointer;
  overflow: hidden;
  transition: background .3s cubic-bezier(.22,1,.36,1),
              border-color .3s cubic-bezier(.22,1,.36,1),
              box-shadow .3s;
}
.hamburger-x:hover {
  box-shadow: 0 0 0 4px rgba(10,94,36,.15);
  border-color: var(--green-700);
}
/* anillo de burst — aparece al añadir .is-burst vía JS */
.hamburger-x::before {
  content: '';
  position: absolute; top: 50%; left: 50%;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2px solid var(--green-700);
  opacity: 0; pointer-events: none;
}
.hamburger-x.is-burst { animation: burgerPulse .5s cubic-bezier(.22,1,.36,1) both; }
.hamburger-x.is-burst::before { animation: burgerRing .55s cubic-bezier(.2,.8,.2,1) both; }

.hamburger-x span {
  position: absolute; left: 13px; right: 13px; height: 2px;
  background: var(--ink-900); border-radius: 2px;
  transform-origin: center;
  transition: transform .42s cubic-bezier(.22,1,.36,1),
              opacity .25s ease,
              top .42s cubic-bezier(.22,1,.36,1),
              background .3s;
}
.hamburger-x span:nth-child(1) { top: 15px; }
.hamburger-x span:nth-child(2) { top: 23px; }
.hamburger-x span:nth-child(3) { top: 31px; }

.hamburger-x.is-open {
  background: #062C12;
  border-color: #062C12;
  box-shadow: 0 0 0 4px rgba(10,94,36,.2);
}
.hamburger-x.is-open span { background: #fff; }
.hamburger-x.is-open span:nth-child(1) { top: 23px; transform: rotate(45deg); }
.hamburger-x.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-x.is-open span:nth-child(3) { top: 23px; transform: rotate(-45deg); }

/* Se muestra justo donde styles.css oculta .nav */
@media (max-width: 980px) {
  .hamburger-x { display: flex; }
}

/* ===== Mobile drawer (full-screen overlay menu) ===== */
/* ── Drawer backdrop ── */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 199;
  background: rgba(6, 14, 8, .6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden;
  transition: opacity .4s ease, visibility .4s ease;
}
.drawer-backdrop.is-open { opacity: 1; visibility: visible; }

/* ── Drawer panel ── */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(420px, 100vw);
  background: #060f08;
  color: #fff;
  z-index: 200;
  display: flex; flex-direction: column;
  padding: 0;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .45s cubic-bezier(.22,1,.36,1), visibility .45s;
  overflow-y: auto;
}
.drawer.is-open { transform: translateX(0); visibility: visible; }

/* En escritorio el cajón no existe: la barra superior ya lleva las mismas
   secciones y se queda fija al bajar, así que un panel lateral con lo mismo
   sobra. Mismo corte que usa styles.css para ocultar .nav y mostrar la
   hamburguesa, para que nunca haya un ancho sin ninguno de los dos. */
@media (min-width: 981px) {
  .drawer,
  .drawer-backdrop { display: none !important; }
}

/* ── Drawer header ── */
.drawer__header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.drawer__close {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255,255,255,.08); border: none; cursor: pointer;
  color: #fff; font-size: 1.2rem;
  display: grid; place-items: center;
  transition: background .2s;
  flex-shrink: 0;
}
.drawer__close:hover { background: rgba(255,255,255,.16); }

/* ── Drawer nav ──
   Una sola escala: filas de sección a 1rem, subpáginas a .94rem y rótulos
   de bloque a .72rem en versalitas. Nada de letra de titular dentro del
   menú: con ella cada fila parecía de un tamaño distinto. */
.drawer__nav { flex: 1; padding: 18px 20px 8px; display: flex; flex-direction: column; gap: 26px; }
.drawer__nav ul { list-style: none; padding: 0; margin: 0; }
.drawer__menu > li { border-bottom: 1px solid rgba(255,255,255,.07); }
.drawer__menu > li:last-child { border-bottom: 0; }

.drawer__fila {
  width: 100%; min-height: 54px; padding: 8px 6px;
  display: flex; align-items: center; gap: 14px;
  background: none; border: 0; border-radius: 12px; cursor: pointer;
  font: 600 1rem/1.25 var(--font-sans); color: rgba(255,255,255,.9); text-align: left;
  transition: background .2s, color .2s;
}
.drawer__fila:hover { background: rgba(255,255,255,.05); color: #fff; }
.drawer__fila-ico {
  width: 34px; height: 34px; flex: none; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.06); color: var(--green-400); font-size: .95rem;
}
.drawer__fila-txt { flex: 1; }
.drawer__fila .dd-arrow { color: rgba(255,255,255,.45); font-size: .85rem; transition: transform .25s cubic-bezier(.22,1,.36,1); }
.drawer__has-sub.is-open > .drawer__fila .dd-arrow { transform: rotate(180deg); }
.drawer__has-sub.is-open > .drawer__fila { color: #fff; }
.drawer__has-sub.is-open > .drawer__fila .drawer__fila-ico { background: rgba(31,164,44,.2); }

.drawer__nav .drawer__sub {
  display: none;
  margin: 0 0 12px 23px; padding-left: 21px;
  border-left: 1px solid rgba(255,255,255,.1);
}
.drawer__nav .drawer__has-sub.is-open .drawer__sub { display: block; }
.drawer__sub li { list-style: none; }
.drawer__sub a {
  display: flex; align-items: center; gap: 10px;
  min-height: 42px; padding: 8px 10px; border-radius: 10px;
  font: 500 .94rem/1.3 var(--font-sans); color: rgba(255,255,255,.66);
  transition: background .2s, color .2s;
}
.drawer__sub a:hover { background: rgba(255,255,255,.06); color: #fff; }
.drawer__sub a[aria-current="page"] { color: #fff; background: rgba(31,164,44,.16); }
.drawer__sub a > i { margin-left: auto; font-size: .8rem; color: rgba(255,255,255,.4); }
.drawer__sub .drawer__sub-hub { color: var(--green-400); font-weight: 600; }
.drawer__sub .drawer__sub-hub > i { margin-left: 0; color: inherit; }
.drawer__etiqueta {
  padding: 2px 8px; border-radius: 999px;
  font-size: .7rem; font-weight: 600; letter-spacing: .02em;
  color: #f9b8d1; background: rgba(247,158,192,.14);
}

/* Bloques de accesos */
.drawer__bloque { display: grid; gap: 10px; }
.drawer__bloque-titulo {
  margin: 0; padding-left: 6px;
  font: 600 .72rem/1 var(--font-sans); letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.45);
}
.drawer__accesos { display: grid; gap: 8px; }
.drawer__acceso .drawer__acceso-txt { flex: 1; }
.drawer__acceso > .bi-arrow-up-right { font-size: .8rem; color: rgba(255,255,255,.4); }
.drawer__accesos--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.drawer__acceso {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 10px; border-radius: 14px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  color: #fff; transition: background .2s, border-color .2s;
}
.drawer__accesos--3 .drawer__acceso { flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px; }
.drawer__acceso:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); }
.drawer__acceso-ico {
  width: 32px; height: 32px; flex: none; border-radius: 9px;
  display: grid; place-items: center; font-size: .95rem;
}
.drawer__acceso-ico--azul  { background: rgba(96,165,250,.16); color: #93c5fd; }
.drawer__acceso-ico--verde { background: rgba(74,222,128,.14); color: #86efac; }
.drawer__acceso-ico--ambar { background: rgba(251,191,36,.14); color: #fcd34d; }
.drawer__acceso-txt { display: grid; gap: 2px; min-width: 0; line-height: 1.2; }
.drawer__acceso-txt strong { font-size: .9rem; font-weight: 600; }
.drawer__acceso-txt small {
  font-size: .74rem; color: rgba(255,255,255,.55);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.drawer__acceso .web-ico { width: 32px; height: 32px; flex: none; }

/* Llamadas a la acción */
.drawer__ctas { display: grid; gap: 8px; }
.drawer__cta {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 12px 18px; border-radius: 14px;
  font: 600 .95rem/1.2 var(--font-sans); text-decoration: none;
  transition: background .2s, filter .2s;
}
.drawer__cta--admision { background: var(--yellow-500); color: var(--brand-900); }
.drawer__cta--admision:hover { filter: brightness(1.06); color: var(--brand-900); }
.drawer__cta--secundario { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); color: #fff; }
.drawer__cta--secundario:hover { background: rgba(255,255,255,.1); color: #fff; }

/* Portal del profesorado: atajo fijo al final del cajón */
.drawer__portal {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(31,164,44,.22), rgba(31,164,44,.08));
  border: 1px solid rgba(74,222,128,.28); color: #fff;
  transition: border-color .2s, background .2s;
}
.drawer__portal:hover { border-color: rgba(74,222,128,.55); color: #fff; }
.drawer__portal-ico {
  width: 36px; height: 36px; flex: none; border-radius: 10px;
  display: grid; place-items: center; background: var(--green-600, #1fa42c); color: #fff;
}
.drawer__portal .drawer__acceso-txt { flex: 1; }
.drawer__portal .drawer__acceso-txt strong { font-size: .98rem; }
.drawer__portal > i { color: #86efac; }

/* Entrada: las piezas suben un poco, escalonadas. Solo transform y opacidad. */
@media (prefers-reduced-motion: no-preference) {
  .drawer__menu > li, .drawer__bloque, .drawer__ctas, .drawer__theme, .drawer__footer {
    opacity: 0; transform: translateY(8px);
    transition: opacity .4s ease, transform .5s cubic-bezier(.22,1,.36,1);
  }
  .drawer.is-open .drawer__menu > li, .drawer.is-open .drawer__bloque,
  .drawer.is-open .drawer__ctas, .drawer.is-open .drawer__theme, .drawer.is-open .drawer__footer { opacity: 1; transform: none; }
  .drawer.is-open .drawer__menu > li:nth-child(2) { transition-delay: .03s; }
  .drawer.is-open .drawer__menu > li:nth-child(3) { transition-delay: .06s; }
  .drawer.is-open .drawer__menu > li:nth-child(4) { transition-delay: .09s; }
  .drawer.is-open .drawer__menu > li:nth-child(5) { transition-delay: .12s; }
  .drawer.is-open .drawer__bloque { transition-delay: .16s; }
  .drawer.is-open .drawer__ctas, .drawer.is-open .drawer__theme, .drawer.is-open .drawer__footer { transition-delay: .2s; }
}

/* ── Drawer footer ── */
.drawer__footer {
  padding: 18px 20px calc(24px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; flex-direction: column; gap: 16px;
  flex-shrink: 0;
}
.drawer__contact { display: flex; flex-direction: column; gap: 10px; }
.drawer__contact a {
  display: inline-flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,.6); font-size: .88rem;
  transition: color .2s;
}
.drawer__contact a:hover { color: var(--yellow-500); }
.drawer__contact i { color: var(--yellow-500); font-size: .9rem; }
.drawer__social { display: flex; gap: 10px; }
.drawer__social a {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  display: grid; place-items: center;
  color: rgba(255,255,255,.7); font-size: 1rem;
  transition: background .2s, color .2s;
}
.drawer__social a:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ===== Glass card ===== */
.glass {
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid rgba(255,255,255,.5);
  box-shadow: 0 30px 60px -20px rgba(14,27,20,.18);
}

/* ===== Floating animation ===== */
.float-slow { animation: floatSlow 7s ease-in-out infinite; }
.float-med  { animation: floatSlow 5s ease-in-out infinite reverse; }
.float-fast { animation: floatSlow 4s ease-in-out infinite; }
@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-14px) rotate(2deg); }
}

/* ===== Scroll progress bar (premium toque) ===== */
.scroll-progress {
  position: fixed; top: 0; left: 0;
  height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--green-700), var(--yellow-500));
  z-index: 100;
  /* Se escala en vez de cambiar el ancho: no obliga a recolocar la página
     en cada fotograma del desplazamiento. */
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .1s linear;
}

/* ===== Stat number con underline animado ===== */
.stat__num--anim {
  position: relative; display: inline-block;
}
.stat__num--anim::after {
  content: ""; position: absolute; left: 50%; bottom: -6px;
  width: 0; height: 3px;
  background: var(--yellow-500);
  transform: translateX(-50%);
  transition: width .8s cubic-bezier(.2,.8,.2,1) .3s;
  border-radius: 2px;
}
.stat.is-visible .stat__num--anim::after { width: 50%; }

/* ===== Cursor ring (desktop, sutil) ===== */
.cursor-ring {
  position: fixed; top: 0; left: 0;
  width: 28px; height: 28px;
  border: 2px solid var(--green-700); border-radius: 50%;
  pointer-events: none; z-index: 999;
  transform: translate(-50%, -50%);
  transition: transform .15s ease, width .2s ease, height .2s ease, border-color .2s ease, opacity .2s ease;
  opacity: 0;
  mix-blend-mode: multiply;
}
.cursor-ring.is-visible { opacity: .7; }
.cursor-ring.is-hover {
  width: 56px; height: 56px;
  border-color: var(--yellow-500);
  background: rgba(201,160,66,.1);
}
@media (max-width: 980px), (pointer: coarse) {
  .cursor-ring { display: none; }
}

/* ===== Wavy underline en enlaces especiales ===== */
.link-wavy {
  background-image: linear-gradient(transparent 65%, rgba(201,160,66,.5) 65%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  transition: background-size .3s ease;
}
.link-wavy:hover {
  background-image: linear-gradient(transparent 0%, rgba(201,160,66,.4) 100%);
}

/* ===== Parallax helper ===== */
[data-parallax] { will-change: transform; transition: transform .1s linear; }

/* ===== Vida del cole - hero strip ===== */
.life-strip {
  position: relative;
  background: linear-gradient(135deg, #062C12 0%, #0A5E24 100%);
  padding: 70px 0;
  color: #fff;
  overflow: hidden;
}
.life-strip::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(201,160,66,.14), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,.07), transparent 40%);
}
.life-strip__head { position: relative; text-align: center; margin-bottom: 50px; max-width: 720px; margin-inline: auto; }
.life-strip__head h2 { color: #fff; }
.life-strip__head p { color: rgba(255,255,255,.85); }

/* ===== Big bold sticky stats =====*/
.bold-fact {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(4rem, 12vw, 9rem);
  line-height: .85;
  letter-spacing: -.04em;
  background: linear-gradient(120deg, var(--green-700) 0%, var(--green-500) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ===== Accesibilidad ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; filter: none; }
  .marquee__track, .gallery-marquee { animation: none; }
}


/* ═══════════════════════════════════════════════════════════
   📱 PERFORMANCE OPTIMIZATIONS para mobile (≤900px)
   Desactiva o simplifica animaciones costosas
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  /* Desactivar el spin continuo de las estrellas (14+ instancias = costoso) */
  .marquee__star { animation: none; }

  /* Reducir el blur del morph-blob (filter blur es muy caro en mobile) */
  .morph-blob { filter: blur(30px); animation-duration: 20s; }

  /* Deshabilitar el shine sweep en hover (solo desktop hover) */
  .shine::before { display: none; }

  /* Pausar el text-gradient-anim cuando no es visible — y reducir frecuencia */
  .text-gradient-anim { animation-duration: 14s; }

  /* Acelerar GPU para todas las marquees */
  .marquee, .gallery-marquee, .gallery-marquee--reverse {
    transform: translateZ(0);
    will-change: transform;
  }

  /* content-visibility: auto en secciones largas para que no se rendericen
     hasta que entren en el viewport. Mejora drásticamente el scroll. */
  .life-strip, .section, .footer, .stats { content-visibility: auto; contain-intrinsic-size: auto 600px; }

  /* En el hero, las morph-blobs no necesitan animación continua — son decorativas */
  .hero__bg .morph-blob { animation-duration: 30s; }
}

/* En mobile MUY pequeño, eliminamos completamente las animaciones decorativas
   que solo ralentizan, manteniendo las funcionales (reveals, transitions) */
@media (max-width: 540px) {
  /* Sólo paint cuando se necesite */
  .marquee__star { display: none; }
  .marquee__item { gap: 0; }
  .marquee__item + .marquee__item::before {
    content: '·'; color: var(--yellow-500); font-size: 1.5em;
    margin: 0 32px;
  }

  /* Pausar morph-blobs al hacer scroll para reducir repaints */
  .morph-blob { animation: none; opacity: .35; }
}

/* Cuando un elemento se cubre con scroll, ahorrar repaints */
@media (prefers-reduced-motion: no-preference) {
  .marquee, .gallery-marquee {
    /* Sólo animar cuando el contenedor padre es visible */
    animation-play-state: running;
  }
}

/* ===== Pausa de las cintas y la galería en movimiento (WCAG 2.2.2) ===== */
.marquee .pausa-mov { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); z-index: 3; }
.marquee.is-pausado .marquee__track,
.gallery-marquee.is-pausado { animation-play-state: paused !important; }
.life-strip__pausa { display: flex; justify-content: flex-end; margin-bottom: 14px; }
