/* =============================================
   ANIMATIONS — Keyframes & Utility Classes
   ============================================= */

/* ---------- REVEAL ON SCROLL ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays for grid children */
.stagger-1 { transition-delay: 0.05s; }
.stagger-2 { transition-delay: 0.10s; }
.stagger-3 { transition-delay: 0.15s; }
.stagger-4 { transition-delay: 0.20s; }
.stagger-5 { transition-delay: 0.25s; }
.stagger-6 { transition-delay: 0.30s; }
.stagger-7 { transition-delay: 0.35s; }
.stagger-8 { transition-delay: 0.40s; }
.stagger-9 { transition-delay: 0.45s; }

/* ---------- HERO ENTRANCE ANIMATIONS ---------- */
@keyframes heroFadeDown {
  from { opacity: 0; transform: translateY(-30px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes heroZoomIn {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

.anim-hero-badge {
  animation: heroFadeDown 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.anim-hero-h1-l1 {
  animation: heroFadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

.anim-hero-h1-l2 {
  animation: heroZoomIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both;
}

.anim-hero-h1-l3 {
  animation: heroFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.75s both;
}

.anim-hero-sub {
  animation: heroFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.9s both;
}

.anim-hero-btns {
  animation: heroFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 1.05s both;
}

.anim-hero-stats {
  animation: heroFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 1.2s both;
}

/* ---------- FLOATING TECH ELEMENTS ---------- */
@keyframes floatSlow {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50%      { transform: translateY(-18px) rotate(2deg); }
}

@keyframes floatMedium {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50%      { transform: translateY(-12px) rotate(-1.5deg); }
}

.float-slow  { animation: floatSlow 9s ease-in-out infinite; }
.float-med   { animation: floatMedium 7s ease-in-out infinite; }
.float-d0    { animation-delay: 0s; }
.float-d1    { animation-delay: 1.5s; }
.float-d2    { animation-delay: 3s; }
.float-d3    { animation-delay: 4.5s; }
.float-d4    { animation-delay: 6s; }

/* ---------- PULSE / GLOW ---------- */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(218,165,32,0.3); }
  50%      { box-shadow: 0 0 25px rgba(218,165,32,0.55), 0 0 50px rgba(218,165,32,0.15); }
}

@keyframes pulseRing {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

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

/* Active step circle ring effect */
.step-circle.active::after {
  content: '';
  position: absolute;
  inset: -5px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  animation: pulseRing 1.8s ease-out infinite;
}

/* ---------- PAGE TRANSITIONS ---------- */
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(25px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page.active {
  animation: pageEnter 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ---------- GRADIENT ANIMATION ON TEXT ---------- */
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.gradient-text-anim {
  background: linear-gradient(135deg, #F5C842, #DAA520, #F5C842, #b8891a);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 6s ease infinite;
}

/* ---------- SCROLL HINT ---------- */
.scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: rgba(218,165,32,0.45);
  font-family: var(--font-code);
  font-size: 10px;
  letter-spacing: 4px;
}

.scroll-hint::after {
  content: '';
  width: 1px;
  height: 45px;
  background: linear-gradient(to bottom, rgba(218,165,32,0.5), transparent);
  animation: scrollPulse 2.2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%,100% { opacity: 1; height: 45px; }
  50%     { opacity: 0.3; height: 30px; }
}

/* ---------- HOLOGRAPHIC CARD SHINE ---------- */
@keyframes holoShine {
  0%   { transform: translateX(-100%) skewX(-15deg); }
  100% { transform: translateX(250%) skewX(-15deg); }
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255,255,255,0.03) 40%,
    rgba(218,165,32,0.06) 50%,
    rgba(255,255,255,0.03) 60%,
    transparent 80%
  );
  z-index: 1;
  pointer-events: none;
}

.service-card:hover::before {
  animation: holoShine 0.8s ease forwards;
}

/* ---------- GLOW DIVIDER ---------- */
.glow-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(218,165,32,0.4), transparent);
  margin: 0;
  position: relative;
}

.glow-divider::after {
  content: '';
  position: absolute;
  top: -3px;
  left: 30%;
  right: 30%;
  height: 7px;
  background: radial-gradient(ellipse, rgba(218,165,32,0.15) 0%, transparent 70%);
}

/* ---------- HEX ITEMS ---------- */
.hex-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.hex-item {
  background: rgba(218,165,32,0.06);
  border: 1px solid rgba(218,165,32,0.2);
  border-radius: 8px;
  padding: 10px 18px;
  font-family: var(--font-code);
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 1px;
  transition: all 0.3s;
}

.hex-item:hover {
  background: rgba(218,165,32,0.15);
  border-color: var(--gold);
  transform: translateY(-3px);
}

/* ---------- 3D TILT PARENT ---------- */
.tilt-3d {
  transition: transform 0.2s ease-out;
  transform-style: preserve-3d;
  will-change: transform;
}

/* ---------- BALANCE BAR ANIMATION ---------- */
.balance-bar {
  width: 100%;
  height: 10px;
  background: rgba(218,165,32,0.12);
  border-radius: 10px;
  overflow: hidden;
  margin: 12px 0;
}

.balance-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.balance-fill.paid {
  background: linear-gradient(90deg, var(--accent-green), #2ed573);
}

.balance-fill.pending {
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
}

/* ---------- LOADING SPINNER ---------- */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(218,165,32,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* ---------- BADGE PULSE (hero badge dot) ---------- */
@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 8px var(--accent-cyan); }
  50%      { opacity: 0.5; transform: scale(0.65); box-shadow: 0 0 3px var(--accent-cyan); }
}

.hero-badge::before {
  animation: dotPulse 2s ease-in-out infinite;
}

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