How do the suprachiasmatic nucleus of the hypothalamus

Can you delve into the physiological mechanisms underlying the regulation of sleep-wake cycles, including the roles of circadian rhythms, sleep stages, and neurotransmitters such as melatonin, serotonin, and adenosine? How do the suprachiasmatic nucleus of the hypothalamus and the pineal gland synchronize the body’s internal clock with external light-dark cycles, leading to the rhythmic release of melatonin and the promotion of sleep onset? Additionally, how do changes in brain activity, neurotransmitter levels, and autonomic functions across different sleep stages, such as REM (rapid eye movement) and non-REM sleep, contribute to restorative sleep and cognitive functions like memory consolidation and emotional processing?