A unified theory of urban living