1 pixel gap between window top and menu bar
This appears to be the design of the Safari window.  Safari (and other Apple apps) have a grey shadow border in dark theme and black in light theme :




It seems the color of the border is unaffected by the background - here is dark mode with colorful wallpaper and the border is still grey.



Whereas Firefox keeps a black border for both themes and so it doesn't show in dark mode.





Looking at other apps there seems to be a mix.  Word acts like Safari while ITerm2 acts like Firefox.  

There doesn't seem to be any way to remove this in Mojave - see this question.  Older fixes/tweaks (like Toggle OSX shadows) don't work any more.