/* Micro interactions. Transform and opacity only. */
.press {
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-med) var(--ease), background-color var(--t-med) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .press:hover:not([aria-disabled='true']):not(:disabled) {
    transform: translateY(-2px);
  }
}
.press:active:not([aria-disabled='true']):not(:disabled) {
  transform: scale(0.97);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes pop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes draw {
  to { stroke-dashoffset: 0; }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.enter { animation: rise var(--t-slow) var(--ease) both; }
.stagger > * { animation: rise var(--t-slow) var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.pop { animation: pop var(--t-med) var(--ease) both; }
.shake { animation: shake 320ms var(--ease); }

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: 14px;
}

.spinner {
  width: 1.1em; height: 1.1em; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  display: inline-block; animation: spin 700ms linear infinite; vertical-align: -0.15em;
}

.check path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw 420ms var(--ease) 80ms forwards; }

::view-transition-old(root) { animation: fade 140ms var(--ease) reverse both; }
::view-transition-new(root) { animation: fade 220ms var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .press:hover, .press:active { transform: none !important; }
  .skeleton { animation: none; }
}
