Coevolution of metal availability and nitrogen assimilation in cyanobacteria and algae