Integrating natural and sexual selection across the biphasic life cycle