Tumbling marriage and birth rates are shaping the future of a country whose population was already falling.