Unified origin for the 3D magnetism and superconductivity in NaxCoO2.