/* MADEP boot splash — the branded loading screen painted with the first HTML,
   before SvelteKit hydrates, then self-dismissed via CSS (no JS, so it can never
   get stuck; served same-origin so it satisfies the strict CSP). Colors are set
   explicitly here (not via tokens) so they're correct at first paint, before the
   app's theme attribute exists; prefers-color-scheme picks light/dark. */

#app-splash {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 22px;
	background: #f7f5f0;
	animation: splash-dismiss 0.5s ease 0.95s forwards;
}

#app-splash .sp-peak {
	width: 66px;
	height: auto;
	opacity: 0;
	transform: translateY(4px) scale(0.92);
	transform-origin: center bottom;
	animation: splash-mark-in 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) 0.05s forwards;
}

#app-splash .sp-wm {
	width: min(196px, 56vw);
	height: auto;
	opacity: 0;
	transform: translateY(8px);
	animation: splash-wm-in 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) 0.22s forwards;
}

#app-splash .sp-ink {
	fill: #4a4b3f;
}
#app-splash .sp-accent {
	fill: #6a6f5e;
}

@keyframes splash-mark-in {
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}
@keyframes splash-wm-in {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}
@keyframes splash-dismiss {
	to {
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
	}
}

@media (prefers-color-scheme: dark) {
	#app-splash {
		background: #111110;
	}
	#app-splash .sp-ink {
		fill: #ede9e1;
	}
	#app-splash .sp-accent {
		fill: #9aa487;
	}
}

@media (prefers-reduced-motion: reduce) {
	#app-splash {
		animation: splash-dismiss 0.01s linear 0.25s forwards;
	}
	#app-splash .sp-peak,
	#app-splash .sp-wm {
		animation: none;
		opacity: 1;
		transform: none;
	}
}
