Scalable Principal-Agent Contract Design via Gradient-Based Optimization