A Statistical Physics of Language Model Reasoning