/* Site-wide motion layer. Only transform / opacity / clip-path are animated (GPU-friendly,
   no layout work), everything plays once on scroll-in, and it all switches off for
   visitors who ask their OS for reduced motion. Pairs with public/js/motion.js. */

:root { --ease-out: cubic-bezier(.16, 1, .3, 1); }

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 2000;
  height: 3px;
  background: linear-gradient(90deg, var(--red-dark), var(--red), #ff5a66);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
  will-change: transform;
}

/* ---------- Stronger, smoother scroll reveal ---------- */
.reveal { transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
:where(.reveal:not(.is-visible)) { transform: translateY(40px) scale(.985); }
/* Stagger delays are only for the entrance - motion.js adds .reveal-done so hovers respond instantly. */
.reveal-done { transition-delay: 0s !important; }

/* ---------- Section headings: words rise into place one by one ---------- */
.split-words .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: .08em;
  margin-bottom: -.08em;
}
.split-words .w > span {
  display: inline-block;
  transform: translateY(105%);
  transition: transform .8s var(--ease-out);
  transition-delay: calc(.15s + var(--wi, 0) * .06s);
}
.reveal.is-visible .split-words .w > span,
.split-words.is-visible .w > span { transform: none; }

/* ---------- Card images unveil with a wipe as the card scrolls in ---------- */
.service-card.reveal .service-card-image img,
.printing-category-card.reveal .pc-image img {
  clip-path: inset(0 0 100% 0);
  transform: scale(1.12);
  transition: clip-path 1s var(--ease-out) .15s, transform 1.4s var(--ease-out) .15s;
}
.service-card.reveal.is-visible .service-card-image img,
.printing-category-card.reveal.is-visible .pc-image img {
  clip-path: inset(0 0 0 0);
  transform: none;
}
/* keep the existing hover zoom working once revealed */
.service-card.reveal.is-visible:hover .service-card-image img { transform: scale(1.08); }
.printing-category-card.reveal.is-visible:hover .pc-image img { transform: scale(1.08); }

.why-us-media.reveal img {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.2s var(--ease-out) .2s;
}
.why-us-media.reveal.is-visible img { clip-path: inset(0 0 0 0); }

/* ---------- Cards: red glow ring on hover (lift/zoom already exist) ---------- */
.service-card,
.printing-category-card,
.why-card,
.package-card {
  transition: opacity .9s var(--ease-out), transform .6s var(--ease-out), box-shadow .45s var(--ease-out), border-color .3s ease;
}
.service-card:hover,
.printing-category-card:hover,
.why-card:hover,
.package-card:hover {
  box-shadow: 0 0 0 2px rgba(235, 10, 30, .55), 0 26px 56px rgba(235, 10, 30, .16);
}

/* ---------- Stats: icons pop in, then breathe ---------- */
@keyframes statPop {
  0% { transform: scale(.3) rotate(-25deg); opacity: 0; }
  60% { transform: scale(1.18) rotate(6deg); opacity: 1; }
  100% { transform: none; opacity: 1; }
}
.stats-bar-item.reveal i { opacity: 0; }
.stats-bar-item.reveal.is-visible i { animation: statPop .8s var(--ease-out) .25s both; }
.stats-bar-item:nth-child(2).is-visible i { animation-delay: .35s; }
.stats-bar-item:nth-child(3).is-visible i { animation-delay: .45s; }
.stats-bar-item:nth-child(4).is-visible i { animation-delay: .55s; }
.stats-bar-item:hover i { transform: translateY(-4px) scale(1.1); transition: transform .3s var(--ease-out); }

/* ---------- Buttons: light sweep on hover ---------- */
.btn-primary,
.quote-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.btn-primary::after,
.quote-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  z-index: 1;
  width: 50%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .4), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
  transition: left .7s var(--ease-out);
}
.btn-primary:hover::after,
.quote-btn:hover::after { left: 130%; }

/* ---------- Reduced motion: show everything, animate nothing ---------- */
@media (prefers-reduced-motion: reduce) {
  .scroll-progress { display: none; }
  .reveal,
  .split-words .w > span,
  .service-card.reveal .service-card-image img,
  .printing-category-card.reveal .pc-image img,
  .why-us-media.reveal img,
  .stats-bar-item.reveal i {
    transform: none !important;
    clip-path: none !important;
    opacity: 1 !important;
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Header: hides while scrolling down, slides back in on scroll up ----------
   Uses the standalone `translate` property so it doesn't fight the page-intro animation's transform. */
header {
  transition: translate .38s var(--ease-out), background .25s ease, padding .25s ease, box-shadow .25s ease;
}
header.header-hidden {
  translate: 0 calc(-100% - 12px);
  box-shadow: none;
}
@media (prefers-reduced-motion: reduce) {
  header { transition: none; }
}
