  We analyse the internal structure and dynamics of cosmic-web filaments that
connect massive high-$z$ haloes. Our analysis is based on a high-resolution
AREPO cosmological simulation zooming-in on a volume encompassing three ${\rm
Mpc}$-scale filaments feeding three massive haloes of $\sim
10^{12}\,\text{M}_\odot$ at $z \sim 4$, embedded in a large-scale sheet. Each
filament is surrounded by a cylindrical accretion shock of radius $r_{\rm
shock} \sim 50 \,{\rm kpc}$. The post-shock gas is in virial equilibrium with
the potential well set by an isothermal dark-matter filament. The filament
line-mass is $\sim 9\times 10^8\,\text{M}_\odot\,{\rm kpc}^{-1}$, the gas
fraction within $r_{\rm shock}$ is the universal baryon fraction, and the
virial temperature is $\sim 7\times 10^5 {\rm K}$. In the outer ''thermal'' (T)
zone, $r \geq 0.65 \, r_{\rm shock}$, inward gravity and ram-pressure forces
are over-balanced by outwards thermal pressure forces, decelerating the
inflowing gas expanding the shock outward. In the intermediate ''vortex'' (V)
zone, $0.25 \leq r/ r_{\rm shock} \leq 0.65$, the velocity field is dominated
by a quadrupolar vortex structure due to offset inflow along the sheet through
the post-shock gas. The outwards force is dominated by centrifugal forces
associated with these vortices, with additional contributions from global
rotation and thermal pressure. The shear and turbulent forces associated with
the vortices act inward. The inner ''stream'' (S) zone, $r < 0.25 \, r_{\rm
shock}$, is a dense isothermal core, $T\sim 3 \times 10^4 \, {\rm K}$ and
$n_{\rm H}\sim 0.01 \,{\rm cm^{-3}}$, defining the cold streams that feed
galaxies. The core is formed by an isobaric cooling flow and is associated with
a decrease in outwards forces, though it exhibits both inflows and outflows.
[abridged]
