/* Archivo: web/assets/css/effects.css | Resumen: luz, motas, barrido y atmósfera continua. */
.cursor-light {
  position: fixed;
  z-index: 0;
  width: 46rem;
  height: 46rem;
  margin: -23rem 0 0 -23rem;
  left: var(--mx, 55%);
  top: var(--my, 28%);
  border-radius: 50%;
  background: radial-gradient(circle, rgb(197 232 168 / 0.16), transparent 62%);
  pointer-events: none;
}

.hero-visual {
  overflow: hidden;
  transform: perspective(920px) rotateX(var(--tilt-y, 0deg)) rotateY(var(--tilt-x, 0deg));
  transform-style: preserve-3d;
  will-change: transform;
}

.light-shaft,
.motes {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
}

.light-shaft {
  background: linear-gradient(
    108deg,
    transparent 18%,
    rgb(232 255 212 / 0.08) 36%,
    rgb(197 232 168 / 0.28) 48%,
    rgb(232 255 212 / 0.06) 58%,
    transparent 72%
  );
  mix-blend-mode: screen;
  opacity: 0.55;
}

.motes::before,
.motes::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f3fbe6;
  box-shadow:
    12vw 18% 0 0 rgb(197 232 168 / 0.55),
    28vw 42% 1px 0 rgb(243 241 234 / 0.35),
    41vw 22% 0 0 rgb(197 232 168 / 0.7),
    63vw 58% 1px 0 rgb(243 241 234 / 0.28),
    71vw 31% 0 0 rgb(197 232 168 / 0.5),
    18vw 72% 0 0 rgb(243 241 234 / 0.22);
}

.motes::after {
  width: 3px;
  height: 3px;
  box-shadow:
    22vw 12% 0 0 rgb(197 232 168 / 0.45),
    48vw 66% 0 0 rgb(243 241 234 / 0.3),
    67vw 18% 0 0 rgb(197 232 168 / 0.6),
    8vw 48% 0 0 rgb(243 241 234 / 0.2);
}

/* Halo de luz reactivo en bordes para tarjetas (estilo Linear / Vercel) */
.bento-card,
.capability-card,
.workflow-card {
  position: relative;
}

.bento-card::before,
.capability-card::before,
.workflow-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    380px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgb(197 232 168 / 0.48),
    transparent 65%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  z-index: 3;
}

.bento-card:hover::before,
.capability-card:hover::before,
.workflow-card:hover::before {
  opacity: 1;
}

.bento-card::after,
.capability-card::after,
.workflow-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    480px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgb(197 232 168 / 0.05),
    transparent 70%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  z-index: 1;
}

.bento-card:hover::after,
.capability-card:hover::after,
.workflow-card:hover::after {
  opacity: 1;
}

.button {
  position: relative;
  overflow: hidden;
}

.button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 25%, rgb(255 255 255 / 0.5), transparent 62%);
  transform: translateX(-130%);
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .glow {
    animation: glow-drift 16s ease-in-out infinite alternate;
  }

  .site-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
    background-size: 42% 100%;
    background-repeat: no-repeat;
    animation: line-travel 7.5s linear infinite;
  }

  .js .enter-stack > * {
    animation: enter-up 1.05s var(--ease) both;
  }

  .js .enter-stack > *:nth-child(1) { animation-delay: 0.08s; }
  .js .enter-stack > *:nth-child(2) { animation-delay: 0.2s; }
  .js .enter-stack > *:nth-child(3) { animation-delay: 0.34s; }
  .js .enter-stack > *:nth-child(4) { animation-delay: 0.46s; }
  .js .enter-stack > *:nth-child(5) { animation-delay: 0.58s; }

  .js .hero-visual {
    animation: enter-frame 1.25s 0.18s var(--ease) both;
  }

  .js .hero-visual img {
    animation: kenburns 22s 1.1s ease-in-out infinite alternate;
  }

  .light-shaft { animation: shaft-breathe 6.5s ease-in-out infinite; }
  .motes::before { animation: mote-rise 14s linear infinite; }
  .motes::after { animation: mote-rise 19s linear infinite reverse; }

  .button::after { animation: sheen-pass 5.5s ease-in-out 2s infinite; }
  .button:hover::after {
    animation: none;
    transform: translateX(130%);
    transition: transform 0.7s var(--ease);
  }

  .js .collection-index.is-in,
  .js .collection-panel.is-in .collection-index {
    animation: index-glow 3.8s ease-in-out infinite;
  }
}

.motion-paused .glow,
.motion-paused .site-header::after,
.motion-paused .hero-visual,
.motion-paused .hero-visual img,
.motion-paused .light-shaft,
.motion-paused .motes::before,
.motion-paused .motes::after,
.motion-paused .button::after,
.motion-paused .collection-index {
  animation-play-state: paused;
}

@keyframes enter-up {
  from { opacity: 0; transform: translateY(32px); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes enter-frame {
  from { opacity: 0; transform: perspective(920px) translateY(24px) scale(0.98); }
  to { opacity: 1; transform: perspective(920px) rotateX(var(--tilt-y, 0deg)) rotateY(var(--tilt-x, 0deg)); }
}

@keyframes kenburns {
  from { transform: scale(1.05) translate(0, 0); }
  to { transform: scale(1.14) translate(-2.4%, 1.8%); }
}

@keyframes shaft-breathe {
  0%, 100% { opacity: 0.28; transform: translateX(0); }
  50% { opacity: 0.8; transform: translateX(6%); }
}

@keyframes mote-rise {
  from { transform: translateY(18%); opacity: 0.15; }
  20% { opacity: 0.9; }
  to { transform: translateY(-28%); opacity: 0.1; }
}

@keyframes glow-drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(7%, 5%) scale(1.12); }
}

@keyframes line-travel {
  from { background-position: -40% 0; }
  to { background-position: 140% 0; }
}

@keyframes sheen-pass {
  0%, 70% { transform: translateX(-130%); }
  85% { transform: translateX(130%); }
  100% { transform: translateX(130%); }
}

@keyframes index-glow {
  50% { color: var(--accent); text-shadow: 0 0 28px rgb(197 232 168 / 0.35); }
}

@media (max-width: 760px) {
  .cursor-light { display: none; }

  .hero-visual {
    transform: none;
    will-change: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor-light,
  .light-shaft,
  .motes { display: none; }
}
