A single-locus model of speciation