/* Consuma Design System — assistant / chat motion utilities.
   Home for the animation *classes* the chat components reference (the tokens
   for easings/durations live in spacing.css). Imported by styles.css so the
   classes resolve in Design-System cards AND consuming pages, not just the
   Chat Interface template. */

/* ── Message + block entrances ─────────────────────────────────────────── */
@keyframes csMsgEnter    { from { opacity: 0; transform: translateY(8px); }            to { opacity: 1; transform: translateY(0); } }
@keyframes csStatusEnter { from { opacity: 0; transform: translateY(4px); }            to { opacity: 1; transform: translateY(0); } }
@keyframes csBlockEnter  { from { opacity: 0; transform: translateY(10px) scale(0.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
.cs-msg-enter    { animation: csMsgEnter    0.42s var(--ease-out) both; }
.cs-status-enter { animation: csStatusEnter 0.28s ease both; }
.cs-block-enter  { animation: csBlockEnter  0.45s var(--ease-out) both; }

/* ── Ghost treatment (ActivityTimeline) — rests faded, wakes on hover/pin ── */
.cs-ghost { opacity: 0.55; transition: opacity 0.18s var(--ease-out); }
.cs-ghost:hover, .cs-ghost.cs-ghost-pinned { opacity: 1; }

/* ── Small "working" pip (fallback bullet) ─────────────────────────────── */
@keyframes csRing { 0%, 100% { transform: scale(0.8); opacity: 0.25; } 50% { transform: scale(1.2); opacity: 0.6; } }
@keyframes csCore { 0%, 100% { opacity: 0.45; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1); } }
@keyframes csDot  { 0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); } 40% { opacity: 0.85; transform: scale(1); } }
.cs-ring  { animation: csRing 1.5s ease-in-out infinite; }
.cs-core  { animation: csCore 1.5s ease-in-out infinite; }
.cs-dot-0 { animation: csDot 1.4s ease-in-out infinite; }
.cs-dot-1 { animation: csDot 1.4s ease-in-out 0.2s infinite; }
.cs-dot-2 { animation: csDot 1.4s ease-in-out 0.4s infinite; }

/* ── Living logo mark ──────────────────────────────────────────────────── */
/* The Consuma lens "breathes" and gently scans while the assistant is
   working, wrapped in a soft violet halo that pulses in sympathy. */
@keyframes csMarkLive {
  0%   { transform: scale(0.9)  rotate(-5deg); }
  50%  { transform: scale(1.05) rotate(5deg); }
  100% { transform: scale(0.9)  rotate(-5deg); }
}
@keyframes csAura {
  0%, 100% { opacity: 0.3;  transform: scale(0.82); }
  50%      { opacity: 0.72; transform: scale(1.14); }
}
.cs-mark-live { animation: csMarkLive 2.4s ease-in-out infinite; transform-origin: 50% 50%; }
.cs-aura      { animation: csAura     2.4s ease-in-out infinite; transform-origin: 50% 50%; }
/* one-shot pop when the mark settles into a finished turn */
@keyframes csMarkIn { from { opacity: 0; transform: scale(0.6) rotate(-16deg); } to { opacity: 1; transform: none; } }
.cs-mark-in { animation: csMarkIn 0.5s var(--ease-out) both; transform-origin: 50% 50%; }

/* ── Streaming text — soft blur+fade ramp at the leading edge ──────────── */
/* Each word mounts as tokens are revealed; because every word animates for
   ~0.42s while new ones arrive every ~28ms, the last dozen words form a
   smooth opacity/blur ramp — the "text materialising" feel. */
@keyframes csWordIn { from { opacity: 0; filter: blur(5px); } to { opacity: 1; filter: blur(0); } }
.cs-word { animation: csWordIn 0.42s var(--ease-out) both; }

/* ── Send sweep ─ one rapid gradient pass across the composer on submit ── */
@keyframes csSendSweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.cs-send-sweep { animation: csSendSweep 1s var(--ease-out) both; }

/* ── Sources appearing ─────────────────────────────────────────────────── */
/* inline citation pill settling in when a claim completes */
@keyframes csCiteIn { from { opacity: 0; transform: translateY(3px) scale(0.85); } to { opacity: 1; transform: none; } }
.cs-cite-in { animation: csCiteIn 0.36s var(--ease-out) both; }
/* source cards rising in a quick stagger (delay set per-chip inline) */
@keyframes csSrcChip { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.cs-src-chip { animation: csSrcChip 0.4s var(--ease-out) both; }

@media (prefers-reduced-motion: reduce) {
  .cs-ring, .cs-core, .cs-dot-0, .cs-dot-1, .cs-dot-2,
  .cs-mark-live, .cs-aura { animation: none; }
  .cs-send-sweep { animation: none; visibility: hidden; }
  /* keep content visible: skip straight to the resolved state */
  .cs-word, .cs-cite-in, .cs-src-chip, .cs-mark-in,
  .cs-msg-enter, .cs-status-enter, .cs-block-enter { animation-duration: 0.001s; }
}
