A reptile that lived 200 million years ago is rewriting the rulebooks on how four-legged animals conquered the world.