Safari tints its user interface to match the background color or a fixed element at the top or bottom edge. Learn more: github.com/andesco/safari-color-tinting
Safari uses the luma (perceived brightness) of the tint color to make the text in its user interface, such as tab titles, dark or light. Refer to Luma: Apple & Perceived Brightness.
When macOS or iOS are in Dark Mode, Safari darkens a light tint color so that its user interface conforms. Tab titles and other user interface text are therefore always light. When the luma of the tint color is more than 127.5, Safari multiplies each RGB value by 0.4: #FFFFFF becomes #666666.
Users can enable or disable browser UI color tinting in Safari 26:
macOS: Safari › Settings › Tabs › Appearance: ✓ Show color in tab bar
iOS: Settings › Apps › Safari ›
Safari does not sample a fixed element with a neutral backdrop-filter:
Safari ignores a fixed element that is hidden:
::before on top has more than one color, and Safari uses only one of them.