/* The pages around Basecoat's components. Colours come from the theme's
   tokens in theme.css, so light and dark both work; the night sky at the
   top carries the class dark, so it takes the dark tokens in both. */

@font-face {
	font-family: "Plus Jakarta Sans";
	src: url("/assets/fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
	font-weight: 200 800;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "JetBrains Mono";
	src: url("/assets/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
	font-weight: 100 800;
	font-style: normal;
	font-display: swap;
}

/* Basecoat's components read Tailwind's --color-* aliases, which resolve
   once on :root. Declaring them again on .dark lets a dark section inside a
   light page, such as the night sky, give its components the dark tokens. */
.dark {
	--color-background: var(--background);
	--color-foreground: var(--foreground);
	--color-card: var(--card);
	--color-card-foreground: var(--card-foreground);
	--color-popover: var(--popover);
	--color-popover-foreground: var(--popover-foreground);
	--color-primary: var(--primary);
	--color-primary-foreground: var(--primary-foreground);
	--color-secondary: var(--secondary);
	--color-secondary-foreground: var(--secondary-foreground);
	--color-muted: var(--muted);
	--color-muted-foreground: var(--muted-foreground);
	--color-accent: var(--accent);
	--color-accent-foreground: var(--accent-foreground);
	--color-destructive: var(--destructive);
	--color-border: var(--border);
	--color-input: var(--input);
	--color-ring: var(--ring);
}

body {
	background: var(--background);
	color: var(--foreground);
	font-family: var(--font-sans);
	font-size: 1rem;
	line-height: 1.6;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.skip-link {
	position: absolute;
	top: -4rem;
	left: 1rem;
	z-index: 10;
	padding: 0.5rem 1rem;
	border-radius: var(--radius);
	background: var(--primary);
	color: var(--primary-foreground);
	font-weight: 600;
}

.skip-link:focus {
	top: 1rem;
}

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

.container {
	max-width: 72rem;
	margin-inline: auto;
	padding-inline: 1.25rem;
}

.eyebrow {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--font-mono);
	font-size: 0.875rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted-foreground);
}

.eyebrow::before {
	content: "";
	width: 1.5rem;
	height: 2px;
	border-radius: 2px;
	background: linear-gradient(90deg, var(--chart-1), var(--chart-4));
}

/* The night sky: aurora ribbons drifting behind the header and hero,
   stars above them, and a mountain ridge where it meets the page. */

.night {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	background: var(--background);
	color: var(--foreground);
}

.night::before {
	content: "";
	position: absolute;
	inset: -30% -20% 10%;
	z-index: -2;
	background:
		radial-gradient(40% 35% at 25% 40%, color-mix(in oklab, var(--chart-1) 55%, transparent), transparent 70%),
		radial-gradient(35% 30% at 60% 25%, color-mix(in oklab, var(--chart-4) 45%, transparent), transparent 70%),
		radial-gradient(45% 35% at 85% 50%, color-mix(in oklab, var(--chart-3) 50%, transparent), transparent 70%),
		radial-gradient(30% 25% at 45% 70%, color-mix(in oklab, var(--chart-5) 35%, transparent), transparent 70%);
	filter: blur(48px);
	opacity: 0.7;
	animation: aurora 24s ease-in-out infinite alternate;
}

.night::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image:
		radial-gradient(1px 1px at 12% 18%, var(--foreground), transparent),
		radial-gradient(1px 1px at 28% 62%, var(--foreground), transparent),
		radial-gradient(1.5px 1.5px at 41% 12%, var(--foreground), transparent),
		radial-gradient(1px 1px at 57% 38%, var(--foreground), transparent),
		radial-gradient(1px 1px at 69% 8%, var(--foreground), transparent),
		radial-gradient(1.5px 1.5px at 83% 30%, var(--foreground), transparent),
		radial-gradient(1px 1px at 93% 66%, var(--foreground), transparent),
		radial-gradient(1px 1px at 6% 78%, var(--foreground), transparent);
	background-size: 640px 420px;
	opacity: 0.5;
}

@keyframes aurora {
	from {
		transform: translate3d(-4%, 0, 0) rotate(-2deg) scale(1);
	}
	to {
		transform: translate3d(4%, 3%, 0) rotate(3deg) scale(1.1);
	}
}

.ridge {
	display: block;
	position: relative;
	width: 100%;
	height: 4rem;
	margin-top: -4rem;
	color: var(--background);
}

.ridge-line {
	stroke: color-mix(in oklab, var(--chart-4) 35%, transparent);
	stroke-width: 1.5px;
	vector-effect: non-scaling-stroke;
}

/* The header floats over the night sky, in its dark tokens. */
.site-header-band {
	position: absolute;
	inset: 0 0 auto;
	z-index: 2;
	color: var(--foreground);
}

.site-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 4.5rem;
}

.wordmark {
	display: inline-flex;
	align-items: center;
	gap: 0.625rem;
	font-weight: 800;
	font-size: 1.125rem;
	letter-spacing: -0.02em;
}

.wordmark::before {
	content: "";
	width: 0.875rem;
	height: 0.875rem;
	border-radius: 50%;
	background: conic-gradient(from 200deg, var(--chart-1), var(--chart-4), var(--chart-3), var(--chart-1));
	box-shadow: 0 0 16px color-mix(in oklab, var(--chart-1) 70%, transparent);
}

.lead {
	max-width: 36rem;
	margin-top: 1.5rem;
	font-size: 1.1875rem;
	line-height: 1.6;
	color: var(--muted-foreground);
}

.site-footer {
	position: relative;
	padding-block: 2.5rem;
	font-size: 0.875rem;
	color: var(--muted-foreground);
}

.site-footer::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 2px;
	background: linear-gradient(90deg, transparent, var(--chart-1), var(--chart-4), var(--chart-3), transparent);
	opacity: 0.7;
}

.site-footer .container {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.5rem 2rem;
}

.site-footer a,
.prose a,
.lead a {
	text-decoration: underline;
	text-underline-offset: 4px;
}

/* Long text: the terms, the privacy policy and the 404 page. */

.page-title {
	padding-block: 7.5rem 6rem;
}

.page-title h1 {
	font-size: clamp(2rem, 5vw, 3.25rem);
	line-height: 1.1;
	font-weight: 800;
	letter-spacing: -0.03em;
}

.prose {
	max-width: 45rem;
	overflow-wrap: break-word;
	padding-block: 1rem 4rem;
}

.prose h2 {
	margin-top: 2rem;
	font-size: 1.125rem;
	font-weight: 700;
}

.prose p {
	margin-top: 1rem;
}

.prose ul {
	margin-top: 1rem;
	padding-left: 1.25rem;
	list-style: disc;
}

.prose li + li {
	margin-top: 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
	.night::before {
		animation: none;
	}
}
