Microscopic dynamics of a phse transition: equilibrium vs out-of-equilibrium regime