/*
  Styles that support site-motion.js (effects modelled on cardexapp.io).
  .motion-ready  = temporary; hides the hero until the intro animation runs (removed right after).
  .has-motion    = stays on while animations are active; removed if the libraries fail to load.
  Every effect below is driven by CSS variables that GSAP animates; without GSAP they rest at 0 / off.
*/

/* Hero starts hidden only while the intro is pending */
.motion-ready .site-header,
.motion-ready .hero-copy > .eyebrow,
.motion-ready .hero-copy > h1,
.motion-ready .hero-copy > .lede,
.motion-ready .hero-actions > *,
.motion-ready .hero-metrics > div,
.motion-ready .shape-collage {
  opacity: 0;
}

/* Sideways slide-ins never cause a horizontal scrollbar (clip keeps the sticky panel working) */
.has-motion body,
.has-motion .page-shell {
  overflow-x: clip;
}

/* 3D tilt reveals need a little perspective on their containers */
.has-motion .hero-copy,
.has-motion .service-grid,
.has-motion .industry-grid,
.has-motion .compliance-grid,
.has-motion .faq-list,
.has-motion .founder-grid,
.has-motion .proof-list {
  perspective: 1000px;
}

/* ---------- Sections: soft green glow that travels across as you scroll, plus a "story rail" ---------- */
.has-motion main > section:not(.landing-hero):not(.proof-section),
.has-motion .proof-panel,
.has-motion .faq-panel {
  position: relative;
}

.has-motion main > section:not(.landing-hero):not(.proof-section)::after,
.has-motion .proof-panel::after,
.has-motion .faq-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: var(--section-glow-opacity, 0);
  background: radial-gradient(
    circle at var(--section-glow-x, 50%) var(--section-glow-y, 50%),
    rgba(126, 211, 33, 0.13),
    transparent 46%
  );
}

.has-motion main > section:not(.landing-hero):not(.proof-section)::before,
.has-motion .proof-panel::before,
.has-motion .faq-panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12%;
  bottom: 12%;
  width: 3px;
  border-radius: 999px;
  pointer-events: none;
  background: linear-gradient(180deg, #7ed321 0%, #65ab1b 55%, rgba(126, 211, 33, 0) 100%);
  transform: scaleY(var(--story-rail-scale, 0));
  transform-origin: top center;
}

/* ---------- Cards: one-time shine sweep on reveal + an orb of light that drifts with scroll ---------- */
.has-motion .service-card,
.has-motion .industry-card,
.has-motion .compliance-card,
.has-motion .proof-item,
.has-motion .faq-list article,
.has-motion .story-note,
.has-motion .why-story-points article,
.has-motion .founder-card,
.has-motion .hero-metrics > div {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transform-style: preserve-3d;
  will-change: transform;
}

.has-motion .service-card::before,
.has-motion .industry-card::before,
.has-motion .compliance-card::before,
.has-motion .faq-list article::before,
.has-motion .story-note::before,
.has-motion .why-story-points article::before,
.has-motion .founder-card::before,
.has-motion .hero-metrics > div::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--motion-orb-opacity, 0);
  background: radial-gradient(
    circle at var(--motion-orb-x, -18%) var(--motion-orb-y, 78%),
    rgba(126, 211, 33, 0.16),
    transparent 42%
  );
}

.has-motion .service-card::after,
.has-motion .industry-card::after,
.has-motion .compliance-card::after,
.has-motion .faq-list article::after,
.has-motion .story-note::after,
.has-motion .why-story-points article::after,
.has-motion .founder-card::after,
.has-motion .hero-metrics > div::after {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: var(--card-shine-x, -35%);
  width: 34%;
  pointer-events: none;
  opacity: var(--card-shine-opacity, 0);
  transform: skewX(-18deg);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0) 100%
  );
}

/* Dark "how we work together" card: softer shine */
.has-motion .founder-card-wide::after {
  background: linear-gradient(90deg, rgba(126, 211, 33, 0) 0%, rgba(126, 211, 33, 0.22) 50%, rgba(126, 211, 33, 0) 100%);
}

/* ---------- "Why ResolveIT" rows fill from the left as they slide in (Cardex check list) ---------- */
.has-motion .proof-item {
  background-image: linear-gradient(
    90deg,
    rgba(126, 211, 33, 0.16) 0%,
    rgba(126, 211, 33, 0.06) calc(var(--check-fill, 1) * 60%),
    rgba(255, 255, 255, 0) calc(var(--check-fill, 1) * 60% + 1%)
  );
  border-left: 3px solid rgba(126, 211, 33, calc(var(--check-fill, 1) * 0.7));
}

/* ---------- Scan line across the hero collage and the sticky panel ---------- */
.has-motion .sticky-panel {
  position: relative;
  overflow: hidden;
}

.has-motion .shape-collage::after,
.has-motion .sticky-panel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: var(--scan-y, -18%);
  height: 2px;
  pointer-events: none;
  opacity: var(--scan-opacity, 0);
  background: linear-gradient(90deg, rgba(126, 211, 33, 0), rgba(126, 211, 33, 0.85), rgba(126, 211, 33, 0));
  box-shadow: 0 0 18px 4px rgba(126, 211, 33, 0.28);
}

/* ---------- Process rows: the top rule draws across instead of appearing all at once ---------- */
.has-motion .process-card {
  position: relative;
  border-top-color: transparent;
}

.has-motion .process-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
  transform: scaleX(var(--rule, 1));
  transform-origin: left center;
}

/* Sticky band: the card in focus is brighter, the others dim slightly */
.has-motion .scroll-card > * {
  opacity: var(--active, 1);
}

/* ---------- Main buttons glow once when they come into view ---------- */
.has-motion .primary-cta {
  box-shadow: 0 0 0 calc(var(--button-pulse, 0) * 8px) rgba(126, 211, 33, calc(var(--button-pulse, 0) * 0.28)),
    0 10px 28px rgba(36, 128, 0, calc(var(--button-pulse, 0) * 0.35));
}

/* Keep hovered cards above their neighbours while they lift */
.has-motion .service-card:hover,
.has-motion .industry-card:hover,
.has-motion .compliance-card:hover,
.has-motion .founder-card:hover {
  z-index: 1;
}

.has-motion .service-tag,
.has-motion .compliance-tag {
  display: inline-block;
  transform-origin: left center;
}
