/* ==========================================================================
   ZOTOM TECH — Animations
   ========================================================================== */

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.25); }
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ---- Scroll reveal (progressively enhanced by animations.js / GSAP) ----
   Fails OPEN: .reveal elements are fully visible by default. JS only
   hides them momentarily, right before animating in, and only once it
   has confirmed GSAP + ScrollTrigger actually loaded. If the CDN is
   blocked, offline, or JS never runs at all, content simply stays
   visible with no animation — it can never get stuck hidden. */
.reveal {
  opacity: 1;
  transform: none;
}
.reveal.pre-anim {
  opacity: 0;
  transform: translateY(28px);
}
.reveal.is-in {
  animation: revealIn 0.9s var(--ease) forwards;
}
@keyframes revealIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Hero visual node pulse ---- */
.pulse-node { animation: pulseDot 2.6s ease-in-out infinite; }
.pulse-node.delay-1 { animation-delay: 0.4s; }
.pulse-node.delay-2 { animation-delay: 0.8s; }
.pulse-node.delay-3 { animation-delay: 1.2s; }
.pulse-node.delay-4 { animation-delay: 1.6s; }

.float-el { animation: floatSlow 6s ease-in-out infinite; }
/* z-rail signal: a comet streaks along the Z divider glyph on a
   continuous loop, trailed by two fading sparks. Pure CSS motion-path.
   Paused until JS arms it once the line-draw finishes (see animations.js). */
.z-spark { display: none; }

@supports (offset-path: path("M0 0 L1 1")) {
  .z-spark {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    offset-path: var(--z-path);
    animation: zSparkTravel 3.1s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate;
    animation-play-state: paused;
  }

  .z-rail.is-armed .z-spark {
    animation-play-state: running;
  }

  .z-spark-comet {
    width: 16px;
    height: 3px;
    margin: -1.5px 0 0 -15px;
    border-radius: 3px;
    background: linear-gradient(90deg, transparent 0%, var(--accent-line) 55%, var(--spark-head) 100%);
    filter: drop-shadow(0 0 5px rgba(34, 211, 238, 0.85));
    offset-rotate: auto;
  }

  .z-spark-dot {
    width: 4px;
    height: 4px;
    margin: -2px 0 0 -2px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px 1px rgba(46, 213, 115, 0.6);
  }
  .z-spark-dot.spark-2 { opacity: 0.55; animation-delay: -0.55s; }
  .z-spark-dot.spark-3 { width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px; opacity: 0.3; animation-delay: -1s; }
}

@keyframes zSparkTravel {
  from { offset-distance: 0%; }
  to { offset-distance: 100%; }
}
/* ---- Page load veil ---- */
.load-veil {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}
.loader {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loader-ring { width: 100%; height: 100%; position: absolute; inset: 0; transform: rotate(-90deg); }
.loader-ring-progress {
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transition: stroke-dashoffset 0.25s linear;
  filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.5));
}
.loader-mark {
  width: 44px;
  height: auto;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.25));
}
.loader-scanline {
  position: absolute;
  left: 8px;
  right: 8px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.9), transparent);
  top: 50%;
  animation: loaderScan 1.6s ease-in-out infinite;
  z-index: 3;
}
@keyframes loaderScan {
  0%, 100% { transform: translateY(-34px); opacity: 0; }
  50% { transform: translateY(34px); opacity: 1; }
}
.loader-status {
  position: absolute;
  bottom: -38px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.loader-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}
.loader-percent {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  min-width: 34px;
}.load-veil.is-hidden { opacity: 0; visibility: hidden; }
/* Without JavaScript nothing would ever hide the veil, so never show it. */
.no-js .load-veil { display: none; }

/* ---- Cursor-follow glow (desktop only, subtle, disabled on touch/reduced-motion) ---- */
.cursor-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle, rgba(34,211,238,0.06) 0%, rgba(46,213,115,0.03) 40%, transparent 70%);
  transform: translate(-50%, -50%);
  will-change: transform;
  transition: opacity 0.4s;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; animation: none !important; }
  .pulse-node, .float-el, .marquee-track, .load-veil { animation: none !important; }
  .cursor-glow { display: none !important; }
  .loader-scanline { display: none; }
}

@media (hover: none) {
  .cursor-glow { display: none; }
}

.marquee-strip:hover .marquee-track {
  animation-play-state: paused;
}

/* Light theme: the cursor halo and loader glows are tuned for dark grounds */
html[data-theme="light"] .loader-ring-progress,
html[data-theme="light"] .loader-mark { filter: none; }
html[data-theme="light"] .cursor-glow {
  background: radial-gradient(circle, rgba(8,145,178,0.07) 0%, rgba(22,163,74,0.035) 40%, transparent 70%);
}
