Sand is blown across beaches and deserts by turbulent winds. This seemingly chaotic process creates two dominant bedforms: decametre-scale dunes and centimetre-scale ripples, but hardly anything in between. By the very same process, grains are constantly sorted. Smaller grains advance faster, while heavier grains trail behind. Here, we argue that, under erosive conditions, sand sorting and structure formation can conspire to create distinct bedforms in the 'forbidden wavelength gap' between aeolian ripples and dunes. These so-called megaripples are shown to co-evolve with an unusual, predominantly bimodal grain-size distribution. Combining theory and field measurements, we develop a mechanistic understanding of their formation, shape and migration, as well as their cyclic ageing, renewal and sedimentary memory, in terms of the intermittent wind statistics. Our results demonstrate that megaripples exhibit close similarities to dunes and can indeed be mechanistically characterized as a special type of ('reptation') dune.