/* ==========================================================================
   IH INDUSTRIAL SUPPLY CO. — effects.css
   Extra motion layer: page transitions, scroll progress, magnetic/ripple
   buttons, 3D tilt cards, parallax, marquee, shimmer, glow cursor, gradient
   text, animated underlines, image reveals, floating shapes, spinners.
   Pure CSS3. Loaded AFTER css/animations.css.
   ========================================================================== */

:root {
  --fx-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --fx-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --fx-accent: var(--accent, #f5a623);
  --fx-speed: 480ms;
}

/* 1. PAGE ENTER / EXIT TRANSITION -------------------------------------- */
body.fx-page {
  animation: fxPageIn 620ms var(--fx-ease) both;
}
body.fx-leaving {
  animation: fxPageOut 320ms var(--fx-ease) both;
}
@keyframes fxPageIn {
  from { opacity: 0; transform: translate3d(0, 14px, 0); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes fxPageOut {
  to { opacity: 0; transform: translate3d(0, -10px, 0); filter: blur(4px); }
}

/* 2. SCROLL PROGRESS BAR ------------------------------------------------ */
.fx-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--fx-accent), #ffd68a, var(--fx-accent));
  background-size: 200% 100%;
  animation: fxSlide 3s linear infinite;
  z-index: 9999;
  pointer-events: none;
}
@keyframes fxSlide { to { background-position: 200% 0; } }

/* 3. CURSOR GLOW (desktop pointer only) --------------------------------- */
.fx-cursor {
  position: fixed;
  top: 0; left: 0;
  width: 320px; height: 320px;
  margin: -160px 0 0 -160px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  background: radial-gradient(circle, rgba(245,166,35,0.18), transparent 62%);
  transition: opacity 400ms ease;
  will-change: transform;
}
@media (hover: hover) and (pointer: fine) {
  .fx-cursor.is-on { opacity: 1; }
}

/* 4. STICKY HEADER SHRINK + BLUR ---------------------------------------- */
.site-header {
  transition: box-shadow 320ms var(--fx-ease), backdrop-filter 320ms ease,
              background-color 320ms ease, transform 420ms var(--fx-ease);
}
.site-header.fx-stuck {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
  backdrop-filter: saturate(1.4) blur(10px);
}
.site-header.fx-hidden { transform: translateY(-100%); }
.site-header .brand__mark { transition: transform 380ms var(--fx-spring); }
.site-header.fx-stuck .brand__mark { transform: scale(0.86); }

/* 5. NAV LINK UNDERLINE SWIPE ------------------------------------------- */
.nav a:not(.btn) {
  position: relative;
  transition: color 260ms ease;
}
.nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  height: 2px; width: 100%;
  background: var(--fx-accent);
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform 380ms var(--fx-ease);
}
.nav a:not(.btn):hover::after,
.nav a:not(.btn):focus-visible::after,
.nav a[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: 0 50%;
}

/* 6. BUTTONS: sheen, magnetic pull, ripple ------------------------------ */
.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 260ms var(--fx-spring), box-shadow 260ms ease,
              background-color 260ms ease, color 260ms ease;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(120deg, transparent 20%, rgba(255,255,255,0.42) 50%, transparent 80%);
  transform: translateX(-130%);
  transition: transform 720ms var(--fx-ease);
}
.btn:hover::before, .btn:focus-visible::before { transform: translateX(130%); }
.btn:hover { box-shadow: 0 12px 26px rgba(0,0,0,0.18); }
.btn:active { transform: scale(0.97); }

.fx-ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255, 255, 255, 0.5);
  animation: fxRipple 620ms var(--fx-ease) forwards;
  pointer-events: none;
  z-index: -1;
}
@keyframes fxRipple {
  to { transform: scale(2.6); opacity: 0; }
}

/* 7. 3D TILT CARDS + SPOTLIGHT ------------------------------------------ */
.fx-tilt {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 320ms var(--fx-ease), box-shadow 320ms ease;
  will-change: transform;
}
.fx-tilt:hover { box-shadow: 0 26px 48px rgba(0,0,0,0.16); }
.fx-tilt::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 320ms ease;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%),
              rgba(245,166,35,0.20), transparent 60%);
  pointer-events: none;
}
.fx-tilt:hover::after { opacity: 1; }

/* 8. CARD LIFT + BORDER GLOW -------------------------------------------- */
.fx-lift {
  transition: transform 380ms var(--fx-ease), box-shadow 380ms ease,
              border-color 380ms ease;
}
.fx-lift:hover { transform: translateY(-8px); border-color: var(--fx-accent); }

/* 9. IMAGE HOVER ZOOM / REVEAL ------------------------------------------ */
.fx-media { overflow: hidden; }
.fx-media img,
.card img, figure img {
  transition: transform 900ms var(--fx-ease), filter 600ms ease;
}
.fx-media:hover img,
.card:hover img { transform: scale(1.07); filter: saturate(1.12); }

.fx-img-reveal { clip-path: inset(0 100% 0 0); }
.fx-img-reveal.is-visible {
  animation: fxWipe 900ms var(--fx-ease) forwards;
}
@keyframes fxWipe { to { clip-path: inset(0 0 0 0); } }

/* 10. SCROLL REVEAL VARIANTS -------------------------------------------- */
[data-fx] {
  opacity: 0;
  transition: opacity 760ms var(--fx-ease), transform 760ms var(--fx-ease),
              filter 760ms ease;
  transition-delay: var(--fx-delay, 0ms);
  will-change: opacity, transform;
}
[data-fx="up"]    { transform: translate3d(0, 42px, 0); }
[data-fx="down"]  { transform: translate3d(0, -42px, 0); }
[data-fx="left"]  { transform: translate3d(-52px, 0, 0); }
[data-fx="right"] { transform: translate3d(52px, 0, 0); }
[data-fx="zoom"]  { transform: scale(0.9); }
[data-fx="flip"]  { transform: perspective(900px) rotateX(-16deg); }
[data-fx="blur"]  { filter: blur(12px); }
[data-fx].is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}

/* 11. GRADIENT + TYPING TEXT -------------------------------------------- */
.fx-gradient-text {
  background: linear-gradient(92deg, var(--fx-accent), #fff3d6, var(--fx-accent));
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: fxSlide 6s linear infinite;
}
.fx-type::after {
  content: "";
  display: inline-block;
  width: 2px; height: 1em;
  margin-left: 3px;
  background: currentColor;
  vertical-align: -0.12em;
  animation: fxCaret 900ms steps(1) infinite;
}
@keyframes fxCaret { 50% { opacity: 0; } }

/* 12. MARQUEE TICKER ----------------------------------------------------- */
.fx-marquee {
  overflow: hidden;
  border-block: 1px solid rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.03);
  padding: 10px 0;
}
.fx-marquee__track {
  display: flex;
  gap: 46px;
  width: max-content;
  animation: fxMarquee 26s linear infinite;
}
.fx-marquee:hover .fx-marquee__track { animation-play-state: paused; }
.fx-marquee span {
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.82rem;
  opacity: 0.72;
  white-space: nowrap;
}
@keyframes fxMarquee { to { transform: translateX(-50%); } }

/* 13. FLOATING DECOR SHAPES + PULSE ------------------------------------- */
.fx-float { animation: fxFloat 7s ease-in-out infinite; }
@keyframes fxFloat {
  50% { transform: translateY(-14px); }
}
.fx-pulse { animation: fxPulse 2.6s ease-out infinite; }
@keyframes fxPulse {
  0%   { box-shadow: 0 0 0 0 rgba(245,166,35,0.5); }
  70%  { box-shadow: 0 0 0 18px rgba(245,166,35,0); }
  100% { box-shadow: 0 0 0 0 rgba(245,166,35,0); }
}

/* 14. SHIMMER SKELETON / LOADER ----------------------------------------- */
.fx-shimmer {
  background: linear-gradient(90deg, rgba(0,0,0,0.05) 25%, rgba(0,0,0,0.10) 37%, rgba(0,0,0,0.05) 63%);
  background-size: 400% 100%;
  animation: fxShimmer 1.4s ease infinite;
}
@keyframes fxShimmer { to { background-position: -135% 0; } }

/* 15. BACK-TO-TOP + FAB MOTION ------------------------------------------ */
.to-top {
  transition: transform 420ms var(--fx-spring), opacity 320ms ease;
}
.to-top:hover { transform: translateY(-6px) scale(1.08); }

/* 16. STAT COUNTERS / PROGRESS BARS -------------------------------------- */
.fx-bar {
  height: 8px;
  border-radius: 99px;
  background: rgba(0,0,0,0.08);
  overflow: hidden;
}
.fx-bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--fx-accent), #ffcf7a);
  transition: width 1400ms var(--fx-ease);
}

/* 17. ACCORDION / DETAILS SMOOTHING -------------------------------------- */
details.fx-acc > summary { cursor: pointer; transition: color 240ms ease; }
details.fx-acc[open] > *:not(summary) { animation: fxPageIn 420ms var(--fx-ease) both; }

/* 18. LIGHTBOX ----------------------------------------------------------- */
.fx-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 5vmin;
  background: rgba(8, 12, 18, 0.86);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 320ms ease, visibility 320ms;
}
.fx-lightbox.is-open { opacity: 1; visibility: visible; }
.fx-lightbox img {
  max-width: 100%;
  max-height: 88vh;
  border-radius: 10px;
  transform: scale(0.92);
  transition: transform 420ms var(--fx-spring);
  box-shadow: 0 40px 90px rgba(0,0,0,0.6);
}
.fx-lightbox.is-open img { transform: scale(1); }

/* 19. TOAST -------------------------------------------------------------- */
.fx-toast {
  position: fixed;
  left: 50%; bottom: 28px;
  transform: translate(-50%, 130%);
  z-index: 10001;
  padding: 12px 20px;
  border-radius: 99px;
  font-size: 0.9rem;
  color: #fff;
  background: #14202e;
  box-shadow: 0 18px 40px rgba(0,0,0,0.28);
  transition: transform 520ms var(--fx-spring);
}
.fx-toast.is-on { transform: translate(-50%, 0); }

/* 20. REDUCED MOTION ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-fx] { opacity: 1 !important; transform: none !important; filter: none !important; }
}
