@font-face {
	font-family: "General Sans";
	src: url("fonts/general-sans-400.woff2") format("woff2");
	font-weight: 400;
	font-display: swap;
}
@font-face {
	font-family: "General Sans";
	src: url("fonts/general-sans-500.woff2") format("woff2");
	font-weight: 500;
	font-display: swap;
}
@font-face {
	font-family: "General Sans";
	src: url("fonts/general-sans-700.woff2") format("woff2");
	font-weight: 700;
	font-display: swap;
}

:root {
	--ground: hsl(232 45% 5%);
	--veil: hsl(232 45% 5% / 0.8);
	--tone-1: hsl(226 42% 14% / 0.92);
	--tone-2: hsl(228 36% 15% / 0.85);
	--tone-3: hsl(205 40% 24%);
	--grass: hsl(150 45% 38%);
	--grass-deep: hsl(158 40% 15% / 0.95);
	--well: hsl(232 45% 6% / 0.92);
	--well-hover: hsl(228 40% 11%);
	--ink: hsl(220 30% 96%);
	--dim: hsl(228 20% 78%);
	--star: hsl(48 100% 82%);
	--star-hover: hsl(48 100% 91%);
	--card: hsl(232 40% 9% / 0.85);
	--card-ink: hsl(220 30% 96%);
	--card-dim: hsl(228 20% 76%);
	--dots:
		radial-gradient(hsl(0 0% 100% / 0.08) 1px, transparent 1.5px) 0 0 / 4px 4px;
	--radius: 0; /* one corner language: square, like the dither cells */
	--margin: clamp(16px, 3vw, 32px);
	--pad: max(var(--margin), calc((100vw - 1480px) / 2));
	--ease: cubic-bezier(0.32, 0.72, 0, 1);
	--step-small: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
	--step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
	--step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
	--step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
	--step-mega: clamp(3.5rem, 10vw, 9.5rem);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}
html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}
#field {
	position: fixed;
	inset: 0;
	z-index: -1;
	width: 100%;
	height: 100vh;
	height: 100lvh;
	image-rendering: pixelated;
	background: linear-gradient(hsl(238 55% 7%), hsl(206 50% 20%));
}
body {
	margin: 0;
	background: var(--ground);
	color: var(--ink);
	font:
		400 var(--step-body) / 1.5 "General Sans",
		system-ui,
		sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}
h1,
h2,
p,
ol,
ul {
	margin: 0;
}
ol {
	padding: 0;
	list-style: none;
}
a {
	color: inherit;
	text-underline-offset: 0.2em;
	text-decoration-thickness: from-font;
}
img {
	display: block;
	max-width: 100%;
	height: auto;
}
.sr {
	position: absolute;
	width: 1px;
	height: 1px; /* taste-skill-ignore */
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
:focus-visible {
	outline: 3px solid var(--star);
	outline-offset: 3px;
}
::selection {
	background: var(--star);
	color: var(--ground);
}
b,
.fig,
.n,
.ui-big {
	font-variant-numeric: tabular-nums;
}

h1,
h2,
.fig,
.clause {
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 0.95;
	text-wrap: balance;
}
h2 {
	font-size: var(--step-head);
}
p {
	text-wrap: pretty;
}

/* Controls: one square shape for every action and field */
.btn,
input[type="text"] {
	font: inherit;
	line-height: 1.2;
	border-radius: var(--radius);
	min-height: 52px;
}
.btn {
	display: inline-flex;
	text-decoration: none;
	align-items: center;
	justify-content: center;
	appearance: none;
	border: 0;
	background: var(--star);
	color: var(--ground);
	font-weight: 700;
	padding: 0 28px;
	cursor: pointer;
	white-space: nowrap;
	transition:
		background-color 0.24s var(--ease),
		transform 0.24s var(--ease);
}
.btn:hover {
	background: var(--star-hover);
}
.btn:active {
	transform: scale(0.97);
}
.btn[disabled] {
	opacity: 0.7;
	cursor: progress;
}
input[type="text"] {
	min-width: 0;
	background: hsl(232 45% 7% / 0.82);
	color: var(--ink);
	border: 0;
	padding: 0 24px;
	font-size: 1rem;
	transition: background-color 0.24s var(--ease);
}
input[type="text"]::placeholder {
	color: var(--dim);
}
input[type="text"]:hover {
	background: var(--well-hover);
}

/* Bar */
.bar {
	position: absolute;
	inset: 0 0 auto 0;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px var(--pad);
}
.mark {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 700;
	font-size: 1.125rem;
	text-decoration: none;
	letter-spacing: -0.01em;
}
.mark img {
	width: 22px;
	height: 22px;
}
.bar nav {
	display: flex;
	align-items: center;
	gap: 28px;
	font-size: var(--step-small);
	font-weight: 500;
}
.bar nav a {
	text-decoration: none;
	transition: color 0.24s var(--ease);
}
.bar nav a:hover {
	color: var(--star);
}
.bar .bar-action {
	background: var(--star);
	color: var(--ground);
	padding: 10px 18px;
	border-radius: var(--radius);
	font-weight: 700;
}
.bar .bar-action:hover {
	color: var(--ground);
	background: var(--star-hover);
}

/* Hero: copy floats in the sky above the field */
.hero {
	position: relative;
	min-height: 100svh;
	display: grid;
	justify-items: center;
	align-content: center;
	padding: 96px var(--pad) 32svh;
	text-align: center;
}
.hero-copy {
	width: 100%;
	max-width: 52rem;
	position: relative;
}
h1 {
	font-size: clamp(2.75rem, 6.4vw, 6.25rem);
}
.find {
	display: flex;
	gap: 8px;
	margin: 36px auto 0;
	max-width: 34rem;
}
.find input {
	flex: 1;
}
.result {
	position: absolute;
	inset: 100% 0 auto;
	margin-top: 16px;
	min-height: 3.2em;
	max-width: 34rem;
	margin-inline: auto;
}
/* Status line: a solid night plate so text stays readable over moon and grass */
.result:not(:empty) {
	width: fit-content;
	min-height: 0;
	padding: 12px 18px;
	background: hsl(232 45% 5% / 0.92);
	border: 0;
	backdrop-filter: blur(8px);
	color: var(--ink);
	line-height: 1.35;
	text-wrap: balance;
}
.result .n {
	font-size: var(--step-lead);
	font-weight: 700;
	color: var(--star);
}
.result a {
	display: inline-block;
	margin-top: 8px;
	font-weight: 700;
}

/* Everything below the hero sits on a night veil over the fixed field */
.stats,
.faq,
.atlas,
.foot {
	background: var(--veil);
}
.close {
	background: var(--veil);
}

/* How it works: four fields, one card, further along each time */
.how {
	padding-top: clamp(96px, 12vw, 200px);
	background: linear-gradient(transparent, var(--veil) 45vh);
}
.how h2 {
	padding: 0 var(--pad) 32px;
}
.fields {
	gap: 8px;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
}
.field {
	border: 0;
	border-radius: var(--radius);
	min-height: min(72svh, 620px);
	position: relative;
	padding: 28px;
	display: flex;
	flex-direction: column;
}
.f1 {
	background: var(--dots), hsl(232 42% 13%);
}
.f2 {
	background: var(--dots), hsl(222 42% 15%);
}
.f3 {
	background: var(--dots), hsl(210 42% 17%);
}
.f4 {
	background: var(--dots), var(--grass-deep);
}
.clause {
	font-size: clamp(1.375rem, 2vw, 2rem);
	line-height: 1.05;
	letter-spacing: -0.015em;
	margin-top: auto;
	padding-top: 32px;
}
.ui {
	margin-top: 28%;
	width: 100%;
	max-width: 260px;
	background: hsl(232 45% 4% / 0.9);
	color: var(--card-ink);
	border: 0;
	border-radius: var(--radius);
	padding: 20px;
	display: grid;
	gap: 10px;
	transition: translate 0.5s var(--ease);
}
.field:hover .ui {
	translate: 0 -8px;
}
.ui-label {
	font-size: 0.8125rem;
	color: var(--card-dim);
	font-weight: 500;
}
.ui-input {
	background: var(--tone-2);
	border-radius: var(--radius);
	padding: 10px 16px;
	font-weight: 500;
}
.ui-btn {
	background: var(--star);
	color: var(--ground);
	border-radius: var(--radius);
	padding: 10px 16px;
	font-weight: 700;
	text-align: center;
	font-size: 0.9375rem;
}
.ui-big {
	font-size: 1.5rem;
	font-weight: 500;
	line-height: 1.1;
}
.ui-big b {
	font-size: 3rem;
	font-weight: 700;
	letter-spacing: -0.03em;
	display: block;
	line-height: 1;
}
.ui-note {
	font-size: 0.875rem;
	color: var(--card-dim);
}
.ui-row {
	background: var(--tone-2);
	border-radius: var(--radius);
	padding: 9px 16px;
	font-weight: 500;
}
.ui-row:first-of-type {
	background: var(--star);
	color: var(--ground);
}

/* Atlas */
.atlas {
	padding: clamp(96px, 12vw, 200px) var(--pad);
}
.atlas-text p {
	font-size: var(--step-lead);
	line-height: 1.3;
	margin-top: 28px;
	max-width: 20em;
}
.atlas-discs {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
	margin-top: clamp(40px, 6vw, 96px);
	align-items: start;
}
.atlas-discs img {
	border-radius: 50%;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	filter: grayscale(1) contrast(1.35) brightness(0.85);
	mix-blend-mode: screen;
	transition: rotate 0.6s var(--ease);
}
.atlas-discs img:hover {
	rotate: 6deg;
	scale: 1.02;
}
.atlas-discs picture {
	position: relative;
	border-radius: 50%;
	overflow: hidden;
	background: hsl(232 45% 4%);
}
.atlas-discs picture::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		radial-gradient(hsl(232 45% 4% / 0.55) 1px, transparent 1.6px) 0 0 / 3px 3px;
	pointer-events: none;
}
.atlas-discs picture:nth-child(2) {
	margin-top: 12%;
}
/* The rubbing is pale lines on dark: invert it to match the two paper charts */
.atlas-discs .rubbing img {
	filter: grayscale(1) brightness(2.2) contrast(1.4) invert(1) brightness(0.72);
}

/* Stats: heading on the page grid, one row of equal tiles with level bottoms */
.stats {
	padding: 0 var(--pad);
}
.stats h2 {
	max-width: 12em;
	padding-bottom: clamp(24px, 3vw, 40px);
}
.tiles {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(0, 1fr);
	gap: 8px;
}
.tile {
	border-radius: var(--radius);
	container-type: inline-size;
	min-height: clamp(220px, 24vw, 340px);
	padding: clamp(20px, 2vw, 28px);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	border: 0;
	border-radius: var(--radius);
	background: var(--dots), hsl(232 42% 13%);
}
.tile[hidden] {
	display: none;
}
.tile p {
	font-size: clamp(1rem, 6.5cqi, 1.25rem);
	line-height: 1.3;
	max-width: 14em;
}
.fig {
	font-size: clamp(2.5rem, 27cqi, 7rem);
}
.t0 {
	background: var(--dots), var(--grass-deep);
	border: 0;
}
.t0 .fig {
	color: var(--star);
}

/* FAQ */
.faq {
	padding: clamp(96px, 12vw, 200px) var(--pad);
	display: grid;
	grid-template-columns: 4fr 8fr;
	gap: 8px clamp(24px, 4vw, 64px);
	align-items: start;
}
.faq h2 {
	position: sticky;
	top: 96px;
}
.qs {
	display: grid;
	gap: 8px;
}
details {
	background: var(--dots), var(--tone-1);
	border: 0;
	border-radius: var(--radius);
	transition: background-color 0.3s var(--ease);
}
details[open] {
	background: var(--dots), var(--grass-deep);
	border: 0;
}
summary {
	list-style: none;
	cursor: pointer;
	min-height: 72px;
	padding: 16px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	font-size: 1.25rem;
	font-weight: 500;
}
summary::-webkit-details-marker {
	display: none;
}
summary::after {
	content: "+";
	flex: none;
	font-size: 2rem;
	font-weight: 400;
	line-height: 1;
	transition: transform 0.4s var(--ease);
}
details[open] summary::after {
	transform: rotate(45deg);
}
details p {
	padding: 0 24px 24px;
	max-width: 30em;
	font-size: 1.0625rem;
}

/* Close */
.close {
	min-height: clamp(520px, 86svh, 880px);
	padding: clamp(64px, 10vw, 140px) var(--pad);
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: 24px;
	align-items: center;
}
.close-copy {
	grid-column: 1 / 8;
}
.close h2 {
	font-size: clamp(3rem, 6.4vw, 6.5rem);
	color: var(--star);
}
.dialog {
	grid-column: 9 / 13;
	background: var(--dots), var(--tone-1);
	color: var(--card-ink);
	border: 0;
	border-radius: var(--radius);
	padding: 28px;
	display: grid;
	gap: 12px;
	max-width: 440px;
	width: 100%;
}
.dialog-title {
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: -0.01em;
}
.dialog label {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--card-dim);
}

/* Footer */
.foot {
	padding: 80px var(--pad) 32px;
}
.blocks {
	display: flex;
	gap: 4px;
	height: clamp(120px, 34svh, 340px);
	align-items: flex-end;
}
.blocks span {
	border-radius: var(--radius);
	flex: 1;
	height: var(--h);
	background: var(--c);
	color: var(--k);
	display: grid;
	place-items: center;
	font-weight: 700;
	font-size: clamp(2.5rem, 9vw, 9rem);
	line-height: 1;
	padding-bottom: 0.12em;
	transition: translate 0.5s var(--ease);
}
.blocks span:hover {
	translate: 0 -12px;
}
.foot-links {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 40px;
	margin-top: 56px;
	font-size: 1rem;
	font-weight: 500;
}
.foot-links a {
	text-decoration: none;
}
.foot-links a:hover {
	color: var(--star);
}
.credits {
	margin-top: 56px;
	font-size: 0.875rem;
	line-height: 1.55;
	max-width: 36em;
}

/* Motion lives in app.js (GSAP); content stays visible if script fails */

@media (max-width: 900px) {
	.bar nav a:not(.bar-action) {
		display: none;
	}
	h1 {
		font-size: clamp(2.5rem, 12.5vw, 4.5rem);
	}
	.find {
		flex-direction: column;
	}
	.find .btn {
		width: 100%;
	}
	.fields {
		grid-template-columns: 1fr;
	}
	.field {
		min-height: 0;
		padding: 24px 24px 32px;
	}
	.ui {
		margin-top: 32px;
		order: 2;
	}
	.clause {
		order: 1;
		margin-top: 0;
		padding-top: 0;
	}
	.atlas-discs {
		grid-template-columns: 1fr 1fr;
		gap: 6px;
	}
	.atlas-discs picture:nth-child(2) {
		margin-top: 0;
	}
	.atlas-discs picture:nth-child(3) {
		grid-column: 1 / 3;
		width: 50%;
		justify-self: center;
	}
	.tiles {
		grid-auto-flow: row;
		grid-auto-columns: auto;
		grid-template-columns: 1fr 1fr;
		gap: 6px;
	}
	.tile {
		min-height: 52vw;
	}
	.tile p {
		font-size: 0.9375rem;
	}
	.tiles:not(.has-repos) .tile:last-child {
		grid-column: 1 / -1;
	}
	.faq {
		grid-template-columns: 1fr;
	}
	.faq h2 {
		position: static;
		font-size: 9vw;
		padding-bottom: 12px;
	}
	summary {
		font-size: 1.125rem;
		min-height: 64px;
	}
	.close {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
		gap: 32px;
		padding-top: 48px;
	}
	.close h2 {
		font-size: 13vw;
	}
	.dialog {
		max-width: none;
	}
	.foot-links {
		gap: 12px 28px;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
	* {
		transition-duration: 0.01ms !important;
	}
}

/* Keep hero type readable over bright stars and the moon */
.hero h1 {
	text-shadow:
		0 0 14px var(--ground),
		0 2px 0 var(--ground);
}

/* Chips: one tap runs the chart */
.chips {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-top: 16px;
}
.chips button {
	font: inherit;
	font-size: var(--step-small);
	font-weight: 500;
	color: var(--ink);
	background: hsl(232 45% 7% / 0.82);
	border: 0;
	border-radius: var(--radius);
	min-height: 40px;
	padding: 0 16px;
	cursor: pointer;
	transition:
		background-color 0.24s var(--ease),
		transform 0.24s var(--ease);
}
.chips button:hover {
	background: var(--tone-3);
}
.chips button:active {
	transform: scale(0.97);
}

/* Small, fast motion: 340 ms, strong ease-out */
@keyframes swap {
	from {
		opacity: 0;
		translate: 0 5px;
		filter: blur(1.5px);
	}
}
.result.swap {
	animation: swap 340ms cubic-bezier(0.16, 1, 0.3, 1);
}
@media (prefers-reduced-motion: reduce) {
	.result.swap {
		animation: none;
	}
}
/* Hero load-in is GSAP (motion.js). Hidden only when motion is allowed; the 3 s fallback shows it if the script never runs. */
@keyframes shown {
	to {
		opacity: 1;
	}
}
@media (prefers-reduced-motion: no-preference) {
	.js .bar,
	.js .hero h1,
	.js .find,
	.js .chips {
		opacity: 0;
		animation: shown 0s 3s forwards;
	}
}

/* Theme cursor (desktop pointer only, see cursor.js) */
html.has-cur,
html.has-cur * {
	cursor: none !important;
}
.cur,
.cur-dot {
	position: fixed;
	inset: 0 auto auto 0;
	z-index: 100;
	pointer-events: none;
	margin: -10px 0 0 -10px;
	width: 20px;
	height: 20px;
	background: var(--star);
	clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}
.cur {
	filter: drop-shadow(0 0 5px hsl(48 100% 70% / 0.85));
	transition: scale 0.2s var(--ease), background-color 0.2s var(--ease);
}
.cur.on {
	scale: 1.6;
	background: var(--star-hover);
}
.cur-dot {
	width: 10px;
	height: 10px;
	margin: -5px 0 0 -5px;
	background: hsl(48 90% 72%);
}

/* Agents: copy on the left, two code wells on the right, hue steps instead of borders */
.agents {
	background: var(--veil);
	padding: clamp(96px, 12vw, 200px) var(--pad) 0;
	display: grid;
	grid-template-columns: 5fr 7fr;
	gap: 32px clamp(24px, 4vw, 64px);
	align-items: start;
}
.agents-text {
	display: grid;
	gap: 24px;
	justify-items: start;
}
.agents-text p {
	font-size: var(--step-lead);
	line-height: 1.3;
	max-width: 20em;
}
.code {
	display: grid;
	gap: 0;
	background: var(--dots), var(--grass-deep);
	padding: 8px;
	min-width: 0;
}
.code-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 8px 8px 16px;
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--card-dim);
}
.code-bar:not(:first-child) {
	margin-top: 8px;
}
.copy {
	font: inherit;
	font-weight: 700;
	color: var(--ground);
	background: var(--star);
	border: 0;
	border-radius: var(--radius);
	min-height: 40px;
	padding: 0 16px;
	cursor: pointer;
	transition:
		background-color 0.24s var(--ease),
		transform 0.24s var(--ease);
}
.copy:hover {
	background: var(--star-hover);
}
.copy:active {
	transform: scale(0.97);
}
.code pre {
	margin: 0;
	padding: 16px;
	background: var(--well);
	overflow-x: auto;
	font:
		400 0.875rem / 1.6 ui-monospace,
		"SF Mono",
		Menlo,
		Consolas,
		monospace;
	color: var(--ink);
}
@media (max-width: 900px) {
	.agents {
		grid-template-columns: 1fr;
	}
	.agents h2 {
		font-size: 9vw;
	}
	.code pre {
		font-size: 0.8125rem;
	}
}
