/* Winter mode — loaded only while the admin switch is on. Effects exist only under html.is-winter. */

/* Registered so the freeze-in and each warmth hole can transition. */
@property --thaw { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
@property --b0r { syntax: "<length>"; inherits: false; initial-value: 0; }
@property --b1r { syntax: "<length>"; inherits: false; initial-value: 0; }
@property --b2r { syntax: "<length>"; inherits: false; initial-value: 0; }
@property --b3r { syntax: "<length>"; inherits: false; initial-value: 0; }
@property --b4r { syntax: "<length>"; inherits: false; initial-value: 0; }
@property --b5r { syntax: "<length>"; inherits: false; initial-value: 0; }

/* Visitor switch in the nav pill (WCAG 2.2.2 pause/stop/hide) */
.winter-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	color: rgba(20, 16, 11, 0.82);
	transition: background 0.25s, color 0.25s, opacity 0.25s;
}
.winter-toggle:hover { background: rgba(255, 255, 255, 0.7); color: var(--ink); }
.nav-on-dark .nav-tray > .winter-toggle { color: rgba(234, 215, 167, 0.85); }
.winter-toggle svg { width: 18px; height: 18px; transition: transform 0.6s var(--ease-out); }
.winter-toggle[aria-pressed="false"] { opacity: 0.55; }
.winter-toggle[aria-pressed="false"] svg { transform: rotate(-30deg) scale(0.86); }

/* The same switch in the menu, with its name spelled out; it takes over below 390px, where the pill runs out of room. */
.winter-toggle--menu {
	display: none;
	width: auto;
	gap: var(--space-2);
	margin: var(--space-6) auto 0;
	padding: 0 var(--space-4);
	border: 1px solid var(--line-gold);
	border-radius: 999px;
	font-family: var(--font-body);
	font-size: 14px;
	color: var(--ink-soft);
}
@media (max-width: 389.98px) {
	.nav-tray > .winter-toggle { display: none; }
	.winter-toggle--menu { display: flex; }
}

/* Frost mask stack: baked frost alpha, minus the thawing hole, minus six warmth holes. Static at rest. */
.winter-masked {
	--frost-mask: linear-gradient(transparent, transparent);
	--spot: #000 36%, rgba(0, 0, 0, 0.55) 66%, transparent 100%;
	-webkit-mask-image:
		var(--frost-mask),
		radial-gradient(ellipse var(--thaw) var(--thaw) at 50% 50%, #000 72%, transparent 100%),
		radial-gradient(circle var(--b0r) at var(--b0x, 0) var(--b0y, 0), var(--spot)),
		radial-gradient(circle var(--b1r) at var(--b1x, 0) var(--b1y, 0), var(--spot)),
		radial-gradient(circle var(--b2r) at var(--b2x, 0) var(--b2y, 0), var(--spot)),
		radial-gradient(circle var(--b3r) at var(--b3x, 0) var(--b3y, 0), var(--spot)),
		radial-gradient(circle var(--b4r) at var(--b4x, 0) var(--b4y, 0), var(--spot)),
		radial-gradient(circle var(--b5r) at var(--b5x, 0) var(--b5y, 0), var(--spot));
	mask-image:
		var(--frost-mask),
		radial-gradient(ellipse var(--thaw) var(--thaw) at 50% 50%, #000 72%, transparent 100%),
		radial-gradient(circle var(--b0r) at var(--b0x, 0) var(--b0y, 0), var(--spot)),
		radial-gradient(circle var(--b1r) at var(--b1x, 0) var(--b1y, 0), var(--spot)),
		radial-gradient(circle var(--b2r) at var(--b2x, 0) var(--b2y, 0), var(--spot)),
		radial-gradient(circle var(--b3r) at var(--b3x, 0) var(--b3y, 0), var(--spot)),
		radial-gradient(circle var(--b4r) at var(--b4x, 0) var(--b4y, 0), var(--spot)),
		radial-gradient(circle var(--b5r) at var(--b5x, 0) var(--b5y, 0), var(--spot));
	-webkit-mask-size: 100% 100%;
	mask-size: 100% 100%;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-composite: source-out, source-over, source-over, source-over, source-over, source-over, source-over, source-over;
	mask-composite: subtract, add, add, add, add, add, add, add;
}

/* Keep a frost stroke from triggering browser history while the finger is on the hero. */
html.is-winter:has(.home-hero.is-frost-touching) { overscroll-behavior-x: contain; }

/* Hero window: the live canvas, or the still copy that pans in step with the photo. Both sit under the scrim. */
.winter-glass,
.winter-still { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.winter-still { overflow: hidden; }
.winter-still__blur {
	position: absolute;
	inset: -2.5%;
	width: 105%;
	height: 105%;
	background-size: cover;
	transform-origin: 62% 56%;
	animation: hero-pan 42s ease-in-out infinite alternate;
}
.winter-still__crystals,
.winter-lace__crystals { position: absolute; inset: 0; background-size: 100% 100%; background-repeat: no-repeat; }

/* Snow on the dark bands */
.winter-snow { position: absolute; inset: 0; overflow: hidden; pointer-events: none; contain: strict; }
.winter-snow--hero { z-index: 5; }
.winter-snow--page-hero { z-index: 2; }
.site-footer > .winter-snow { position: absolute; z-index: 0; }
.winter-flake { position: absolute; will-change: transform; }
.winter-flake__body { position: absolute; inset: 0; background-position: center; background-repeat: no-repeat; background-size: contain; }
.winter-flake__body--dust-soft { background-image: radial-gradient(circle closest-side, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.7) 35%, rgba(255, 255, 255, 0)); }
.winter-flake__body--dust { background-image: radial-gradient(circle closest-side, #fff, rgba(255, 255, 255, 0.92) 30%, rgba(232, 240, 252, 0.32) 60%, rgba(232, 240, 252, 0)); }
.winter-flake__body--bokeh { background-image: radial-gradient(circle closest-side, rgba(255, 246, 228, 0.8), rgba(255, 240, 214, 0.66) 70%, rgba(255, 234, 200, 0.3) 90%, rgba(255, 234, 200, 0)); }

/* Painted flakes behind the cream sections (inside the back leaf plane) */
.winter-paper { position: absolute; inset: 0; pointer-events: none; }
.winter-paper__band { position: absolute; left: 0; right: 0; }
.winter-paper__flake {
	position: absolute;
	opacity: 0;
	background-position: center;
	background-repeat: no-repeat;
	background-size: contain;
	will-change: transform, opacity;
}

/* Snow cornice resting on the footer's top edge — the footer clips sideways only. */
.is-winter .site-footer { overflow-x: clip; overflow-y: visible; }
.site-footer > .winter-cornice { position: absolute; z-index: 3; left: 0; right: 0; top: -22px; height: 40px; pointer-events: none; }
.winter-cornice svg { display: block; width: 100%; height: 100%; overflow: visible; }

/* Snow caps and frost lace on glass surfaces */
.is-winter .nav-tray { position: relative; }
.is-winter .page-hero__frame { position: relative; isolation: isolate; }
.winter-cap { position: absolute; z-index: 3; line-height: 0; pointer-events: none; }
.winter-cap svg { display: block; overflow: visible; }
.winter-lace { position: absolute; inset: 0; z-index: -1; overflow: hidden; border-radius: inherit; pointer-events: none; }

/* Cinebreak glass: above the scene and its grade, milky toward the frosted edges */
.winter-lace--band { z-index: 3; background: rgba(250, 249, 246, 0.12); }
