  We prove a Cohen-Macaulay version of a result by Avramov-Golod and
Frankild-J{\o}rgensen about Gorenstein rings, showing that if a noetherian ring
$A$ is Cohen-Macaulay, and $a_1,\dots,a_n$ is any sequence of elements in $A$,
then the Koszul complex $K(A;a_1,\dots,a_n)$ is a Cohen-Macaulay DG-ring. We
further generalize this result, showing that it also holds for commutative
DG-rings. In the process of proving this, we develop a new technique to study
the dimension theory of a noetherian ring $A$, by finding a Cohen-Macaulay
DG-ring $B$ such that $\mathrm{H}^0(B) = A$, and using the Cohen-Macaulay
structure of $B$ to deduce results about $A$. As application, we prove that if
$f:X \to Y$ is a morphism of schemes, where $X$ is Cohen-Macaulay and $Y$ is
nonsingular, then the homotopy fiber of $f$ at every point is Cohen-Macaulay.
As another application, we generalize the miracle flatness theorem.
Generalizations of these applications to derived algebraic geometry are also
given.
