Gradient at a point is perpendicular to the level curve, but not always? I've been trying to geometrically understand why the gradient always points to the direction of steepest ascend, but I found it hard to understand, especially because I found a real life counter example (which is obviously wrong, but I need to find out why). Here it is.

If I had a topographical map, where the red lines are level curves, the gradient on the blue point should be perpendicular to that place on the level curve. However, the steepest climb is not in the perpendicular diraction, but rather a bit to the left or a bit to the right. This can, I believe, also be applied to infinitesimal differences in functions. So I ask: where is my intuition wrong?
 A: Suppose $f\colon M\to \mathbb{R}^{k}$ is $C^2$ and the level set $S$ is given by all points $x$ in a Riemannian manifold $(M,g)$ such that $f(x)=c$. If $c$ is a regular value of $f$ (i.e. its differential at at any point $x$ of the preimage of $c$ has full rank) then $S$ is a submanifold of $M$ of dimension $dim(M)-k$.
Consider a point $x$ on $S$ and a tangent vector $v$ in $T_xS$ and some curve $\gamma\colon (-\epsilon,\epsilon)\to S$ in direction $v$, starting at $x$. Then $$
\mathrm{d}f_{x}(v)=\tfrac{\mathrm{d}}{\mathrm{d}t}|_{t=0} f(\gamma(t))=\tfrac{\mathrm{d}}{\mathrm{d}t}|_{t=0} c=0.
$$
By definition of the gradient
$$
g_{x}(\mathrm{grad}f_{x}, v)=\mathrm{d}f_{x}(v)=0.
$$
Since $v$ was arbitrary you have that the gradient at $x$ is perpendicular to the tangent space at $x$. Since this holds for all points on $S$ you have shown that the gradient is a vector field along the level set $S$ that is everywhere perpendicular to $S$.
A: If that can convince you, the plot below shows four level curves of the function $$f(x,y)=(x^2+1)y.$$
And crossing them, there are four curves orthogonal to them, with equation
$$y=\sqrt{\frac{x^2}2+\log x+C}.$$

