  A new scenario for neutron-star cooling is proposed, based on the
correspondence between pion condensation, occurring in neutron matter due to
critical spin-isospin fluctuations, and the metal-insulator phase transition in
a two-dimensional electron gas. Beyond the threshold density for pion
condensation, where neutron-star matter loses its spatial homogeneity, the
neutron single-particle spectrum acquires an insulating gap that quenches
neutron contributions to neutrino-production reactions and to the star's
specific heat. In the liquid phase at densities below the transition point,
spin-isospin fluctuations are found to play dual roles. On the one hand, they
lead to a multi-sheeted neutron Fermi surface that extends to low momenta,
thereby activating the normally forbidden direct-Urca cooling mechanism; on the
other, they amplify the nodeless $P$-wave neutron superfluid gap while
suppressing $S$-wave pairing. In this picture, lighter stars without a
pion-condensed core experience slow cooling, while enhanced cooling occurs in
heavier stars through direct-Urca emission from a narrow shell of the interior.
