Why San Francisco is a nightmare, according to science