.fx-spot,
.fx-trail { position: fixed; pointer-events: none; }

.fx-spot {
  left: 0;
  top: 0;
  z-index: 60;
  width: 560px;
  height: 560px;
  margin: -280px 0 0 -280px;
  background: radial-gradient(closest-side, rgba(79, 140, 255, 0.14), rgba(79, 140, 255, 0.05) 45%, transparent 72%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.5s ease;
  will-change: transform;
}
html.fx-cursor-live .fx-spot { opacity: 1; }

.fx-trail { inset: 0; z-index: 61; width: 100%; height: 100%; }

.fx-glow { position: relative; isolation: isolate; }
.fx-glow::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgba(110, 163, 255, 0.17), transparent 62%);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.fx-glow.is-lit::before { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .fx-spot, .fx-trail { display: none; }
}

@property --amb-x { syntax: "<percentage>"; inherits: true; initial-value: 50%; }
@property --amb-y { syntax: "<percentage>"; inherits: true; initial-value: 20%; }

html {
  --amb-x: 50%;
  --amb-y: 20%;
  transition: --amb-x 1.4s cubic-bezier(0.22, 1, 0.36, 1), --amb-y 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}
html[data-amb="services"] { --amb-x: 15%; --amb-y: 35%; }
html[data-amb="why"] { --amb-x: 85%; --amb-y: 45%; }
html[data-amb="projects"] { --amb-x: 50%; --amb-y: 55%; }
html[data-amb="lab"] { --amb-x: 25%; --amb-y: 30%; }
html[data-amb="process"] { --amb-x: 75%; --amb-y: 60%; }
html[data-amb="pricing"] { --amb-x: 30%; --amb-y: 45%; }
html[data-amb="about"] { --amb-x: 80%; --amb-y: 35%; }
html[data-amb="faq"] { --amb-x: 20%; --amb-y: 55%; }
html[data-amb="contact"] { --amb-x: 50%; --amb-y: 70%; }

.fx-ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(48% 42% at var(--amb-x) var(--amb-y), rgba(60, 110, 230, 0.2), transparent 70%),
    radial-gradient(30% 28% at calc(100% - var(--amb-x)) calc(100% - var(--amb-y)), rgba(40, 80, 190, 0.12), transparent 70%);
}
html.fx-ambient-on .section--alt { background: rgba(10, 14, 26, 0.72); }

html.fx-ready [data-fx="up"] {
  opacity: 0;
  translate: 0 28px;
  transition:
    opacity 0.85s var(--ease) calc(var(--fx-i, 0) * 90ms),
    translate 0.95s var(--ease) calc(var(--fx-i, 0) * 90ms),
    transform 0.35s var(--ease),
    border-color 0.35s var(--ease),
    box-shadow 0.35s var(--ease),
    background-color 0.35s var(--ease);
}
html.fx-ready [data-fx="up"].is-in { opacity: 1; translate: 0 0; }

html.fx-ready [data-fx="wipe"] {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.1s var(--ease) calc(var(--fx-i, 0) * 120ms);
}
html.fx-ready [data-fx="wipe"] img { scale: 1.18; transition: scale 1.4s var(--ease) calc(var(--fx-i, 0) * 120ms), transform 0.6s var(--ease); }
html.fx-ready [data-fx="up"].is-in [data-fx="wipe"] { clip-path: inset(0 0 0 0); }
html.fx-ready [data-fx="up"].is-in [data-fx="wipe"] img { scale: 1; }

.fx-word { display: inline-block; white-space: nowrap; }
.fx-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.55em) rotateX(-55deg);
  transform-origin: 50% 100%;
  filter: blur(7px);
  transition:
    opacity 0.7s var(--ease) calc(120ms + var(--ci, 0) * 26ms),
    transform 0.85s var(--ease) calc(120ms + var(--ci, 0) * 26ms),
    filter 0.7s var(--ease) calc(120ms + var(--ci, 0) * 26ms);
}
[data-fx-title].is-in .fx-char { opacity: 1; transform: none; filter: blur(0); }

.fx-energy {
  position: relative;
  height: 1px;
  width: min(1180px, 88%);
  margin: 0 auto -1px;
  background: linear-gradient(90deg, transparent, rgba(110, 163, 255, 0.5) 20%, rgba(110, 163, 255, 0.5) 80%, transparent) center / 0% 100% no-repeat;
  transition: background-size 1.3s var(--ease);
}
.fx-energy.is-in { background-size: 100% 100%; }
.fx-energy i {
  position: absolute;
  top: -2px;
  left: 0;
  width: 140px;
  height: 5px;
  border-radius: 5px;
  background: radial-gradient(closest-side, #dbe8ff, rgba(110, 163, 255, 0.6) 55%, transparent);
  filter: blur(1px);
  opacity: 0;
}
.fx-energy.is-in i { animation: energyRun 3.4s cubic-bezier(0.45, 0, 0.25, 1) 0.5s 1 forwards; }
@keyframes energyRun {
  0% { left: -6%; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html.fx-ready [data-fx], .fx-char { opacity: 1 !important; translate: none !important; transform: none !important; filter: none !important; clip-path: none !important; transition: none !important; }
  .fx-energy { background-size: 100% 100%; transition: none; }
  .fx-energy i { display: none; }
}

.fx-sparks { position: absolute; left: 0; top: 0; z-index: 40; width: 0; height: 0; pointer-events: none; }
.fx-spark {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #cfe0ff;
  box-shadow: 0 0 9px 1px #6ea3ff;
  opacity: 0;
  animation: sparkOut 1s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
@keyframes sparkOut {
  0% { opacity: 0; transform: translate(0, 0) scale(0.6); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.15); }
}

.price--featured { position: relative; overflow: hidden; }
.price--featured::after,
.const__stage::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -4%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #bcd3ff 30%, #e8f0ff 50%, #bcd3ff 70%, transparent);
  box-shadow: 0 0 16px 4px rgba(110, 163, 255, 0.5);
  opacity: 0;
  pointer-events: none;
  animation: coverScan 11s ease-in-out 3s infinite;
}
.const__stage::after { animation-delay: 6s; animation-duration: 13s; }

@media (prefers-reduced-motion: reduce) {
  .fx-sparks, .price--featured::after, .const__stage::after { display: none; }
}

.btn, .pv-btn, .form__action, .geo-allow, .geo-deny, .arc__cta { position: relative; overflow: hidden; isolation: isolate; }

.fx-ripple {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(190, 215, 255, 0.55), rgba(79, 140, 255, 0.25) 45%, transparent 70%);
  transform: scale(0);
  animation: rippleOut 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
@keyframes rippleOut { to { transform: scale(1); opacity: 0; } }

.btn--primary::before, .btn--quote::before, .pv-btn::before, .arc__cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, 0.26) 50%, transparent 68%);
  transform: translateX(-130%);
  transition: transform 0.85s var(--ease);
}
.btn--primary:hover::before, .btn--quote:hover::before, .pv-btn:hover::before, .arc__cta:hover::before { transform: translateX(130%); }

.btn--primary { box-shadow: 0 10px 30px -12px var(--color-accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.28); }
.btn:active, .pv-btn:active, .form__action:active, .arc__cta:active { transform: translateY(0) scale(0.98); }

.btn:focus-visible, .pv-btn:focus-visible, .form__action:focus-visible, .arc__cta:focus-visible,
.geo-allow:focus-visible, .geo-deny:focus-visible, .hud-start:focus-visible {
  outline: 2px solid #bcd3ff;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(79, 140, 255, 0.25), 0 0 26px -4px rgba(110, 163, 255, 0.8);
}

@media (prefers-reduced-motion: reduce) {
  .fx-ripple { display: none; }
  .btn--primary::before, .btn--quote::before, .pv-btn::before, .arc__cta::before { display: none; }
}

@media (max-width: 760px) {
  .lab-card, .const__panel, .form, .pv__badge { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .lab-card, .const__panel, .form { background: rgba(12, 20, 42, 0.92); }
}
