Let A = \(\left[
\begin{array}{c}
a_1 \\
a_2
\end{array}
\right]\) and B = \(\left[
\begin{array}{c}
b_1 \\
b_2
\end{array}
\right]\) be two 2 × 1 matrices with real entries such that A = XB, where \(X=\frac{1}{\sqrt{3}}\)\(\left[
\begin{array}{c}
1 & -1\\
1 & k
\end{array}
\right],\) and k \(\in\) R. If
\(a^2_1+a^2_2=\frac{2}{3}(b^2_1+b^2_2)\) and \((k^2+1)b^2_2\neq -2b_1b_2,\) then the value of k is _______.