/* Smart Tire motion layer: 2.5D parallax, scroll reveals, 3D hero canvas,
   designed hover/focus. Transform/opacity only. Loaded non-blocking from
   the end of <body>; everything hidden here is gated on html.mo (set by
   motion.js) so no-JS and reduced-motion visitors always see content. */
:root {
  --mo-dur: 0.8s;
  --mo-dur-fast: 0.25s;
  --mo-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --mo-lift: 28px;
  --mo-stagger: 90ms;
  --focus-ring: 3px solid var(--yellow);
}

/* Focus: visible, branded, keyboard only */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}

/* ── 3D hero tire ── */
.hero-tire {
  position: absolute;
  z-index: 2;
  top: 42%;
  left: 60%;
  width: clamp(260px, 32vw, 480px);
  aspect-ratio: 1;
  transform: translate3d(-50%, -50%, 0) scale(0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.1s var(--mo-ease), transform 1.1s var(--mo-ease);
}
.hero-tire.ready { opacity: 1; transform: translate3d(-50%, -50%, 0) scale(1); }
.hero-visual.webgl .hero-photo.active { opacity: 0.42; }
.hero-photo { will-change: opacity, transform; }

/* ── Reveals ── */
.mo .rv {
  opacity: 0;
  transform: translate3d(0, var(--mo-lift), 0);
  transition:
    opacity var(--mo-dur) var(--mo-ease),
    transform var(--mo-dur) var(--mo-ease);
  transition-delay: calc(var(--i, 0) * var(--mo-stagger));
}
.mo .rv.rv-in { opacity: 1; transform: none; }
.mo .rv-mask {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1s var(--mo-ease);
}
.mo .rv-mask.rv-in { clip-path: inset(0 0 0 0); }

/* ── 2.5D depth: hero photos drift slower than the page ── */
.mo .hero-photo { transform: translate3d(0, var(--py, 0px), 0) scale(1.12); }

/* ── Designed hover / focus ── */
@media (hover: hover) {
  .service-card {
    transition: transform var(--mo-dur-fast) var(--mo-ease), background var(--mo-dur-fast);
  }
  .service-card:hover { transform: translate3d(0, -6px, 0); }
  .stat-item { transition: transform var(--mo-dur-fast) var(--mo-ease); }
  .stat-item:hover { transform: translate3d(0, -4px, 0); }
}
.service-card:focus-within { transform: translate3d(0, -6px, 0); }

@media (prefers-reduced-motion: reduce) {
  .hero-tire { display: none; }
  .mo .rv, .mo .rv-mask { opacity: 1; transform: none; clip-path: none; transition: none; }
  .mo .hero-photo, .service-card, .stat-item { transition: none; transform: none; }
  .service-card:hover, .service-card:focus-within, .stat-item:hover { transform: none; }
}
