Environment determines evolutionary trajectory in a constrained phenotypic space