/* ═══════════════════════════════════════════════
   CIERRE — sección final — LABRIEGO
   Grilla infinita + flashlight + orbes flotantes
═══════════════════════════════════════════════ */

#cierre {
  position: relative;
  height: 200vh;
  background: #080808;
}

.cierre-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 72px 0;
  box-sizing: border-box;
}

/* ── Grilla base (siempre visible, muy sutil) ─── */
.cierre-grid-base,
.cierre-grid-active {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  animation: cierreGridScroll 5s linear infinite;
}

/* ── Grilla activa (revelada por mouse) ───────── */
.cierre-grid-active {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.5) 1px, transparent 1px);
  /* Máscara linterna — JS actualiza la posición */
  -webkit-mask-image: radial-gradient(300px circle at -600px -600px, black, transparent);
  mask-image: radial-gradient(300px circle at -600px -600px, black, transparent);
}

@keyframes cierreGridScroll {
  from { background-position: 0 0; }
  to   { background-position: 44px 44px; }
}

/* ── Orbes de color flotantes ─────────────────── */
.cierre-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(110px);
}

.cierre-orb--coral {
  width: 55%;
  height: 55%;
  background: radial-gradient(circle, rgba(232, 89, 60, 0.45) 0%, transparent 70%);
  top: -28%;
  right: -18%;
  animation: orbDrift1 11s ease-in-out infinite;
}

.cierre-orb--indigo {
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.38) 0%, transparent 70%);
  bottom: -22%;
  left: -14%;
  animation: orbDrift2 14s ease-in-out infinite;
}

@keyframes orbDrift1 {
  0%, 100% { transform: translate(0, 0) scale(1);    }
  33%       { transform: translate(-28px, 22px) scale(1.06); }
  66%       { transform: translate(18px, -16px) scale(0.96); }
}

@keyframes orbDrift2 {
  0%, 100% { transform: translate(0, 0) scale(1);    }
  40%       { transform: translate(24px, -32px) scale(1.08); }
  70%       { transform: translate(-18px, 20px) scale(0.94); }
}

/* ── Contenido ────────────────────────────────── */
.cierre-content {
  position: relative;
  z-index: 10;
  text-align: center;
  color: #ffffff;
  padding: 0 clamp(1.5rem, 6vw, 4rem);
  max-width: 960px;
}

/* ── Estados iniciales para animación de entrada ─ */
.cierre-eyebrow,
.cierre-heading,
.cierre-sub,
.cierre-actions {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.cierre-heading { transition-delay: 0.1s;  }
.cierre-sub     { transition-delay: 0.22s; }
.cierre-actions { transition-delay: 0.36s; }

#cierre.in-view .cierre-eyebrow,
#cierre.in-view .cierre-heading,
#cierre.in-view .cierre-sub,
#cierre.in-view .cierre-actions {
  opacity: 1;
  transform: translateY(0);
}

/* ── Eyebrow ──────────────────────────────────── */
.cierre-eyebrow {
  display: block;
  font-size: 11px;
  letter-spacing: 6px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 20px;
}

/* ── Heading ──────────────────────────────────── */
.cierre-heading {
  font-size: clamp(2.8rem, 7.5vw, 6.5rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -2px;
  margin: 0 0 22px;
}

/* ── Subtexto ─────────────────────────────────── */
.cierre-sub {
  font-size: clamp(0.95rem, 1.8vw, 1.2rem);
  color: rgba(255, 255, 255, 0.42);
  line-height: 1.7;
  margin: 0 0 40px;
}

/* ── Botones ──────────────────────────────────── */
.cierre-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  align-items: center;
}

.cierre-btn-primary {
  display: inline-block;
  text-decoration: none;
  background: #ffffff;
  color: #0A0A0A;
  font-size: 15px;
  font-weight: 700;
  padding: 15px 44px;
  letter-spacing: 0.5px;
  border-radius: 3px;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              background 0.25s ease,
              box-shadow 0.25s ease;
}

.cierre-btn-primary:hover {
  background: #f0f0f0;
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 24px 52px rgba(255, 255, 255, 0.14);
}

.cierre-btn-secondary {
  display: inline-block;
  text-decoration: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-size: 15px;
  font-weight: 600;
  padding: 15px 36px;
  letter-spacing: 0.5px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: transform 0.25s ease,
              border-color 0.25s ease,
              color 0.25s ease;
}

.cierre-btn-secondary:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-4px);
}

/* ── Reduced motion ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .cierre-grid-base,
  .cierre-grid-active,
  .cierre-orb--coral,
  .cierre-orb--indigo {
    animation: none;
  }

  .cierre-eyebrow,
  .cierre-heading,
  .cierre-sub,
  .cierre-actions {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ── Mobile ───────────────────────────────────── */
@media (max-width: 768px) {
  #cierre {
    height: auto;
    min-height: 100vh;
  }

  .cierre-sticky {
    position: relative;
    top: auto;
    height: auto;
    min-height: 100vh;
  }

  .cierre-heading {
    letter-spacing: -2px;
  }

  .cierre-sub {
    margin-bottom: 48px;
  }

  .cierre-actions {
    flex-direction: column;
    gap: 12px;
  }

  .cierre-btn-primary,
  .cierre-btn-secondary {
    width: 100%;
    max-width: 320px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .cierre-heading {
    letter-spacing: -1.5px;
  }
}
