Organism–environment interactions in a changing world: a mechanistic approach