/* Header glass on first scroll (owner, 2026-11-23). Loads after every other section file.
   motion.js adds .is-scrolled once the page has moved more than 8px, on every page.
   Before: the home header stayed fully transparent until the whole hero had gone, so the
   nav labels ran over the hero content; light pages had a solid bar with no glass at all.
   Now: at the very top the header is unchanged (transparent on home, Night on dark heroes,
   Mist on light pages). Once scrolled it is glass: dark glass while a dark hero is still
   behind it, light glass everywhere else. While a mega panel is open the bar stays solid
   so bar and panel read as one piece (unchanged). */
@media (min-width: 1280px) {
	.site-header {
		transition: background-color 320ms var(--ease-out-quart), box-shadow 320ms var(--ease-out-quart),
			-webkit-backdrop-filter 320ms var(--ease-out-quart), backdrop-filter 320ms var(--ease-out-quart);
	}
	/* Light glass: light pages once scrolled; home and dark-hero pages after the hero. */
	.site-header.is-scrolled:not(.site-header--dark):not(.site-header--overlay):not(:has(.mega.is-open)),
	.site-header.site-header--overlay.is-lit:not(:has(.mega.is-open)),
	.site-header.site-header--dark.is-lit:not(:has(.mega.is-open)) {
		background: rgba(246, 248, 252, .8);
		box-shadow: inset 0 -1px 0 var(--ink-07), 0 12px 32px -24px rgba(10, 13, 49, .28);
		-webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
	}
	/* Dark glass: scrolled, with the dark hero still under the bar. */
	.site-header.site-header--overlay.is-scrolled:not(.is-lit):not(:has(.mega.is-open)),
	.site-header.site-header--dark.is-scrolled:not(.is-lit):not(:has(.mega.is-open)) {
		background: rgba(7, 10, 36, .62);
		box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .08);
		-webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
	}
}
/* Below 1280 the header is the floating card, which is glass from the start: a little more
   see-through, with a stronger blur and a soft lift so it separates from what scrolls under it. */
@media (max-width: 1279px) {
	.mbar {
		background: rgba(18, 22, 74, .8);
		box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 10px 28px -18px rgba(7, 10, 36, .55);
		-webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
	}
}

/* ---------------------------------------------------------------- QA 2026-11-23 follow-ups */
/* Dark-hero pages: the sticky header keeps a 76px slot in the flow above <main>. That slot
   was the Mist page background, so for the first 76px of scroll the dark glass blurred a
   light strip and showed a grey band along its top. The slot is Night on these pages. */
@media (min-width: 1280px) {
	body.has-dark-hero { background-image: linear-gradient(var(--c-night), var(--c-night)); background-repeat: no-repeat; background-size: 100% 76px; }
}

/* ---------------------------------------------------------------- Phone and tablet header: cover above the card (owner, 2026-12-01) */
/* Below 1280 the header is a floating glass card 10px under the top of the screen. The page
   scrolled through that 10px gap and through the two notches beside the card's rounded top
   corners. A cover in the page color now fills the gap and the notches. The card itself (its
   glass, transparency, size and position) is not touched, and the cover sits under it.
   Color: Mist, the page background, so nothing shows at the top of a light page. Night while
   a full-width dark section is behind the top of the screen (.is-over-dark, set by motion.js
   for dark heroes and dark stats bands) and while a dark-hero page still has its Night header
   strip. None on the home page until it has been scrolled, so the hero is unchanged at the top.
   Corner pieces: the card is at most 720px wide and centered, so its left edge is at
   max(10px, 50% - 360px) of the header. A percentage in a background position is taken from the
   width minus the 16px piece, hence 352px here.
   Windows High Contrast drops background gradients, so the cover is not drawn there and the
   header looks as it did before. */
@property --sth-cap { syntax: "<color>"; inherits: false; initial-value: transparent; }
@media (max-width: 1279px) {
	.site-header::before {
		content: ""; position: absolute; top: 0; left: 0; right: 0; height: 26px; pointer-events: none;
		--sth-cap: var(--c-mist);
		background:
			linear-gradient(var(--sth-cap), var(--sth-cap)) 0 0 / 100% 10px no-repeat,
			radial-gradient(circle at 100% 100%, transparent 15.5px, var(--sth-cap) 16px) left max(10px, calc(50% - 352px)) top 10px / 16px 16px no-repeat,
			radial-gradient(circle at 0 100%, transparent 15.5px, var(--sth-cap) 16px) right max(10px, calc(50% - 352px)) top 10px / 16px 16px no-repeat;
		transition: --sth-cap 400ms var(--ease-out-quart);
	}
	.site-header--dark:not(.is-lit)::before, .site-header.is-over-dark::before { --sth-cap: var(--c-night); }
	.site-header--overlay:not(.is-scrolled)::before { --sth-cap: transparent; }
}
@media (max-width: 1279px) and (prefers-reduced-motion: reduce) {
	.site-header::before { transition: none; }
}
