Safari seems not to respect z-indexes until after browser window is resized. Open up this file in Safari 7.0.3 on OS X.
To investigate next: what else, besides browser resize, will force the z-index layering to be correct? Modifying the style of the relevant elements (either before scrolling up or after)? Any repaint (again, either before scrolling up or after)?