/*
  Apple Liquid UI — animations.css
  Spring-based motion for every interactive state change. Respects
  prefers-reduced-motion globally — do not bypass this when adding new
  keyframes.
*/

/* ---------- Base transition helpers ---------- */
.motion-standard {
  transition: all var(--duration-base) var(--ease-spring-standard);
}
.motion-snappy {
  transition: all var(--duration-fast) var(--ease-spring-snappy);
}
.motion-gentle {
  transition: all var(--duration-slow) var(--ease-spring-gentle);
}

/* ---------- Press feedback — use on any tappable element ---------- */
.press-scale {
  transition: transform var(--duration-fast) var(--ease-spring-snappy),
              opacity var(--duration-fast) var(--ease-out-quick);
}
.press-scale:active {
  transform: scale(0.96);
  opacity: 0.85;
}

/* ---------- Entrance keyframes ---------- */
@keyframes sheet-rise {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes pop-in {
  0%   { opacity: 0; transform: scale(0.8); }
  60%  { opacity: 1; transform: scale(1.04); }
  100% { transform: scale(1); }
}
@keyframes backdrop-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes liquid-sheen {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes toast-drop {
  from { opacity: 0; transform: translateY(-16px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.anim-sheet-rise   { animation: sheet-rise var(--duration-slow) var(--ease-spring-standard) both; }
.anim-fade-in      { animation: fade-in var(--duration-base) var(--ease-out-quick) both; }
.anim-scale-in     { animation: scale-in var(--duration-base) var(--ease-spring-standard) both; }
.anim-pop-in       { animation: pop-in var(--duration-base) var(--ease-spring-snappy) both; }
.anim-backdrop-fade{ animation: backdrop-fade var(--duration-base) var(--ease-out-quick) both; }
.anim-toast-drop   { animation: toast-drop var(--duration-base) var(--ease-spring-standard) both; }

/* ---------- Stagger helper for lists ---------- */
.stagger > * {
  animation: fade-in var(--duration-base) var(--ease-out-quick) both;
}
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 40ms; }
.stagger > *:nth-child(3) { animation-delay: 80ms; }
.stagger > *:nth-child(4) { animation-delay: 120ms; }
.stagger > *:nth-child(5) { animation-delay: 160ms; }
.stagger > *:nth-child(6) { animation-delay: 200ms; }
.stagger > *:nth-child(n+7) { animation-delay: 240ms; }

/* ---------- Accessibility: respect reduced motion everywhere ---------- */
@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;
  }
  .glass-liquid::after {
    display: none;
  }
}
