/* The public product site. Colors, type, spacing and radii are the design
   system's (tokens.css is written from design/tokens.json by
   tools/build-site.mjs); its rules hold here too: surfaces part by lightness
   and not by borders, the accent is used once, chips are never capitals. */

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

html {
	color-scheme: dark;
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--background);
	color: var(--foreground);
	font-family: var(--font-sans);
	font-size: 17px;
	line-height: 26px;
	-webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
dt,
.wordmark {
	font-family: var(--font-display);
	font-weight: 500;
	letter-spacing: -0.02em;
	margin: 0;
}

h1 {
	font-size: clamp(36px, 6vw, 60px);
	line-height: 1.05;
	text-wrap: balance;
}

h2 {
	font-size: clamp(26px, 3.4vw, 36px);
	line-height: 1.15;
}

h3 {
	font-size: 24px;
	line-height: 28px;
}

p {
	margin: 0;
	text-wrap: pretty;
}

a {
	color: var(--foreground);
	text-underline-offset: 3px;
}

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

.wrap {
	width: min(100% - 2 * var(--space-5), 1120px);
	margin-inline: auto;
}

.skip {
	position: absolute;
	left: var(--space-4);
	top: -100px;
	padding: var(--space-2) var(--space-4);
	border-radius: var(--radius-pill);
	background: var(--surface-2);
}

.skip:focus {
	top: var(--space-4);
}

/* Top line */

.top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-6);
	padding-block: var(--space-6);
}

.wordmark {
	font-size: 22px;
	line-height: 28px;
}

.top nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: var(--space-1) var(--space-5);
	font-size: 15px;
	line-height: 20px;
}

.top nav a {
	color: var(--muted);
	text-decoration: none;
	padding-block: var(--space-3);
}

.top nav a:hover {
	color: var(--foreground);
}

/* Chips: what is built, in testing and planned */

.chip {
	display: inline-block;
	padding: 0 var(--space-3);
	border-radius: var(--radius-pill);
	background: var(--surface-2);
	color: var(--foreground);
	font-family: var(--font-sans);
	font-size: 13px;
	line-height: 26px;
	font-weight: 500;
	letter-spacing: 0;
}

.chip-accent {
	color: var(--accent);
}

.chip-built {
	color: var(--success);
}

.chip-testing {
	color: var(--warning);
}

.chip-planned {
	color: var(--muted);
}

/* First screen */

.hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: var(--space-12);
	padding-block: var(--space-8) var(--space-12);
}

.hero-text {
	display: grid;
	justify-items: start;
	gap: var(--space-5);
	max-width: 560px;
}

.lede {
	font-size: 19px;
	line-height: 30px;
}

.meta {
	color: var(--muted);
}

.hero-screens {
	display: flex;
	gap: var(--space-5);
	--scale: 0.56;
}

.hero-screens .phone:last-child {
	margin-top: var(--space-12);
}

/* A screen: a board from design/hifi in a frame, drawn at its own size and
   scaled down. The bezel is a lighter surface, since the screen is black on
   a black page. */

.phone,
.browser {
	margin: 0;
	--scale: 0.66;
}

.phone {
	--width: 390;
	--height: 844;
	--bezel: 8px;
	--corner: 28px;
	width: calc(var(--width) * var(--scale) * 1px + 2 * var(--bezel));
}

.browser {
	--width: 1440;
	--height: 1000;
	--bezel: 6px;
	--corner: 14px;
	--scale: 0.72;
	width: calc(var(--width) * var(--scale) * 1px + 2 * var(--bezel));
}

.hero-screens .phone {
	--scale: inherit;
}

.screen {
	padding: var(--bezel);
	border-radius: var(--corner);
	background: var(--surface-2);
}

.screen iframe {
	display: block;
	border: 0;
	width: calc(var(--width) * 1px);
	height: calc(var(--height) * 1px);
	transform: scale(var(--scale));
	transform-origin: 0 0;
	/* The frame keeps its drawn size in the layout; the margins take back
	   what the scale leaves empty. */
	margin-right: calc(var(--width) * (var(--scale) - 1) * 1px);
	margin-bottom: calc(var(--height) * (var(--scale) - 1) * 1px);
	border-radius: calc((var(--corner) - var(--bezel)) / var(--scale));
	background: #000;
}

figcaption {
	margin-top: var(--space-3);
	padding-inline: var(--bezel);
	color: var(--muted);
	font-size: 14px;
	line-height: 20px;
}

/* Sections */

section[id],
footer {
	padding-block: var(--space-12);
}

.intro {
	margin-top: var(--space-3);
	max-width: 640px;
	color: var(--muted);
	font-size: 19px;
	line-height: 30px;
}

/* Steps */

.step {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: var(--space-8) var(--space-12);
	margin-top: var(--space-12);
	padding: var(--space-8);
	border-radius: var(--radius-xl);
	background: var(--surface);
}

.step-wide,
.step-text-only {
	grid-template-columns: minmax(0, 1fr);
}

.step-text {
	display: grid;
	justify-items: start;
	gap: var(--space-4);
	max-width: 520px;
}

.step-wide .step-text {
	max-width: 720px;
}

.step-number {
	color: var(--muted);
	font-size: 15px;
	line-height: 20px;
}

.tags {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
}

.step-screens {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-5);
}

.step .screen {
	background: var(--surface-2);
}

/* Lists of rules */

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: var(--space-4);
	margin: var(--space-8) 0 0;
}

.card {
	padding: var(--space-6);
	border-radius: var(--radius-lg);
	background: var(--surface);
}

.card dt {
	font-size: 19px;
	line-height: 24px;
}

.card dd {
	margin: var(--space-2) 0 0;
	color: var(--muted);
	font-size: 16px;
	line-height: 24px;
}

/* Status */

.status {
	display: grid;
	gap: var(--space-4);
	margin: var(--space-8) 0;
	max-width: 720px;
}

.status > div {
	display: grid;
	grid-template-columns: 110px minmax(0, 1fr);
	gap: var(--space-4);
	align-items: baseline;
}

.status dd {
	margin: 0;
}

/* Last lines */

footer {
	color: var(--muted);
	font-size: 14px;
	line-height: 22px;
}

footer h2 {
	color: var(--foreground);
	font-size: 17px;
	line-height: 22px;
	letter-spacing: 0;
}

footer p {
	max-width: 720px;
	margin-top: var(--space-2);
}

footer p + h2 {
	margin-top: var(--space-8);
}

.missing {
	display: grid;
	gap: var(--space-5);
	padding-block: var(--space-12);
}

/* Narrower windows */

@media (max-width: 1180px) {
	.browser {
		--scale: 0.6;
	}
}

@media (max-width: 980px) {
	.hero {
		grid-template-columns: minmax(0, 1fr);
	}

	.hero-screens {
		justify-content: center;
	}

	.step {
		grid-template-columns: minmax(0, 1fr);
	}

	.browser {
		--scale: 0.44;
	}
}

@media (max-width: 760px) {
	.top nav {
		display: none;
	}

	.step {
		padding: var(--space-5);
	}

	.step-screens {
		justify-content: center;
	}

	/* The web screen keeps a size that can be read and is pulled sideways. */
	.step-wide .step-screens {
		justify-content: flex-start;
		flex-wrap: nowrap;
		overflow-x: auto;
		margin-inline: calc(-1 * var(--space-5));
		padding-inline: var(--space-5);
	}

	.browser {
		flex: none;
	}

	.browser figcaption {
		max-width: calc(100vw - 4 * var(--space-5));
	}

	.hero-screens {
		--scale: 0.4;
		gap: var(--space-3);
	}

	.status > div {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--space-1);
	}
}

@media (max-width: 500px) {
	body {
		font-size: 16px;
		line-height: 24px;
	}

	.lede,
	.intro {
		font-size: 17px;
		line-height: 26px;
	}

	.phone {
		--scale: 0.6;
	}

	.hero-screens {
		--scale: 0.36;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}
