'Environment-dependent trade-offs and phenotypic plasticity in metamorphic timing