Hypnagogia

Hypnagogia is the transitional state from wakefulness to sleep, also defined as the waning state of consciousness during the onset of sleep. Its opposite state is described as hypnopompia – the transitional state from sleep into wakefulness. Mental phenomena that may occur during this "threshold consciousness" phase include hypnagogic hallucinations, lucid dreaming, and sleep paralysis.