High-harmonic generation by a highly non-linear interaction of infrared laser fields with matter allows for the generation of attosecond pulses in the XUV spectral regime. This process, well established for atoms, has been recently extended to the condensed phase. Remarkably well pronounced harmonics up to order ~30 have been observed for dielectrics. We present the first ab-initio multi-scale simulation of solid-state high-harmonic generation. We find that mesoscopic effects of the extended system, in particular the realistic sampling of the entire Brillouin zone, the pulse propagation in the dense medium, and the inhomogeneous illumination of the crystal have a strong effect on the formation of clean harmonic spectra. Our results provide a novel explanation for the formation of clean harmonics and have implications for a wide range of non-linear optical processes in dense media.