Primordial origins of Earth's carbon