Gaussian-based multiconfiguration time-dependent Hartree: A two-layer approach. I. Theory | Synapse