/* =========================================================
   INFOWEBS motion pack: loader, hover, 3D tilt, reveal,
   micro interactions, parallax. Everything is off for
   visitors who ask for reduced motion.
   ========================================================= */

/* ---------- 02 smooth loader (first page of a visit) ----------
   Drawn with pseudo-elements so it is there from the very first paint.
   theme.js adds html.fx-load; fx.js removes it once the page is ready. */
html.fx-load body::before {
  content: ""; position: fixed; inset: 0; z-index: 9998; background: var(--bg-0, #050B16); -webkit-mask-image: none; mask-image: none;
  transition: opacity .5s ease, visibility .5s ease;
  animation: fx-loader-out .5s ease 3s forwards; /* safety net if a script fails */
}
html.fx-load body::after {
  content: ""; position: fixed; z-index: 9999; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px;
  border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); border-right-color: var(--accent);
  box-shadow: 0 0 30px -6px var(--accent-glow);
  transition: opacity .35s ease, transform .5s cubic-bezier(.2, .7, .2, 1), visibility .35s ease;
  animation: spin .8s cubic-bezier(.6, .2, .4, .8) infinite, fx-loader-out .35s ease 3s forwards;
}
html.fx-load.fx-loaded body::before { opacity: 0; visibility: hidden; }
html.fx-load.fx-loaded body::after { opacity: 0; visibility: hidden; }
@keyframes fx-loader-out { to { opacity: 0; visibility: hidden; } }
/* hold the hero entrance until the loader lifts */
html.fx-load:not(.fx-loaded) .fx-rise { animation-play-state: paused; }

/* page fade when moving between pages */
html.fx-leaving body { opacity: 0; transform: translateY(-6px); transition: opacity .28s ease, transform .28s ease; }

/* ---------- scroll progress bar ---------- */
.fx-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; pointer-events: none;
  background: linear-gradient(90deg, var(--accent-2, var(--accent)), var(--accent));
  box-shadow: 0 0 10px var(--accent-glow);
  transform-origin: 0 50%; transform: scaleX(var(--fx-p, 0));
}

/* ---------- 01 hover effects ---------- */
/* glowing gradient edge on cards */
.fx-edge {
  position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 1;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), var(--accent), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .3s ease;
}
:hover > .fx-edge { opacity: 1; }
/* animated underline on menu and footer links */
.fx-ul { background-image: linear-gradient(currentColor, currentColor); background-size: 0 1.5px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .3s ease, color .2s ease; }
.fx-ul:hover, .fx-ul:focus-visible { background-size: 100% 1.5px; }
/* icons inside cards give a small lift and glow */
.svc-item:hover .orb, .wcu-card:hover .wcu-icon { transform: translateY(-3px) scale(1.06); filter: drop-shadow(0 6px 14px var(--accent-glow)); }
.svc-item .orb, .wcu-card .wcu-icon { transition: transform .35s cubic-bezier(.2, .7, .2, 1), filter .35s ease; }

/* ---------- 03 3D motion (tilt) ---------- */
.fx-tilt { transform-style: preserve-3d; will-change: transform; }
.fx-tilt.is-tilting { transition: transform .12s ease-out, border-color .25s ease, box-shadow .25s ease !important; }
.fx-tilt.is-resetting { transition: transform .6s cubic-bezier(.2, .7, .2, 1), border-color .25s ease, box-shadow .25s ease !important; }
.fx-tilt-glare { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2; opacity: 0; transition: opacity .3s ease;
  background: linear-gradient(var(--ga, 135deg), rgba(255, 255, 255, .14), transparent 55%); }
.fx-tilt:hover .fx-tilt-glare { opacity: 1; }

/* ---------- 04 entrance reveal ---------- */
html.fx .rv { filter: blur(6px); transition-property: opacity, transform, filter; }
html.fx .rv.in { filter: none; }
/* hero: headline, text and panel rise in one after another */
.fx-rise { animation: fx-rise .9s cubic-bezier(.2, .7, .2, 1) var(--d, .1s) both; }
@keyframes fx-rise { from { opacity: 0; transform: translateY(22px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@media (prefers-reduced-motion: no-preference) {
  /* the headline keeps its existing colour sweep and gains the rise */
  .hero h1.fx-rise, .page-hero h1.fx-rise { animation: fx-rise .9s cubic-bezier(.2, .7, .2, 1) var(--d, .1s) both, shine 2.4s calc(var(--d, .1s) + .3s) ease-out both; }
}

/* ---------- 05 micro interactions ---------- */
.btn { will-change: transform; }
.btn:active { transform: scale(.97) !important; }
.fx-ripple { position: absolute; border-radius: 50%; pointer-events: none; transform: scale(0); opacity: .45; background: currentColor; animation: fx-ripple .6s ease-out forwards; }
@keyframes fx-ripple { to { transform: scale(1); opacity: 0; } }
/* back-to-top button with a scroll ring */
.fx-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 60; width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid var(--line-strong); cursor: pointer;
  background: var(--header-bg, var(--bg-1)); color: var(--text); backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(16px) scale(.9); pointer-events: none;
  transition: opacity .3s ease, transform .3s cubic-bezier(.2, .7, .2, 1), border-color .2s ease;
}
.fx-top.is-on { opacity: 1; transform: none; pointer-events: auto; }
.fx-top:hover { border-color: var(--accent-line); transform: translateY(-3px); }
.fx-top svg.ring { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); transform: rotate(-90deg); }
.fx-top svg.ring circle { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 150.8; stroke-dashoffset: calc(150.8 * (1 - var(--fx-p, 0))); }
.fx-top .arrow { width: 18px; height: 18px; transition: transform .25s ease; }
.fx-top:hover .arrow { transform: translateY(-3px); }
.fx-top:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* form fields glow when in use */
input:focus-visible, select:focus-visible, textarea:focus-visible { box-shadow: 0 0 0 4px var(--accent-soft), 0 0 24px -8px var(--accent-glow); transition: box-shadow .25s ease, border-color .25s ease; }
/* leave room above the WhatsApp/footer area on phones */
@media (max-width: 600px) { .fx-top { right: 14px; bottom: 14px; width: 46px; height: 46px; } }

/* ---------- 06 parallax ---------- */
.fx-px { will-change: transform; }

/* ---------- reduced motion: keep it calm ---------- */
@media (prefers-reduced-motion: reduce) {
  html.fx-load body::before, html.fx-load body::after, .fx-progress, .fx-tilt-glare, .fx-ripple { display: none !important; }
  .fx-rise { opacity: 1; animation: none !important; transform: none; filter: none; }
  html.fx-leaving body { opacity: 1; transform: none; }
  .fx-tilt, .fx-px { transform: none !important; }
}
