Step roots of Littlewood polynomials and the extrema of functions in the Takagi class