/* ============================================================================
   metatrix-fx.css — sitewide graphics + loading polish (paired with
   metatrix-fx.js; injected by local-server.mjs into every page).
   Progressive: every rule no-ops gracefully where unsupported, and all
   motion is disabled under prefers-reduced-motion.
   ========================================================================== */

/* Cross-document View Transitions — buttery page-to-page navigation on
   Chromium 126+; other engines simply ignore the at-rule. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: mtx-vt-out .18s ease-in both; }
::view-transition-new(root) { animation: mtx-vt-in  .26s ease-out both; }
@keyframes mtx-vt-out { to   { opacity: 0; transform: scale(.992); } }
@keyframes mtx-vt-in  { from { opacity: 0; transform: scale(1.008); } }

/* First-paint ease-in (CSS-only — cannot strand a page invisible). */
html { animation: mtx-pagein .32s ease-out both; }
@keyframes mtx-pagein { from { opacity: .55; } to { opacity: 1; } }

/* Slim top progress bar during internal navigation (set by metatrix-fx.js). */
#mtx-fx-bar {
  position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 2147483000;
  background: linear-gradient(90deg, #3FB6FF, #22C55E, #A78BFA);
  box-shadow: 0 0 12px rgba(63, 182, 255, .55);
  pointer-events: none; opacity: 0;
}
#mtx-fx-bar.go { opacity: 1; animation: mtx-bar 1.4s cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes mtx-bar { 0% { width: 0; } 65% { width: 62%; } 100% { width: 88%; } }

/* 3D micro-tilt on cards/stat tiles (elements tagged by metatrix-fx.js).
   GPU-composited transform only; a soft specular sheen follows the pointer. */
.mtx-tilt {
  transition: transform .18s ease-out, box-shadow .25s ease-out;
  transform-style: preserve-3d;
  position: relative;
}
.mtx-tilt:hover {
  box-shadow: 0 14px 42px rgba(0, 0, 0, .45);
  background-image: radial-gradient(240px 200px at var(--mtx-shx, 50%) var(--mtx-shy, 50%),
    rgba(255, 255, 255, .045), transparent 70%);
}

/* Respect the user: no motion, no tilt, no transitions when reduced. */
@media (prefers-reduced-motion: reduce) {
  html { animation: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .mtx-tilt, .mtx-tilt:hover { transition: none; transform: none !important; background-image: none; }
  #mtx-fx-bar { display: none; }
}
