/* =========================================================
   Houston Trade Pros — Animation & Effects Utilities
   css/effects.css
   Loaded globally after redesign.css.
   Pure CSS — no library required.
   ========================================================= */

/* ══════════════════════════════════════════════════════════
   KEYFRAMES
   ══════════════════════════════════════════════════════════ */

@keyframes shimmer-sweep {
  from { background-position: 200% center; }
  to   { background-position: -200% center; }
}

@keyframes aurora-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

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

@keyframes glow-pulse-anim {
  0%, 100% { box-shadow: var(--glow-orange-sm, 0 0 20px rgba(249,115,22,0.20)); }
  50%       { box-shadow: var(--glow-orange,    0 0 40px rgba(249,115,22,0.25), 0 0 80px rgba(249,115,22,0.10)); }
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1;   box-shadow: 0 0 6px  rgba(249,115,22,0.60); }
  50%       { opacity: 0.6; box-shadow: 0 0 16px rgba(249,115,22,0.90); }
}

@keyframes meteor-fall {
  0%   { transform: rotate(215deg) translateX(0);     opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: rotate(215deg) translateX(600px); opacity: 0; }
}

@keyframes grid-drift {
  from { background-position: 0 0; }
  to   { background-position: 40px 40px; }
}

@keyframes hf-glow-pulse {
  0%, 100% { transform: translateX(-50%) scale(1);    opacity: 0.7; }
  50%       { transform: translateX(-50%) scale(1.15); opacity: 1; }
}

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

@keyframes hero-orb-drift {
  from { transform: translate(0,    0)    scale(1); }
  to   { transform: translate(-40px, 30px) scale(1.1); }
}

@keyframes confetti-fall {
  0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
  100% {
    transform:
      translateY(var(--cf-y, 200px))
      translateX(var(--cf-x, 0px))
      rotate(var(--cf-rot, 360deg))
      scale(0.5);
    opacity: 0;
  }
}

@keyframes border-beam-travel {
  0%   { offset-distance: 0%; }
  100% { offset-distance: 100%; }
}

/* ══════════════════════════════════════════════════════════
   TEXT EFFECTS
   ══════════════════════════════════════════════════════════ */

/* Shimmer — sweeping highlight across text */
.shimmer-text {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.5) 0%,
    rgba(255,255,255,1)   20%,
    rgba(249,115,22,0.9)  40%,
    rgba(255,255,255,1)   60%,
    rgba(255,255,255,0.5) 80%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer-sweep 3s linear infinite;
}

/* Aurora — animated hue-shift gradient (replaces static version) */
.aurora-text {
  background: linear-gradient(
    135deg,
    #f97316 0%,
    #fbbf24 25%,
    #fb923c 50%,
    #f97316 75%,
    #ef4444 100%
  );
  background-size: 400% 400%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: aurora-shift 6s ease infinite;
}

/* Gradient text — animated for CTAs and highlights */
.gradient-text-animated {
  background: linear-gradient(
    135deg,
    var(--brand-500, #f97316),
    #fbbf24,
    var(--brand-400, #fb923c),
    var(--brand-500, #f97316)
  );
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 4s ease infinite;
}

/* Text glow — warm orange halo */
.text-glow {
  text-shadow:
    0 0 30px rgba(249,115,22,0.5),
    0 0 60px rgba(249,115,22,0.25);
}

/* ══════════════════════════════════════════════════════════
   GLOW EFFECTS
   ══════════════════════════════════════════════════════════ */

/* Pulsing box-shadow glow */
.glow-pulse {
  animation: glow-pulse-anim 2.5s ease-in-out infinite;
}

/* Orange glowing dot indicator */
.glow-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--brand-500, #f97316);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--brand-500, #f97316);
  animation: dot-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   BACKGROUND EFFECTS
   ══════════════════════════════════════════════════════════ */

/* Animated subtle dot grid */
.animated-grid-bg {
  background-image:
    linear-gradient(to right, rgba(249,115,22,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(249,115,22,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: grid-drift 20s linear infinite;
}

/* Noise / grain texture overlay */
.noise-overlay {
  position: relative;
}
.noise-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  border-radius: inherit;
  z-index: 0;
}

/* ══════════════════════════════════════════════════════════
   CARD INTERACTION EFFECTS
   ══════════════════════════════════════════════════════════ */

/* 3D tilt — CSS vars --rx/--ry set by JS on mousemove */
.tilt-card {
  transform-style: preserve-3d;
  transition:
    transform var(--duration-slow, 400ms) var(--ease-spring, cubic-bezier(0.34,1.56,0.64,1));
}
.tilt-card:hover {
  transform:
    perspective(800px)
    rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg))
    translateZ(10px);
}

/* Spotlight card — cursor-tracked radial glow via CSS vars --mx/--my */
.spotlight-card {
  position: relative;
  overflow: hidden;
}
.spotlight-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    600px circle at var(--mx, -200px) var(--my, -200px),
    rgba(249,115,22,0.07),
    transparent 40%
  );
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity var(--duration-base, 250ms);
}
.spotlight-card:hover::after {
  opacity: 1;
}

/* ══════════════════════════════════════════════════════════
   METEOR SHOWER
   ══════════════════════════════════════════════════════════ */

.meteor-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.meteor {
  position: absolute;
  width: 2px;
  height: 60px;
  background: linear-gradient(180deg, rgba(249,115,22,0.8), transparent);
  border-radius: 100px;
  animation: meteor-fall var(--meteor-duration, 3s) linear var(--meteor-delay, 0s) infinite;
  top:  var(--meteor-top,  -10%);
  left: var(--meteor-left, 50%);
  transform: rotate(215deg);
}

/* ══════════════════════════════════════════════════════════
   BUTTON SHIMMER SWEEP
   ══════════════════════════════════════════════════════════ */

/* Light streak across primary buttons on hover */
.btn-primary {
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: -50%; left: -60%;
  width: 40%;
  height: 200%;
  background: rgba(255,255,255,0.15);
  transform: rotate(25deg) translateX(0);
  transition: transform 0.5s ease;
  pointer-events: none;
}
.btn-primary:hover::after {
  transform: rotate(25deg) translateX(600%);
}

/* Loading shimmer state */
.btn-primary.loading::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.15) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer-sweep 1s linear infinite;
  z-index: 1;
}

/* ══════════════════════════════════════════════════════════
   CONFETTI PARTICLES
   ══════════════════════════════════════════════════════════ */

.confetti-particle {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 9999;
  animation: confetti-fall var(--cf-dur, 1.2s) var(--cf-ease, ease-out) forwards;
  transform-origin: center;
}

/* ══════════════════════════════════════════════════════════
   SECTION EYEBROW
   ══════════════════════════════════════════════════════════ */

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display, sans-serif);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-500, #f97316);
  margin-bottom: 12px;
}
.section-eyebrow::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--brand-500, #f97316);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   REDUCED MOTION — Respect user preference
   ══════════════════════════════════════════════════════════ */

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