  The proalgebraic fundamental group of a connected topological space $X$,
recently introduced by the first author, is an affine group scheme whose
representations classify local systems of finite-dimensional vector spaces on
$X$. In this article, we further develop the theory of the proalgebraic
fundamental group, in particular, we establish homotopy invariance and a
Seifert-van Kampen theorem. To facilitate the latter, we study amalgamated free
product of affine group schemes. We also compute the proalgebraic fundamental
group of the arithmetically relevant Kucharcyzk-Scholze spaces and compare it
to the motivic Galois group.
