@font-face {
	font-family: "KiUT Bricolage";
	src: url("fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
	font-weight: 200 800;
	font-display: swap;
}
@font-face {
	font-family: "KiUT Geist";
	src: url("fonts/geist-latin-wght-normal.woff2") format("woff2");
	font-weight: 100 900;
	font-display: swap;
}

/* Aurora-Farben (wie die KiUmzug-Seiten) */
:root,
:root[data-theme="dark"] {
	color-scheme: dark;
	--bg: #060816;
	--fg: #eceffe;
	--muted: rgba(236, 239, 254, 0.62);
	--faint: rgba(236, 239, 254, 0.14);
	--brand: #c5f035;
	--g-1: #8b9cff;
	--g-2: #c4a8ff;
	--g-3: #7dd3fc;
	--btn-1: #5b6cff;
	--btn-2: #9b6bff;
	--field: rgba(255, 255, 255, 0.05);
	--field-line: rgba(255, 255, 255, 0.12);
	--focus: #a5b1ff;
	--ok: #d4ff5a;
	--err: #ff9a8a;
	--fallback: radial-gradient(60% 50% at 68% 45%, rgba(91, 108, 255, 0.35), transparent 70%), radial-gradient(40% 35% at 70% 50%, rgba(155, 107, 255, 0.35), transparent 70%), #060816;
}

:root[data-theme="light"] {
	color-scheme: light;
	--bg: #f5f6fb;
	--fg: #0a0f2c;
	--muted: rgba(10, 15, 44, 0.62);
	--faint: rgba(10, 15, 44, 0.12);
	--brand: #3346ff;
	--g-1: #3346ff;
	--g-2: #7c3aed;
	--g-3: #0ea5e9;
	--btn-1: #3346ff;
	--btn-2: #7c3aed;
	--field: rgba(255, 255, 255, 0.75);
	--field-line: rgba(10, 15, 44, 0.12);
	--focus: #3346ff;
	--ok: #3f5a00;
	--err: #b3261e;
	--fallback: radial-gradient(60% 50% at 68% 45%, rgba(51, 70, 255, 0.18), transparent 70%), radial-gradient(40% 35% at 70% 50%, rgba(124, 58, 237, 0.18), transparent 70%), #f5f6fb;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

body {
	background: var(--bg);
	color: var(--fg);
	font-family: "KiUT Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
	transition: background-color .4s ease, color .4s ease;
}

#kiut-scene {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	cursor: grab;
	touch-action: pan-y;
	opacity: 0;
	transition: opacity 1.2s ease;
}
#kiut-scene.grabbing { cursor: grabbing; }
.webgl #kiut-scene { opacity: 1; }

.kiut-fallback { display: none; position: fixed; inset: 0; background: var(--fallback); }
.no-webgl .kiut-fallback { display: block; }
.no-webgl #kiut-scene, .no-webgl .kiut-hint { display: none; }

/* Inhalte liegen über der Szene, leere Flächen lassen Ziehen/Drehen durch */
.kiut-shell {
	position: relative;
	z-index: 1;
	min-height: 100vh;
	min-height: 100svh;
	display: grid;
	grid-template-rows: auto 1fr auto;
	padding: clamp(18px, 3vw, 40px) clamp(16px, 4.5vw, 72px);
	padding-bottom: max(clamp(18px, 3vw, 34px), env(safe-area-inset-bottom));
	pointer-events: none;
}
.kiut-shell a, .kiut-shell button, .kiut-shell input, .kiut-shell label, .kiut-headline, .kiut-sub, .kiut-count, .kiut-when { pointer-events: auto; }

/* Kopf */
.kiut-top { display: flex; align-items: center; justify-content: space-between; }
.kiut-word {
	font-family: "KiUT Bricolage", "KiUT Geist", sans-serif;
	font-weight: 800;
	font-size: 23px;
	letter-spacing: -0.02em;
	line-height: 1;
}
.kiut-word b { font-weight: 800; color: var(--brand); }

.kiut-theme {
	appearance: none;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 1px solid var(--field-line);
	background: var(--field);
	color: var(--fg);
	display: grid;
	place-items: center;
	cursor: pointer;
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	transition: border-color .2s ease, transform .2s ease;
}
.kiut-theme:hover { border-color: var(--focus); }
.kiut-theme:active { transform: scale(.94); }
.kiut-theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] .i-sun, [data-theme="light"] .i-moon { display: none; }

/* Bühne */
.kiut-stage { align-self: center; max-width: 640px; padding: 5vh 0 3vh; }

.kiut-headline {
	margin: 0;
	font-family: "KiUT Bricolage", "KiUT Geist", sans-serif;
	font-weight: 700;
	font-size: clamp(2.6rem, 6vw, 5.6rem);
	line-height: 0.96;
	letter-spacing: -0.035em;
	max-width: 11ch;
	text-wrap: balance;
	min-height: 1.92em;
}
.kiut-headline .g { color: var(--g-1); }

.kiut-sub {
	margin: 22px 0 0;
	max-width: 34ch;
	font-size: clamp(1.02rem, 1.3vw, 1.2rem);
	color: var(--muted);
	text-wrap: pretty;
}

.kiut-count {
	margin-top: clamp(28px, 5vh, 48px);
	display: flex;
	gap: clamp(14px, 2.4vw, 34px);
	font-family: "KiUT Bricolage", "KiUT Geist", sans-serif;
}
.kiut-unit { display: flex; flex-direction: column; gap: 8px; }
.kiut-num {
	display: flex;
	font-size: clamp(2.6rem, 6.2vw, 5.4rem);
	font-weight: 600;
	line-height: 1;
	letter-spacing: -0.03em;
}
.kiut-reel {
	position: relative;
	display: block;
	height: 1.08em;
	width: 0.6em;
	overflow: hidden;
	clip-path: inset(0);
	-webkit-mask-image: linear-gradient(180deg, transparent 0, #000 8%, #000 92%, transparent 100%);
	mask-image: linear-gradient(180deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}
.kiut-strip { display: flex; flex-direction: column; }
.kiut-strip span {
	display: block;
	height: 1.08em;
	line-height: 1.08;
	text-align: center;
	background: linear-gradient(170deg, var(--g-1) 10%, var(--g-2) 55%, var(--g-3) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.kiut-lbl { font-size: 13px; color: var(--muted); }
.kiut-when { margin: 16px 0 0; font-size: 14px; color: var(--muted); }

/* Anmeldung */
.kiut-form { margin-top: 26px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; max-width: 540px; }
.kiut-field input {
	width: 100%;
	height: 52px;
	padding: 0 20px;
	font: inherit;
	color: var(--fg);
	background: var(--field);
	border: 1px solid var(--field-line);
	border-radius: 999px;
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	transition: border-color .2s ease, box-shadow .2s ease;
}
.kiut-field input::placeholder { color: var(--muted); }
.kiut-field input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 18%, transparent); }
.kiut-form button {
	height: 52px;
	padding: 0 24px;
	border: 0;
	border-radius: 999px;
	font: inherit;
	font-weight: 600;
	color: #fff;
	background: linear-gradient(120deg, var(--btn-1), var(--btn-2));
	box-shadow: 0 12px 30px -14px var(--btn-1);
	cursor: pointer;
	transition: filter .2s ease, transform .15s ease;
}
.kiut-form button:hover { filter: brightness(1.08); }
.kiut-form button:active { transform: translateY(1px); }
.kiut-form button[disabled] { opacity: .6; cursor: progress; }
.kiut-consent { grid-column: 1 / -1; display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); cursor: pointer; padding-left: 6px; }
.kiut-consent input { margin: 3px 0 0; accent-color: var(--btn-1); }
.kiut-consent a, .kiut-legal a { color: inherit; }
.kiut-msg { grid-column: 1 / -1; margin: 0; min-height: 1.4em; font-size: 14px; padding-left: 6px; }
.kiut-msg.ok { color: var(--ok); }
.kiut-msg.err { color: var(--err); }
.kiut-form.done .kiut-field, .kiut-form.done button, .kiut-form.done .kiut-consent { display: none; }
.kiut-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.kiut-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Fuß */
.kiut-bottom { display: flex; align-items: center; gap: 24px; font-size: 13px; color: var(--muted); }
.kiut-progress { margin-right: auto; display: inline-flex; align-items: center; gap: 12px; font-variant-numeric: tabular-nums; }
.kiut-bar { position: relative; width: 120px; height: 2px; background: var(--faint); border-radius: 2px; overflow: hidden; }
.kiut-bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--g-1), var(--g-2), var(--brand)); transition: width 1.2s ease; }
.kiut-hint { display: inline-flex; align-items: center; gap: 8px; transition: opacity .6s ease; }
.kiut-hint svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.kiut-hint.gone { opacity: 0; }
.kiut-legal { display: flex; gap: 18px; }
.kiut-legal a { text-decoration: none; }
.kiut-legal a:hover { color: var(--fg); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 8px; }

/* Einblendung beim Laden: ein einziger, ruhiger Ablauf */
.js .kiut-headline, .js .kiut-sub, .js .kiut-count, .js .kiut-when, .js .kiut-form, .js .kiut-top, .js .kiut-bottom {
	opacity: 0;
	transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.2, .8, .2, 1);
}
.js .kiut-count { transform: translateY(14px); }
.js.ready .kiut-top { opacity: 1; transition-delay: .3s; }
.js.ready .kiut-headline { opacity: 1; transition: opacity .4s ease .45s; }
.js.ready .kiut-sub { opacity: 1; transition-delay: 1.6s; }
.js.ready .kiut-count { opacity: 1; transform: none; transition-delay: 2s; }
.js.ready .kiut-when, .js.ready .kiut-form { opacity: 1; transition-delay: 2.5s; }
.js.ready .kiut-bottom { opacity: 1; transition-delay: 2.9s; }

/* Nach der Öffnung */
.launched .kiut-sub, .launched .kiut-form, .launched .kiut-hint { display: none; }
.launched .kiut-headline { min-height: 0; }

/* Mobil */
@media (max-width: 760px) {
	.kiut-stage { align-self: end; padding-top: 40vh; }
	.kiut-headline { min-height: 0; }
	.kiut-sub { margin-top: 14px; }
	.kiut-count { gap: 14px; }
	.kiut-lbl { font-size: 11px; }
	.kiut-form { grid-template-columns: 1fr; }
	.kiut-bottom { flex-wrap: wrap; gap: 12px 20px; }
	.kiut-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.js .kiut-headline, .js .kiut-sub, .js .kiut-count, .js .kiut-when, .js .kiut-form, .js .kiut-top, .js .kiut-bottom { transition: none; transform: none; }
	#kiut-scene { transition: none; }
}
