How long does caffeine really stay in you?
The half-life is about five to six hours for most adults, so half of a 2pm coffee is still present around 8pm and a quarter around 1am. Genetics move that range a lot — some people clear it in three hours, some take nine. If coffee has never affected your sleep, you're probably a fast metaboliser, and you can be more relaxed about the cutoff.
Is decaf actually caffeine-free?
Nearly. A decaf coffee has roughly 2–5mg against 95mg for a normal one. It's irrelevant to your sleep and it keeps the ritual, which is exactly what you want.
I get headaches when I cut back. What am I doing wrong?
Cutting too fast. Withdrawal headaches usually mean a drop of more than about 100mg a day. Reduce by roughly a half-cup at a time, hold it for three days, then reduce again.
What about green tea in the evening?
It's less, not nothing — around 30mg a cup. If you're sensitive, two evening cups is most of an espresso. Try herbal for two weeks and see whether it changes anything for you.