How Catalonia could be a state