// Package ratelimit implements a sliding window rate limiter using
// Redis-like semantics but backed by a sync.Map for in-process use.
//
// Unlike token bucket (bursty) or fixed window (boundary spikes),
// sliding window gives smooth, predictable rate limiting. It counts
// requests in the current window proportionally blended with the
// previous window.
//
// Example: 100 req/min limit. At t=0:45 (45s into current window),
// previous window had 80 requests, current window has 30.
// Weighted count = 80 * (15/60) + 30 = 50. Under limit, allow.
ratelimit.go