Modeling maladaptation in the inequality–environment nexus