Period domains $D$ can be described as certain analytic open sets of flag varieties; due to the presence of monodromy, however, the period map of a family of algebraic varieties lands in a quotient $D/\Gamma$ by an arithmetic group. In the very special case when $D/\Gamma$ is itself algebraic, understanding the interaction between algebraic structures on the source and target of the uniformization $D\rightarrow D/\Gamma$ is a crucial component of the modern approach to the Andr\'e-Oort conjecture. We prove a version of the Ax-Schanuel conjecture for general period maps $X\rightarrow D/\Gamma$ which says that atypical algebraic relations between $X$ and $D$ are governed by Hodge loci. We will also discuss some geometric and arithmetic applications. This is joint work with J. Tsimerman.