/* Public pages: home, redirect and not-found. */

:root {
	--bg: #000000;
	--surface: #111114;
	--ink: #f5f5f7;
	--muted: #98989d;
	--accent: #a1a1a6;
	--rule: #303034;
	--font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
	color-scheme: dark;
}

:root[data-theme="light"] {
	--bg: #f5f5f7;
	--surface: #ffffff;
	--ink: #1c1c1e;
	--muted: #6e6e73;
	--accent: #636366;
	--rule: #d1d1d6;
	color-scheme: light;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	background: var(--bg);
}

body {
	margin: 0;
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	align-items: flex-end;
	padding: clamp(1.5rem, 6vw, 4.5rem);
	background: var(--bg);
	color: var(--ink);
	font: 1rem/1.5 var(--font-body);
	-webkit-font-smoothing: antialiased;
}

.stage {
	width: 100%;
	max-width: 44rem;
}

.home-page {
	align-items: center;
	justify-content: center;
	background: var(--bg);
}

.home-page .stage {
	max-width: 42rem;
	padding: clamp(1.5rem, 6vw, 3rem);
	border: 1px solid var(--rule);
	border-radius: 0;
	background: var(--surface);
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.home-search {
	display: flex;
	gap: .65rem;
	margin: 1.5rem 0 0;
}

.home-search input {
	min-width: 0;
	flex: 1;
	padding: .85rem 1rem;
	border: 1px solid var(--rule);
	border-radius: 0;
	background: var(--surface);
	color: var(--ink);
	font: inherit;
}

.home-search input::placeholder { color: var(--muted); opacity: .8; }

.home-search button {
	width: auto;
	margin: 0;
	padding: .8rem 1.15rem;
	border: 1px solid #4a4a4e;
	border-radius: 0;
	background: #2c2c2e;
	color: #f5f5f7;
	font: 700 .95rem/1.2 Inter, "Inter var", system-ui, sans-serif;
	cursor: pointer;
}

.home-search button:hover { background: #3a3a3c; }

:root[data-theme="light"] .home-search button { border-color: #c7c7cc; background: #e5e5ea; color: #1c1c1e; }
:root[data-theme="light"] .home-search button:hover { background: #d8d8dd; }

.search-message {
	min-height: 1.5em;
	margin: 1.1rem 0 0;
	color: var(--muted);
	font-size: .9rem;
}

.search-results {
	display: grid;
	gap: .65rem;
	margin: .5rem 0 0;
	padding: 0;
	list-style: none;
}

.search-results li {
	display: grid;
	gap: .2rem;
	min-width: 0;
	padding: .85rem 1rem;
	border: 1px solid var(--rule);
	border-radius: 0;
	background: var(--surface);
}

.search-results a {
	width: fit-content;
	max-width: 100%;
	color: var(--ink);
	font-weight: 650;
	text-decoration-color: var(--accent);
	text-underline-offset: .2em;
	overflow-wrap: anywhere;
}

.result-destination {
	color: var(--muted);
	font-size: .82rem;
	overflow-wrap: anywhere;
}

@media (max-width: 480px) {
	.home-search { flex-direction: column; }
	.home-search button { width: 100%; }
}

.lead {
	margin: 0 0 0.5rem;
	color: var(--muted);
}

/* The destination, set large: the one thing the redirect page is about. */
.dest {
	margin: 0;
	font: 500 clamp(1.75rem, 7vw, 3.5rem) / 1.1 var(--font-mono);
	letter-spacing: -0.03em;
	overflow-wrap: anywhere;
}

.title {
	margin: 0 0 0.5rem;
	font-size: clamp(1.5rem, 5vw, 2.25rem);
	line-height: 1.15;
	font-weight: 600;
	letter-spacing: -0.02em;
}

/* A line that fills from left to right while the redirect counts down. */
.track {
	height: 2px;
	margin: 1.75rem 0 1rem;
	background: var(--rule);
	overflow: hidden;
}

.travel {
	display: block;
	height: 100%;
	background: var(--accent);
	transform: scaleX(0);
	transform-origin: left center;
	animation: travel var(--delay, 1400ms) cubic-bezier(0.6, 0, 0.3, 1) forwards;
}

@keyframes travel {
	to {
		transform: scaleX(1);
	}
}

.note {
	margin: 0;
	max-width: 34rem;
	color: var(--muted);
}

.skip {
	margin: 0;
}

.skip a {
	color: var(--ink);
	text-underline-offset: 0.2em;
}

/* A small, calm pause before following a short link. */
.redirect-page {
	position: relative;
	isolation: isolate;
	align-items: center;
	justify-content: center;
	background: #18181a;
}

.redirect-page::before {
	position: fixed;
	inset: 0;
	z-index: 0;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
	content: "";
	opacity: .12;
	pointer-events: none;
}

:root[data-theme="light"] .redirect-page {
	background: var(--bg);
}

:root[data-theme="light"] .redirect-page::before {
	display: none;
}

.redirect-card {
	position: relative;
	z-index: 1;
	max-width: 38rem;
	padding: 0 clamp(1.5rem, 6vw, 3.5rem) clamp(1.5rem, 6vw, 3.5rem);
	border: 1px solid var(--rule);
	border-radius: 0;
	background: #000000;
}

:root[data-theme="light"] .redirect-card { background: var(--surface); }

.redirect-garden {
	height: clamp(10rem, 36vw, 14rem);
	margin: 0 calc(clamp(1.5rem, 6vw, 3.5rem) * -1) 1.75rem;
	overflow: hidden;
	background: transparent;
}

:root[data-theme="light"] .redirect-garden { background: #f0f0f5; }

.redirect-garden svg { display: block; width: 100%; height: 100%; }
.redirect-garden .stem { fill: none; stroke: #a8b38f; stroke-width: 2.5; stroke-linecap: round; }
.redirect-garden .leaf { fill: #a6bd86; }
.redirect-garden .bloom-coral { fill: #f09a8e; }
.redirect-garden .bloom-lilac { fill: #c2a4d4; }
.redirect-garden .bloom-gold { fill: #f3c86d; }
.redirect-garden .bloom-blue { fill: #91c6d9; }
.redirect-garden .bloom-pink { fill: #ed9fba; }
.redirect-garden .bloom circle { fill: #fff0a8; }
.redirect-garden .sparkle { fill: #f0cb76; }
.redirect-garden .ground { fill: none; stroke: #81818a; stroke-width: 1.5; stroke-linecap: round; opacity: .65; }

.redirect-mark {
	width: 2.75rem;
	height: 2.75rem;
	display: grid;
	place-items: center;
	margin-bottom: 2rem;
	border-radius: 0;
	background: color-mix(in srgb, var(--accent) 14%, var(--bg));
}

.redirect-mark span {
	width: 0.7rem;
	height: 0.7rem;
	border-radius: 0;
	background: var(--accent);
}

.redirect-page .lead {
	margin-bottom: 0.4rem;
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.redirect-page .dest {
	display: block;
	margin: 0;
	color: var(--ink);
	font: 600 clamp(1.25rem, 5vw, 1.75rem)/1.25 var(--font-body);
	letter-spacing: 0;
	word-break: break-word;
}

.redirect-page .track {
	margin: 2rem 0 1.25rem;
	height: 3px;
	border-radius: 0;
}

.redirect-page .travel {
	border-radius: 0;
}

.redirect-page .skip a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 9rem;
	padding: .8rem 1.4rem;
	border: 1px solid #4a4a4e;
	border-radius: 0;
	background: #2c2c2e;
	color: #f5f5f7;
	font: 700 1rem/1.2 Inter, "Inter var", system-ui, -apple-system, "Segoe UI", sans-serif;
	letter-spacing: .005em;
	text-decoration: none;
	transition: background-color 150ms ease;
}

.redirect-page .skip a:hover {
	background: #3a3a3c;
}

.notfound-page {
	align-items: center;
	justify-content: center;
	background: var(--bg);
}

.notfound-card {
	width: min(100%, 34rem);
	padding: clamp(1.25rem, 5vw, 2.5rem);
	border: 1px solid var(--rule);
	border-radius: 0;
	background: var(--surface);
	text-align: center;
}

.notfound-art {
	display: block;
	width: 100%;
	height: clamp(9rem, 34vw, 13rem);
	margin: 0 auto 1rem;
	border-radius: 0;
	background: #111114;
}

:root[data-theme="light"] .notfound-art { background: #f0f0f5; }

.nf-ground { fill: none; stroke: #81818a; stroke-width: 1.5; opacity: .75; }
.nf-stem { fill: none; stroke: #a8b38f; stroke-width: 2.5; stroke-linecap: round; }
.nf-leaf { fill: #a6bd86; }
.nf-flower ellipse { stroke: #fffdf9; stroke-width: .6; }
.nf-flower circle { fill: #fff0a8; }
.nf-pink ellipse { fill: #ed91a3; }
.nf-yellow ellipse { fill: #f1c45f; }
.nf-purple ellipse { fill: #ad92c9; }
.nf-butterfly { fill: #df987e; }
.nf-path { fill: none; stroke: #d7b69a; stroke-width: 2; stroke-dasharray: 2 7; stroke-linecap: round; }

.notfound-label {
	margin: 0 0 .35rem;
	color: var(--muted);
	font-size: .8rem;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
}

.notfound-title {
	margin: 0;
	font-size: clamp(1.7rem, 7vw, 2.4rem);
	font-weight: 650;
	letter-spacing: -.04em;
	line-height: 1.1;
}

.notfound-copy {
	margin: .7rem 0 1.35rem;
	color: var(--muted);
}

.notfound-home {
	display: inline-flex;
	justify-content: center;
	padding: .8rem 1.4rem;
	border: 1px solid #4a4a4e;
	border-radius: 0;
	background: #2c2c2e;
	color: #f5f5f7;
	font: 700 1rem/1.2 Inter, "Inter var", system-ui, -apple-system, "Segoe UI", sans-serif;
	text-decoration: none;
}

.notfound-home:hover {
	background: #3a3a3c;
}

:root[data-theme="light"] .notfound-home { border-color: #c7c7cc; background: #e5e5ea; color: #1c1c1e; }
:root[data-theme="light"] .notfound-home:hover { background: #d8d8dd; }

.theme-toggle {
	position: fixed;
	top: 1rem;
	right: 1rem;
	z-index: 2;
	width: 2.75rem;
	height: 2.75rem;
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--ink);
	cursor: pointer;
}

.theme-toggle:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.theme-toggle svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-icon-moon { display: none; }
:root[data-theme="light"] .theme-icon-sun { display: none; }
:root[data-theme="light"] .theme-icon-moon { display: block; }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

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

@media (prefers-reduced-motion: reduce) {
	.travel {
		animation: none;
		transform: scaleX(1);
	}
}
