Hybrid dynamics as a constrained quantum system