/* ============================================================
   Nubilab · capa de movimiento (iteración 2)
   Premium, sutil, GPU-friendly. Todo se apaga con
   prefers-reduced-motion al final del archivo.
   ============================================================ */

/* ---------- fondo vivo: auroras + destellos ---------- */
.nb__aurora,
.nb__spark {
  position: fixed;
  inset: -10% -10% -10% -10%;
  z-index: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.nb__aurora {
  opacity: 0.62;
  background:
    radial-gradient(38% 32% at 18% 18%, rgba(139, 92, 246, 0.34), transparent 70%),
    radial-gradient(34% 30% at 82% 26%, rgba(79, 107, 255, 0.28), transparent 70%),
    radial-gradient(40% 34% at 60% 82%, rgba(196, 181, 253, 0.2), transparent 72%);
  filter: blur(14px);
  animation: nbAurora 26s ease-in-out infinite alternate;
  transform: translate3d(0, calc(var(--nb-scroll, 0) * -0.02px), 0);
}

@keyframes nbAurora {
  0% {
    transform: translate3d(-1.5%, 1%, 0) scale(1.02);
    opacity: 0.5;
  }
  50% {
    transform: translate3d(1.5%, -1.5%, 0) scale(1.06);
    opacity: 0.72;
  }
  100% {
    transform: translate3d(-1%, 2%, 0) scale(1.03);
    opacity: 0.56;
  }
}

/* puntos de luz que suben lentísimo, como polvo estelar */
.nb__spark {
  opacity: 0.5;
}

.nb__spark i {
  position: absolute;
  left: var(--x, 50%);
  bottom: -8vh;
  width: var(--s, 3px);
  height: var(--s, 3px);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.9), rgba(196, 181, 253, 0.25) 60%, transparent);
  filter: blur(0.3px);
  animation: nbDrift var(--d, 26s) linear var(--delay, 0s) infinite;
  will-change: transform, opacity;
}

@keyframes nbDrift {
  0% {
    transform: translate3d(0, 0, 0) scale(0.7);
    opacity: 0;
  }
  12% {
    opacity: 0.85;
  }
  80% {
    opacity: 0.5;
  }
  100% {
    transform: translate3d(var(--dx, 20px), -118vh, 0) scale(1.1);
    opacity: 0;
  }
}

/* ---------- nav dinámica ---------- */
.nb-nav {
  transition: background 0.45s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.45s ease,
    box-shadow 0.45s ease, backdrop-filter 0.45s ease;
}

.nb-nav--scrolled {
  box-shadow: 0 18px 46px -34px rgba(10, 6, 40, 0.9);
  backdrop-filter: blur(20px) saturate(140%);
}

.nb-nav__links a {
  position: relative;
  padding-bottom: 4px;
}

.nb-nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--lav, #c4b5fd), var(--blue, #4f6bff));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
  opacity: 0.9;
}

.nb-nav__links a:hover::after,
.nb-nav__links a.is-active::after {
  transform: scaleX(1);
}

.nb-nav__links a.is-active {
  color: var(--text, #f4f1ff);
}

/* ---------- botones: glow premium + respiración ---------- */
.nb-btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.32s ease, background 0.32s ease,
    border-color 0.32s ease, filter 0.32s ease;
}

/* barrido de luz al hover */
.nb-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.26) 48%, transparent 66%);
  transform: translateX(-120%);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.nb-btn:hover::after {
  transform: translateX(120%);
}

.nb-btn:active {
  transform: translateY(0) scale(0.985);
}

.nb-btn--primary {
  animation: nbBreathe 5.2s ease-in-out infinite;
}

.nb-btn--primary:hover {
  transform: translateY(-3px);
  filter: saturate(112%);
  box-shadow: 0 26px 64px -16px var(--glow-a, rgba(124, 92, 245, 0.7)),
    0 0 0 1px rgba(255, 255, 255, 0.16) inset;
}

@keyframes nbBreathe {
  0%,
  100% {
    box-shadow: 0 14px 42px -12px var(--glow-a, rgba(124, 92, 245, 0.65)),
      inset 0 1px 0 rgba(255, 255, 255, 0.28);
  }
  50% {
    box-shadow: 0 20px 56px -12px var(--glow-a, rgba(124, 92, 245, 0.85)),
      inset 0 1px 0 rgba(255, 255, 255, 0.34);
  }
}

.nb-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(196, 181, 253, 0.85), 0 0 0 6px rgba(139, 92, 246, 0.24);
}

/* ---------- hero: parallax de puntero + capas ---------- */
.nb-hero {
  position: relative;
}

.nb-hero__grid > div:first-child {
  transform: translate3d(calc(var(--nb-px, 0) * -6px), calc(var(--nb-py, 0) * -4px), 0);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.nb-hero__visual {
  transform: translate3d(calc(var(--nb-px, 0) * 12px), calc(var(--nb-py, 0) * 10px), 0);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.nb-hero__img {
  animation: nbFloatSoft 11s ease-in-out infinite alternate;
  box-shadow: 0 60px 120px -60px rgba(124, 92, 245, 0.75);
}

@keyframes nbFloatSoft {
  from {
    transform: translate3d(0, -9px, 0) rotate(-0.5deg);
  }
  to {
    transform: translate3d(0, 11px, 0) rotate(0.5deg);
  }
}

/* halo del visual que late apenas */
.nb-hero__visual::after {
  animation: nbHalo 7.5s ease-in-out infinite alternate;
}

@keyframes nbHalo {
  from {
    opacity: 0.55;
    transform: scale(0.96);
  }
  to {
    opacity: 0.95;
    transform: scale(1.05);
  }
}

.nb-pill .nb-dot,
.nb-dot {
  animation: nbPulseDot 2.6s ease-in-out infinite;
}

@keyframes nbPulseDot {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(196, 181, 253, 0.55);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 0 7px rgba(196, 181, 253, 0);
    opacity: 0.75;
  }
}

/* facts del hero: aparición escalonada e íconos que se dibujan */
ul.nb-hero__facts li {
  animation: nbRise 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}
ul.nb-hero__facts li:nth-child(1) { animation-delay: 0.42s; }
ul.nb-hero__facts li:nth-child(2) { animation-delay: 0.5s; }
ul.nb-hero__facts li:nth-child(3) { animation-delay: 0.58s; }

/* ---------- reveal más refinado ---------- */
.nb-reveal {
  transition: opacity 0.95s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.95s cubic-bezier(0.22, 1, 0.36, 1), filter 0.95s ease;
  transition-delay: var(--nb-delay, 0ms);
  will-change: opacity, transform;
}

/* ---------- recorrido: viaje conectado ---------- */
.nb-journey {
  position: relative;
}

.nb-journey__rail {
  position: absolute;
  left: 6%;
  right: 6%;
  top: -22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196, 181, 253, 0.22), transparent);
  overflow: hidden;
}

.nb-journey__rail::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  width: 26%;
  transform: translateX(-30%);
  animation: nbRail 6.5s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

@keyframes nbRail {
  0% {
    transform: translateX(-30%);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: translateX(400%);
    opacity: 0;
  }
}

.nb-step {
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.4s ease, box-shadow 0.5s ease,
    background 0.5s ease;
}

.nb-step__glow {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease;
  background: radial-gradient(
    360px circle at var(--mx, 50%) var(--my, 0%),
    rgba(196, 181, 253, 0.16),
    transparent 62%
  );
}

.nb-step:hover .nb-step__glow,
.nb-step[data-active="true"] .nb-step__glow {
  opacity: 1;
}

.nb-step:hover,
.nb-step[data-active="true"] {
  transform: translateY(-8px) scale(1.012);
  border-color: rgba(196, 181, 253, 0.4);
  box-shadow: 0 40px 90px -44px var(--glow-a, rgba(124, 92, 245, 0.85));
}

/* cuando hay una etapa activa, las otras retroceden apenas */
.nb-journey[data-has-active="true"] .nb-step:not([data-active="true"]) {
  opacity: 0.72;
  transform: translateY(0) scale(0.99);
}

.nb-step__n {
  transition: letter-spacing 0.5s ease, color 0.4s ease;
}

.nb-step:hover .nb-step__n,
.nb-step[data-active="true"] .nb-step__n {
  letter-spacing: 0.36em;
  color: #ffffff;
}

/* bullets que se revelan en cascada dentro de cada card */
.nb-step__list li {
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), color 0.35s ease;
}

.nb-step:hover .nb-step__list li,
.nb-step[data-active="true"] .nb-step__list li {
  transform: translateX(4px);
}

.nb-step__list li .nb-check {
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), color 0.35s ease;
}

.nb-step:hover .nb-step__list li .nb-check,
.nb-step[data-active="true"] .nb-step__list li .nb-check {
  transform: rotate(90deg) scale(1.15);
}

.nb-step__out {
  transition: border-color 0.4s ease, background 0.4s ease, transform 0.45s ease;
}

.nb-step:hover .nb-step__out,
.nb-step[data-active="true"] .nb-step__out {
  transform: translateY(-2px);
  border-color: rgba(196, 181, 253, 0.4);
}

/* ---------- profundidad en tarjetas y paneles ---------- */
.nb-card,
.nb-panel,
.nb-quotebox,
.nb-manifesto {
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s ease, border-color 0.4s ease;
}

.nb-card:hover,
.nb-panel:hover {
  transform: translateY(-5px);
  border-color: rgba(196, 181, 253, 0.28);
  box-shadow: 0 36px 80px -46px rgba(124, 92, 245, 0.75);
}

/* parallax suave de bloques grandes */
.nb-quotebox,
.nb-manifesto {
  transform: translate3d(0, calc(var(--nb-scroll, 0) * -0.008px), 0);
}

/* ---------- FAQ: apertura elegante ---------- */
.nb-faq details summary {
  transition: color 0.3s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.nb-faq details summary:hover {
  transform: translateX(3px);
}

.nb-faq details[open] > p {
  animation: nbFaq 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes nbFaq {
  from {
    opacity: 0;
    transform: translateY(-6px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

/* ---------- CTA final + formulario ---------- */
.nb-final {
  position: relative;
}

.nb-final__title em {
  background: linear-gradient(100deg, #ffffff, var(--lav, #c4b5fd) 45%, var(--blue, #4f6bff));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 220% 100%;
  animation: nbShine 9s ease-in-out infinite alternate;
}

@keyframes nbShine {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 100% 50%;
  }
}

.nb-form {
  transition: box-shadow 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.nb-form:focus-within {
  box-shadow: 0 44px 100px -50px var(--glow-a, rgba(124, 92, 245, 0.85));
}

.nb-field label {
  transition: color 0.3s ease, transform 0.3s ease;
  display: inline-block;
}

.nb-field:focus-within label {
  color: var(--lav, #c4b5fd);
  transform: translateY(-1px);
}

.nb-input,
.nb-select,
.nb-textarea {
  transition: border-color 0.3s ease, box-shadow 0.35s ease, background 0.3s ease, transform 0.3s ease;
}

.nb-input:focus,
.nb-select:focus,
.nb-textarea:focus {
  outline: none;
  border-color: rgba(196, 181, 253, 0.6);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.16);
  transform: translateY(-1px);
}

.nb-form__ok {
  animation: nbPop 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes nbPop {
  from {
    opacity: 0;
    transform: scale(0.96);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

/* ---------- accesibilidad y mobile ---------- */
@media (max-width: 900px) {
  .nb__spark {
    opacity: 0.3;
  }
  .nb__aurora {
    animation-duration: 34s;
    filter: blur(18px);
  }
  .nb-hero__grid > div:first-child,
  .nb-hero__visual,
  .nb-quotebox,
  .nb-manifesto {
    transform: none;
  }
  .nb-journey__rail {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nb__aurora,
  .nb__spark,
  .nb__spark i,
  .nb-btn--primary,
  .nb-hero__img,
  .nb-hero__visual::after,
  .nb-dot,
  ul.nb-hero__facts li,
  .nb-journey__rail::after,
  .nb-final__title em,
  .nb-form__ok,
  .nb-faq details[open] > p {
    animation: none !important;
  }
  .nb__spark {
    display: none;
  }
  .nb-btn::after {
    display: none;
  }
  .nb-hero__grid > div:first-child,
  .nb-hero__visual,
  .nb-quotebox,
  .nb-manifesto {
    transform: none !important;
  }
  .nb-final__title em {
    color: var(--lav, #c4b5fd);
    -webkit-text-fill-color: currentColor;
  }
}
