/*
 * motion.css — easing, duration, keyframes, skeleton shimmer.
 * duration-fast/normal/slow는 product.css에 이미 있다 — 여기서는 확장분만 정의한다.
 */

:root {
  /* ===== Easing ===== */
  --ease-standard: cubic-bezier(0.2, 0, 0.13, 1); /* @kind other */
  --ease-decelerate: cubic-bezier(0, 0, 0.2, 1); /* @kind other */
  --ease-accelerate: cubic-bezier(0.4, 0, 1, 1); /* @kind other */
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1); /* @kind other */
  --ease-linear: linear; /* @kind other */

  /* ===== Duration (product.css의 fast 150 / normal 300 / slow 500 확장) ===== */
  --duration-instant: 75ms; /* @kind other */
  --duration-slower: 800ms; /* @kind other */

  /* ===== Composed transitions ===== */
  --transition-colors: color var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard); /* @kind other */
  --transition-transform: transform var(--duration-normal) var(--ease-standard); /* @kind other */
  --transition-opacity: opacity var(--duration-fast) var(--ease-standard); /* @kind other */

  /* ===== Overlay motion ===== */
  --motion-overlay-in: ds-fade-in var(--duration-fast) var(--ease-decelerate); /* @kind other */
  --motion-panel-in: ds-scale-in var(--duration-normal) var(--ease-spring); /* @kind other */
  --motion-toast-in: ds-toast-in var(--duration-normal) var(--ease-decelerate); /* @kind other */
  --motion-menu-in: ds-slide-down var(--duration-fast) var(--ease-decelerate); /* @kind other */
  --skeleton-shimmer-duration: 1400ms; /* @kind other */
}

@keyframes ds-fade-in { from { opacity: 0 } to { opacity: 1 } }
@keyframes ds-fade-out { from { opacity: 1 } to { opacity: 0 } }
@keyframes ds-slide-up { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
@keyframes ds-slide-down { from { opacity: 0; transform: translateY(-6px) } to { opacity: 1; transform: none } }
@keyframes ds-scale-in { from { opacity: 0; transform: scale(0.96) translateY(6px) } to { opacity: 1; transform: none } }
@keyframes ds-toast-in { from { opacity: 0; transform: translateY(12px) scale(0.98) } to { opacity: 1; transform: none } }
@keyframes ds-spin { to { transform: rotate(360deg) } }
@keyframes ds-shimmer { from { background-position: 200% 0 } to { background-position: -200% 0 } }
@keyframes ds-pulse { 0%, 100% { opacity: 1 } 50% { opacity: 0.45 } }

/* ===== Skeleton ===== */
.ds-skeleton {
  background-size: 200% 100%;
  animation: ds-shimmer var(--skeleton-shimmer-duration) var(--ease-linear) infinite;
  border-radius: 4px;
}
.ds-spinner {
  display: inline-block; width: 16px; height: 16px; border-radius: 999px;
  border: 2px solid transparent;
  animation: ds-spin var(--duration-slower) var(--ease-linear) infinite;
}

/* ===== Reduced motion — 접근성 필수 ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
