/* Codex map reveal — GPU-friendly strokes + transforms only */

#map-modal.codex-live #lore-svg.codex-animating .codex-scan {
  opacity: 1;
  animation: codex-scan-sweep 2.4s ease-out forwards;
}

#map-modal.codex-live #lore-svg.codex-animating .codex-rose {
  animation: codex-rose-spin 48s linear infinite;
}

#map-modal.codex-live #lore-svg.codex-animating .lore-link {
  animation: codex-draw-link 1.1s ease-out forwards;
}

#map-modal.codex-live #lore-svg.codex-animating .map-node-group {
  animation: codex-node-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  opacity: 0;
}

#map-modal.codex-live #lore-svg.codex-animating .map-node-group .lore-node-circle {
  animation: codex-node-pulse 3.2s ease-in-out 0.8s infinite;
}

#map-modal.codex-live #lore-svg.codex-animating .map-node-group.map-active .lore-node-circle {
  animation: codex-node-active 1.4s ease-in-out infinite;
}

@keyframes codex-draw-link {
  to {
    stroke-dashoffset: 0;
    stroke-opacity: 1;
  }
}

@keyframes codex-node-in {
  from {
    opacity: 0;
    transform: scale(0.55);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes codex-node-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}

@keyframes codex-node-active {
  0%, 100% {
    stroke-width: 2;
    filter: brightness(1.2);
  }
  50% {
    stroke-width: 3.5;
    filter: brightness(1.45);
  }
}

@keyframes codex-rose-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes codex-scan-sweep {
  0% {
    opacity: 0;
    transform: translateY(-120px);
  }
  15% { opacity: 0.35; }
  100% {
    opacity: 0;
    transform: translateY(920px);
  }
}

.codex-scan {
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  #map-modal.codex-live #lore-svg.codex-animating .lore-link,
  #map-modal.codex-live #lore-svg.codex-animating .map-node-group,
  #map-modal.codex-live #lore-svg.codex-animating .codex-rose,
  #map-modal.codex-live #lore-svg.codex-animating .codex-scan {
    animation: none !important;
    opacity: 1 !important;
    stroke-dashoffset: 0 !important;
    transform: none !important;
  }
}
