/* ============================================================
   ANIMATIONS — AC7 Studio
   Scroll reveals, keyframes, transitions
   ============================================================ */

/* ---------- Keyframes ---------- */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.85); }
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(10px); }
}

@keyframes heroScrollEnter {
  from { opacity: 0; transform: translateX(-50%) translateY(18px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes heroScrollArrow {
  0%, 100% { transform: translateY(-3px) rotate(45deg); }
  50%      { transform: translateY(2px) rotate(45deg); }
}

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

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

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

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

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

@keyframes heroNeonIntro {
  0%, 18% {
    text-shadow: none;
  }
  42% {
    text-shadow:
      0 0 4px rgba(85, 128, 255, 0.78),
      0 0 10px rgba(85, 128, 255, 0.58),
      0 0 22px rgba(0, 47, 255, 0.46),
      0 0 44px rgba(0, 47, 255, 0.3),
      0 0 72px rgba(0, 47, 255, 0.18);
  }
  68% {
    text-shadow:
      0 0 3px rgba(85, 128, 255, 0.46),
      0 0 8px rgba(85, 128, 255, 0.34),
      0 0 16px rgba(0, 47, 255, 0.26),
      0 0 28px rgba(0, 47, 255, 0.16);
  }
  100% {
    text-shadow: none;
  }
}

@keyframes heroTextSheen {
  0%, 74% {
    background-position: calc(0% - 420px) 0;
    opacity: 0;
  }
  76% {
    background-position: calc(0% - 420px) 0;
    opacity: 0.24;
  }
  78% {
    background-position: calc(8% - 420px) 0;
    opacity: 0.92;
  }
  89% {
    background-position: calc(100% + 420px) 0;
    opacity: 0.92;
  }
  91%, 100% {
    background-position: calc(100% + 420px) 0;
    opacity: 0;
  }
}

@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(20px, -30px) scale(1.04); }
  66%       { transform: translate(-15px, 15px) scale(0.97); }
}

/* ---------- Orb animation ---------- */
.hero__orb--1 { animation: orb-float 12s ease-in-out infinite; }
.hero__orb--2 { animation: orb-float 16s ease-in-out infinite reverse; }

/* ---------- Gradient text animation ---------- */
.animated-gradient {
  color: inherit;
}

.hero__title::after {
  animation: heroTextSheen 15s cubic-bezier(0.65, 0, 0.35, 1) 4.9s infinite;
}

.hero__title::before {
  animation: heroNeonIntro 3.6s ease-out 1.15s both;
}

/* ---------- Scroll reveal base states ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s var(--ease-out),
              transform 0.65s var(--ease-out);
}
.reveal.from-left {
  transform: translateX(-28px);
}
.reveal.from-right {
  transform: translateX(28px);
}
.reveal.scale-in {
  transform: scale(0.93);
}

/* When intersected, animate in */
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Stagger delays for grouped children */
.stagger-children > * { opacity: 0; transform: translateY(24px); transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out); }
.stagger-children.visible > *:nth-child(1)  { opacity: 1; transform: none; transition-delay: 0.05s; }
.stagger-children.visible > *:nth-child(2)  { opacity: 1; transform: none; transition-delay: 0.12s; }
.stagger-children.visible > *:nth-child(3)  { opacity: 1; transform: none; transition-delay: 0.19s; }
.stagger-children.visible > *:nth-child(4)  { opacity: 1; transform: none; transition-delay: 0.26s; }
.stagger-children.visible > *:nth-child(5)  { opacity: 1; transform: none; transition-delay: 0.33s; }
.stagger-children.visible > *:nth-child(6)  { opacity: 1; transform: none; transition-delay: 0.40s; }

/* Hero animations — triggered on load */
.hero__badge   { animation: fadeInUp 0.7s var(--ease-out) 0.2s both; }
.hero__title   {
  animation: fadeInUp 0.8s var(--ease-out) 0.35s both;
}
.hero__tagline { animation: fadeInUp 0.8s var(--ease-out) 0.5s both; }
.hero__ctas    { animation: fadeInUp 0.8s var(--ease-out) 0.65s both; }
.hero__scroll  { animation: heroScrollEnter 0.8s var(--ease-out) 1.0s both; }
.hero__scroll-icon { animation: heroScrollArrow 1.4s var(--ease-out) 1.85s infinite; }

/* ---------- Hover lift ---------- */
.lift {
  transition: transform var(--dur-med) var(--ease), box-shadow var(--dur-med);
}
.lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* ---------- Number counter pulse ---------- */
.stat__num { transition: color var(--dur-slow); }
.stat__num.counted { color: #fff; }
[data-theme="high-contrast"] .animated-gradient {
  background: none;
  color: var(--color-brand);
  -webkit-text-fill-color: currentColor;
  filter: none;
  animation: none;
}

[data-theme="high-contrast"] .hero__title::after {
  content: none;
}

[data-theme="high-contrast"] .hero__title::before {
  content: none;
}

[data-theme="high-contrast"] .hero__title {
  text-shadow: none;
  animation: fadeInUp 0.8s var(--ease-out) 0.35s both;
}

@media (prefers-reduced-motion: reduce) {
  .hero__title {
    text-shadow: none;
  }

  .hero__title::before {
    animation: none;
    opacity: 0;
  }

  .hero__title::after {
    animation: none;
    opacity: 0;
  }
}
[data-theme="high-contrast"] .stat__num,
[data-theme="high-contrast"] .stat__num.counted { color: var(--color-brand); }

/* ---------- Progress bar (for nav) ---------- */
.read-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--color-brand), var(--text-brand));
  z-index: 1001;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ---------- Reduced motion override ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .stagger-children > * {
    opacity: 1 !important;
    transform: none !important;
  }
}
