/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Blinking cursor ---------- */
.cursor-blink {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* ---------- Neon pulse on primary CTAs ---------- */
.btn--primary {
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(var(--neon-purple-rgb), 0.3); }
  50% { box-shadow: 0 0 20px var(--neon-cyan), 0 0 32px var(--neon-purple); }
}

/* ---------- Glitch text ---------- */
.glitch {
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-void);
  overflow: hidden;
  opacity: 0;
}

.glitch:hover::before,
.glitch:hover::after {
  opacity: 1;
}

.glitch::before {
  color: var(--neon-cyan);
  clip-path: inset(0 0 55% 0);
  animation: glitch-shift 0.6s infinite linear alternate-reverse;
}

.glitch::after {
  color: var(--neon-pink);
  clip-path: inset(55% 0 0 0);
  animation: glitch-shift 0.5s infinite linear alternate-reverse;
}

@keyframes glitch-shift {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-2px, 1px); }
  40% { transform: translate(2px, -1px); }
  60% { transform: translate(-1px, -1px); }
  80% { transform: translate(1px, 1px); }
  100% { transform: translate(0, 0); }
}

/* Maialinux wordmark: continuous subtle glitch, not hover-only */
.maialinux-hero__title.glitch::before,
.maialinux-hero__title.glitch::after {
  opacity: 0.6;
  animation-duration: 3s;
  animation-timing-function: steps(2, end);
}

/* ---------- Toast / flash message entrance ---------- */
.flash-message {
  animation: toast-in 0.4s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
