improve header shrink animation to minimize white gap