The connection between what you eat and how you sleep clicked for me during a week of camping. No matter what I ate, I slept like I was 12 years old again—deep, dreamless, and restorative. The culprit wasn't the camping itself; it was the absence of processed foods, excessive caffeine, and the irregular eating times that characterized my normal urban diet. That week taught me that optimizing sleep requires optimizing what you put into your body hours before bedtime. The digestive process itself affects sleep readiness. Large meals within 2-3 hours of bedtime divert blood flow to your gut for digestion, create physical discomfort when lying down, and can trigger acid reflux that burns your esophagus and disrupts sleep architecture. The solution isn't necessarily eating less overall but rather eating earlier—distributing your caloric intake across earlier meals and keeping evening eating light. Certain foods contain tryptophan, an amino acid precursor to both serotonin and melatonin. Turkey contains famously high tryptophan levels, explaining the post-Thanksgiving drowsiness many people experience. However, tryptophan competes with other amino acids for brain access, and carbohydrates help by triggering insulin release that clears competing amino acids while leaving tryptophan relatively abundant. This is why high-carbohydrate evening meals with moderate protein often produce drowsiness—it's not imagination but neurochemistry. Magnesium deficiency correlates strongly with poor sleep quality. This mineral serves over 300 enzymatic reactions, including some involved in melatonin production and nervous system relaxation. Nuts, seeds, leafy greens, and whole grains provide magnesium, but modern diets often fall short. Magnesium glycinate supplements before bed provide relaxation benefits without the digestive activation that other magnesium forms sometimes cause. Processed sugars cause blood sugar spikes followed by crashes that disrupt sleep. More subtly, high-glycemic diets create inflammatory states that impair sleep quality independent of blood sugar fluctuations. Conversely, fiber-rich diets correlate strongly with deeper NREM sleep and fewer arousals. The sleep-affecting impact of diet choices shows up in sleep lab measurements, not just subjective reports. Alcohol deserves special attention because it's simultaneously sedating and sleep-disrupting. That initial buzz comes from increased adenosine suppression, creating drowsiness fast. However, as alcohol metabolizes, this effect reverses and often causes middle-of-the-night awakening during the second half of sleep when alcohol's effects wear off. Regular alcohol consumption disrupts sleep architecture measurably, reducing REM percentage and deep NREM sleep regardless of how the drinker subjectively rates their sleep. Caffeine's effects are covered elsewhere, but timing deserves reemphasis. The half-life of caffeine means it persists in your system for hours. Beyond direct sleep disruption, caffeine masks adenosine accumulation, preventing the natural sleep pressure that makes falling asleep easy. People who consume caffeine throughout the afternoon often don't feel sleepy at bedtime because their adenosine signal is chemically blocked—not because they don't need sleep. Strategic evening snacks can support sleep if chosen carefully. The ideal sleep-supporting snack combines complex carbohydrates with tryptophan-rich protein and possibly a small amount of healthy fat. Examples: banana with almond butter, small bowl of oatmeal with milk, apple slices with cheese. These provide steady blood sugar, tryptophan for melatonin synthesis, and modest satiety that doesn't trigger digestive discomfort. The key is small portions—overeating any snack undermines sleep regardless of its composition.