/*
 * Season colours. One key colour per season (or per event) is set by the plugin as
 * --season-key, with --season-on-key (text on it), inline on the body (class dp-has-season)
 * or on an element (class dp-keyed). Everything else is derived from the key colour here,
 * as in the brandbook: the season colour is the accent, tints are mixes with it.
 * Neutrals (background, text, lines) stay as in tokens.css.
 * Without a key colour nothing here applies and the site uses tokens.css as before.
 */

body.dp-has-season,
.dp-keyed {
	--accent: var(--season-key);
	--accent-soft: color-mix(in srgb, var(--season-key) 16%, #fff);
	--brass: var(--season-key);
	--brand: var(--season-key);
	--brand-hover: color-mix(in srgb, var(--season-key) 80%, #000);
	--brand-soft: color-mix(in srgb, var(--season-key) 14%, #fff);
	--ink: color-mix(in srgb, var(--season-key) 55%, #000);
	--ink-2: color-mix(in srgb, var(--season-key) 70%, #000);
	--on-ink: var(--season-on-key);
	--on-ink-muted: color-mix(in srgb, var(--season-on-key) 75%, transparent);
	/* Small text keeps 4.5:1: links, the logo and light pills use a darker key colour, small labels sit on it.
	   Large elements (buttons, the hero, cards) keep the key colour itself. */
	--accent-text: var(--season-key-text, var(--season-key));
	--accent-small: var(--season-key-small, var(--season-key));
}

body.dp-has-season {
	--bg: color-mix(in srgb, var(--season-key) 5%, #fff);
	--surface: #fff;
	--surface-2: color-mix(in srgb, var(--season-key) 10%, #fff);
}

/* Other pages: the header sits on the season photo from the home page, with light text.
   On scroll it turns into the same dark bar as on the home page: the photo (::before) fades out
   and the ink backing with its shadow fades in, on the same scroll range (site.css). */
@keyframes dp-hdr-season { from { background-color: var(--ink, #1a2018); box-shadow: none; } to { background-color: color-mix(in srgb, var(--ink, #1a2018) 94%, transparent); box-shadow: 0 6px 18px rgba(18, 37, 28, .18); } }
@keyframes dp-hdr-photo-out { from { opacity: 1; } to { opacity: 0; } }
body.dp-has-season:not(.home) .dp-hdr-root header {
	background: var(--ink, #1a2018);
	animation-name: dp-hdr-season;
	border-bottom-color: transparent !important;
	color: #fff;
	isolation: isolate;
}
body.dp-has-season:not(.home) .dp-hdr-root header::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background: linear-gradient(rgba(10, 14, 20, .55), rgba(10, 14, 20, .55)), var(--season-photo, none) center 40% / cover;
	animation: dp-hdr-photo-out linear both;
	animation-timeline: scroll(root);
	animation-range: 0 120px;
}
body.dp-has-season:not(.home) .dp-hdr-root header .dp-nav a,
body.dp-has-season:not(.home) .dp-hdr-root header .dp-logo,
body.dp-has-season:not(.home) .dp-hdr-root header .dp-logo__text,
body.dp-has-season:not(.home) .dp-hdr-root header summary,
body.dp-has-season:not(.home) .dp-hdr-root header > .dp-in > a:not(.dp-pill),
body.dp-has-season:not(.home) .dp-hdr-root header svg { color: #fff; }

/* Every page takes the season background (winter: a pale blue, about #f6f9fd) instead of the theme beige. */
body.dp-has-season {
	background: var(--bg);
}
