/* ==========================================================================
   Vac-Ex HOME PAGE animations
   Enqueued on the front page only (inc/scripts.php), with
   js/home-enhancements.js. Scoped to body.home. Animation and hover polish
   only: no layout or content changes.
     1. Pulsing primary CTAs
     2. Hero entrance + 24/7 badge (spin-in, yellow colour sweep)
     3. Hover polish (sectors, checklist, value cards, steps, machines, FAQs, brochure)
     4. Scroll reveal (only when html.hm-anim is set in <head>)
     5. Reduced motion
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Pulsing CTAs (staggered so two never pulse together; pause on hover)
   -------------------------------------------------------------------------- */
@keyframes hm-beat { 0%, 70%, 100% { transform: scale(1); } 76% { transform: scale(1.05); } 82% { transform: scale(1); } 88% { transform: scale(1.03); } }
@keyframes hm-halo { 0%, 70% { box-shadow: 0 0 0 0 rgba(241,221,56,0); } 74% { box-shadow: 0 0 0 0 rgba(241,221,56,.6); } 96%, 100% { box-shadow: 0 0 0 16px rgba(241,221,56,0); } }

.home .hero-block .btns-holder .btn.lightbox,
.home .howitworks-block .btns-holder .btn,
.home .introcolumns-block .about .btn {
  animation: hm-beat 4.5s ease-in-out 1.5s infinite, hm-halo 4.5s ease-out 1.5s infinite;
  will-change: transform;
}
/* stagger so two CTAs on screen never pulse together */
.home .introcolumns-block .about .btn { animation-delay: 3.2s, 3.2s; }
.home .hero-block .btns-holder .btn.lightbox:hover,
.home .howitworks-block .btns-holder .btn:hover,
.home .introcolumns-block .about .btn:hover,
.home .btn:focus-visible { animation-play-state: paused; }

/* --------------------------------------------------------------------------
   2. Hero entrance (runs once on load; content is visible without JS)
   -------------------------------------------------------------------------- */
@keyframes hm-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
html.hm-anim .home .hero-block .caption-holder > * { animation: hm-rise .7s cubic-bezier(.2,.7,.2,1) both; }
html.hm-anim .home .hero-block .caption-holder > :nth-child(2) { animation-delay: .12s; }
html.hm-anim .home .hero-block .caption-holder > :nth-child(3) { animation-delay: .22s; }
html.hm-anim .home .hero-block .caption-holder > :nth-child(4) { animation-delay: .32s; }
html.hm-anim .home .hero-block .caption-holder > :nth-child(5) { animation-delay: .42s; }

/* --------------------------------------------------------------------------
   2b. 24/7 badge: sits further right (clear of the headline), spins in on
   first load, then a band of lighter/deeper yellow sweeps through it every
   6 seconds. Its positioning moves from `transform` to `translate`, so the
   spin and scale happen around the badge's own centre.
   -------------------------------------------------------------------------- */
.home .hero-block .circular-badge {
  overflow: hidden; isolation: isolate;
  background-color: #f1dd38;
  background-image: linear-gradient(115deg, #f1dd38 0%, #f1dd38 34%, #f7e870 41%, #fff6b8 47%, #e6cf10 53%, #d9bf00 56%, #f1dd38 66%, #f1dd38 100%);
  background-size: 320% 100%; background-position: 100% 0;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
}
/* soft white sheen riding just behind the colour band */
.home .hero-block .circular-badge::before { content: ""; position: absolute; inset: -20%; z-index: -1; background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.55) 50%, transparent 60%); translate: -120% 0; }
/* expanding ring each time the colour passes */
.home .hero-block .circular-badge::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 0 rgba(241,221,56,.7); pointer-events: none; }
.home .hero-block .circular-badge .badge-title { position: relative; }
/* positioning moves from transform to translate, so the spin/scale happen around the badge's centre */
.home .hero-block .circular-badge { transform: none; translate: 0 -50%; }
@media (min-width: 768px) {
  .home .hero-block .circular-badge { translate: 72% 0; }   /* theme: 50%, which sat over the headline */
  .home .hero-block .title-slider { padding-right: 36px; }
}

@keyframes hm-badge-in { 0% { opacity: 0; scale: .3; rotate: -200deg; } 65% { opacity: 1; scale: 1.12; rotate: 12deg; } 82% { scale: .96; rotate: -4deg; } 100% { opacity: 1; scale: 1; rotate: 0deg; } }
@keyframes hm-badge-sweep { 0%, 62% { background-position: 100% 0; } 92%, 100% { background-position: 0% 0; } }
@keyframes hm-badge-sheen { 0%, 64% { translate: -120% 0; } 94%, 100% { translate: 120% 0; } }
@keyframes hm-badge-ring { 0%, 70% { box-shadow: 0 0 0 0 rgba(241,221,56,.7); } 100% { box-shadow: 0 0 0 18px rgba(241,221,56,0); } }
@keyframes hm-badge-beat { 0%, 66%, 100% { scale: 1; } 76% { scale: 1.07; } 86% { scale: 1; } }

html.hm-anim .home .hero-block .circular-badge { animation: hm-badge-in 1.1s cubic-bezier(.2,.7,.2,1) .5s both, hm-badge-sweep 6s ease-in-out 2.2s infinite; }
html.hm-anim .home .hero-block .circular-badge .badge-title { animation: hm-badge-beat 6s ease-in-out 2.2s infinite; display: block; }
.home .hero-block .circular-badge::before { animation: hm-badge-sheen 6s ease-in-out 2.2s infinite; }
.home .hero-block .circular-badge::after { animation: hm-badge-ring 6s ease-out 2.2s infinite; }

/* --------------------------------------------------------------------------
   3. Hover polish
   -------------------------------------------------------------------------- */
/* Sectors: hexagons lift on hover, "Find out more" underline grows */
.home .sectors-slider-block .sector .icon { transition: transform .35s cubic-bezier(.2,.7,.2,1), filter .35s ease; }
.home .sectors-slider-block .sector:hover .icon,
.home .sectors-slider-block .sector:focus-visible .icon { transform: translateY(-6px) rotate(-4deg); filter: drop-shadow(0 10px 14px rgba(0,0,0,.35)); }
.home .sectors-slider-block .sector .more { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; text-decoration: none; padding-bottom: 2px; transition: background-size .3s ease; }
.home .sectors-slider-block .sector:hover .more { background-size: 100% 1px; }

/* "Are you concerned about..." list items nudge on hover */
.home .introcolumns-block .about li { transition: transform .25s ease; }
.home .introcolumns-block .about li:hover { transform: translateX(4px); }

/* Value Delivered cards: lift + yellow edge on hover */
.home .valuedeliverd-block .features-list .feature { transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s ease; box-shadow: inset 0 0 0 1px rgba(241,221,56,0); }
.home .valuedeliverd-block .features-list .feature:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 2px #f1dd38, 0 16px 34px rgba(0,0,0,.45); }

/* How it works: step cards respond to hover */
.home .howitworks-block .feature-holder { transition: transform .35s cubic-bezier(.2,.7,.2,1); }
.home .howitworks-block .feature:hover .feature-holder { transform: translateY(-4px); }

/* Operated machines: card lifts and the machine floats on hover */
.home .machine-block .col-holder { transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s ease, border-color .35s ease; }
.home .machine-block .col-holder:hover { transform: translateY(-6px); box-shadow: 0 24px 50px rgba(0,0,0,.12); border-color: #f1dd38; }
.home .machine-block .image img { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.home .machine-block .col-holder:hover .image img { transform: translateY(-8px) scale(1.03); }

/* FAQs: underline on hover */
.home .faq-block .accordion .opener { transition: color .2s ease; }
.home .faq-block .accordion li:not(.active) .opener:hover { color: #000; text-decoration: underline; text-decoration-color: #f1dd38; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* Brochure: brochure stack tilts gently */
.home .brochure-block .image img { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.home .brochure-block .row:hover .image img { transform: rotate(-2deg) translateY(-6px); }

/* --------------------------------------------------------------------------
   4. Scroll reveal (classes added by home-enhancements.js; nothing hidden without JS)
   -------------------------------------------------------------------------- */
html.hm-anim .hm-reveal { opacity: 0; transform: translateY(26px); }
html.hm-anim .hm-reveal.hm-in { opacity: 1; transform: none; }
/* While revealing, this transition wins over any hover transitions; home-enhancements.js adds .hm-done afterwards */
html.hm-anim .hm-reveal:not(.hm-done) { transition: opacity .7s ease var(--hm-delay, 0s), transform .7s cubic-bezier(.2,.7,.2,1) var(--hm-delay, 0s) !important; }

/* --------------------------------------------------------------------------
   5. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .home *, .home *::before, .home *::after { animation: none !important; transition: none !important; }
  html.hm-anim .hm-reveal { opacity: 1; transform: none; }
}
