A bimodular mechanism of calcium control in eukaryotes