/* ============================================================
   Fusion4o — Shared Transition & Animation Styles
   Companion to assets/js/motion.js
   Works on all sub-pages (plain HTML).
============================================================ */

/* ---- Base: prevent flash of unstyled content ---- */
body {
  -webkit-font-smoothing: antialiased;
}

/* Scroll-reveal: hidden until motion.js adds .is-visible or animates */
.reveal,
[data-reveal] {
  will-change: opacity, transform;
}

html.motion-ready .reveal:not(.is-visible),
html.motion-ready [data-reveal]:not(.is-visible) {
  opacity: 0;
  transform: translateY(20px);
}

html.motion-ready .reveal.is-visible,
html.motion-ready [data-reveal].is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Reduced motion: skip all transitions */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal,
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---- Card hover ---- */
.svc-card,
.feature-card,
.tier,
.industry-card,
.dl-card,
.step {
  transition:
    transform 0.28s cubic-bezier(0.34,1.56,0.64,1),
    box-shadow 0.28s ease,
    border-color 0.25s ease;
  will-change: transform;
}

/* ---- Button micro-interactions ---- */
.btn,
a.btn,
button.btn {
  transition:
    background 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.18s cubic-bezier(0.34,1.56,0.64,1);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37,99,235,0.25);
}
.btn:active {
  transform: translateY(0) scale(0.97);
}

/* ---- Nav link underline animation ---- */
.nav-links a,
a[data-nav] {
  position: relative;
}
.nav-links a::after,
a[data-nav]::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 2px;
  background: var(--color-accent-1, #2563eb);
  border-radius: 2px;
  transition: width 0.25s cubic-bezier(0.25,0.46,0.45,0.94);
}
.nav-links a:hover::after,
a[data-nav]:hover::after,
a[data-nav].active::after {
  width: 100%;
}
a[data-nav].active {
  color: var(--color-accent-1, #2563eb);
  font-weight: 600;
}

/* ---- Page-hero heading reveal ---- */
.page-hero h1 {
  line-height: 1.08;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* ---- Image lazy-load fade (motion.js adds .loaded on load) ---- */
img[loading='lazy']:not(.loaded) {
  opacity: 0;
  transition: opacity 0.5s ease;
}
img[loading='lazy'].loaded,
img[loading='eager'] {
  opacity: 1;
}

/* ---- Section divider line animate ---- */
.section-divider {
  width: 0;
  height: 2px;
  background: var(--color-accent-1, #2563eb);
  margin: 0 auto 32px;
  transition: width 0.6s cubic-bezier(0.25,0.46,0.45,0.94);
}
.section-divider.visible {
  width: 48px;
}

/* ---- Smooth focus rings ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-accent-1, #2563eb);
  outline-offset: 3px;
  border-radius: 4px;
}