/* Vyntranex 3D Loader — styles
   Fonts (optional, add to <head>):
   <link href="https://fonts.googleapis.com/css2?family=Michroma&family=Jura:wght@300;400&display=swap" rel="stylesheet"> */

html.vx-loading:not(.vx-skip-loader),
html.vx-loading:not(.vx-skip-loader) body {
  overflow: hidden;
}

/* If already seen in this session or on non-home routes, instantly hide loader */
html.vx-skip-loader #vx-loader,
html.vx-skip-loader .vx-loader,
#vx-loader.vx-hidden,
.vx-loader.vx-hidden {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* The overlay covers the page immediately, even before the JS module runs */
#vx-loader,
.vx-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background:
    radial-gradient(60% 45% at 50% 37%, rgba(150, 165, 190, 0.13), transparent 70%),
    radial-gradient(120% 90% at 50% 100%, rgba(40, 46, 58, 0.35), transparent 60%),
    #030304;
  color: #e9ebef;
  overflow: hidden;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.5s;
  --vx-p: 0;
  --vx-logo-bottom: 46vh;
}

.vx-stage,
.vx-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- brand block under the 3D monogram ---------- */
.vx-brand {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--vx-logo-bottom) + clamp(18px, 4.5vh, 48px));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
  will-change: transform, opacity;
  backface-visibility: hidden;
  transition: opacity 0.45s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.vx-word {
  display: flex;
  gap: 0.16em;
  font-family: 'Michroma', 'Eurostile', 'Bank Gothic', 'Arial Black', sans-serif;
  font-size: clamp(22px, 5vw, 58px);
  line-height: 1;
  letter-spacing: 0.02em;
  margin-right: -0.16em; /* optically centre after the trailing gap */
}

.vx-word span {
  display: inline-block;
  background: linear-gradient(115deg, #8d939c 0%, #f7f8fa 28%, #b9bec6 46%, #ffffff 58%, #8a9099 82%, #d5d9df 100%);
  background-size: 260% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 0.045em rgba(214, 218, 224, 0.92); /* heavier strokes, closer to the logo */
  paint-order: stroke fill;
  opacity: 0;
  transform: translate3d(0, 0.45em, 0) scale(0.96);
  will-change: transform, opacity;
  backface-visibility: hidden;
  transition:
    opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.95s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--i) * 55ms);
}

.vx-reveal .vx-word span {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  animation: vx-shine 3.4s cubic-bezier(0.45, 0, 0.25, 1) calc(0.6s + var(--i) * 40ms) infinite;
}

@keyframes vx-shine {
  0%   { background-position: 100% 0; }
  45%  { background-position: 0% 0; }
  100% { background-position: 0% 0; }
}

/* — TECHNOLOGIES — with rules that fill as the page loads */
.vx-sub {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 22px);
  margin-top: clamp(12px, 2.2vh, 22px);
  font-family: 'Jura', 'Montserrat', 'Segoe UI', sans-serif;
  font-weight: 400;
  font-size: clamp(11px, 1.6vw, 19px);
  letter-spacing: 0.55em;
  text-transform: uppercase;
  color: #d9dce1;
  will-change: transform, opacity;
}

.vx-sub-text {
  margin-right: -0.55em;
  opacity: 0;
  transition: opacity 0.9s ease 0.45s, letter-spacing 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.35s;
  letter-spacing: 0.2em;
}
.vx-reveal .vx-sub-text {
  opacity: 1;
  letter-spacing: 0.55em;
}

.vx-rule {
  position: relative;
  width: clamp(36px, 11vw, 130px);
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  opacity: 0;
  transition: opacity 0.6s ease 0.6s;
}
.vx-reveal .vx-rule { opacity: 1; }

.vx-rule i {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.35), #ffffff);
  box-shadow: 0 0 8px rgba(220, 230, 255, 0.55);
  transform: scaleX(0);
  will-change: transform;
}
.vx-rule--l i { transform-origin: right center; background: linear-gradient(270deg, #ffffff, rgba(255, 255, 255, 0.35)); }
.vx-rule--r i { transform-origin: left center; }

.vx-tag {
  display: flex;
  gap: clamp(18px, 4vw, 52px);
  margin-top: clamp(10px, 1.8vh, 18px);
  font-family: 'Jura', 'Montserrat', 'Segoe UI', sans-serif;
  font-weight: 300;
  font-size: clamp(9px, 1.15vw, 14px);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: #b9bdc4;
}
.vx-tag span {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.vx-tag span:nth-child(1) { transition-delay: 0.85s; }
.vx-tag span:nth-child(2) { transition-delay: 1.05s; }
.vx-tag span:nth-child(3) { transition-delay: 1.25s; }
.vx-reveal .vx-tag span { opacity: 1; transform: none; }

.vx-pct {
  margin-top: clamp(22px, 5vh, 54px);
  font-family: 'Michroma', 'Segoe UI', sans-serif;
  font-size: clamp(10px, 1vw, 12px);
  letter-spacing: 0.3em;
  color: rgba(233, 235, 239, 0.55);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 0.6s ease 1.4s;
}
.vx-pct b { font-weight: 400; color: #ffffff; }
.vx-pct small { font-size: 0.8em; margin-left: 0.2em; }
.vx-reveal .vx-pct { opacity: 1; }

/* ---------- exit ---------- */
.vx-exit .vx-brand {
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition-delay: 0s;
}
.vx-loader.vx-exit {
  opacity: 0;
  pointer-events: none;
}

/* ---------- no-WebGL fallback ---------- */
.vx-fallback {
  position: absolute;
  overflow: visible;
  filter: drop-shadow(0 6px 24px rgba(180, 195, 220, 0.18));
}
.vx-fallback polygon {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: translateY(30px) rotate(-12deg) scale(0.8);
  animation: vx-shard-in 0.9s cubic-bezier(0.16, 1, 0.3, 1) calc(var(--i) * 110ms) forwards;
}
@keyframes vx-shard-in {
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .vx-word span,
  .vx-sub-text,
  .vx-tag span,
  .vx-fallback polygon {
    transition-duration: 0.01s !important;
    transition-delay: 0s !important;
    animation: none !important;
    opacity: 1;
    transform: none;
    filter: none;
  }
}
