/* ============================================================
   MustSkills — experience layer
   Motion logo, animated backgrounds, video slots, 3D tilt cards,
   scroll progress, back-to-top. All motion is disabled for users
   who ask for reduced motion.
   ============================================================ */

/* ---------- Motion logo ---------- */
.navbar__logo { flex-direction: row !important; align-items: center; gap: 10px; perspective: 600px; }
.ms-text { display: flex; flex-direction: column; }
.ms-mark { width: 36px; height: 36px; flex: 0 0 36px; display: block; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.navbar__logo:hover .ms-mark, .navbar__logo:focus-visible .ms-mark { transform: rotateY(360deg); }
.ms-mark__bg { fill: var(--navy); }
.ms-mark__m { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 120; stroke-dashoffset: 120; animation: msDraw 1.1s .2s cubic-bezier(.65,0,.35,1) forwards; }
.ms-mark__bar { fill: var(--amber); transform-box: fill-box; transform-origin: left center; transform: scaleX(0); animation: msBar .6s 1.1s cubic-bezier(.2,.8,.2,1) forwards; }
.ms-mark__shine { fill: url(#msShine); opacity: 0; animation: msShine 6s 2.2s ease-in-out infinite; }
.navbar__logo-name, .navbar__logo-tagline { animation: msFadeIn .7s .5s both; }
@keyframes msDraw { to { stroke-dashoffset: 0; } }
@keyframes msBar  { to { transform: scaleX(1); } }
@keyframes msShine { 0%, 82% { opacity: 0; transform: translateX(-60px); } 86% { opacity: .9; } 100% { opacity: 0; transform: translateX(60px); } }
@keyframes msFadeIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Animated backgrounds (always on, under the video) ---------- */
.fx-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.fx-bg__blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; will-change: transform; }
.fx-bg__blob--a { width: 520px; height: 520px; background: radial-gradient(circle, #2A4D7A 0%, transparent 70%); top: -160px; right: -120px; animation: fxFloatA 18s ease-in-out infinite alternate; }
.fx-bg__blob--b { width: 420px; height: 420px; background: radial-gradient(circle, rgba(245,158,11,.35) 0%, transparent 70%); bottom: -180px; left: 10%; animation: fxFloatB 22s ease-in-out infinite alternate; }
.fx-bg__blob--c { width: 300px; height: 300px; background: radial-gradient(circle, rgba(46,125,50,.28) 0%, transparent 70%); top: 30%; left: 45%; animation: fxFloatC 26s ease-in-out infinite alternate; }
.fx-bg__spot { position: absolute; inset: 0; background: radial-gradient(600px circle at var(--mx, 70%) var(--my, 30%), rgba(255,255,255,.06), transparent 60%); transition: background .2s; }
@keyframes fxFloatA { to { transform: translate(-120px, 90px) scale(1.15); } }
@keyframes fxFloatB { to { transform: translate(160px, -60px) scale(1.2); } }
@keyframes fxFloatC { to { transform: translate(-140px, 40px) scale(.85); } }

/* ---------- Background video slots ---------- */
.fx-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; opacity: 0; transition: opacity 1.2s ease; pointer-events: none; }
.fx-video.is-ready { opacity: 1; }
.fx-video-shade { position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(21,41,68,.94) 0%, rgba(21,41,68,.80) 45%, rgba(21,41,68,.55) 100%); opacity: 0; transition: opacity 1.2s ease; }
.fx-video.is-ready + .fx-video-shade { opacity: 1; }
.hero > :not(.fx-bg):not(.fx-video):not(.fx-video-shade),
.page-hero > :not(.fx-bg):not(.fx-video):not(.fx-video-shade),
.final-cta > :not(.fx-bg):not(.fx-video):not(.fx-video-shade) { position: relative; z-index: 1; }
.page-hero { position: relative; overflow: hidden; }

/* ---------- Hero panel: float + 3D follow ---------- */
.hero__illus { perspective: 1200px; }
.hero__illus > * { transform-style: preserve-3d; animation: fxBob 6s ease-in-out infinite; transition: transform .25s ease-out; }
@keyframes fxBob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }

/* ---------- 3D tilt cards ---------- */
.fx-tilt { transform-style: preserve-3d; transition: transform .25s ease-out, box-shadow .25s ease-out; will-change: transform; position: relative; }
.fx-tilt:hover { box-shadow: 0 18px 40px rgba(21,41,68,.14); }
.fx-tilt__glare { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.35), transparent 55%); mix-blend-mode: soft-light; }
.fx-tilt:hover .fx-tilt__glare { opacity: 1; }

/* ---------- Buttons: shine sweep ---------- */
.btn--primary { position: relative; overflow: hidden; }
.btn--primary::after { content: ""; position: absolute; top: 0; left: -75%; width: 50%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.45), transparent); transform: skewX(-20deg); pointer-events: none; }
.btn--primary:hover::after { animation: fxShine .8s ease; }
@keyframes fxShine { to { left: 130%; } }

/* ---------- Domain cards: staggered 3D entrance ---------- */
.domains-grid .domain-card.fx-enter { opacity: 0; transform: perspective(900px) rotateX(18deg) translateY(30px); }
.domains-grid .domain-card.fx-entered { opacity: 1; transform: none; transition: opacity .7s ease, transform .9s cubic-bezier(.2,.8,.2,1); }

/* ---------- Scroll progress + back to top ---------- */
.fx-progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--amber), var(--amber-dark)); z-index: 1000; pointer-events: none; }
.fx-top { position: fixed; right: 20px; bottom: 24px; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer; z-index: 250;
  background: var(--navy); color: #fff; box-shadow: 0 8px 24px rgba(21,41,68,.3); display: grid; place-items: center;
  opacity: 0; transform: translateY(16px) scale(.9); pointer-events: none; transition: opacity .3s, transform .3s, background .2s; }
.fx-top.is-on { opacity: 1; transform: none; pointer-events: auto; }
.fx-top:hover { background: var(--amber-dark); }
.fx-top:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
@media (max-width: 1023px) { .fx-top { bottom: 84px; } } /* stay above the mobile CTA bar */

/* ---------- Reduced motion: switch everything off ---------- */
@media (prefers-reduced-motion: reduce) {
  .ms-mark__m { animation: none; stroke-dashoffset: 0; }
  .ms-mark__bar { animation: none; transform: none; }
  .ms-mark__shine, .navbar__logo-name, .navbar__logo-tagline { animation: none; }
  .fx-bg__blob, .hero__illus > * { animation: none; }
  .fx-video, .fx-video-shade { display: none; }
  .domains-grid .domain-card.fx-enter { opacity: 1; transform: none; }
  .btn--primary:hover::after { animation: none; }
}
