/* ============================================================
   LUXE TECH — ANIMATIONS.CSS
   Micro-animations, page transitions, scroll effects
   ============================================================ */

/* ============================================================
   GLOBAL ANIMATION STATES
   ============================================================ */

/* Elements start invisible — JS adds .is-visible via IntersectionObserver */
[data-animate] {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

[data-animate="fade-up"] {
  transform: translateY(40px);
}

[data-animate="fade-down"] {
  transform: translateY(-30px);
}

[data-animate="fade-left"] {
  transform: translateX(40px);
}

[data-animate="fade-right"] {
  transform: translateX(-40px);
}

[data-animate="scale-up"] {
  transform: scale(0.92);
}

[data-animate="slide-reveal"] {
  transform: translateY(60px);
  clip-path: inset(0 0 100% 0);
}

[data-animate].is-visible {
  opacity: 1;
  transform: none;
  clip-path: none;
}

/* Staggered children */
[data-stagger] > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

[data-stagger].is-visible > *:nth-child(1) { transition-delay: 0.05s; opacity: 1; transform: none; }
[data-stagger].is-visible > *:nth-child(2) { transition-delay: 0.12s; opacity: 1; transform: none; }
[data-stagger].is-visible > *:nth-child(3) { transition-delay: 0.19s; opacity: 1; transform: none; }
[data-stagger].is-visible > *:nth-child(4) { transition-delay: 0.26s; opacity: 1; transform: none; }
[data-stagger].is-visible > *:nth-child(5) { transition-delay: 0.33s; opacity: 1; transform: none; }
[data-stagger].is-visible > *:nth-child(6) { transition-delay: 0.40s; opacity: 1; transform: none; }
[data-stagger].is-visible > *:nth-child(7) { transition-delay: 0.47s; opacity: 1; transform: none; }
[data-stagger].is-visible > *:nth-child(8) { transition-delay: 0.54s; opacity: 1; transform: none; }
[data-stagger].is-visible > *:nth-child(n+9) { transition-delay: 0.60s; opacity: 1; transform: none; }

/* ============================================================
   HERO SECTION ANIMATIONS
   ============================================================ */
.hero-eyebrow {
  animation: hero-entry 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s both;
}

.hero-headline {
  animation: hero-entry 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.25s both;
}

.hero-subheading {
  animation: hero-entry 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.45s both;
}

.hero-cta-group {
  animation: hero-entry 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.6s both;
}

.hero-proof {
  animation: hero-entry 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.75s both;
}

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

/* ── Hero Background Particle ── */
.hero-particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--color-accent);
  border-radius: 50%;
  opacity: 0;
  animation: particle-float var(--duration, 4s) ease-in-out var(--delay, 0s) infinite;
}

/* Disable expensive particle animations on mobile for performance */
@media (max-width: 767px) {
  .hero-particle {
    display: none !important;
  }
}

@keyframes particle-float {
  0%   { opacity: 0; transform: translateY(0) scale(1); }
  20%  { opacity: 0.6; }
  80%  { opacity: 0.3; }
  100% { opacity: 0; transform: translateY(-80px) scale(0); }
}

/* ── Typing Cursor ── */
.typing-cursor {
  display: inline-block;
  width: 3px;
  height: 0.85em;
  background: var(--color-accent);
  margin-left: 4px;
  border-radius: 2px;
  vertical-align: middle;
  animation: blink-cursor 1s step-start infinite;
}

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

/* ── Floating badge ── */
.hero-floating-badge {
  animation: float-badge 3s ease-in-out infinite;
}

@keyframes float-badge {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* ============================================================
   SHIMMER EFFECT — for skeleton loading
   ============================================================ */
.shimmer {
  background: linear-gradient(
    90deg,
    var(--color-surface-2) 25%,
    var(--color-surface-3) 50%,
    var(--color-surface-2) 75%
  );
  background-size: 400% 100%;
  animation: shimmer-pass 1.5s ease infinite;
  will-change: background-position;
}

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

/* ============================================================
   GOLD SHIMMER on buttons (hover sweep)
   ============================================================ */
.btn-shimmer {
  position: relative;
  overflow: hidden;
}

.btn-shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.btn-shimmer:hover::after { left: 160%; }

/* ============================================================
   TRUST SECTION COUNTERS
   ============================================================ */
.counter-value {
  display: inline-block;
  transition: transform 0.3s ease;
}

.trust-stat {
  text-align: center;
  padding: var(--space-6);
  transition: transform var(--transition-base);
}

.trust-stat:hover { transform: translateY(-4px); }

.trust-stat__number {
  font-family: var(--font-mono);
  font-size: var(--text-4xl);
  font-weight: var(--fw-light);
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.trust-stat__label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ============================================================
   GLOW PULSE — for accent decorative elements
   ============================================================ */
.glow-pulse {
  animation: glow-ring 3s ease-in-out infinite;
}

@keyframes glow-ring {
  0%, 100% { box-shadow: 0 0 20px rgba(201, 169, 110, 0.1); }
  50%       { box-shadow: 0 0 40px rgba(201, 169, 110, 0.3), 0 0 80px rgba(201, 169, 110, 0.1); }
}

/* ============================================================
   TICKER / MARQUEE — Scrolling announcement bar
   ============================================================ */
.ticker-wrapper {
  background: var(--color-accent);
  overflow: hidden;
  padding: var(--space-2) 0;
}

.ticker-track {
  display: flex;
  gap: var(--space-8);
  width: max-content;
  animation: ticker-scroll 30s linear infinite;
  will-change: transform; /* GPU layer promotion for smooth scroll */
}

.ticker-track:hover { animation-play-state: paused; }

.ticker-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-invert);
  white-space: nowrap;
}

.ticker-dot {
  width: 4px;
  height: 4px;
  background: rgba(0,0,0,0.3);
  border-radius: 50%;
}

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================================
   HERO SCROLL INDICATOR
   ============================================================ */
.scroll-indicator {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: hero-entry 1s ease 1.2s both;
}

.scroll-indicator__line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--color-accent), transparent);
  animation: scroll-line 1.5s ease-in-out infinite;
}

@keyframes scroll-line {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 1; }
  50%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
  100% { transform: scaleY(1); transform-origin: bottom; opacity: 0; }
}

/* ============================================================
   PAGE LOADING OVERLAY
   ============================================================ */
#page-loader {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 2px solid var(--color-border-2);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ============================================================
   REDUCED MOTION — Accessibility
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-animate],
  [data-stagger] > * {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }

  .ticker-track { animation: none; }
  .scroll-indicator__line { animation: none; }

  /* Disable all infinite animations for accessibility */
  .hero-particle,
  .typing-cursor,
  .hero-floating-badge { animation: none !important; }
}
