import { useMemo } from 'react';

/**
 * Stable prefers-reduced-motion check.
 * Uses useMemo so it only re-evaluates when the media query actually changes.
 */
export function useReducedMotion(): boolean {
  return useMemo(
    () => window.matchMedia('(prefers-reduced-motion: reduce)').matches,
    [],
  );
}
