/* Dolf Agency — FX: pointer spotlight + hairline border glow on card groups.
   Classes are added by fx/spotlight-cards.js on desktop pointers only
   (never on touch or under reduced motion), so without JS the cards render
   exactly as in styles.css.

   ::before  soft fill light, hovered card only
   ::after   1px border light on every card of the active group, so the edges
             of neighbouring cards catch the light as the pointer approaches.
   --mx/--my are written per card by the script (pointer relative to the
   card's border box). Monochrome, sharp corners, no layout impact. */

.fx-spot {
  position: relative;
  isolation: isolate;
}
.fx-spot > * {
  position: relative;
  z-index: 1;
}

.fx-spot::before,
.fx-spot::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}

/* Fill light */
.fx-spot::before {
  inset: 0;
  z-index: 0;
  background: radial-gradient(
    320px circle at var(--mx, 50%) var(--my, 50%),
    rgba(242, 242, 242, 0.06),
    transparent 60%
  );
}

/* Border light: a 1px ring masked out of a radial gradient, sitting exactly
   on top of the card's own 1px hairline. */
.fx-spot::after {
  inset: -1px;
  z-index: 2;
  padding: 1px;
  background: radial-gradient(
    220px circle at var(--mx, 50%) var(--my, 50%),
    rgba(242, 242, 242, 0.6),
    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);
}

.fx-spot-group.is-spot-active > .fx-spot::after { opacity: 1; }
.fx-spot:hover::before { opacity: 1; }

/* Process steps have no box of their own (number rail + body) and span the
   full list width while their copy stops at ~52ch. The light draws a frame a
   little outside the step so it never hugs the text, and only as wide as
   rail + gap + copy so it never floats in the empty right half. The offset
   stays inside the list's side padding and the gap between steps.
   The fill sits above the content here, because .process-num has an opaque
   background (it masks the rail line) that would otherwise show as a dark
   patch inside the light. */
.process-step.fx-spot {
  --fx-spot-out: clamp(0.85rem, 1.6vw, 1.5rem);
  --fx-spot-w: min(100%, var(--rail, 6rem) + clamp(1.25rem, 4vw, 3rem) + 30rem);
}
.process-step.fx-spot::before,
.process-step.fx-spot::after {
  right: auto;
}
.process-step.fx-spot::before {
  top: calc(-1 * var(--fx-spot-out));
  bottom: calc(-1 * var(--fx-spot-out));
  left: calc(-1 * var(--fx-spot-out));
  width: calc(var(--fx-spot-w) + 2 * var(--fx-spot-out));
  z-index: 2;
  background: radial-gradient(
    360px circle at calc(var(--mx, 50%) + var(--fx-spot-out)) calc(var(--my, 50%) + var(--fx-spot-out)),
    rgba(242, 242, 242, 0.045),
    transparent 60%
  );
}
.process-step.fx-spot::after {
  top: calc(-1px - var(--fx-spot-out));
  bottom: calc(-1px - var(--fx-spot-out));
  left: calc(-1px - var(--fx-spot-out));
  width: calc(var(--fx-spot-w) + 2px + 2 * var(--fx-spot-out));
  background: radial-gradient(
    220px circle at calc(var(--mx, 50%) + 1px + var(--fx-spot-out)) calc(var(--my, 50%) + 1px + var(--fx-spot-out)),
    rgba(242, 242, 242, 0.5),
    transparent 70%
  );
}

/* Touch, reduced motion, and Windows high-contrast / forced colors (where a
   white gradient ring would ignore the user's palette): no light at all. */
@media (hover: none), (prefers-reduced-motion: reduce), (forced-colors: active) {
  .fx-spot::before,
  .fx-spot::after {
    display: none;
  }
}
