/* ==========================================================
   Wefix — motion system
   Principles: smooth, purposeful, never blocks content.
   Content is visible without JS (.no-js); reduced motion disables
   all movement (see end of file).
   ========================================================== */

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--delay, 0ms);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal--left { transform: translate3d(-32px, 0, 0); }
.reveal--right { transform: translate3d(32px, 0, 0); }
.reveal--scale { transform: scale(0.97); }
.reveal--fade { transform: none; }
.no-js .reveal, .no-js .reveal--left, .no-js .reveal--right, .no-js .reveal--scale { opacity: 1; transform: none; }

/* Image mask reveal (clip wipes open on entry) */
.mask-reveal { clip-path: inset(0 0 100% 0 round var(--r-md)); transition: clip-path 1.2s var(--ease-out); }
.mask-reveal.is-visible { clip-path: inset(0 0 0 0 round var(--r-md)); }
.no-js .mask-reveal { clip-path: none; }

/* ---------- Hero entrance (staggered on load) ---------- */
@keyframes hero-rise { from { opacity: 0; transform: translate3d(0, 24px, 0); } to { opacity: 1; transform: none; } }
@keyframes hero-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes hero-drift { from { opacity: 0; transform: translate3d(0, 18px, 0) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes float-y { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -10px, 0); } }
@keyframes spin-slow { to { transform: rotate(360deg); } }

.js .hero__copy > * { animation: hero-rise 0.9s var(--ease-out) both; }
.js .hero__copy > *:nth-child(1) { animation-delay: 0.05s; }
.js .hero__copy > *:nth-child(2) { animation-delay: 0.15s; }
.js .hero__copy > *:nth-child(3) { animation-delay: 0.25s; }
.js .hero__copy > *:nth-child(4) { animation-delay: 0.35s; }
.js .hero__copy > *:nth-child(5) { animation-delay: 0.45s; }
.js .hero__stage > .hero__art { animation: hero-drift 1.2s var(--ease-out) 0.2s both; }
.js .float-card { animation: hero-fade 0.9s var(--ease-out) both; }
.js .float-card--a { animation-delay: 0.8s; }
.js .float-card--b { animation-delay: 1s; }
.js .hero .float-card { animation-name: hero-fade, float-y; animation-duration: 0.9s, 6s; animation-timing-function: var(--ease-out), ease-in-out; animation-iteration-count: 1, infinite; animation-delay: 0.8s, 1.8s; animation-fill-mode: both, none; }
.js .hero .float-card--b { animation-delay: 1s, 2.2s; }
.js .page-hero .page-hero__media .media { animation: hero-drift 1.1s var(--ease-out) 0.15s both; }
.js .page-hero__float { animation: hero-fade 0.9s var(--ease-out) 0.7s both; }

/* ---------- Hover & interaction details ---------- */
.svc__media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(13,27,42,0.25));
  opacity: 0; transition: opacity var(--dur) var(--ease-out);
}
.svc:hover .svc__media::after { opacity: 1; }

.icon-tile { transition: transform var(--dur) var(--ease-out), background var(--dur-fast), color var(--dur-fast); }
.panel:hover .icon-tile, .why__point:hover .icon-tile { transform: rotate(-6deg) scale(1.05); }

.nav-underline { position: relative; }

/* Smooth mobile-friendly tap feedback */
.btn, .tab, .svc, .panel, .step, .choice label, .repair-list a, .faq__q { -webkit-tap-highlight-color: transparent; }

/* Scroll progress bar (top of page, decorative) */
.scroll-progress { position: fixed; left: 0; top: 0; height: 3px; width: 100%; z-index: 200; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--brand), #7cc6ef); pointer-events: none; }

/* Carousel slide entrance */
.carousel__slide { transition: opacity var(--dur) var(--ease-out); }

/* Button loading spinner */
.btn.is-loading::after {
  content: ""; width: 16px; height: 16px; margin-left: 0.2rem; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin-slow 0.8s linear infinite;
}

/* Subtle decorative drift (hero background shape) */
.hero-orb { position: absolute; border-radius: 50%; pointer-events: none; z-index: -1; background: radial-gradient(circle, rgba(37,150,208,0.22), transparent 70%); filter: blur(10px); }
.js .hero-orb { animation: float-y 9s ease-in-out infinite; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }
  .js .hero .float-card { animation: none !important; }
  .js .hero-orb { animation: none !important; }
  .reveal, .reveal--left, .reveal--right, .reveal--scale { opacity: 1 !important; transform: none !important; }
  .mask-reveal { clip-path: none !important; }
  .process__fill { transform: scaleX(1) !important; }
  .svc:hover, .panel:hover, .tab:hover, .btn:hover, .brand-word:hover, .step:hover .step__num { transform: none !important; }
  .svc:hover .svc__media img, .row:hover .row__media .media img, .mag-feature:hover .media img { transform: none !important; }
  .scroll-progress { display: none; }
}
