Non-perturbative Floquet engineering of the toric-code Hamiltonian and its ground state