/* ============================================
   PHOENIX ACCOUNTING GROUP - Animations CSS
   Scroll-reveal, Parallax, Transitions, Keyframes
   ============================================ */

/* ─── Scroll Reveal Base ─── */
[data-reveal] {
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

[data-reveal="fade"] { opacity: 0; }
[data-reveal="up"]   { opacity: 0; transform: translateY(40px); }
[data-reveal="down"] { opacity: 0; transform: translateY(-40px); }
[data-reveal="left"] { opacity: 0; transform: translateX(-50px); }
[data-reveal="right"]{ opacity: 0; transform: translateX(50px); }
[data-reveal="scale"]{ opacity: 0; transform: scale(0.90); }
[data-reveal="blur"] { opacity: 0; filter: blur(10px); }

[data-reveal].revealed {
  opacity: 1;
  transform: none;
  filter: none;
}

/* Staggered children */
[data-stagger] > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-stagger].revealed > *:nth-child(1)  { transition-delay: 0.05s; }
[data-stagger].revealed > *:nth-child(2)  { transition-delay: 0.12s; }
[data-stagger].revealed > *:nth-child(3)  { transition-delay: 0.19s; }
[data-stagger].revealed > *:nth-child(4)  { transition-delay: 0.26s; }
[data-stagger].revealed > *:nth-child(5)  { transition-delay: 0.33s; }
[data-stagger].revealed > *:nth-child(6)  { transition-delay: 0.40s; }
[data-stagger].revealed > *:nth-child(7)  { transition-delay: 0.47s; }
[data-stagger].revealed > *:nth-child(8)  { transition-delay: 0.54s; }
[data-stagger].revealed > *:nth-child(9)  { transition-delay: 0.60s; }
[data-stagger].revealed > *:nth-child(10) { transition-delay: 0.66s; }
[data-stagger].revealed > *:nth-child(n+11) { transition-delay: 0.70s; }

[data-stagger].revealed > * {
  opacity: 1;
  transform: none;
}

/* ─── Parallax ─── */
[data-parallax] {
  will-change: transform;
}

/* ─── Line draw animation ─── */
.line-draw {
  display: block;
  overflow: hidden;
  position: relative;
}
.line-draw::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-gold);
  transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}
.line-draw.revealed::after { width: 100%; }

/* ─── Counter animation ─── */
.count-up {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ─── Gradient text ─── */
.text-gradient {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ─── Keyframes ─── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  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 slideDown {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}

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

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

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

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

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

@keyframes dashDraw {
  to { stroke-dashoffset: 0; }
}

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

@keyframes particleDrift {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-80vh) translateX(40px); opacity: 0; }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(201,168,76,0.3); }
  50%       { box-shadow: 0 0 60px rgba(201,168,76,0.6); }
}

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

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

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

/* ─── Hero text animation classes ─── */
.hero-word {
  display: inline-block;
  overflow: hidden;
}

.hero-word-inner {
  display: inline-block;
  animation: heroWordIn 0.8s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

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

/* ─── Floating particles ─── */
.particles-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(201,168,76,0.6);
  border-radius: 50%;
  animation: particleDrift linear infinite;
}

/* ─── Animated gradient border ─── */
.gradient-border {
  position: relative;
}
.gradient-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: var(--gradient-gold);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition-base);
}
.gradient-border:hover::before { opacity: 1; }

/* ─── Animated underline ─── */
.animated-underline {
  position: relative;
  display: inline-block;
}
.animated-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-gold);
  transition: width var(--transition-base);
}
.animated-underline:hover::after { width: 100%; }

/* ─── Number stat animation ─── */
.stat-number {
  font-family: var(--font-heading);
  font-weight: var(--weight-black);
  color: var(--color-gold);
  line-height: 1;
}

/* ─── Typed cursor ─── */
.typed-cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--color-gold);
  margin-left: 4px;
  vertical-align: text-bottom;
  animation: cursorBlink 1s step-end infinite;
}

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

/* ─── Reveal delay utilities ─── */
.delay-100  { transition-delay: 0.1s !important; }
.delay-200  { transition-delay: 0.2s !important; }
.delay-300  { transition-delay: 0.3s !important; }
.delay-400  { transition-delay: 0.4s !important; }
.delay-500  { transition-delay: 0.5s !important; }
.delay-600  { transition-delay: 0.6s !important; }
.delay-700  { transition-delay: 0.7s !important; }
.delay-800  { transition-delay: 0.8s !important; }

/* ─── Animated background grid ─── */
.bg-grid {
  background-image:
    linear-gradient(rgba(201,168,76,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,168,76,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ─── Glow circle ─── */
.glow-circle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,0.15) 0%, transparent 70%);
  pointer-events: none;
  animation: glowFloat 8s ease-in-out infinite;
}

@keyframes glowFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(20px, -30px) scale(1.05); }
  66%  { transform: translate(-15px, 15px) scale(0.95); }
}
