/* ==========================================================================
   CYBIONICA — MOTION
   Reveal-on-scroll, word fusion, live indicators. All motion is disabled
   under prefers-reduced-motion.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Live indicators
   -------------------------------------------------------------------------- */
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(var(--bio-rgb), 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(var(--bio-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--bio-rgb), 0); }
}

@keyframes live-pulse-signal {
  0%   { box-shadow: 0 0 0 0 rgba(var(--signal-rgb), 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(var(--signal-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--signal-rgb), 0); }
}

.dot--live {
  animation: live-pulse 2.4s var(--ease) infinite;
}

.readout--signal .dot--live {
  animation-name: live-pulse-signal;
}

/* Heartbeat signal on the status panel */
@keyframes sig-run {
  from { stroke-dashoffset: 140; }
  to   { stroke-dashoffset: -1000; }
}

.sig-live {
  animation: sig-run 3.4s linear infinite;
}

/* Loop outer orbit slow rotation */
@keyframes orbit-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.loop-ticks {
  transform-origin: 200px 200px;
  animation: orbit-spin 60s linear infinite;
}

/* Print and screenshot fallbacks */
@media print {
  .js [data-reveal]:not(.is-visible) {
    opacity: 1 !important;
    translate: none !important;
  }
}

/* --------------------------------------------------------------------------
   Reveal on scroll (only when JS is available)
   Uses the individual `translate` property so components keep `transform`
   free for hover effects. The zero-specificity :where() lets components
   define their own transition lists.
   -------------------------------------------------------------------------- */
:where(.js [data-reveal]) {
  transition:
    opacity 0.9s var(--ease-out) var(--reveal-delay, 0s),
    translate 0.9s var(--ease-out) var(--reveal-delay, 0s);
}

.js [data-reveal]:not(.is-visible) {
  opacity: 0;
  translate: 0 28px;
}

/* --------------------------------------------------------------------------
   Word fusion — fragments converge into CYBIONICA
   -------------------------------------------------------------------------- */
.js .fusion .fw {
  transition:
    transform 1.3s var(--ease-out),
    opacity 1.3s var(--ease-out),
    filter 1.3s var(--ease-out);
}

.js .fusion .fw--bion { transition-delay: 0.12s; }
.js .fusion .fw--ica  { transition-delay: 0.24s; }

.js .fusion:not(.is-visible) .fw {
  opacity: 0;
  filter: blur(10px);
}

.js .fusion:not(.is-visible) .fw--cy   { transform: translateX(-0.7em); }
.js .fusion:not(.is-visible) .fw--bion { transform: translateY(0.4em); }
.js .fusion:not(.is-visible) .fw--ica  { transform: translateX(0.7em); }

.js .fusion .fusion-line span:not(.fusion-plus) {
  transition: transform 1.1s var(--ease-out) 0.45s;
}

.js .fusion .fusion-plus {
  transition: opacity 0.6s var(--ease) 0.9s;
}

.js .fusion:not(.is-visible) .fusion-line span:not(.fusion-plus) {
  transform: scaleX(0);
}

.js .fusion:not(.is-visible) .fusion-plus {
  opacity: 0;
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .js [data-reveal]:not(.is-visible) {
    opacity: 1;
    translate: none;
  }

  .js .fusion:not(.is-visible) .fw,
  .js .fusion:not(.is-visible) .fusion-plus {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .js .fusion:not(.is-visible) .fusion-line span:not(.fusion-plus) {
    transform: none;
  }

  .sig-live {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
  }

  .hero-hint {
    display: none;
  }
}
