Solution (source code)

= Solution

Use the orthonormal right-handed basis
$$
u=\frac1{\sqrt2}(1,1,0)^T,\qquad
v=\frac1{\sqrt2}(-1,1,0)^T,\qquad w=(0,0,1)^T.
$$
Direct multiplication gives $B(r)u=u$, $B(r)v=rv+w/\sqrt2$ and $B(r)w=-v/\sqrt2+rw$. Thus the matrix in this basis is
$$
\begin{pmatrix}1&0&0\\0&r&-1/\sqrt2\\0&1/\sqrt2&r\end{pmatrix}.
$$
The last two columns are <orthogonal> and both have squared <norm> $r^2+1/2$. Therefore $B(r)$ is an <orthogonal matrix> precisely when $r^2+1/2=1$, giving the unique positive value
$$
\boxed{r_0=1/\sqrt2.}
$$
Its determinant is $r_0^2+1/2=1$, so it is a proper <rotation matrix>, not a reflection. The transverse block has cosine and sine both $1/\sqrt2$. Consequently
$$
\boxed{\text{axis }\{t(1,1,0):t\in\mathbb R\},\qquad\text{angle }\pi/4.}
$$
With the oriented axis $u$, the angle is positive by the right-hand rule, since $u\times v=w$. The axis also follows from the unit-<eigenvalue> eigenspace. As a check, $\operatorname{tr}B(r_0)=1+\sqrt2=1+2\cos(\pi/4)$.