Caffeine works by blocking adenosine, the molecule that builds sleep pressure across the day โ that's why you feel awake, and also why timing matters. Caffeine's half-life is roughly five hours: half of a 4 p.m. coffee is still circulating at 9 p.m., quietly making sleep shallower even if you fall asleep fine. For most healthy adults, the FDA cites around 400 mg a day (about four to five small cups of coffee) as an amount not generally associated with negative effects.
Sensitivity varies a lot โ genetics change how fast you clear caffeine, and sensitive people get jitters or a racing, anxious feeling at doses others don't notice. If anxiety or poor sleep is bugging you, caffeine is one of the first levers to check: keep it to the morning and early afternoon, and remember that poor sleep drives next-day cravings, closing a loop you don't want.