/* Keyframes + motion. Quiet, editorial easing throughout.
   All entrance motion is disabled under reduced-motion. */

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.97) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes tl-reveal {
  from { opacity: 0; }
  to { opacity: 1; transform: translateX(0); }
}

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

@keyframes bar-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes path-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes node-pop {
  from { opacity: 0; transform: scale(0.4); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Timeline light wave — a soft sliver of light gliding down the spine. */
@keyframes tl-pulse-flow {
  0% { top: -26px; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 1.5px solid rgba(0, 0, 0, 0.25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* SVG entrance helpers (applied by renderers) */
.draw-path {
  stroke-dasharray: var(--path-len, 600);
  stroke-dashoffset: var(--path-len, 600);
  animation: path-draw 0.7s cubic-bezier(0.3, 0, 0.2, 1) forwards;
}
.pop-node {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: node-pop 0.3s cubic-bezier(0.2, 0.6, 0.2, 1) forwards;
}

/* Revisiting a lens already seen for this dataset: no entrance replay — the
   view is simply there. Same recipe as reduced-motion, scoped to the canvas,
   and only touching entrance animations (hover/state transitions are exempt). */
.no-anim *, .no-anim *::before, .no-anim *::after {
  animation-duration: 0.01ms !important;
  animation-delay: 0ms !important;
}
.no-anim .tl-item, .no-anim .data-card, .no-anim .pop-node { opacity: 1 !important; transform: none !important; }
.no-anim .draw-path { stroke-dashoffset: 0 !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  .tl-item, .data-card, .pop-node { opacity: 1 !important; transform: none !important; }
  .draw-path { stroke-dashoffset: 0 !important; }
}
