/* ==========================================================================
   The Norwich sky.
   sky.js sets the custom properties on .sky from the real time and weather:
   --sky-top / --sky-bottom  gradient colours
   --night                   0 (day) to 1 (night)
   --glow                    dawn and dusk glow, 0 to 1
   --sun-x / --sun-y         sun position, --sun-o its opacity
   --moon-x / --moon-y       moon position, --moon-o its opacity
   --cloud-o / --cloud-dark  cloud cover and how stormy they look
   ========================================================================== */

.sky {
	--sky-top: #a9d3f5;
	--sky-bottom: #f4f9fd;
	--night: 0;
	--glow: 0;
	--sun-x: 72%;
	--sun-y: 30%;
	--sun-o: 1;
	--moon-x: 30%;
	--moon-y: 30%;
	--moon-o: 0;
	--cloud-o: 0;
	--cloud-dark: 0;
	--on-sky: #141a26;
	--on-sky-muted: #3b4558;
	--beam-size: max(2600px, 230vmax);

	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: center;
	color: var(--on-sky);
	background: var(--sky-bottom);
}

.sky.is-night {
	--on-sky: #f4f7fc;
	--on-sky-muted: #c8d1e2;
}

.sky--full {
	min-height: max(620px, 100svh);
	padding: calc(var(--header-h) + 24px) 0 clamp(150px, 20vw, 210px);
}

.sky--band {
	min-height: clamp(360px, 48vh, 480px);
	padding: calc(var(--header-h) + 36px) 0 clamp(110px, 12vw, 150px);
	--beam-size: max(2000px, 180vmax);
}

/* Scene layers ------------------------------------------------------------ */
.sky-scene,
.sky-scene > * {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.sky-scene {
	z-index: 0;
}

.sky-gradient {
	background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 78%);
	transition: background 1.2s ease;
}

.sky-glow {
	background: url("../images/bg-dawn.png") center 70% / cover no-repeat;
	opacity: calc(var(--glow) * 0.85);
	mix-blend-mode: multiply;
	transition: opacity 1.2s ease;
}

.sky.is-dusk .sky-glow {
	background-image: url("../images/bg-dusk.png");
}

/* Stars, drawn by sky.js */
.sky-stars {
	opacity: var(--night);
	transition: opacity 1.5s ease;
}

.star {
	position: absolute;
	width: 2px;
	height: 2px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
	animation: twinkle 3s ease-in-out infinite alternate;
}

.star.is-big {
	width: 3px;
	height: 3px;
}

.shooting-star {
	position: absolute;
	width: 140px;
	height: 2px;
	background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), transparent);
	border-radius: 2px;
	transform: rotate(-20deg);
	opacity: 0;
	animation: shoot 9s ease-in infinite;
}

@keyframes twinkle {
	from { opacity: 0.25; }
	to { opacity: 1; }
}

@keyframes shoot {
	0%, 88% { opacity: 0; transform: rotate(-20deg) translateX(0); }
	90% { opacity: 1; }
	100% { opacity: 0; transform: rotate(-20deg) translateX(-420px); }
}

/* Sun rays: the Mad Beans sunburst, centred on the sun */
.sky-beams {
	inset: auto;
	left: var(--sun-x);
	top: var(--sun-y);
	width: var(--beam-size);
	height: var(--beam-size);
	margin: calc(var(--beam-size) / -2) 0 0 calc(var(--beam-size) / -2);
	opacity: calc((1 - var(--night)) * (1 - var(--cloud-o)) * (1 - var(--cloud-o)) * (1 - var(--glow) * 0.8) * 0.7);
	transition: opacity 1.2s ease, left 1.2s ease, top 1.2s ease;
}

.sky-beams img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	animation: sky-spin 260s linear infinite;
}

.sky-sun,
.sky-moon {
	inset: auto;
	width: clamp(70px, 9vw, 120px);
	aspect-ratio: 1;
	transform: translate(-50%, -50%);
	transition: left 1.2s ease, top 1.2s ease, opacity 1.2s ease;
}

.sky-sun {
	left: var(--sun-x);
	top: var(--sun-y);
	opacity: calc(var(--sun-o) * (1 - var(--cloud-o) * 0.75));
}

.sun-disc {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: radial-gradient(circle at 50% 50%, #fffef5 0%, #fff6c9 38%, #ffd36b 64%, rgba(255, 196, 80, 0) 72%);
	box-shadow: 0 0 80px 30px rgba(255, 223, 140, 0.55);
}

.sky.is-dusk .sun-disc,
.sky.is-dawn .sun-disc {
	background: radial-gradient(circle at 50% 50%, #fff3d6 0%, #ffc078 40%, #ff8a4c 64%, rgba(255, 120, 60, 0) 72%);
	box-shadow: 0 0 90px 40px rgba(255, 140, 80, 0.5);
}

.sky-moon {
	left: var(--moon-x);
	top: var(--moon-y);
	width: clamp(56px, 6vw, 84px);
	opacity: var(--moon-o);
}

.moon-disc {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: radial-gradient(circle at 38% 35%, #ffffff 0%, #eef1f7 45%, #c9d0de 100%);
	box-shadow: 0 0 40px 10px rgba(220, 230, 255, 0.35);
	-webkit-mask: radial-gradient(circle at 72% 30%, transparent 42%, #000 43%);
	mask: radial-gradient(circle at 72% 30%, transparent 42%, #000 43%);
}

/* Clouds */
.sky-clouds {
	opacity: var(--cloud-o);
	filter: brightness(calc(1 - var(--cloud-dark) * 0.55 - var(--night) * 0.6)) saturate(calc(1 - var(--cloud-dark) * 0.5));
	transition: opacity 1.6s ease, filter 1.6s ease;
}

.cloud {
	position: absolute;
	left: 0;
	width: clamp(320px, 42vw, 640px);
	aspect-ratio: 2 / 1;
	background: url("../images/clouds.png") center / contain no-repeat;
	animation: cloud-drift linear infinite;
	will-change: transform;
}

.cloud-1 { top: 2%; animation-duration: 160s; animation-delay: -20s; }
.cloud-2 { top: 14%; animation-duration: 210s; animation-delay: -120s; transform: scale(0.8); }
.cloud-3 { top: -4%; animation-duration: 240s; animation-delay: -60s; }
.cloud-4 { top: 24%; animation-duration: 190s; animation-delay: -160s; opacity: 0.85; }
.cloud-5 { top: 8%; animation-duration: 260s; animation-delay: -200s; }
.cloud-6 { top: 30%; animation-duration: 230s; animation-delay: -90s; opacity: 0.8; }

/* Light cloud cover only shows a few clouds. */
.sky:not(.is-overcast) .cloud-4,
.sky:not(.is-overcast) .cloud-5,
.sky:not(.is-overcast) .cloud-6 {
	display: none;
}

@keyframes cloud-drift {
	from { transform: translateX(-60vw); }
	to { transform: translateX(110vw); }
}

/* Birds on clear days */
.sky-birds {
	opacity: calc((1 - var(--night)) * (1 - var(--cloud-o)));
}

.bird {
	position: absolute;
	left: 0;
	width: 30px;
	height: 30px;
	background: url("../images/birds.png") 0 0 / 60px 30px no-repeat;
	animation: bird-flap 0.5s steps(1) infinite, bird-fly 46s linear infinite;
}

.bird:nth-child(1) { top: 22%; animation-delay: 0s, -6s; }
.bird:nth-child(2) { top: 26%; animation-delay: 0.2s, -8s; transform: scale(0.8); }
.bird:nth-child(3) { top: 19%; animation-delay: 0.1s, -10s; transform: scale(0.65); }

@keyframes bird-flap {
	0% { background-position: 0 0; }
	50% { background-position: -30px 0; }
}

@keyframes bird-fly {
	0% { left: 105%; }
	45% { left: -8%; }
	100% { left: -8%; }
}

/* Storm */
.sky-storm {
	opacity: 0;
	transition: opacity 1.5s ease;
}

.sky.is-storm .sky-storm {
	opacity: 1;
}

.storm-clouds {
	position: absolute;
	inset: 0;
	background:
		radial-gradient(ellipse 70% 45% at 30% 0%, rgba(18, 20, 34, 0.55), transparent 70%),
		radial-gradient(ellipse 60% 40% at 80% 5%, rgba(18, 20, 34, 0.5), transparent 70%),
		linear-gradient(180deg, rgba(20, 24, 38, 0.45) 0%, rgba(20, 24, 38, 0.15) 55%, transparent 80%);
}

.storm-flash {
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse at var(--flash-x, 50%) 10%, rgba(235, 240, 255, 0.95), rgba(220, 228, 255, 0.55) 45%, rgba(220, 228, 255, 0.25));
	opacity: 0;
}

/* Lightning bolts, drawn by sky.js for each strike. */
.storm-bolts {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.storm-bolts path {
	fill: none;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.bolt-glow {
	stroke: rgba(190, 205, 255, 0.55);
	filter: blur(6px);
}

.bolt-core {
	stroke: #fbfcff;
}

.sky-sound .when-sound,
.sky-sound[aria-pressed="true"] .when-muted {
	display: none;
}

.sky-sound[aria-pressed="true"] .when-sound {
	display: block;
}

/* Rain and snow, drawn by sky.js */
.sky-rain,
.sky-snow {
	opacity: 0;
	transition: opacity 1.5s ease;
}

.sky.is-rain .sky-rain,
.sky.is-storm .sky-rain,
.sky.is-snow .sky-snow {
	opacity: 1;
}

.drop {
	position: absolute;
	top: -12%;
	width: 1.5px;
	height: 70px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(205, 220, 240, 0.85));
	animation: rain-fall linear infinite;
}

.sky:not(.is-night) .drop {
	background: linear-gradient(180deg, rgba(90, 110, 140, 0), rgba(90, 110, 140, 0.6));
}

@keyframes rain-fall {
	to { transform: translate(-60px, var(--fall, 125vh)); }
}

.flake {
	position: absolute;
	top: -5%;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 4px rgba(140, 160, 190, 0.6);
	animation: snow-fall linear infinite;
}

@keyframes snow-fall {
	0% { transform: translate(0, 0); }
	50% { transform: translate(30px, 55vh); }
	100% { transform: translate(-10px, 115vh); }
}

/* Fog */
.sky-fog {
	opacity: 0;
	transition: opacity 2s ease;
}

.sky.is-fog .sky-fog {
	opacity: var(--fog-o, 0.8);
}

.fog-band {
	position: absolute;
	left: -50%;
	width: 200%;
	height: 45%;
	background: radial-gradient(ellipse at center, rgba(235, 240, 246, 0.9) 0%, rgba(235, 240, 246, 0) 70%);
	filter: blur(8px);
	animation: fog-drift 60s ease-in-out infinite alternate;
}

.sky.is-night .fog-band {
	background: radial-gradient(ellipse at center, rgba(150, 160, 185, 0.6) 0%, rgba(150, 160, 185, 0) 70%);
}

.fog-1 { bottom: 0; }
.fog-2 { bottom: 18%; animation-duration: 80s; animation-delay: -20s; }
.fog-3 { bottom: 34%; animation-duration: 100s; animation-delay: -40s; opacity: 0.7; }

@keyframes fog-drift {
	from { transform: translateX(-8%); }
	to { transform: translateX(8%); }
}

/* Skyline: Norwich with the cathedral, castle and a windmill */
.skyline {
	inset: auto;
	right: 0;
	bottom: -1px;
	width: max(1300px, 118vw);
	aspect-ratio: 529.17 / 211.67;
	--sl-1: color-mix(in srgb, #0d1017 calc((1 - var(--night)) * 100%), #05070c);
	--sl-ground: color-mix(in srgb, #1b1e26 calc((1 - var(--night)) * 100%), #0a0d15);
	--sl-2: color-mix(in srgb, #4d525d calc((1 - var(--night)) * 100%), #1a2032);
	--sl-3: color-mix(in srgb, #676d79 calc((1 - var(--night)) * 100%), #222a3f);
	--sl-4: color-mix(in srgb, #b1b7c2 calc((1 - var(--night)) * 100%), #2b3349);
}

.sky--band .skyline {
	width: max(1100px, 100vw);
	right: -1vw;
}

.skyline > svg:not(.skyline-blade-lights) {
	display: block;
	width: 100%;
	height: 100%;
}

.skyline-blades {
	position: absolute;
	left: 95.68%;
	top: 75.4%;
	width: 5.9%;
	height: auto;
	transform: translate(-50%, -50%);
	animation: sky-spin 9s linear infinite;
	filter: brightness(calc(1 - var(--night) * 0.6));
}

.skyline-tractor,
.skyline-tractor-light {
	position: absolute;
	left: 88%;
	top: 87.6%;
	width: 1.7%;
	height: auto;
	transform: translate(-50%, -100%);
	animation: tractor 240s ease-in-out infinite;
}

.skyline-tractor {
	filter: brightness(calc(1 - var(--night) * 0.4));
}

/* The drawing faces right, so it is flipped on the way left. */
@keyframes tractor {
	0% { left: 92.5%; top: 87.9%; transform: translate(-50%, -100%) scaleX(-1); }
	48% { left: 84%; top: 88.6%; transform: translate(-50%, -100%) scaleX(-1); }
	50% { left: 84%; top: 88.6%; transform: translate(-50%, -100%) scaleX(1); }
	98% { left: 92.5%; top: 87.9%; transform: translate(-50%, -100%) scaleX(1); }
	100% { left: 92.5%; top: 87.9%; transform: translate(-50%, -100%) scaleX(-1); }
}

/* At night the tractor gets a headlamp, a beam ahead of it and a glow above. */
.skyline-tractor-light {
	aspect-ratio: 1;
	pointer-events: none;
	opacity: calc(var(--night) * 1.3 - 0.3);
	transition: opacity 1.5s ease;
}

.skyline-tractor-light > span {
	position: absolute;
}

.tractor-halo {
	left: -100%;
	top: calc(-110% + 10px);
	width: 300%;
	height: 200%;
	background: radial-gradient(ellipse 50% 45% at 50% 70%, rgba(255, 214, 140, 0.32), rgba(255, 190, 110, 0.1) 50%, transparent 100%);
}

.tractor-beam {
	left: 90%;
	top: 56%;
	width: 210%;
	height: 34%;
	background: linear-gradient(90deg, rgba(255, 236, 180, 0.38), rgba(255, 226, 160, 0.1) 55%, transparent);
	clip-path: polygon(0 40%, 100% 0, 100% 100%, 0 64%);
	filter: blur(0.5px);
}

.tractor-lamp {
	left: 86%;
	top: 60%;
	width: 9%;
	aspect-ratio: 1;
	border-radius: 50%;
	background: #fff6d8;
	box-shadow: 0 0 3px 1px rgba(255, 228, 160, 0.8);
}

/* Lights on the tips of the windmill sails, turning with them. */
.skyline-blade-lights {
	position: absolute;
	left: 95.68%;
	top: 75.4%;
	width: 5.9%;
	height: auto;
	aspect-ratio: 1;
	overflow: visible;
	pointer-events: none;
	transform: translate(-50%, -50%);
	animation: blades-spin 9s linear infinite;
	fill: #ffe7a6;
	filter: drop-shadow(0 0 1.5px rgba(255, 210, 120, 0.9));
	opacity: calc(var(--night) * 1.3 - 0.3);
	transition: opacity 1.5s ease;
}

@keyframes sky-spin {
	to { transform: rotate(360deg); }
}

.skyline-blades {
	animation-name: blades-spin;
}

@keyframes blades-spin {
	from { transform: translate(-50%, -50%) rotate(0deg); }
	to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Content in the sky ------------------------------------------------------ */
.sky-content {
	position: relative;
	z-index: auto;
	width: 100%;
	max-width: calc(1180px + var(--gutter) * 2);
	margin: 0 auto;
	padding: 0 var(--gutter);
}

.hero-title-wrap,
.page-heading {
	text-align: center;
	max-width: 860px;
	margin: 0 auto;
}

.hero-kicker,
.page-kicker {
	margin: 0 0 10px;
	font-family: var(--font-head);
	font-weight: 700;
	font-size: 0.9rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--on-sky-muted);
}

.page-kicker a {
	color: inherit;
	text-decoration: none;
}

.page-kicker a:hover {
	text-decoration: underline;
}

.hero-title,
.page-title {
	margin: 0;
	font-family: var(--font-head);
	font-weight: 300;
	font-size: clamp(2.6rem, 7vw, 5.2rem);
	line-height: 1.02;
	letter-spacing: 0.01em;
	color: var(--on-sky);
	text-wrap: balance;
}

.page-title {
	font-size: clamp(2.2rem, 5.6vw, 4rem);
	font-weight: 400;
}

.hero-lead,
.page-lead {
	margin: 14px auto 0;
	max-width: 640px;
	font-size: clamp(1.05rem, 2vw, 1.25rem);
	color: var(--on-sky-muted);
}

.hero-lead h1,
.hero-lead h2,
.hero-lead h3,
.hero-lead h4 {
	font-family: var(--font-script);
	font-weight: 400;
	font-size: clamp(1.7rem, 4vw, 2.5rem);
	letter-spacing: 0;
	color: var(--on-sky);
	margin: 0.2em 0 0;
}

.hero-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-top: 28px;
}

.page-heading .post-meta {
	color: var(--on-sky-muted);
	opacity: 1;
}

/* Hero slider: the game art blends into the sky instead of sitting in a box.
   Light art (white backgrounds) multiplies into a day sky, so only the drawing
   shows. At night it is inverted and screened, so it glows. Dark art fades in
   at the edges by day and screens into a night sky. */
.hero-slider {
	position: relative;
}

.slider-track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 100%;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
}

.slider-track::-webkit-scrollbar {
	display: none;
}

.slider-track:focus-visible {
	outline: 3px solid var(--focus);
	outline-offset: 4px;
}

.slide {
	position: relative;
	scroll-snap-align: start;
	min-height: clamp(400px, 58vh, 560px);
	display: flex;
	align-items: center;
}

.slide--welcome {
	justify-content: center;
	text-align: center;
}

.slide--welcome .slide-inner {
	max-width: 860px;
	padding: 0 8px;
}

.slide--welcome .hero-kicker,
.slide--welcome .hero-title,
.slide--welcome .hero-lead,
.slide--welcome .hero-actions {
	animation: rise-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.slide--welcome .hero-lead {
	animation-delay: 0.15s;
}

.slide--welcome .hero-actions {
	animation-delay: 0.3s;
}

.slide--game .slide-inner {
	position: relative;
	width: 100%;
	padding: clamp(10px, 3vw, 32px) 0;
}

.slide-art {
	position: absolute;
	top: 0;
	right: 0;
	width: 68%;
	height: 100%;
	object-fit: cover;
	object-position: center 55%;
	-webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 40%, transparent 100%);
	mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 40%, transparent 100%);
	transition: filter 1.2s ease, opacity 1.2s ease;
	pointer-events: none;
}

.art-light .slide-art {
	mix-blend-mode: multiply;
}

.art-dark .slide-art {
	opacity: 0.9;
}

.sky.is-night .art-light .slide-art {
	filter: invert(1) hue-rotate(180deg);
	mix-blend-mode: screen;
}

.sky.is-night .art-dark .slide-art {
	mix-blend-mode: screen;
	opacity: 1;
}

.slide-card {
	position: relative;
	max-width: 500px;
	padding: clamp(18px, 2.6vw, 28px);
	border-radius: var(--radius);
	border: 1px solid rgba(255, 255, 255, 0.45);
	background: rgba(255, 255, 255, 0.22);
	color: var(--on-sky);
	-webkit-backdrop-filter: blur(6px) saturate(1.2);
	backdrop-filter: blur(6px) saturate(1.2);
}

.sky.is-night .slide-card {
	border-color: rgba(255, 255, 255, 0.12);
	background: rgba(8, 12, 28, 0.3);
}

.slide[aria-hidden="false"] .slide-card {
	animation: card-in 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.slide-logo {
	display: block;
	max-width: 300px;
	max-height: 96px;
	width: auto;
	height: auto;
	margin-bottom: 14px;
	filter: drop-shadow(0 4px 14px rgba(255, 255, 255, 0.35));
	transition: filter 1.2s ease;
}

.sky.is-night .logo-dark .slide-logo {
	filter: invert(1) hue-rotate(180deg) drop-shadow(0 4px 14px rgba(0, 0, 0, 0.5));
}

.logo-light .slide-logo {
	filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 2px rgba(0, 0, 0, 0.6));
}

.slide-title {
	font-family: var(--font-display);
	font-weight: 400;
	font-size: clamp(1.7rem, 3.5vw, 2.3rem);
	margin: 0 0 8px;
}

.slide-text {
	margin: 0 0 18px;
	font-size: 1.04rem;
	line-height: 1.55;
	color: var(--on-sky);
}

.slide-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

@keyframes rise-in {
	from {
		opacity: 0;
		transform: translateY(26px);
		filter: blur(6px);
	}
	to {
		opacity: 1;
		transform: none;
		filter: none;
	}
}

@keyframes card-in {
	from {
		opacity: 0;
		transform: translateX(-30px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@media (max-width: 760px) {
	.slide-art {
		right: -20%;
		width: 140%;
		-webkit-mask-image: radial-gradient(ellipse 50% 46% at 50% 36%, #000 30%, transparent 78%);
		mask-image: radial-gradient(ellipse 50% 46% at 50% 36%, #000 30%, transparent 78%);
	}

	.slide--game .slide-inner {
		align-self: flex-end;
	}
}

.slider-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin-top: 18px;
}

.slider-arrow {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid rgba(20, 26, 38, 0.15);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.75);
	color: #141a26;
	font-size: 1.3rem;
	cursor: pointer;
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	transition: transform 0.18s ease, background-color 0.18s ease;
}

.slider-arrow:hover {
	background: #fff;
	transform: scale(1.06);
}

.slider-dots {
	display: flex;
	gap: 8px;
}

.slider-dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: color-mix(in srgb, var(--on-sky) 30%, transparent);
	cursor: pointer;
	transition: width 0.25s ease, background-color 0.25s ease;
}

.slider-dot[aria-selected="true"] {
	width: 28px;
	background: var(--brand-gradient);
}

/* Sky controls ------------------------------------------------------------ */
.sky-ui {
	position: absolute;
	z-index: 4;
	left: var(--gutter);
	bottom: clamp(18px, 3vw, 30px);
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	max-width: calc(100% - var(--gutter) * 2);
}

.sky-readout {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	padding: 6px 14px 6px 8px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.72);
	color: #141a26;
	font-size: 0.88rem;
	line-height: 1.2;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
}

.sky.is-night .sky-readout,
.sky.is-night .sky-button,
.sky.is-night .sky-panel {
	background: rgba(14, 20, 34, 0.72);
	color: #f0f3f9;
}

.sky-readout-icon {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--brand-gradient);
	color: #fff;
	font-size: 1.05rem;
}

.sky-readout-text {
	display: grid;
}

.sky-readout strong {
	font-family: var(--font-head);
	font-size: 1rem;
}

.sky-readout strong:empty {
	display: none;
}

.sky-controls {
	display: flex;
	gap: 6px;
}

.sky-button {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.72);
	color: #141a26;
	font-size: 1.15rem;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	transition: transform 0.18s ease, background-color 0.3s ease;
}

.sky-button:hover {
	transform: translateY(-2px);
}

.sky-button[aria-expanded="true"],
.sky-button[aria-pressed="true"] {
	background: var(--brand-gradient) !important;
	color: #fff !important;
}

.sky-panel {
	position: absolute;
	left: 0;
	bottom: calc(100% + 10px);
	width: min(330px, calc(100vw - var(--gutter) * 2));
	padding: 16px;
	border-radius: var(--radius);
	background: rgba(255, 255, 255, 0.92);
	color: #141a26;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
}

.sky-panel[hidden] {
	display: none;
}

.sky-panel label,
.sky-panel legend {
	display: flex;
	justify-content: space-between;
	font-family: var(--font-head);
	font-weight: 700;
	font-size: 0.85rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	margin-bottom: 8px;
	padding: 0;
}

.sky-panel fieldset {
	border: 0;
	margin: 0 0 12px;
	padding: 0;
}

.sky-panel input[type="range"] {
	width: 100%;
	accent-color: var(--violet);
	margin: 0 0 12px;
}

.sky-chips {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;
}

.sky-chip {
	position: relative;
	display: flex !important;
	flex-direction: column;
	align-items: center;
	justify-content: center !important;
	gap: 4px;
	margin: 0 !important;
	padding: 8px 4px;
	border: 1px solid rgba(20, 26, 38, 0.15);
	border-radius: 12px;
	font-size: 0.75rem !important;
	cursor: pointer;
	text-align: center;
}

.sky.is-night .sky-chip {
	border-color: rgba(255, 255, 255, 0.2);
}

.sky-chip .icon {
	font-size: 1.3rem;
}

.sky-chip input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.sky-chip:has(input:checked) {
	background: var(--brand-gradient);
	border-color: transparent;
	color: #fff;
}

.sky-chip:has(input:focus-visible) {
	outline: 3px solid var(--focus);
	outline-offset: 2px;
}

.sky-reset {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 0.88rem;
	text-decoration: underline;
	cursor: pointer;
	opacity: 0.8;
}

.sky-place {
	position: absolute;
	z-index: 3;
	right: var(--gutter);
	bottom: clamp(14px, 2.4vw, 26px);
	margin: 0;
	font-family: var(--font-head);
	font-style: italic;
	font-weight: 700;
	font-size: 0.9rem;
	letter-spacing: 0.04em;
	color: rgba(235, 239, 247, 0.75);
}

.sky-scroll {
	position: absolute;
	z-index: 3;
	left: 50%;
	bottom: clamp(16px, 2.6vw, 28px);
	display: grid;
	place-items: center;
	width: 64px;
	height: 36px;
	transform: translateX(-50%);
	border-radius: 999px;
	background: var(--brand-gradient);
	color: #fff;
	font-size: 1.3rem;
	box-shadow: 0 10px 24px rgba(107, 63, 214, 0.4);
	animation: nudge 2.4s ease-in-out infinite;
}

@keyframes nudge {
	0%, 100% { transform: translate(-50%, 0); }
	50% { transform: translate(-50%, 5px); }
}

@media (max-width: 760px) {
	.sky--full {
		padding-bottom: 190px;
	}

	.sky-ui {
		bottom: 56px;
	}

	.sky-place {
		bottom: 18px;
		font-size: 0.8rem;
	}

	.sky-scroll {
		display: none;
	}

	.sky--band .sky-controls,
	.sky--band .sky-panel {
		display: none;
	}

	.sky--band .sky-ui {
		bottom: 52px;
	}

	.slide {
		min-height: 440px;
		align-items: flex-end;
	}

	.slide--welcome {
		align-items: center;
	}

	.slide-text {
		font-size: 0.96rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cloud,
	.bird,
	.drop,
	.flake,
	.star,
	.shooting-star,
	.storm-flash,
	.sky-beams img,
	.skyline-blades,
	.skyline-blade-lights,
	.skyline-tractor,
	.skyline-tractor-light,
	.avatar-beams {
		animation: none !important;
	}
}

.sky.is-night .hero-title,
.sky.is-night .page-title,
.sky.is-night .hero-lead,
.sky.is-night .page-lead {
	text-shadow: 0 2px 18px rgba(8, 10, 30, 0.45);
}

/* Rain in front of the city and splashes on the ground. */
.sky-rain--front,
.sky-splashes {
	opacity: 0;
	transition: opacity 1.5s ease;
}

.sky.is-rain .sky-rain--front,
.sky.is-storm .sky-rain--front,
.sky.is-rain .sky-splashes,
.sky.is-storm .sky-splashes {
	opacity: 1;
}

.drop--near {
	width: 2px;
	height: 110px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(220, 232, 248, 0.75)) !important;
}

.splash {
	position: absolute;
	width: 14px;
	height: 5px;
	border-radius: 50%;
	border-top: 1.5px solid rgba(215, 228, 245, 0.85);
	transform: translateX(-50%) scale(0.2);
	opacity: 0;
	animation: splash ease-out infinite;
}

@keyframes splash {
	0% {
		transform: translateX(-50%) scale(0.2, 0.4);
		opacity: 0.9;
	}
	100% {
		transform: translateX(-50%) scale(1.6, 1);
		opacity: 0;
	}
}

/* City lights at night. */
.sky-city-glow {
	inset: auto 0 0 auto;
	width: 85%;
	height: 50%;
	background: radial-gradient(ellipse at 72% 100%, rgba(255, 168, 90, 0.42), rgba(255, 140, 80, 0.12) 40%, transparent 68%);
	opacity: calc(var(--night) * 1.2 - 0.2);
	transition: opacity 1.5s ease;
}

.city-light {
	fill: #ffd27a;
	opacity: calc(var(--night) * 1.25 - 0.25);
	transition: opacity 1.5s ease;
}

.city-light.is-far {
	fill: #f6c46e;
	opacity: calc((var(--night) * 1.25 - 0.25) * 0.7);
}

/* Foreground windows: a little smaller (set in sky.js), brighter. */
.city-light.is-near {
	fill: #fff0c4;
	opacity: calc(var(--night) * 1.3 - 0.3);
}

.city-light.is-tower {
	fill: #ffdc8e;
	opacity: calc((var(--night) * 1.25 - 0.25) * 0.85);
}

.city-light.is-back {
	fill: #f0bf78;
	opacity: calc((var(--night) * 1.25 - 0.25) * 0.5);
}

.city-light.is-flicker {
	animation: window-flicker 20s steps(1) infinite;
}

@keyframes window-flicker {
	0%, 34% { fill: #ffd27a; }
	35%, 61% { fill: transparent; }
	62%, 100% { fill: #ffe3a3; }
}

.sky.is-storm .sky-sun,
.sky.is-storm .sky-beams,
.sky.is-storm .sky-birds {
	opacity: 0;
}

/* A veil of the sky's own colour over the sunburst by day, so text in front
   of it reads cleanly. It thins as the light goes and is gone at night. */
.sky-veil {
	background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 78%);
	opacity: calc((1 - var(--night)) * 0.7);
	transition: background 1.2s ease, opacity 1.2s ease;
}

/* By day the top of the page is marked off in white, behind the header, and
   fades down into the sky. It shows exactly when the header text is black. */
.sky-scene > .sky-wash {
	inset: 0 0 auto;
	height: calc(var(--header-h) + 140px);
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.95) 38%, rgba(255, 255, 255, 0.55) 68%, rgba(255, 255, 255, 0) 100%);
	opacity: 0;
	transition: opacity 1.2s ease;
}

:root[data-sky="day"] .sky-scene > .sky-wash {
	opacity: 1;
}

/* Overcast: a grey deck of cloud drifts across the top of the sky. */
.sky-clouds::before {
	content: "";
	position: absolute;
	inset: -6% -10% auto;
	height: 62%;
	background:
		url("../images/clouds.png") 0 0 / 520px auto repeat-x,
		url("../images/clouds.png") 260px 40px / 440px auto repeat-x;
	opacity: 0;
	transition: opacity 1.6s ease;
	animation: cloud-deck 240s linear infinite;
}

.sky.is-overcast .sky-clouds::before {
	opacity: 0.9;
}

@keyframes cloud-deck {
	to { background-position: 1040px 0, 1140px 40px; }
}

/* Snow lying on the front of the skyline, settling and melting. */
.sky-snowlay {
	opacity: 0;
	transition: opacity 2s ease;
}

.sky.is-snow .sky-snowlay {
	opacity: 1;
}

.snowlay {
	position: absolute;
	height: 4px;
	border-radius: 50% 50% 35% 35%;
	background: #f4f7fb;
	box-shadow: 0 0 3px rgba(255, 255, 255, 0.6);
	transform: translate(-50%, 50%) scaleX(0.3);
	opacity: 0;
	animation: snow-settle ease-in-out infinite;
}

@keyframes snow-settle {
	0% { opacity: 0; transform: translate(-50%, 50%) scaleX(0.3); }
	25% { opacity: 0.95; transform: translate(-50%, 50%) scaleX(1); }
	70% { opacity: 0.9; transform: translate(-50%, 50%) scaleX(1); }
	100% { opacity: 0; transform: translate(-50%, 50%) scaleX(0.6); }
}

/* Floodlit landmarks at night: City Hall, the cathedral and the castle. */
.landmark-flood,
.landmark-detail {
	opacity: calc(var(--night) * 1.25 - 0.25);
	transition: opacity 1.5s ease;
	pointer-events: none;
}

.landmark-flood.is-spire {
	opacity: calc((var(--night) * 1.25 - 0.25) * 0.5);
}
