/* ===========================================================================
   GRATZ — fx.css  (premium "light-edge" layer, bolt-on / removable)
   A1  traveling light edge on the signature cards (.sample, .pay-method)
   A2  ambient light bead sweeping the section rules (.steps, .deliver__list,
       .site-footer)
   B3  masked line-reveal of headings (.hero__title, .section-title)  — JS wraps
   B5  magnetic spotlight glow following the cursor over the dark cards — JS
       feeds --mx / --my
   All motion is desktop-only: JS adds html.motion-off on phones / touch /
   reduced-motion, and every effect below is neutralised under that class.
   Remove the <link> in index.html + the two fx IIFEs in app.js to roll back.
   =========================================================================== */

@property --fx-a {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

/* ===========================================================================
   B5 — magnetic spotlight (base layer, below content, above the card surface)
   =========================================================================== */
.sample,
.pay-method,
.step {
  position: relative;
  overflow: hidden;
}

/* keep the real content above the glow + edge pseudos */
.sample>*,
.pay-method>*,
.step>* {
  position: relative;
  z-index: 1;
}

.sample::before,
.pay-method::before,
.step::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%),
      rgba(255, 255, 255, .09) 0%,
      rgba(255, 255, 255, 0) 60%);
  opacity: 0;
  transition: opacity .3s var(--ease);
  pointer-events: none;
  z-index: 0;
}

.sample:hover::before,
.pay-method:hover::before,
.step:hover::before {
  opacity: 1;
}

/* ===========================================================================
   A1 — traveling light edge (1px conic ring riding the card border)
   =========================================================================== */
.sample::after,
.pay-method::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--fx-a),
      rgba(255, 255, 255, 0) 0 66%,
      rgba(255, 255, 255, .9) 76%,
      rgba(255, 255, 255, 0) 88% 100%);
  -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, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: .4;
  transition: opacity .3s var(--ease);
  animation: fx-edge-spin 7.5s linear infinite;
  pointer-events: none;
  z-index: 2;
}

.sample:hover::after,
.pay-method:hover::after {
  opacity: 1;
}

@keyframes fx-edge-spin {
  to {
    --fx-a: 360deg;
  }
}

/* ===========================================================================
   A2 — ambient light bead sweeping the horizontal section rules
   =========================================================================== */
.steps,
.deliver__list {
  position: relative;
}

.steps::before,
.deliver__list::before,
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 1px;
  width: 34%;
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, .8) 50%,
      rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  z-index: 3;
  animation: fx-bead 8s var(--ease) infinite;
}

/* stagger the beads so they don't march in lockstep */
.deliver__list::before {
  animation-delay: 2.6s;
}

.site-footer::before {
  animation-delay: 5.2s;
}

@keyframes fx-bead {
  0% {
    transform: translateX(-120%);
    opacity: 0;
  }

  12% {
    opacity: 1;
  }

  60% {
    opacity: 1;
  }

  100% {
    transform: translateX(380%);
    opacity: 0;
  }
}

/* ===========================================================================
   B3 — masked line-reveal of headings (JS wraps each line in .fx-ln/.fx-ln__t)
   =========================================================================== */
.fx-ln {
  display: block;
  overflow: hidden;
  padding-bottom: .14em;
  margin-bottom: -.14em;
}

.fx-ln__t {
  display: block;
  transform: translateY(118%);
  transition: transform .9s var(--ease);
  will-change: transform;
}

.fx-rv-in .fx-ln__t {
  transform: none;
}

/* ===========================================================================
   C7 — rim-light on the monolith: a white halo that grows with scroll.
   app.js sets --rim (0 at top → 1 at the bottom of the page) on the SVG;
   the first drop-shadow keeps the original grounding shadow.
   =========================================================================== */
.bg-monolith svg {
  filter:
    drop-shadow(0 30px 80px rgba(0, 0, 0, .6))
    drop-shadow(0 0 calc(var(--rim, 0) * 30px) rgba(255, 255, 255, calc(var(--rim, 0) * .45)));
}

/* ===========================================================================
   C8 — scroll-progress hairline, pinned just under the header
   =========================================================================== */
.scroll-progress {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  height: 2px;
  z-index: 59;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg,
      rgba(255, 255, 255, .22) 0%,
      rgba(255, 255, 255, .95) 100%);
  pointer-events: none;
}

/* ===========================================================================
   MOTION-OFF (phones / touch / reduced-motion): drop every fx animation
   =========================================================================== */
html.motion-off .sample::after,
html.motion-off .pay-method::after,
html.motion-off .sample::before,
html.motion-off .pay-method::before,
html.motion-off .step::before {
  display: none;
}

html.motion-off .steps::before,
html.motion-off .deliver__list::before,
html.motion-off .site-footer::before {
  display: none;
}

/* B3 lines are only wrapped by JS when motion is on, so no override needed. */
