/*
 * Home page animations (added on top of the original WordPress design).
 * Calm and subtle on purpose. Visitors who ask their device for reduced motion
 * get the plain, still page. The moving parts are wired up in
 * src/components/HomeAnimations.tsx (typing line + mouse parallax).
 */

/* ---------- Hero background: soft circles ---------- */
.home .hero-blobs {
  position: absolute;
  inset: 0;
  z-index: 1; /* above the peach background, below the hero content */
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}
.home .hero-blob {
  position: absolute;
  border-radius: 50%;
  background: rgba(243, 80, 15, 0.07);
}
.home .hero-blob-1 {
  width: 340px;
  height: 340px;
  top: -90px;
  right: -90px;
}
.home .hero-blob-2 {
  width: 230px;
  height: 230px;
  bottom: -70px;
  left: -60px;
  background: rgba(243, 80, 15, 0.05);
}
.home .hero-blob-3 {
  width: 130px;
  height: 130px;
  top: 58%;
  left: 49%;
  background: rgba(243, 80, 15, 0.05);
}

/* smaller circles on phones so they stay in the background */
@media (max-width: 781px) {
  .home .hero-blob-1 { width: 210px; height: 210px; top: -70px; right: -70px; }
  .home .hero-blob-2 { width: 150px; height: 150px; bottom: -50px; left: -50px; }
  .home .hero-blob-3 { width: 90px; height: 90px; top: 62%; left: 70%; }
}

/* ---------- Typing line ---------- */
.hero-typing .typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 3px;
  vertical-align: -0.18em;
  background: var(--wp--preset--color--primary, #f3500f);
  animation: homeTypingBlink 1s steps(1) infinite;
}
.hero-typing .typing-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: no-preference) {
  /* ---------- Hero entrance (one after another) ---------- */
  .home .banner-content-div > p,
  .home .banner-head {
    animation: homeRise 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }
  .home .banner-content-div > p {
    animation-delay: 0.1s;
  }
  .home .banner-head {
    animation-delay: 0.25s;
  }
  .home .banner-image figure {
    animation: homeRisePhoto 1s cubic-bezier(0.22, 0.61, 0.36, 1) 0.4s both;
  }
  /* then the photo floats gently */
  .home .banner-image figure img {
    animation: homeFloat 6s ease-in-out 1.4s infinite alternate;
  }

  /* ---------- Hero background motion + mouse parallax ---------- */
  .home .hero-blob {
    animation: homeDrift 22s ease-in-out infinite alternate;
  }
  .home .hero-blob-2 {
    animation-duration: 28s;
    animation-delay: -6s;
  }
  .home .hero-blob-3 {
    animation-duration: 18s;
    animation-delay: -3s;
  }
  /* --mx / --my go from -1 to 1 as the mouse moves over the hero */
  .home .banner-image figure,
  .home .banner-head,
  .home .hero-blobs {
    transition: transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  .home .banner-image figure {
    transform: translate3d(calc(var(--mx, 0) * 12px), calc(var(--my, 0) * 10px), 0);
  }
  .home .banner-head {
    transform: translate3d(calc(var(--mx, 0) * -4px), calc(var(--my, 0) * -3px), 0);
  }
  .home .hero-blobs {
    transform: translate3d(calc(var(--mx, 0) * -14px), calc(var(--my, 0) * -10px), 0);
  }

  /* ---------- Cards: reveal one after another, lift on hover ---------- */
  .home .soft-rise {
    animation-name: homeSoftRise;
  }
  .home .soft-rise.animated {
    animation-duration: 0.7s;
    animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  .home .service-box,
  .home .post-main-area {
    transition:
      translate 0.35s cubic-bezier(0.22, 0.61, 0.36, 1),
      box-shadow 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  .home .service-box:hover,
  .home .post-main-area:hover {
    translate: 0 -6px;
    box-shadow:
      0 18px 36px -14px rgba(243, 80, 15, 0.32),
      0 4px 14px rgba(0, 0, 0, 0.05);
  }
  .home .service-box .icon-box {
    transition:
      scale 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
      rotate 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .home .service-box:hover .icon-box {
    scale: 1.1;
    rotate: -8deg;
  }

  /* ---------- "Get More Clicks": soft pulse ---------- */
  .home .cta-pulse {
    animation: homePulse 2.8s ease-out infinite;
    transition: translate 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  .home .cta-pulse:hover {
    translate: 0 -2px;
  }
}

@keyframes homeRise {
  from { opacity: 0; translate: 0 24px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes homeRisePhoto {
  from { opacity: 0; translate: 0 30px; scale: 0.96; }
  to { opacity: 1; translate: 0 0; scale: 1; }
}
@keyframes homeFloat {
  from { translate: 0 0; }
  to { translate: 0 -10px; }
}
@keyframes homeDrift {
  0% { translate: 0 0; }
  50% { translate: 24px 18px; }
  100% { translate: -16px 26px; }
}
@keyframes homeSoftRise {
  from { opacity: 0; transform: translate3d(0, 26px, 0); }
  to { opacity: 1; transform: none; }
}
@keyframes homePulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55); }
  70% { box-shadow: 0 0 0 14px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
@keyframes homeTypingBlink {
  50% { opacity: 0; }
}
