Simulating the observed negative correlation between bolometric luminosity and gas-phase metallicity, driven by AGN feedback and gas depletion.