/* ══════════════════════════════════════════════════════════
   ORBEXIA — Motion: preloader, cursor, reveals, keyframes
   ══════════════════════════════════════════════════════════ */

/* ─────────── Keyframes ─────────── */
@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(34,211,238,0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(34,211,238,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,211,238,0); }
}
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}
@keyframes spin-slow { to { transform: rotate(360deg); } }
@keyframes spin-reverse { to { transform: rotate(-360deg); } }
@keyframes draw-stroke { to { stroke-dashoffset: 0; } }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}
@keyframes scan {
  0%   { transform: translateY(-100%); opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateY(1100%); opacity: 0; }
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes blink { 50% { opacity: 0.25; } }

/* ─────────── Preloader ─────────── */
#preloader {
  position: fixed;
  inset: 0;
  z-index: var(--z-loader);
  display: grid;
  place-items: center;
  background: var(--bg-0);
  transition: opacity 0.6s var(--ease-out), visibility 0.6s;
}
#preloader.done { opacity: 0; visibility: hidden; }

.pl-inner { display: grid; place-items: center; gap: 30px; text-align: center; }

.pl-logo { width: clamp(96px, 16vw, 150px); height: auto; overflow: visible; }
.pl-logo .pl-path {
  fill: none;
  stroke: url(#plGrad);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: var(--len, 400);
  stroke-dashoffset: var(--len, 400);
  animation: draw-stroke 1.35s var(--ease-out) forwards;
}
.pl-logo .pl-node {
  fill: url(#plGrad);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: node-pop 0.5s var(--ease-spring) forwards;
}
@keyframes node-pop {
  from { opacity: 0; transform: scale(0); }
  to   { opacity: 1; transform: scale(1); }
}

.pl-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.15rem, 2.4vw, 1.7rem);
  letter-spacing: 0.42em;
  padding-left: 0.42em;
  color: var(--text);
  opacity: 0;
  animation: fade-up 0.7s var(--ease-out) 0.85s forwards;
}
.pl-bar {
  width: min(220px, 46vw);
  height: 2px;
  border-radius: 2px;
  background: rgba(255,255,255,0.09);
  overflow: hidden;
  opacity: 0;
  animation: fade-up 0.5s var(--ease-out) 1s forwards;
}
.pl-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--grad);
  box-shadow: var(--glow-sm);
  transition: width 0.25s var(--ease-out);
}
.pl-pct {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-mute);
  letter-spacing: 0.18em;
  opacity: 0;
  animation: fade-up 0.5s var(--ease-out) 1.05s forwards;
}

/* ─────────── Custom cursor ─────────── */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  z-index: var(--z-cursor);
  pointer-events: none;
  border-radius: 50%;
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.3s;
}
body.cursor-ready .cursor-dot,
body.cursor-ready .cursor-ring { opacity: 1; }

.cursor-dot {
  width: 6px; height: 6px;
  background: var(--teal-light);
  box-shadow: 0 0 12px rgba(34,211,238,0.85);
  transform: translate(-50%, -50%);
}
.cursor-ring {
  width: 36px; height: 36px;
  border: 1px solid rgba(34,211,238,0.55);
  transform: translate(-50%, -50%);
  transition: width 0.28s var(--ease-out), height 0.28s var(--ease-out),
              border-color 0.28s var(--ease-out), background 0.28s var(--ease-out), opacity 0.3s;
}
.cursor-ring.hovering {
  width: 62px; height: 62px;
  border-color: rgba(34,211,238,0.85);
  background: rgba(34,211,238,0.08);
}
.cursor-ring.pressing { width: 26px; height: 26px; }

/* ─────────── Scroll progress ─────────── */
#scrollProgress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--grad);
  box-shadow: 0 0 14px rgba(34,211,238,0.7);
  z-index: calc(var(--z-nav) + 5);
  transition: width 0.08s linear;
}

/* ─────────── Reveal ─────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.85s var(--ease-out), transform 0.85s var(--ease-out);
  will-change: opacity, transform;
}
.reveal.visible { opacity: 1; transform: none; }

.reveal-left  { opacity: 0; transform: translateX(-38px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); }
.reveal-right { opacity: 0; transform: translateX(38px);  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); }
.reveal-left.visible, .reveal-right.visible { opacity: 1; transform: none; }

.reveal-scale { opacity: 0; transform: scale(0.94); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); }
.reveal-scale.visible { opacity: 1; transform: none; }

/* Word-by-word headline reveal */
.split-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.55em) rotateX(-45deg);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.split-line { display: inline-block; overflow: hidden; vertical-align: top; }
.visible .split-word,
.split-ready.visible .split-word { opacity: 1; transform: none; }

/* ─────────── Marquee ─────────── */
.marquee {
  position: relative;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 38s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }

/* ─────────── Reduced motion ─────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .reveal-left, .reveal-right, .reveal-scale, .split-word {
    opacity: 1 !important;
    transform: none !important;
  }
  .cursor-dot, .cursor-ring { display: none; }
  .marquee-track { animation: none; }
}
