Intraspecific variation in traits in relation to environment and sex in an insect