Area minimizing hypersurfaces modulo $p$: a geometric free-boundary problem