/* ==========================================================================
   Motion — one orchestrated entrance, everything else responds to the user
   ========================================================================== */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.boot > * { animation: rise 600ms var(--ease-out) both; }
.boot > *:nth-child(1) { animation-delay: 40ms; }
.boot > *:nth-child(2) { animation-delay: 140ms; }

/* A single sweep across the console when the widget finishes loading */
@keyframes sweep {
  0%   { transform: translateX(-100%); opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translateX(220%); opacity: 0; }
}
.console::after {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 40%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--dl-soft), transparent);
  opacity: 0;
}
.console[data-booting='true']::after { animation: sweep 1100ms var(--ease) 1; }

/* The brand mark pulses only while something is actually running */
@keyframes pulse {
  0%, 100% { opacity: 0.35; r: 3; }
  50%      { opacity: 1; r: 4.6; }
}
body[data-testing='true'] .brand-mark .pulse,
body[data-measuring='true'] .brand-mark .pulse { animation: pulse 1.2s var(--ease) infinite; }

/* The probe currently being measured */
@keyframes probe-scan {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}
.probe[data-state='busy'] .probe-bar {
  position: relative;
  overflow: hidden;
}
.probe[data-state='busy'] .probe-bar::after {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 25%;
  background: linear-gradient(90deg, transparent, var(--lat), transparent);
  animation: probe-scan 1s linear infinite;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.toast { animation: toast-in 240ms var(--ease-out); }

@keyframes shimmer { to { background-position-x: -200%; } }
.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--panel-2) 40%, var(--panel) 50%, var(--panel-2) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  color: transparent;
  min-height: 1em;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
