Economic and ecological trade-offs of agricultural specialization at different spatial scales