/* =========================================================
   Site-wide motion & interaction styles
   Hidden "before" states only apply under .motion-ready (set by motion.js),
   so content is always visible without JS or with reduced motion.
   Reveals use the individual translate/scale/rotate properties, which compose
   with existing hover transforms instead of fighting them.
   ========================================================= */
:root {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dist: 44px;
}

/* slide-ins start off to the side; never let that create a sideways scrollbar */
.page {
  overflow-x: clip;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- scroll reveals ---------- */
.motion-ready [data-reveal] {
  transition:
    opacity 0.9s var(--ease-soft),
    translate 1s var(--ease-out),
    scale 1s var(--ease-out),
    rotate 1s var(--ease-out),
    clip-path 1.2s var(--ease-out);
  transition-delay: var(--delay, 0ms);
}
.motion-ready [data-reveal]:not(.is-in) {
  opacity: 0;
}
.motion-ready [data-reveal='up']:not(.is-in) {
  translate: 0 var(--dist);
}
.motion-ready [data-reveal='down']:not(.is-in) {
  translate: 0 calc(var(--dist) * -0.6);
}
.motion-ready [data-reveal='left']:not(.is-in) {
  translate: calc(var(--dist) * -1.4) 0;
}
.motion-ready [data-reveal='right']:not(.is-in) {
  translate: calc(var(--dist) * 1.4) 0;
}
.motion-ready [data-reveal='zoom'] {
  transition-timing-function: var(--ease-soft), var(--ease-out), var(--ease-back), var(--ease-out), var(--ease-out);
}
.motion-ready [data-reveal='zoom']:not(.is-in) {
  scale: 0.86;
}
.motion-ready [data-reveal='tilt']:not(.is-in) {
  translate: 0 calc(var(--dist) * 1.2);
  rotate: -2.5deg;
  scale: 0.97;
}
/* image / media mask reveals */
.motion-ready [data-reveal^='clip']:not(.is-in) {
  opacity: 1;
  scale: 1.08;
}
.motion-ready [data-reveal='clip']:not(.is-in) {
  clip-path: inset(100% 0 0 0);
}
.motion-ready [data-reveal='clip-left']:not(.is-in) {
  clip-path: inset(0 100% 0 0);
}
.motion-ready [data-reveal='clip-right']:not(.is-in) {
  clip-path: inset(0 0 0 100%);
}
.motion-ready [data-reveal^='clip'].is-in {
  clip-path: inset(0 0 0 0);
}
/* lines that draw themselves (timeline) */
.motion-ready [data-reveal='line'] {
  transform-origin: left center;
  transition-duration: 0.6s, 0s, 1.6s;
}
.motion-ready [data-reveal='line']:not(.is-in) {
  opacity: 1;
  scale: 0 1;
}

.motion-reset,
.motion-reset * {
  transition: none !important;
}

/* split headings: each word rises out of its own mask */
.motion-ready [data-split] {
  opacity: 1;
  translate: none;
}
.split .sw {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
}
.motion-ready .split .sw__i {
  display: inline-block;
  transition:
    translate 1.1s var(--ease-out),
    opacity 0.8s var(--ease-soft),
    rotate 1.1s var(--ease-out);
  transition-delay: calc(var(--delay, 0ms) + var(--w, 0) * 45ms);
}
.motion-ready [data-split='chars'] .sw__i {
  transition-delay: calc(var(--delay, 0ms) + var(--w, 0) * 28ms);
}
.motion-ready [data-split]:not(.is-in) .sw__i {
  translate: 0 105%;
  rotate: 4deg;
  opacity: 0;
}

/* ---------- parallax & scroll-linked hero ---------- */
[data-parallax] {
  transform: translate3d(0, var(--py, 0px), 0);
  will-change: transform;
}
[data-scroll-fade] {
  opacity: calc(1 - var(--sf, 0) * 0.75);
  transform: translate3d(0, calc(var(--sf, 0) * 70px), 0);
}

/* ---------- animated hero background shapes ---------- */
[data-hero] {
  position: relative;
  isolation: isolate;
}
.motion-orbs {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.motion-orbs span {
  position: absolute;
  display: block;
  border-radius: 50%;
  will-change: transform;
}
.motion-orbs__a {
  width: 620px;
  height: 620px;
  top: -260px;
  right: -140px;
  background: radial-gradient(circle at 50% 50%, rgba(105, 178, 73, 0.28), rgba(105, 178, 73, 0) 65%);
  animation: orb-float-a 22s ease-in-out infinite alternate;
}
.motion-orbs__b {
  width: 760px;
  height: 760px;
  bottom: -420px;
  left: -220px;
  background: radial-gradient(circle at 50% 50%, rgba(58, 114, 168, 0.5), rgba(58, 114, 168, 0) 65%);
  animation: orb-float-b 26s ease-in-out infinite alternate;
}
.motion-orbs__c {
  width: 260px;
  height: 260px;
  top: 30%;
  left: 46%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
  animation:
    orb-morph 14s ease-in-out infinite,
    orb-spin 40s linear infinite;
}
@keyframes orb-float-a {
  to {
    transform: translate3d(-120px, 90px, 0) scale(1.15);
  }
}
@keyframes orb-float-b {
  to {
    transform: translate3d(140px, -80px, 0) scale(1.1);
  }
}
@keyframes orb-morph {
  0%,
  100% {
    border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
  }
  33% {
    border-radius: 63% 37% 41% 59% / 58% 36% 64% 42%;
  }
  66% {
    border-radius: 36% 64% 52% 48% / 38% 62% 38% 62%;
  }
}
@keyframes orb-spin {
  to {
    rotate: 360deg;
  }
}

/* ---------- buttons: light sweep, press feedback, magnetic lean ---------- */
.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transform: translate3d(var(--mx, 0px), var(--my, 0px), 0) scale(var(--press, 1));
  transition:
    background 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.35s var(--ease-soft),
    transform 0.45s var(--ease-back);
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.32) 50%, transparent 75%);
  transform: translateX(-120%);
  transition: transform 0.8s var(--ease-out);
  pointer-events: none;
}
.btn:hover::before {
  transform: translateX(120%);
}
.btn:hover {
  box-shadow: 0 14px 28px -12px rgba(14, 32, 52, 0.55);
}
.btn:active {
  --press: 0.96;
}

/* ---------- links: underline that draws in ---------- */
.footer .fl a,
.utility-bar__link,
.ci a,
.mega__bar-text a {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition:
    background-size 0.4s var(--ease-out),
    color 0.2s ease;
}
.footer .fl a:hover,
.utility-bar__link:hover,
.ci a:hover,
.mega__bar-text a:hover {
  background-size: 100% 1px;
}

/* ---------- cards: 3D tilt with soft glare ---------- */
[data-tilt] {
  position: relative;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition:
    transform 0.6s var(--ease-out),
    box-shadow 0.4s ease,
    border-color 0.3s ease,
    background 0.3s ease;
}
[data-tilt]:hover {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-6px);
}
[data-tilt].is-tilting {
  transition:
    transform 0.12s linear,
    box-shadow 0.4s ease,
    border-color 0.3s ease;
  box-shadow: 0 30px 50px -24px rgba(14, 32, 52, 0.35);
}
[data-tilt]::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.35), transparent 55%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  mix-blend-mode: soft-light;
}
[data-tilt].is-tilting::before {
  opacity: 1;
}

/* ---------- images & logos ---------- */
.clients__logo,
.client-logo {
  transition:
    scale 0.5s var(--ease-back),
    filter 0.4s ease;
}
.clients__row:hover .clients__logo,
.companies-ve-partnered__row-bg-white:hover .client-logo {
  scale: 1.08;
}
.sales-academy__media,
.osb-logo {
  transition: scale 0.7s var(--ease-out);
}
.sales-academy__media:hover,
.osb-logo:hover {
  scale: 1.03;
}

/* ---------- header state & scroll progress ---------- */
.header {
  transition: box-shadow 0.35s ease;
}
.header.is-scrolled {
  box-shadow: 0 12px 30px -12px rgba(5, 14, 26, 0.55);
}
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: 3px;
  background: linear-gradient(90deg, #69b249, #a6d98a);
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

/* ---------- cursor ring (desktop, fine pointer only) ---------- */
.motion-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  pointer-events: none;
  opacity: 0;
}
.motion-cursor::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(105, 178, 73, 0.75);
  transition:
    scale 0.35s var(--ease-back),
    background 0.3s ease,
    border-color 0.3s ease;
}
.motion-cursor.is-visible {
  opacity: 1;
  transition: opacity 0.3s ease;
}
.motion-cursor.is-active::after {
  scale: 1.6;
  background: rgba(105, 178, 73, 0.1);
  border-color: rgba(105, 178, 73, 0.45);
}
.motion-cursor.is-text::after {
  scale: 0.5;
}
.motion-cursor.is-pressed::after {
  scale: 0.8;
}

/* ---------- smooth page-to-page transitions (where supported) ---------- */
@view-transition {
  navigation: auto;
}
::view-transition-old(root) {
  animation: vt-out 0.3s var(--ease-soft) both;
}
::view-transition-new(root) {
  animation: vt-in 0.5s var(--ease-out) both;
}
@keyframes vt-out {
  to {
    opacity: 0;
    transform: translateY(-12px);
  }
}
@keyframes vt-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

/* ---------- smaller screens: shorter travel, no pointer effects ---------- */
@media (max-width: 900px) {
  :root {
    --dist: 26px;
  }
  [data-parallax],
  [data-scroll-fade] {
    transform: none;
    opacity: 1;
  }
  .motion-orbs__a {
    width: 380px;
    height: 380px;
  }
  .motion-orbs__b {
    width: 460px;
    height: 460px;
  }
  .motion-orbs__c {
    display: none;
  }
}

/* ---------- reduced motion and print: no movement, everything visible ---------- */
@media print, (prefers-reduced-motion: reduce) {
  [data-reveal],
  .split .sw__i {
    opacity: 1 !important;
    translate: none !important;
    scale: none !important;
    rotate: none !important;
    clip-path: none !important;
    transition: none !important;
  }
  [data-parallax],
  [data-scroll-fade],
  [data-tilt] {
    transform: none !important;
    opacity: 1 !important;
  }
  .motion-orbs span,
  .btn::before {
    animation: none !important;
    transition: none !important;
  }
  .btn {
    transform: none;
  }
  .motion-cursor,
  .scroll-progress {
    display: none;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}
