Rack middleware sits between the web server and Rails application, providing a hook for cross-cutting concerns like request logging, metrics collection, or custom authentication. I use middleware to inject request IDs, track response times, or enforce