A consumption-based theory of the environmental Kuznets curve