Rising longevity, fertility dynamics, and R&D-based growth