/* === Site-wide motion layer (paired with /assets/js/motion.js) === */

/* scroll progress bar */
.mx-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 2000;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(232,87,28,0.55);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* navbar tightens and gains depth once the page scrolls */
nav.navbar { transition: box-shadow 0.3s ease, padding 0.3s ease !important; }
.mx-scrolled nav.navbar {
  box-shadow: 0 10px 30px -12px rgba(15,23,42,0.18) !important;
}

/* graph-paper grid lights up in brand orange around the cursor */
#hero-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
  background-image:
    linear-gradient(rgba(232,87,28,0.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232,87,28,0.55) 1px, transparent 1px),
    linear-gradient(rgba(247,168,32,0.30) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247,168,32,0.30) 1px, transparent 1px);
  background-size: 66px 66px, 66px 66px, 22px 22px, 22px 22px;
  -webkit-mask-image: radial-gradient(260px circle at var(--mx, -999px) var(--my, -999px), #000 0%, transparent 70%);
  mask-image: radial-gradient(260px circle at var(--mx, -999px) var(--my, -999px), #000 0%, transparent 70%);
}
.mx-pointer #hero-grid::after { opacity: 1; }

/* card spotlight — soft glow plus a lit border that tracks the cursor */
.mx-pointer :is(.pg-card, .gr-card) {
  position: relative;
  isolation: isolate;
}
.mx-pointer :is(.pg-card, .gr-card)::before,
.mx-pointer :is(.pg-card, .gr-card)::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.mx-pointer :is(.pg-card, .gr-card)::before {
  z-index: -1;
  background: radial-gradient(340px circle at var(--cx) var(--cy), rgba(232,87,28,0.08), transparent 65%);
}
.mx-pointer :is(.pg-card, .gr-card)::after {
  padding: 1px;
  background: radial-gradient(220px circle at var(--cx) var(--cy), rgba(232,87,28,0.65), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.mx-lit::before, .mx-lit::after { opacity: 1 !important; }

/* icon tiles tilt up on card hover */
.pg-icon { transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), background 0.3s ease, box-shadow 0.3s ease; }
.pg-card:hover .pg-icon {
  transform: translateY(-2px) rotate(-6deg) scale(1.06);
  background: rgba(232,87,28,0.12);
  box-shadow: 0 8px 18px -8px rgba(232,87,28,0.55);
}

/* primary buttons — light sweep on hover, magnetic offset set by JS */
.btn-blue {
  position: relative;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), box-shadow 0.25s ease, translate 0.2s ease-out !important;
}
.btn-blue::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: skewX(-18deg);
  pointer-events: none;
}
.btn-blue:hover::after { animation: mxSheen 0.85s ease; }
@keyframes mxSheen { to { left: 130%; } }

/* eyebrow labels — pulsing status dot ahead of the text */
.pg-eyebrow { font-variant-numeric: tabular-nums; }
.pg-eyebrow::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 8px;
  vertical-align: 1px;
  border-radius: 50%;
  background: var(--c-blue);
  animation: mxPulse 2.2s ease-out infinite;
}
@keyframes mxPulse {
  0%   { box-shadow: 0 0 0 0 rgba(232,87,28,0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(232,87,28,0); }
  100% { box-shadow: 0 0 0 0 rgba(232,87,28,0); }
}

/* dark CTA panels — slow drifting aurora */
.pg-cta { position: relative; overflow: hidden; isolation: isolate; }
.pg-cta::before {
  content: '';
  position: absolute;
  inset: -40%;
  z-index: -1;
  background:
    radial-gradient(30% 40% at 20% 30%, rgba(232,87,28,0.22), transparent 70%),
    radial-gradient(25% 35% at 80% 70%, rgba(247,168,32,0.16), transparent 70%);
  animation: mxAurora 16s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes mxAurora {
  from { transform: translate(-6%, -4%) rotate(0deg); }
  to   { transform: translate(6%, 4%) rotate(12deg); }
}

/* scroll reveals sharpen in from a soft blur */
.js-reveal .pg-reveal { filter: blur(6px); transition-property: opacity, transform, filter; }
.js-reveal .pg-reveal.in-view { filter: none; }

/* --- Section entrances (JS adds .mx-r + variant, then .mx-in when visible) --- */

/* split headings — words rise out of per-word masks */
.mx-split .mx-w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}
.mx-split .mx-wi {
  display: inline-block;
  transform: translateY(110%) rotate(4deg);
  transform-origin: 0 100%;
  transition: transform 0.95s cubic-bezier(0.22,1,0.36,1);
  transition-delay: calc(var(--wi, 0) * 55ms);
}
.mx-split.mx-in .mx-wi { transform: none; }

/* blocks */
.mx-r {
  transition:
    opacity 0.8s ease,
    translate 0.95s cubic-bezier(0.22,1,0.36,1),
    scale 0.95s cubic-bezier(0.22,1,0.36,1),
    filter 0.8s ease;
  transition-delay: calc(var(--mx-i, 0) * 110ms + 120ms);
}
.mx-r:not(.mx-in) { opacity: 0; translate: 0 26px; filter: blur(5px); }
.mx-r-left:not(.mx-in) { translate: -32px 0; }
.mx-r-card:not(.mx-in) { translate: 0 70px; scale: 0.94; }
.mx-r-beam:not(.mx-in) { opacity: 1; translate: none; filter: none; }

/* footer divider — gradient beam draws across */
footer hr.mx-r-beam { position: relative; overflow: visible; opacity: 1; }
footer hr.mx-r-beam::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-blue) 30%, var(--c-violet) 60%, transparent);
  box-shadow: 0 0 14px rgba(232,87,28,0.6);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 1.6s cubic-bezier(0.65,0,0.35,1);
}
footer hr.mx-in::after { transform: scaleX(1); }

/* "3 steps" — numbered nodes on a self-drawing circuit line */
@media (max-width: 991px) { .mx-steps { padding-left: 1.25rem; padding-right: 1.25rem; } }
.mx-steps .mx-step {
  position: relative;
  margin-bottom: 0 !important;
  padding-bottom: 1.9rem;
}
.mx-steps .mx-step:last-child { padding-bottom: 0; }
.mx-step-node {
  position: relative;
  z-index: 1;
  flex: none;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  margin-right: 1.4rem;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid rgba(232,87,28,0.35);
  box-shadow: 0 6px 18px -6px rgba(232,87,28,0.45);
}
.mx-step-node span {
  font: 700 0.78rem/1 ui-monospace, 'SF Mono', Menlo, monospace;
  letter-spacing: 0.04em;
  color: var(--c-blue);
}
.mx-step-node::after {
  content: '';
  position: absolute;
  inset: -1.5px;
  border-radius: 50%;
  border: 1.5px solid var(--c-blue);
  opacity: 0;
}
.mx-step.mx-in .mx-step-node::after { animation: mxRing 2.6s ease-out calc(var(--mx-i, 0) * 0.45s + 0.6s) infinite; }
@keyframes mxRing {
  0%   { opacity: 0.7; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(1.55); }
}
.mx-steps .mx-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 21px;
  top: 50px;
  bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--c-blue), var(--c-violet));
  transform: scaleY(0);
  transform-origin: 50% 0;
  transition: transform 0.9s cubic-bezier(0.65,0,0.35,1) calc(var(--mx-i, 0) * 110ms + 0.6s);
}
.mx-steps .mx-step.mx-in:not(:last-child)::before { transform: scaleY(1); }
/* a spark travels down each finished segment */
.mx-steps .mx-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 19px;
  top: 50px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px var(--c-blue), 0 0 14px 3px rgba(232,87,28,0.8);
  opacity: 0;
}
.mx-steps .mx-step.mx-in:not(:last-child)::after { animation: mxSpark 2.8s ease-in-out calc(var(--mx-i, 0) * 0.4s + 1.6s) infinite; }
@keyframes mxSpark {
  0%   { top: 50px; opacity: 0; }
  15%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { top: calc(100% - 10px); opacity: 0; }
}

/* testimonials — dot matrix revealed by a slow scanning band */
.mx-scan {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,0.22) 1px, transparent 1.4px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(100deg, transparent 35%, #000 50%, transparent 65%);
  mask-image: linear-gradient(100deg, transparent 35%, #000 50%, transparent 65%);
  -webkit-mask-size: 300% 100%;
  mask-size: 300% 100%;
  animation: mxScan 11s linear infinite;
}
/* light variant on "Our Promise" — dark dots, content kept above the layer */
.wct-section .mx-scan { background-image: radial-gradient(rgba(26,39,68,0.30) 1px, transparent 1.4px); }
.wct-section > .container { position: relative; z-index: 1; }
@keyframes mxScan {
  from { -webkit-mask-position: 100% 0; mask-position: 100% 0; }
  to   { -webkit-mask-position: 0% 0;   mask-position: 0% 0; }
}

/* rating stars ignite in sequence */
.mx-stars span {
  display: inline-block;
  opacity: 0.25;
  transform: scale(0.6);
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.34,1.56,0.64,1), text-shadow 0.4s ease;
  transition-delay: calc(var(--si) * 120ms + 0.5s);
}
.mx-stars.mx-in span {
  opacity: 1;
  transform: none;
  text-shadow: 0 0 10px rgba(251,188,5,0.55);
}

@media (prefers-reduced-motion: reduce) {
  .pg-eyebrow::before, .pg-cta::before, .btn-blue:hover::after, .mx-scan,
  .mx-step-node::after, .mx-steps .mx-step::after { animation: none !important; }
  .js-reveal .pg-reveal { filter: none; }
}
