Coupled-mode equations for deep nonlinear gratings