/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS — Motion & Effects
   ═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────
   KEYFRAMES
   ───────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translate3d(0, -30px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translate3d(-30px, 0, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translate3d(30px, 0, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale3d(0.9, 0.9, 1);
  }

  to {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }
}

@keyframes slideInUp {
  from {
    transform: translate3d(0, 100%, 0);
  }

  to {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes slideInDown {
  from {
    transform: translate3d(0, -100%, 0);
  }

  to {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

@keyframes float {

  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(0, -10px, 0);
  }
}

@keyframes glow {

  0%,
  100% {
    box-shadow: 0 0 20px var(--color-accent-glow);
  }

  50% {
    box-shadow: 0 0 40px var(--color-accent-glow);
  }
}

@keyframes spin {
  from {
    transform: rotate3d(0, 0, 1, 0deg);
  }

  to {
    transform: rotate3d(0, 0, 1, 360deg);
  }
}

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

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Optimize gradient animation - use transform if possible */
@media (prefers-reduced-motion: reduce) {
  .hero__headline-accent {
    animation: none;
    background-position: 0% 50%;
  }
}

/* ─────────────────────────────────────────────────────────────
   ANIMATION CLASSES
   ───────────────────────────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────────
   ANIMATION CLASSES
   ───────────────────────────────────────────────────────────── */
.animate-fade-in {
  animation: fadeIn 0.4s var(--ease-out-expo) forwards;
}

.animate-fade-in-up {
  animation: fadeInUp 0.4s var(--ease-out-expo) forwards;
}

.animate-fade-in-down {
  animation: fadeInDown 0.4s var(--ease-out-expo) forwards;
}

.animate-fade-in-left {
  animation: fadeInLeft 0.4s var(--ease-out-expo) forwards;
}

.animate-fade-in-right {
  animation: fadeInRight 0.4s var(--ease-out-expo) forwards;
}

.animate-scale-in {
  animation: scaleIn 0.4s var(--ease-out-expo) forwards;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* ─────────────────────────────────────────────────────────────
   SCROLL-TRIGGERED ANIMATIONS
   ───────────────────────────────────────────────────────────── */
[data-animate] {
  opacity: 0;
  transform: translate3d(0, 15px, 0);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

[data-animate].in-view {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  will-change: auto;
}

/* Hero section - no animation delays */
.hero [data-animate] {
  opacity: 1;
  transform: none;
  transition: none;
}

[data-animate="fade"] {
  transform: none;
}

[data-animate="slide-left"] {
  transform: translate3d(-30px, 0, 0);
}

[data-animate="slide-left"].in-view {
  transform: translate3d(0, 0, 0);
}

[data-animate="slide-right"] {
  transform: translate3d(30px, 0, 0);
}

[data-animate="slide-right"].in-view {
  transform: translate3d(0, 0, 0);
}

[data-animate="scale"] {
  transform: scale3d(0.95, 0.95, 1);
}

[data-animate="scale"].in-view {
  transform: scale3d(1, 1, 1);
}

/* Staggered Delays - Faster */
[data-animate-delay="100"] {
  transition-delay: 0.05s;
}

[data-animate-delay="200"] {
  transition-delay: 0.1s;
}

[data-animate-delay="300"] {
  transition-delay: 0.15s;
}

[data-animate-delay="400"] {
  transition-delay: 0.2s;
}

[data-animate-delay="500"] {
  transition-delay: 0.25s;
}

[data-animate-delay="600"] {
  transition-delay: 0.3s;
}

[data-animate-delay="700"] {
  transition-delay: 0.35s;
}

[data-animate-delay="800"] {
  transition-delay: 0.4s;
}

/* ─────────────────────────────────────────────────────────────
   BLUR-UP ANIMATION
   ───────────────────────────────────────────────────────────── */
[data-animate="blur-up"] {
  opacity: 0;
  transform: translate3d(0, 25px, 0);
  filter: blur(8px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate="blur-up"].in-view,
[data-animate="blur-up"].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  filter: blur(0);
}

/* IS-VISIBLE support (scroll.js) — mirror in-view */
[data-animate].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  will-change: auto;
}

[data-animate="slide-left"].is-visible,
[data-animate="slide-right"].is-visible,
[data-animate="scale"].is-visible {
  transform: translate3d(0, 0, 0);
}

[data-animate="scale"].is-visible {
  transform: scale3d(1, 1, 1);
}

/* ─────────────────────────────────────────────────────────────
   STAGGER CHILDREN
   ───────────────────────────────────────────────────────────── */
.stagger-children>* {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-children>*.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* ─────────────────────────────────────────────────────────────
   PAGE TRANSITIONS
   ───────────────────────────────────────────────────────────── */
.page-enter {
  opacity: 0;
}

.page-enter-active {
  opacity: 1;
  transition: opacity 0.3s var(--ease-out-expo);
}

.page-exit {
  opacity: 1;
}

.page-exit-active {
  opacity: 0;
  transition: opacity 0.3s var(--ease-out-expo);
}

/* ─────────────────────────────────────────────────────────────
   HERO ANIMATIONS
   ───────────────────────────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────────
   HERO ANIMATIONS
   ───────────────────────────────────────────────────────────── */
.hero-content {
  opacity: 0;
  animation: fadeInUp 0.6s var(--ease-out-expo) 0.1s forwards;
}

.hero-headline {
  opacity: 0;
  animation: fadeInUp 0.6s var(--ease-out-expo) 0.2s forwards;
}

.hero-subheadline {
  opacity: 0;
  animation: fadeInUp 0.6s var(--ease-out-expo) 0.3s forwards;
}

.hero-cta {
  opacity: 0;
  animation: fadeInUp 0.6s var(--ease-out-expo) 0.4s forwards;
}

/* ─────────────────────────────────────────────────────────────
   MENU ANIMATIONS
   ───────────────────────────────────────────────────────────── */
.mobile-nav {
  transform: translateX(100%);
  transition: transform 0.4s var(--ease-out-expo);
}

.mobile-nav.open {
  transform: translate3d(0, 0, 0);
  will-change: auto;
}

.mobile-nav__item {
  opacity: 0;
  transform: translate3d(20px, 0, 0);
  transition: opacity 0.3s var(--ease-out-expo),
    transform 0.3s var(--ease-out-expo);
}

.mobile-nav.open .mobile-nav__item {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.mobile-nav.open .mobile-nav__item:nth-child(1) {
  transition-delay: 0.1s;
}

.mobile-nav.open .mobile-nav__item:nth-child(2) {
  transition-delay: 0.15s;
}

.mobile-nav.open .mobile-nav__item:nth-child(3) {
  transition-delay: 0.2s;
}

.mobile-nav.open .mobile-nav__item:nth-child(4) {
  transition-delay: 0.25s;
}

.mobile-nav.open .mobile-nav__item:nth-child(5) {
  transition-delay: 0.3s;
}

.mobile-nav.open .mobile-nav__item:nth-child(6) {
  transition-delay: 0.35s;
}

.mobile-nav.open .mobile-nav__item:nth-child(7) {
  transition-delay: 0.4s;
}

/* ─────────────────────────────────────────────────────────────
   HAMBURGER ANIMATION
   ───────────────────────────────────────────────────────────── */
.hamburger {
  cursor: pointer;
  width: 32px;
  height: 24px;
  position: relative;
  background: none;
  border: none;
  padding: 0;
}

.hamburger__line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  transition: all 0.3s var(--ease-out-expo);
}

.hamburger__line:nth-child(1) {
  top: 0;
}

.hamburger__line:nth-child(2) {
  top: 50%;
  transform: translateY(-50%);
}

.hamburger__line:nth-child(3) {
  bottom: 0;
}

.hamburger.active .hamburger__line:nth-child(1) {
  top: 50%;
  transform: translate3d(0, -50%, 0) rotate3d(0, 0, 1, 45deg);
}

.hamburger.active .hamburger__line:nth-child(2) {
  opacity: 0;
  transform: translate3d(-20px, 0, 0);
}

.hamburger.active .hamburger__line:nth-child(3) {
  bottom: 50%;
  transform: translate3d(0, 50%, 0) rotate3d(0, 0, 1, -45deg);
}

/* ─────────────────────────────────────────────────────────────
   LOADING STATES
   ───────────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,
      var(--color-bg-elevated) 0%,
      var(--color-bg-card) 50%,
      var(--color-bg-elevated) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ─────────────────────────────────────────────────────────────
   REDUCE MOTION
   ───────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-animate] {
    opacity: 1;
    transform: none;
  }
}