/* ============================================================
   WEBLUX Animations — animations.css
   Keyframes, Scroll Reveal, Parallax, Motion Classes
   ============================================================ */

/* ── Keyframes ─────────────────────────────────────── */

@keyframes preloaderReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes preloaderProgress {
  to {
    width: 100%;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes clipReveal {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes clipRevealLeft {
  from {
    clip-path: inset(0 0 0 100%);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  33% {
    transform: translateY(-12px) rotate(1deg);
  }
  66% {
    transform: translateY(-6px) rotate(-1deg);
  }
}

@keyframes floatReverse {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  33% {
    transform: translateY(10px) rotate(-1deg);
  }
  66% {
    transform: translateY(5px) rotate(1deg);
  }
}

@keyframes floatSlow {
  0%, 100% {
    transform: translateY(0px) translateX(0px);
  }
  25% {
    transform: translateY(-15px) translateX(5px);
  }
  50% {
    transform: translateY(-8px) translateX(-5px);
  }
  75% {
    transform: translateY(-20px) translateX(3px);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.8;
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.1);
  }
  50% {
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.2);
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes rotateSlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes marqueeScroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes marqueeScrollReverse {
  from {
    transform: translateX(-50%);
  }
  to {
    transform: translateX(0);
  }
}

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

@keyframes slideInFromBottom {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes drawLine {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes gridPulse {
  0%, 100% {
    opacity: 0.02;
  }
  50% {
    opacity: 0.05;
  }
}

/* ── Scroll Reveal Classes ─────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  will-change: opacity, transform;
}

.reveal--left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  will-change: opacity, transform;
}

.reveal--right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  will-change: opacity, transform;
}

.reveal--scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  will-change: opacity, transform;
}

.reveal--clip {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1s var(--ease-out);
  will-change: clip-path;
}

/* Revealed State */
.reveal.is-visible,
.reveal--left.is-visible,
.reveal--right.is-visible,
.reveal--scale.is-visible {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

.reveal--clip.is-visible {
  clip-path: inset(0 0 0 0);
}

/* Stagger Children */
.stagger-children > *:nth-child(1) { transition-delay: 0ms; }
.stagger-children > *:nth-child(2) { transition-delay: 80ms; }
.stagger-children > *:nth-child(3) { transition-delay: 160ms; }
.stagger-children > *:nth-child(4) { transition-delay: 240ms; }
.stagger-children > *:nth-child(5) { transition-delay: 320ms; }
.stagger-children > *:nth-child(6) { transition-delay: 400ms; }
.stagger-children > *:nth-child(7) { transition-delay: 480ms; }
.stagger-children > *:nth-child(8) { transition-delay: 560ms; }
.stagger-children > *:nth-child(9) { transition-delay: 640ms; }
.stagger-children > *:nth-child(10) { transition-delay: 720ms; }
.stagger-children > *:nth-child(11) { transition-delay: 800ms; }
.stagger-children > *:nth-child(12) { transition-delay: 880ms; }

/* ── Floating Elements ─────────────────────────────── */
.float {
  animation: float 6s ease-in-out infinite;
}

.float--reverse {
  animation: floatReverse 7s ease-in-out infinite;
}

.float--slow {
  animation: floatSlow 10s ease-in-out infinite;
}

.float--delay-1 { animation-delay: -1s; }
.float--delay-2 { animation-delay: -2s; }
.float--delay-3 { animation-delay: -3s; }
.float--delay-4 { animation-delay: -4s; }

/* ── Rotation ──────────────────────────────────────── */
.rotate-slow {
  animation: rotateSlow 40s linear infinite;
}

/* ── Pulse ─────────────────────────────────────────── */
.pulse {
  animation: pulse 3s ease-in-out infinite;
}

.pulse-glow {
  animation: pulseGlow 4s ease-in-out infinite;
}

/* ── Shimmer ───────────────────────────────────────── */
.shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.03) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
}

/* ── Typewriter Cursor ─────────────────────────────── */
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--color-gold-400);
  margin-left: 2px;
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

/* ── Hero Shapes ───────────────────────────────────── */
.hero-shape {
  position: absolute;
  border-radius: var(--radius-xl);
  opacity: 0.06;
  pointer-events: none;
  will-change: transform;
}

.hero-shape--1 {
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, var(--color-gold-400), transparent);
  top: 15%;
  right: 10%;
  animation: float 8s ease-in-out infinite;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}

.hero-shape--2 {
  width: 200px;
  height: 200px;
  background: linear-gradient(225deg, var(--color-gold-500), transparent);
  bottom: 20%;
  left: 5%;
  animation: floatReverse 10s ease-in-out infinite;
  border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
}

.hero-shape--3 {
  width: 150px;
  height: 150px;
  border: 1px solid rgba(212, 175, 55, 0.1);
  top: 30%;
  left: 15%;
  animation: rotateSlow 30s linear infinite, float 12s ease-in-out infinite;
}

.hero-shape--4 {
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.15), transparent);
  bottom: 30%;
  right: 20%;
  animation: floatSlow 14s ease-in-out infinite;
  border-radius: 50%;
}

.hero-shape--5 {
  width: 250px;
  height: 250px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  top: 50%;
  right: 30%;
  animation: rotateSlow 50s linear infinite reverse;
  border-radius: 50%;
}

/* ── Grid Background ──────────────────────────────── */
.grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridPulse 8s ease-in-out infinite;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black, transparent);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black, transparent);
}

/* ── Gradient Orbs ─────────────────────────────────── */
.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.4;
}

.gradient-orb--gold {
  background: var(--color-gold-400);
  opacity: 0.06;
}

.gradient-orb--navy {
  background: var(--color-navy-300);
  opacity: 0.08;
}

/* ── Line Draw ─────────────────────────────────────── */
.line-draw {
  position: relative;
  overflow: hidden;
}

.line-draw::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-gold-400);
  transition: width 0.6s var(--ease-out);
}

.line-draw:hover::after {
  width: 100%;
}

/* ── Parallax Data Attributes ──────────────────────── */
[data-parallax] {
  will-change: transform;
  transition: transform 0.1s linear;
}

/* ── 3D Tilt ───────────────────────────────────────── */
[data-tilt] {
  transform-style: preserve-3d;
  will-change: transform;
}

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

  .reveal,
  .reveal--left,
  .reveal--right,
  .reveal--scale,
  .reveal--clip {
    opacity: 1;
    transform: none;
    clip-path: none;
  }

  .marquee__track {
    animation: none;
  }

  .hero-shape {
    animation: none;
  }
}
