I accidently hit the "vote" button - but you have a good question. The brain fog is from toxins being removed from your body. When these toxins cross the myelin sheath that covers the brain - it triggers the Central Nervous System - when the CNS is irritated - it can cause all sorts of "mental" disturbances such as: brain fog, mood swings, anxiety, depression, etc.
Once the toxins are gone - the fog will lift. Drink more water to help hydrate the body and to help flush out the toxins faster.