Ocean acidification can mediate biodiversity shifts by changing biogenic habitat