Spontaneous stratification in granular mixtures