Evolutionary ecology of an extended phenotype: nest design and function in a variable environment