Maximally Orthogonal High-Order Basis Functions Have a Well-Conditioned Gram Matrix