Let $\nabla$ denote de Levi-Civita connection on a spacelike surface $S$ in Lorentz-Minkowski space $\mathbb{L}^3$. Let $N$ denote the unit normal vector field, $X$ a tangent vector field and $a$ a fixed vector in $\mathbb{L^3}$.
Going over a paper it is claimed that the gradient of the function $f:S \rightarrow \mathbb{R}$ given by $f = \langle N, a \rangle$ is $$ \text{grad}(f) = \text{grad}\langle N,a\rangle -A(a^T) $$ And I found a proof of this in a thesis provided by my professor. However, one step is still not clear. The proof goes as follows: \begin{align} \langle \text{grad} \langle N,a \rangle, X\rangle & = X\langle N,a\rangle \\ & = \langle \nabla_XN,a\rangle + \langle N, \nabla_Xa \rangle \\ & = \langle -AX, a \rangle + \langle N, \nabla_Xa \rangle \\ & = \langle -AX, a \rangle + \langle N, X \rangle \\ & = \langle X, -Aa\rangle + 0 \\ & = -\langle X,Aa \rangle \\ & = -\langle Aa, X \rangle \end{align} This way we have that $\text{grad}(f) = -A(a^T)$.
I specifically do not understand where the fourth step comes from the third. And to be honest, I also do not fully understand thte conclusion - but I assume this comes from the fact that $X$ is a tangent vector field.
P.S. This is in a Lorentzian context but I believe the same should be true over any Riemannian Surface.