/* ==========================================================================
   Hobby Doser — Animations & Motion
   ========================================================================== */

/* --------------------------------------------------------------------------
   Keyframes
   -------------------------------------------------------------------------- */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes float-phone-left {
  0%,
  100% {
    transform: rotate(-8deg) translateY(12px);
  }
  50% {
    transform: rotate(-8deg) translateY(0);
  }
}

@keyframes float-phone-right {
  0%,
  100% {
    transform: rotate(8deg) translateY(20px);
  }
  50% {
    transform: rotate(8deg) translateY(6px);
  }
}

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

@keyframes pulse-glow {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.08);
  }
}

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

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

@keyframes ripple-effect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

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

/* --------------------------------------------------------------------------
   Hero Entrance
   -------------------------------------------------------------------------- */
.hero__content > * {
  opacity: 0;
  animation: fade-in-up 0.8s var(--ease-out) forwards;
}

.hero__brand {
  animation-delay: 0.1s;
}

.hero__title {
  animation-delay: 0.25s;
}

.hero__subtitle {
  animation-delay: 0.4s;
}

.hero__actions {
  animation-delay: 0.55s;
}

.hero__visual {
  opacity: 0;
  animation: fade-in 1s var(--ease-out) 0.35s forwards;
}

/* Floating phones */
.phone-mockup--primary {
  animation: float-phone-center 5s ease-in-out infinite;
}

.phone-mockup--left {
  animation: float-phone-left 6s ease-in-out infinite;
}

.phone-mockup--right {
  animation: float-phone-right 5.5s ease-in-out 0.4s infinite;
}

.hero__glow {
  animation: pulse-glow 6s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   Background Shapes
   -------------------------------------------------------------------------- */
.bg-shape--1 {
  animation: shape-drift 18s ease-in-out infinite;
}

.bg-shape--2 {
  animation: shape-drift 22s ease-in-out 2s infinite reverse;
}

.bg-shape--3 {
  animation: shape-drift 16s ease-in-out 1s infinite;
}

/* --------------------------------------------------------------------------
   Animated Gradient Text / Buttons
   -------------------------------------------------------------------------- */
.gradient-animated {
  background: linear-gradient(135deg, #5e5ce6, #00d2ff, #7c5cfc, #5e5ce6);
  background-size: 300% 300%;
  animation: gradient-shift 8s ease infinite;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.btn--primary {
  background-size: 200% 200%;
  background-image: linear-gradient(135deg, #5e5ce6, #00d2ff, #7c5cfc);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-position 0.4s ease;
}

.btn--primary:hover {
  background-position: 100% 50%;
}

/* --------------------------------------------------------------------------
   Hover Glow
   -------------------------------------------------------------------------- */
.hover-glow {
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.hover-glow:hover {
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

/* --------------------------------------------------------------------------
   Scroll Reveal (Intersection Observer toggles .is-visible)
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

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

.reveal-delay-1 {
  transition-delay: 0.1s;
}

.reveal-delay-2 {
  transition-delay: 0.2s;
}

.reveal-delay-3 {
  transition-delay: 0.3s;
}

.reveal-delay-4 {
  transition-delay: 0.4s;
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

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

/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
}

.reveal-stagger.is-visible > *:nth-child(1) {
  transition-delay: 0.05s;
}
.reveal-stagger.is-visible > *:nth-child(2) {
  transition-delay: 0.1s;
}
.reveal-stagger.is-visible > *:nth-child(3) {
  transition-delay: 0.15s;
}
.reveal-stagger.is-visible > *:nth-child(4) {
  transition-delay: 0.2s;
}
.reveal-stagger.is-visible > *:nth-child(5) {
  transition-delay: 0.25s;
}
.reveal-stagger.is-visible > *:nth-child(6) {
  transition-delay: 0.3s;
}
.reveal-stagger.is-visible > *:nth-child(7) {
  transition-delay: 0.35s;
}
.reveal-stagger.is-visible > *:nth-child(8) {
  transition-delay: 0.4s;
}
.reveal-stagger.is-visible > *:nth-child(9) {
  transition-delay: 0.45s;
}
.reveal-stagger.is-visible > *:nth-child(10) {
  transition-delay: 0.5s;
}
.reveal-stagger.is-visible > *:nth-child(11) {
  transition-delay: 0.55s;
}
.reveal-stagger.is-visible > *:nth-child(12) {
  transition-delay: 0.6s;
}
.reveal-stagger.is-visible > *:nth-child(n) {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Parallax helper (JS sets --parallax-y)
   -------------------------------------------------------------------------- */
.parallax {
  transform: translate3d(0, var(--parallax-y, 0), 0);
  will-change: transform;
}

/* --------------------------------------------------------------------------
   Nav underline already in style.css — enhance active pulse
   -------------------------------------------------------------------------- */
.nav__link.is-active::after {
  box-shadow: 0 0 8px rgba(0, 210, 255, 0.5);
}

/* --------------------------------------------------------------------------
   Reduced Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

  .reveal,
  .reveal-scale,
  .reveal-stagger > *,
  .hero__content > *,
  .hero__visual {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }

  .phone-mockup--primary,
  .phone-mockup--left,
  .phone-mockup--right {
    animation: none !important;
  }

  body[data-page="home"]::before {
    animation: none !important;
    background-position: 50% 50% !important;
  }

  .phone-mockup--left {
    transform: rotate(-8deg) translateY(12px);
  }

  .phone-mockup--right {
    transform: rotate(8deg) translateY(20px);
  }
}
