The environmental geochemistry of mineral deposits