Ontogenetic trait variation influences tree community assembly across environmental gradients