Weyl-invariant Einstein-Cartan gravity: unifying the strong CP and hierarchy puzzles