/* =========================================================
   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(28px);
  transition:
    opacity .9s cubic-bezier(.2,.8,.2,1),
    transform .9s cubic-bezier(.2,.8,.2,1),
    filter .9s cubic-bezier(.2,.8,.2,1);
  filter: blur(8px);
  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: .08s; }
[data-reveal-delay="2"]  { transition-delay: .16s; }
[data-reveal-delay="3"]  { transition-delay: .24s; }
[data-reveal-delay="4"]  { transition-delay: .32s; }
[data-reveal-delay="5"]  { transition-delay: .40s; }
[data-reveal-delay="6"]  { transition-delay: .48s; }
[data-reveal-delay="7"]  { transition-delay: .56s; }
[data-reveal-delay="8"]  { transition-delay: .64s; }

/* ===== 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;
}
.shine::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(115deg,
    transparent 0%,
    transparent 35%,
    rgba(255,255,255,.55) 50%,
    transparent 65%,
    transparent 100%);
  transform: translateX(-100%);
  transition: transform .9s cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}
.shine:hover::before { transform: translateX(100%); }

/* ===== 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,.5); 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; }

/* ── Drawer header ── */
.drawer__header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 28px;
  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 ── */
.drawer__nav { flex: 1; padding: 32px 28px 24px; display: flex; flex-direction: column; gap: 32px; }
.drawer__nav ul { list-style: none; padding: 0; margin: 0; }
.drawer__nav ul li { overflow: hidden; }
.drawer__nav ul a {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,.07);
  color: rgba(255,255,255,.85);
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.75rem; line-height: 1.1;
  transform: translateX(40px); opacity: 0;
  transition: transform .5s cubic-bezier(.2,.8,.2,1), opacity .5s, color .2s;
}
.drawer__nav ul a:hover { color: var(--yellow-500); }
.drawer.is-open .drawer__nav ul a { transform: translateX(0); opacity: 1; }
.drawer.is-open .drawer__nav ul li:nth-child(1) a { transition-delay: .08s; }
.drawer.is-open .drawer__nav ul li:nth-child(2) a { transition-delay: .13s; }
.drawer.is-open .drawer__nav ul li:nth-child(3) a { transition-delay: .18s; }
.drawer.is-open .drawer__nav ul li:nth-child(4) a { transition-delay: .23s; }
.drawer.is-open .drawer__nav ul li:nth-child(5) a { transition-delay: .28s; }
.drawer.is-open .drawer__nav ul li:nth-child(6) a { transition-delay: .33s; }

.drawer__cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--brand-700);
  color: #fff; font-weight: 700; font-size: 1rem;
  padding: 16px 28px; border-radius: 6px;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(10,94,36,.3);
  transition: transform .25s, box-shadow .25s;
  opacity: 0; transform: translateY(12px);
  transition: opacity .4s .38s, transform .4s .38s cubic-bezier(.22,1,.36,1), box-shadow .25s;
}
.drawer.is-open .drawer__cta { opacity: 1; transform: translateY(0); }
.drawer__cta:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(10,94,36,.45); color: #fff; }

/* ── Drawer platforms (Alexia / Raíces) ── */
.drawer__platforms {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  opacity: 0; transform: translateY(10px);
  transition: opacity .4s .30s, transform .4s .30s cubic-bezier(.22,1,.36,1);
}
.drawer.is-open .drawer__platforms { opacity: 1; transform: translateY(0); }
.drawer__platform-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 10px; border-radius: 14px;
  font-weight: 700; font-size: .88rem;
  transition: background .2s, border-color .2s, color .2s, transform .2s;
  border: 1px solid transparent;
}
.drawer__platform-btn:hover { transform: translateY(-2px); }
.drawer__platform-btn i { font-size: 1.1rem; }

/* Alexia — azul */
.drawer__platform-btn:nth-child(1) {
  background: rgba(59,130,246,.18); border-color: rgba(59,130,246,.35); color: #93c5fd;
}
.drawer__platform-btn:nth-child(1):hover {
  background: rgba(59,130,246,.3); border-color: rgba(59,130,246,.6); color: #bfdbfe;
}
/* Raíces — verde */
.drawer__platform-btn:nth-child(2) {
  background: rgba(34,197,94,.16); border-color: rgba(34,197,94,.32); color: #86efac;
}
.drawer__platform-btn:nth-child(2):hover {
  background: rgba(34,197,94,.28); border-color: rgba(34,197,94,.55); color: #bbf7d0;
}
/* Infantil NSD — rosa */
.drawer__platform-btn:nth-child(3) {
  background: rgba(244,114,182,.16); border-color: rgba(244,114,182,.32); color: #f9a8d4;
}
.drawer__platform-btn:nth-child(3):hover {
  background: rgba(244,114,182,.28); border-color: rgba(244,114,182,.55); color: #fce7f3;
}
/* Campamento — ámbar */
.drawer__platform-btn:nth-child(4) {
  background: rgba(251,191,36,.16); border-color: rgba(251,191,36,.32); color: #fde68a;
}
.drawer__platform-btn:nth-child(4):hover {
  background: rgba(251,191,36,.28); border-color: rgba(251,191,36,.55); color: #fef9c3;
}

/* ── Drawer footer ── */
.drawer__footer {
  padding: 24px 28px 32px;
  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: 0;
  background: linear-gradient(90deg, var(--green-700), var(--yellow-500));
  z-index: 100;
  transition: width .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;
  }
}

