/*
 * IWonnaP — Motion (feedback)
 * Feedback-only keyframes — bound to specific UI states:
 *   rs-pulse        right-sidebar running-event pulse (Phase 26)
 *   ef-flash        edit-field auto-save success flash (Phase 27)
 *   modal-spin      modal loading spinner (Phase 29)
 *   vault-cd-tick   vault reveal countdown ring (redesign-v2.1 screen 4)
 *   dt-pulse        calendar day-timeline live chip pulse (FB-4)
 *   dt-pop-in       calendar day-timeline popover entrance (FB-4)
 *
 * Split out of animations.css (ADR-026) so feedback motion has a dedicated home
 * and prefers-reduced-motion overrides for these states can win in the cascade.
 *
 * Load LAST in the pipeline so its reduced-motion @media overrides any
 * `animation:` declarations from earlier stylesheets.
 */

/* ═══ Right-sidebar running event pulse ════════════════ */

@keyframes rs-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); }
  70%  { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
}

/* ═══ Edit-field auto-save success flash ══════════════ */

@keyframes ef-flash {
  0%   { background: color-mix(in srgb, var(--success) 26%, transparent); }
  100% { background: transparent; }
}

/* ═══ Modal loading spinner ═══════════════════════════ */

@keyframes modal-spin {
  to { transform: rotate(1turn); }
}

/* ═══ Family-tree loading spinner ═════════════════════ */

@keyframes ft-spin {
  to { transform: rotate(1turn); }
}

/* ═══ Vault reveal countdown ring ═════════════════════ */

@keyframes vault-cd-tick {
  to { stroke-dashoffset: 270; }
}

/* ═══ Calendar timeline active-chip blink ═════════════ */

@keyframes dt-pulse {
  0%, 100% { opacity: .25; }
  50% { opacity: .9; }
}

@keyframes dt-pop-in {
  from { transform: translateY(7px); }
  to { transform: none; }
}

/* ═══ Mobile full-navigation sheet ════════════════════ */

@keyframes mnav-slide-up {
  from { transform: translateY(100%); }
  to { transform: none; }
}

/* ═══ prefers-reduced-motion ══════════════════════════
   Feedback animations stop, but the state must still be readable.
   Keep colour/border, drop motion.
*/

@media (prefers-reduced-motion: reduce) {
  .modal-loading__spinner {
    animation: none;
    border-top-color: var(--accent);
  }
  .tree-loading__spinner {
    animation: none;
    border-top-color: var(--accent);
  }
  .dt-track,
  .dt-base,
  .dt-chip,
  .dt-pop,
  .dt-toggle .chev {
    transition: none;
  }
  .dt-chip.t-active::after,
  .dt-chip.t-active .live,
  .dt-base.is-live::after,
  .dt-pop.is-shown {
    animation: none;
  }
  .vault-countdown-ring circle.fg {
    animation: none;
    stroke-dashoffset: 0;
  }
  .mnav-panel {
    animation: none !important;
    transition: none;
  }
  .mnav-scrim { transition: none; }
}
