Elements needed to derive the Riemann-Siegel Z function On this post I got a comment to motivate the present question:

To prove a zero $\zeta(s_0)=0, s_0 \approx 1/2+iy$ is exactly on the critical line, it is enough to prove the real function $Z(t) = \zeta(1/2+it) e^{i \,\text{arg}(\Gamma(1/4+it/2)}\, \pi^{-it/2}$ changes of sign around $t=y$. We know $Z(t)$ is real for $t$ real thanks to the functional equation.

So I would like to ask for some help understanding where the expression
$$\large Z(t) = \zeta\left(\frac{1}{2}+it\right)\quad e^{i \;\text{arg}\left(\Gamma(\frac{1}{4}+\frac{it}{2})\right)}\quad \pi^{\frac{-it}{2}}\tag 1$$
comes from.
The terser version $Z(t)=\zeta\left(\frac{1}{2}+it\right)\; e^{i\theta(t)}$ becomes Eq. $(1)$ when $\theta(t)$ is unfolded:
$$\theta(t)= \Im\left(\ln\Gamma\left(\frac{1}{4}+\frac{it}{2} \right) \right)-\frac{t}{2}\ln(\pi)$$

The closest I got digging out online material for the amateur math curious is the following, probably related, equation of the Riemann functional:
$$\large \pi^{\frac{-s}{2}}\Gamma\left(\frac{s}{2}\right)\,\zeta(s)=\pi^{-\frac{1-s}{2}}\Gamma\left(\frac{1-s}{2}\right)\,\zeta(1-s)$$
 A: The Riemann functional
$$\large \pi^{\frac{-s}{2}}\Gamma\left(\frac{s}{2}\right)\,\zeta(s)=\pi^{-\frac{1-s}{2}}\Gamma\left(\frac{1-s}{2}\right)\,\zeta(1-s)$$
relates $\zeta(s)$ to $\zeta(s-1)$, as a fraction expressed as
$$\chi(s) = \frac{\zeta(s)}{\zeta(s-1)}
=\frac{\Gamma\left(\frac{1}{2}(1-s)\right)}{\Gamma\left(\frac{1}{2} s \right)}\; \pi^{s-1/2}$$
But we are interested in $s = \frac{1}{2} + it$. Therefore,
$$\begin{align}
\chi\left(\frac{1}{2} + it \right)
&=\frac{\Gamma\left(\frac{1}{2}\,\left(1 - \left(\frac{1}{2}+it\right)\right) \right)}{\Gamma \left( \frac{1}{2}\,\left(\frac{1}{2}+it \right)\right)}
\,\pi^{\left(\frac{1}{2}+it\right)-\frac{1}{2}}\\[2ex]
&= \frac{\Gamma\left(\frac{1}{4} - \frac{it}{2} \right)}{\Gamma \left( \frac{1}{4}+\frac{it}{2}\right)}
\,\pi^{it}
\end{align}$$
Now comes the definition of the Riemann-Siegel or Hardy Z-function:
$$Z(t) := \zeta\left(\frac{1}{2}+it\right)\;\left[\chi\left(\frac{1}{2} + it \right)\right]^{-1/2}$$
Substituting,
$$\begin{align}
Z(t) &= \zeta \left(\frac{1}{2}+it\right)\left(
\frac{\Gamma\left(\frac{1}{4} - \frac{it}{2} \right)}{\Gamma \left( \frac{1}{4}+\frac{it}{2}\right)}
\right)^{-1/2}\; \,\pi^{\frac{-it}{2}}\\[2ex]
&=\zeta \left(\frac{1}{2}+it\right)\color{blue}{
\frac{\Gamma^{1/2} \left( \frac{1}{4}+\frac{it}{2}\right)}{\Gamma^{1/2}\left(\frac{1}{4} - \frac{it}{2} \right)}}
\;\pi^{\frac{-it}{2}}\\[2ex]
&= \zeta \left(\frac{1}{2}+it\right)\color{blue}{\sqrt{\frac{\Gamma \left( \frac{1}{4}+\frac{it}{2}\right)}{\Gamma\left(\frac{1}{4} - \frac{it}{2} \right)}}}
\;\pi^{\frac{-it}{2}}\\[2ex]
&= \zeta \left(\frac{1}{2}+it\right)\color{blue}{e^{i\,\arg\left(\Gamma\left(\frac{1}{4}+\frac{it}{2}\right)\right)}}
\;\pi^{\frac{-it}{2}}
\end{align}$$
So, how to see that
$$\color{blue}{\sqrt{\frac{\Gamma \left( \frac{1}{4}+\frac{it}{2}\right)}{\Gamma\left(\frac{1}{4} - \frac{it}{2} \right)}}}=\color{blue}{e^{i\,\arg\left(\Gamma\left(\frac{1}{4}+\frac{it}{2}\right)\right)}}$$?
The argument of a complex number $z = x + i y=\rho\ e^{i\theta}$
$$\theta = \arg(z)= \frac{1}{i}\log\sqrt{\frac{z}{\bar z}}=\frac{\log z - \log \bar z}{2i}$$
so we can modify
$$\frac{\Gamma^{1/2} \left( \frac{1}{4}+\frac{it}{2}\right)}{\Gamma^{1/2}\left(\frac{1}{4} - \frac{it}{2} \right)}= \sqrt{\frac{\Gamma \left( \frac{1}{4}+\frac{it}{2}\right)}{\Gamma\left(\frac{1}{4} - \frac{it}{2} \right)}}$$
Now $\Gamma\left(\frac{1}{4} - \frac{it}{2}\right)$ is the complex conjugate of $\Gamma\left(\frac{1}{4} + \frac{it}{2}\right)$, acknowledging the comment by Daniel Fischer on this post:

From whichever definition of $\Gamma$ you use, it should be easy to see that $\Gamma(x) \in \mathbb R$ for positive real $x$. So the two entire meromorphic functions $f \colon z \mapsto \Gamma(z)$ and $g \colon z \mapsto \overline{\Gamma(\overline{z})}$ coincide on a set that has an accumulation point in the domain where they are holomorphic. By the identity theorem, $f \equiv g$.

Hence,
$$\arg\left(\Gamma\left(\frac{1}{4} + \frac{it}{2}\right)\right)=\frac{1}{i}\;\log\left(\sqrt{\frac{\Gamma \left( \frac{1}{4}+\frac{it}{2}\right)}{\Gamma\left(\frac{1}{4} - \frac{it}{2} \right)}}\right)$$
and
$$\exp\left[i\;{\arg\left(\Gamma\left(\frac{1}{4} + \frac{it}{2}\right)\right)}\right]
=\exp\left[i\;{\frac{1}{i}\;\log\left(\sqrt{\frac{\Gamma \left( \frac{1}{4}+\frac{it}{2}\right)}{\Gamma\left(\frac{1}{4} - \frac{it}{2} \right)}}\right)}\right]$$
Finally,
$$\color{blue}{e^{i\,\arg\left(\Gamma\left(\frac{1}{4}+\frac{it}{2}\right)\right)}}=\color{blue}{\sqrt{\frac{\Gamma \left( \frac{1}{4}+\frac{it}{2}\right)}{\Gamma\left(\frac{1}{4} - \frac{it}{2} \right)}}}\quad\square$$
Now, of course, the most intriguing part, after all this algebra is the origin of the definition of the Hardy Z-function. So back to square one!
