/* Matches frontend tokens, V3HomePage sticky chrome, V3Chrome, ThemeToggle, LocaleSwitcher. */

:root {
	--color-brand-50: #fff1f0;
	--color-brand-300: #ffa099;
	--color-brand-500: #e84842;
	--color-brand-600: #d12f2c;
	--color-ink-50: #f7f4f2;
	--color-ink-100: #ebe4df;
	--color-ink-200: #d6c9c0;
	--color-ink-300: #b9a598;
	--color-ink-400: #9b8476;
	--color-ink-600: #69564d;
	--color-ink-700: #564740;
	--color-ink-800: #483c37;
	--color-ink-900: #2a2320;
	--color-ink-950: #161210;

	--page-bg: #f3eeea;
	--page-bg-image:
		radial-gradient(ellipse 80% 50% at 50% -10%, rgb(232 72 66 / 0.12), transparent),
		radial-gradient(ellipse 60% 40% at 100% 0%, rgb(255 160 153 / 0.18), transparent),
		linear-gradient(180deg, #f7f4f2 0%, #efe8e2 100%);

	--text: var(--color-ink-950);
	--text-muted: var(--color-ink-600);
	--text-faint: var(--color-ink-300);
	--border: rgb(214 201 192 / 0.8);
	--border-solid: var(--color-ink-200);
	--surface: #ffffff;
	--chrome-bg: color-mix(in oklab, var(--page-bg, #f7f4f2) 88%, transparent);
	--font-display: 'Fraunces', Georgia, serif;
	--font-sans: 'Outfit', ui-sans-serif, system-ui, sans-serif;
}

html.dark {
	--page-bg: #120e0c;
	--page-bg-image:
		radial-gradient(ellipse 70% 45% at 50% -15%, rgb(232 72 66 / 0.16), transparent),
		radial-gradient(ellipse 50% 35% at 0% 20%, rgb(72 60 55 / 0.5), transparent),
		linear-gradient(180deg, #161210 0%, #0f0c0a 100%);

	--text: var(--color-ink-50);
	--text-muted: var(--color-ink-300);
	--text-faint: var(--color-ink-600);
	--border: var(--color-ink-800);
	--border-solid: var(--color-ink-700);
	--surface: var(--color-ink-900);
	--chrome-bg: rgb(22 18 16 / 0.85);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-smooth;
}

body {
	margin: 0;
	min-height: 100dvh;
	font-family: var(--font-sans);
	color: var(--text);
	background-color: var(--page-bg);
	background-image: var(--page-bg-image);
	-webkit-font-smoothing: antialiased;
}

::selection {
	background: #ffc7c1;
	color: var(--color-ink-950);
}

html.dark ::selection {
	background: #af2424;
	color: #fff;
}

.grain {
	position: relative;
}

.grain::before {
	content: '';
	pointer-events: none;
	position: absolute;
	inset: 0;
	z-index: 0;
	opacity: 0.035;
	mix-blend-mode: multiply;
	background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

html.dark .grain::before {
	opacity: 0.06;
	mix-blend-mode: soft-light;
}

/* V3HomePage sticky wrapper */
.chrome-sticky {
	position: sticky;
	top: 0;
	z-index: 40;
	border-bottom: 1px solid var(--border);
	background: var(--chrome-bg);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}

/* V3Chrome row */
.chrome-inner {
	position: relative;
	z-index: 2;
	max-width: 80rem; /* max-w-7xl */
	margin: 0 auto;
	padding: 0.75rem 1rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

@media (min-width: 640px) {
	.chrome-inner {
		padding-inline: 1.5rem;
	}
}

.logo {
	font-family: var(--font-display);
	font-size: 1.25rem;
	font-weight: 600;
	letter-spacing: -0.025em;
	color: var(--text);
	text-decoration: none;
	line-height: 1.2;
}

.logo-dot {
	color: var(--color-brand-500);
}

.chrome-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

/* LocaleSwitcher.svelte */
.locale {
	position: relative;
}

.locale-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	height: 2.5rem;
	padding: 0 0.625rem 0 0.5rem;
	border-radius: 9999px;
	border: 1px solid var(--border-solid);
	background: var(--surface);
	color: var(--color-ink-800);
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 500;
	cursor: pointer;
	transition: border-color 0.15s ease;
}

html.dark .locale-btn {
	color: var(--color-ink-100);
}

.locale-btn:hover {
	border-color: var(--color-ink-300);
}

html.dark .locale-btn:hover {
	border-color: var(--color-ink-600);
}

.locale-btn:focus-visible {
	outline: 2px solid var(--color-brand-500);
	outline-offset: 2px;
}

.locale-flag {
	display: grid;
	width: 1.25rem;
	height: 1.25rem;
	flex-shrink: 0;
	overflow: hidden;
	border-radius: 9999px;
	box-shadow:
		0 0 0 1px rgb(42 35 32 / 0.1),
		0 1px 2px rgb(0 0 0 / 0.08);
}

.locale-flag svg {
	width: 100%;
	height: 100%;
	grid-area: 1 / 1;
}

html[lang='da'] .flag-en,
html[lang='en'] .flag-da {
	display: none;
}

.locale-label {
	display: none;
}

@media (min-width: 640px) {
	.locale-label {
		display: inline;
	}
}

.locale-chevron {
	margin-left: auto;
	color: var(--color-ink-400);
	transition: transform 0.15s ease;
}

.locale[data-open='true'] .locale-chevron {
	transform: rotate(180deg);
}

.locale-menu {
	position: absolute;
	top: calc(100% + 0.35rem);
	right: 0;
	z-index: 50;
	min-width: 100%;
	margin: 0;
	padding: 0.5rem 0;
	list-style: none;
	overflow: hidden;
	border-radius: 1rem;
	border: 1px solid var(--border-solid);
	background: var(--surface);
	box-shadow: 0 10px 25px rgb(0 0 0 / 0.12);
}

.locale-option {
	display: flex;
	width: 100%;
	align-items: center;
	gap: 0.625rem;
	padding: 0.625rem 0.75rem;
	border: 0;
	background: transparent;
	color: var(--color-ink-800);
	font: inherit;
	font-size: 0.875rem;
	font-weight: 500;
	text-align: left;
	white-space: nowrap;
	cursor: pointer;
}

html.dark .locale-option {
	color: var(--color-ink-100);
}

.locale-option:hover {
	background: var(--color-brand-50);
}

html.dark .locale-option:hover {
	background: rgb(232 72 66 / 0.1);
}

.locale-menu li[aria-selected='true'] .locale-option {
	background: var(--color-brand-500);
	color: #fff;
}

.locale-menu li[aria-selected='true'] .locale-option:hover {
	background: var(--color-brand-500);
	color: #fff;
}

/* ThemeToggle.svelte */
.theme-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	flex-shrink: 0;
	border-radius: 9999px;
	border: 1px solid var(--border-solid);
	background: var(--surface);
	color: var(--color-ink-800);
	cursor: pointer;
	transition: border-color 0.15s ease;
}

html.dark .theme-btn {
	color: var(--color-ink-100);
}

.theme-btn:hover {
	border-color: var(--color-ink-300);
}

html.dark .theme-btn:hover {
	border-color: var(--color-ink-600);
}

.theme-btn:focus-visible {
	outline: 2px solid var(--color-brand-500);
	outline-offset: 2px;
}

.theme-btn .icon {
	display: none;
}

html[data-theme='light'] .theme-btn .icon-sun,
html[data-theme='dark'] .theme-btn .icon-moon,
html[data-theme='system'] .theme-btn .icon-system {
	display: block;
}

.stage {
	position: relative;
	z-index: 1;
	min-height: calc(100dvh - 3.75rem);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 2rem 1.5rem 5rem;
}

.brand {
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.28em;
	font-family: var(--font-display);
	font-weight: 600;
	font-size: clamp(2.1rem, 8.5vw, 4.75rem);
	line-height: 0.98;
	letter-spacing: -0.03em;
	color: var(--text);
	animation: fade-up 0.45s ease-out both;
}

.brand-line {
	display: block;
}

.brand-line-alt {
	color: var(--color-ink-600);
	font-weight: 500;
	font-size: 0.72em;
	letter-spacing: -0.02em;
}

html.dark .brand-line-alt {
	color: var(--color-ink-300);
}

.brand-dot {
	color: var(--color-brand-500);
}

.brand-dot-alt {
	color: #3a8f86; /* media teal from frontend tokens */
}

html.dark .brand-dot-alt {
	color: #9dcdc6;
}

.lead {
	max-width: 26rem;
	margin: 1.25rem 0 0;
	font-size: clamp(1rem, 2.2vw, 1.15rem);
	font-weight: 400;
	line-height: 1.55;
	color: var(--text-muted);
	animation: fade-up 0.45s 0.08s ease-out both;
}

.foot {
	position: fixed;
	z-index: 1;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	justify-content: center;
	padding: 1.25rem;
	font-size: 0.75rem;
	letter-spacing: 0.04em;
	color: var(--text-faint);
	animation: fade-up 0.45s 0.18s ease-out both;
}

@keyframes fade-up {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.brand,
	.lead,
	.foot {
		animation: none;
	}
}
