Closed-loop systems like on the ISS already reclaim water from humidity, sweat, and urine, and could be scaled up for larger habitats. Air works similarly: CO₂ is scrubbed, oxygen is regenerated from electrolysis, and trace gases are filtered. I realize you still need an initial stock of oxygen and nitrogen, but isn’t this a problem that could be solved eventually with science?