/* tiles.klementine.net. How it is decided: DESIGN.md. Tokens first; nothing below names a colour. */

@font-face {
	font-family: 'Instrument Sans';
	src: url('/fonts/instrument-sans-latin-400-normal.woff2') format('woff2');
	font-weight: 400;
	font-display: swap;
}
@font-face {
	font-family: 'Instrument Sans';
	src: url('/fonts/instrument-sans-latin-600-normal.woff2') format('woff2');
	font-weight: 600;
	font-display: swap;
}
@font-face {
	font-family: 'JetBrains Mono';
	src: url('/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2');
	font-weight: 400;
	font-display: swap;
}

:root {
	color-scheme: light dark;
	/* the app's paper and ink (its theme.css), light and dark */
	--ground: light-dark(#f5f3ee, #1b1916);
	--surface: light-dark(#ffffff, #262420);
	--recess: light-dark(#ebe7de, #211f1b);
	--ink: light-dark(#24231d, #f2efe7);
	--ink2: light-dark(#5c594e, #bdb6a8);
	--ink3: light-dark(#66625a, #aaa498);
	--edge: light-dark(#e2ddd0, #34312b);
	--line: light-dark(rgb(36 35 29 / 0.1), rgb(255 248 235 / 0.09));
	--on-ink: light-dark(#f5f3ee, #1b1916);
	/* what floats: the window over the page */
	--float: light-dark(
		0 1px 2px rgb(36 35 29 / 0.06),
		0 1px 2px rgb(0 0 0 / 0.4)
	);
	--window-shadow: light-dark(
		0 2px 4px rgb(36 35 29 / 0.04),
		0 2px 4px rgb(0 0 0 / 0.3)
	);

	--sans: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
	--mono: 'JetBrains Mono', ui-monospace, monospace;
	--ease-out: cubic-bezier(0.23, 1, 0.32, 1);

	/* the grid: 8px steps, margins, the text column and the window */
	--margin: 24px;
	--text: 640px;
	--wide: 1200px;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}
html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}
body {
	margin: 0;
	background: var(--ground);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 19px;
	line-height: 30px;
	-webkit-font-smoothing: antialiased;
	font-variant-numeric: tabular-nums;
	text-rendering: optimizeLegibility;
}
img,
svg {
	display: block;
}
a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}
:focus-visible {
	outline: 2px solid var(--ink);
	outline-offset: 3px;
	border-radius: 6px;
}
h1,
h2,
p,
dl,
dd,
figure,
pre {
	margin: 0;
}
code,
pre {
	font-family: var(--mono);
}

/* ── header ─────────────────────────────────────────────── */
.top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	max-width: calc(var(--wide) + 2 * var(--margin));
	margin: 0 auto;
	padding: 20px var(--margin);
}
.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 600;
	font-size: 20px;
	letter-spacing: -0.02em;
	text-decoration: none;
}
.top nav {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 15px;
	line-height: 20px;
	font-weight: 600;
}
.top nav a:not(.key) {
	padding: 10px 12px;
	text-decoration: none;
	color: var(--ink2);
}
.top nav a:not(.key):hover {
	color: var(--ink);
}

/* ── keys: the one filled, the rest outlined ───────────── */
.key {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 20px;
	border-radius: 999px;
	border: 1px solid var(--edge);
	background: var(--surface);
	color: var(--ink);
	font-weight: 600;
	font-size: 16px;
	line-height: 20px;
	text-decoration: none;
	transition: transform 160ms var(--ease-out);
}
.top .key {
	min-height: 40px;
	padding: 0 16px;
	font-size: 15px;
}
.key.filled {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--on-ink);
}
.key:active {
	transform: scale(0.97);
}

/* ── the opening ───────────────────────────────────────── */
.hero {
	max-width: calc(var(--wide) + 2 * var(--margin));
	margin: 0 auto;
	padding: 64px var(--margin) 40px;
	text-align: center;
}
h1 {
	font-size: 72px;
	line-height: 72px;
	letter-spacing: -0.045em;
	font-weight: 600;
	text-wrap: balance;
}
.lead {
	max-width: 600px;
	margin: 24px auto 0;
	color: var(--ink2);
	font-size: 21px;
	line-height: 32px;
	text-wrap: balance;
}
.ways {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-top: 40px;
}
.fine {
	margin-top: 16px;
	color: var(--ink3);
	font-size: 14px;
	line-height: 20px;
}

/* ── the tour ──────────────────────────────────────────── */
.tour {
	max-width: calc(var(--wide) + 2 * var(--margin));
	margin: 0 auto;
	padding: 0 var(--margin);
}
.notice {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	max-width: 760px;
	margin: 0 auto 32px;
	padding: 12px 18px;
	border: 1px solid var(--edge);
	border-radius: 14px;
	font-size: 15px;
	line-height: 22px;
	color: var(--ink2);
}
.notice svg {
	flex: none;
	margin-top: 2px;
	color: var(--ink);
}
.notice strong {
	color: var(--ink);
	font-weight: 600;
}
.notice a {
	color: var(--ink);
	white-space: nowrap;
}

.window .frame {
	position: relative;
	border-radius: 14px;
	overflow: hidden;
	box-shadow:
		0 0 0 1px var(--edge),
		0 24px 64px -16px light-dark(rgb(36 35 29 / 0.18), rgb(0 0 0 / 0.6)),
		0 8px 20px -8px light-dark(rgb(36 35 29 / 0.1), rgb(0 0 0 / 0.4));
	background: var(--ground);
}
.shots {
	display: grid;
}
.shots > picture {
	grid-area: 1 / 1;
	opacity: 0;
	filter: blur(8px);
	transition:
		opacity 240ms var(--ease-out),
		filter 240ms var(--ease-out);
	pointer-events: none;
}
.shots > picture.shown {
	opacity: 1;
	filter: none;
	pointer-events: auto;
}
.shots img {
	width: 100%;
	height: auto;
}
[data-tour].instant .shots > picture {
	transition: none;
}
@media (prefers-reduced-motion: reduce) {
	.shots > picture {
		transition: none;
		filter: none;
	}
}

/* The window's own tabs, at their places in the picture (1440 × 900): what the visitor presses
   is the tab they see. */
.window .tabs {
	position: absolute;
	inset: 0 0 auto 0;
	height: calc(44 / 900 * 100%);
	aspect-ratio: 1440 / 44;
	width: 100%;
}
.window .tabs button {
	position: absolute;
	top: 12%;
	height: 76%;
	left: calc(var(--x) / 1440 * 100%);
	width: calc(var(--w) / 1440 * 100%);
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: transparent;
	font: inherit;
	font-size: 1px;
	cursor: pointer;
}
.window .tabs button[aria-selected='false']:hover {
	background: light-dark(rgb(36 35 29 / 0.05), rgb(255 248 235 / 0.06));
}
.window .tabs button:focus-visible {
	outline-offset: 0;
}

.phone {
	display: none;
}

.caption {
	display: grid;
	max-width: var(--text);
	margin: 28px auto 0;
	text-align: center;
	color: var(--ink2);
	font-size: 17px;
	line-height: 26px;
}
.caption > span {
	grid-area: 1 / 1;
	visibility: hidden;
	opacity: 0;
	transition: opacity 240ms var(--ease-out);
}
.caption > span.shown {
	visibility: visible;
	opacity: 1;
}
.caption strong {
	color: var(--ink);
	font-weight: 600;
}
.hint {
	margin-top: 4px;
	text-align: center;
	color: var(--ink3);
	font-size: 14px;
	line-height: 20px;
}

/* ── agents ────────────────────────────────────────────── */
.agents {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: 64px;
	align-items: start;
	max-width: calc(var(--wide) + 2 * var(--margin));
	margin: 0 auto;
	padding: 144px var(--margin) 0;
}
h2 {
	font-size: 40px;
	line-height: 44px;
	letter-spacing: -0.035em;
	font-weight: 600;
	text-wrap: balance;
}
.agents .text p {
	margin-top: 20px;
	color: var(--ink2);
	text-wrap: pretty;
}
.agents .text p.quiet {
	font-size: 16px;
	line-height: 24px;
	color: var(--ink3);
}
.agents .text code {
	font-size: 0.9em;
	color: var(--ink);
}
.code {
	display: grid;
	gap: 12px;
	min-width: 0;
}
.block {
	overflow-x: auto;
	padding: 18px 20px;
	border-radius: 14px;
	background: var(--recess);
	font-size: 14px;
	line-height: 22px;
	color: var(--ink);
	tab-size: 2;
}
.dim {
	color: var(--ink3);
}
/* ── facts ─────────────────────────────────────────────── */
.facts {
	max-width: calc(var(--wide) + 2 * var(--margin));
	margin: 0 auto;
	padding: 144px var(--margin) 0;
}
.facts dl {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 40px;
	border-top: 1px solid var(--edge);
	padding-top: 32px;
}
.facts dt {
	font-weight: 600;
	font-size: 17px;
	line-height: 24px;
}
.facts dd {
	margin-top: 8px;
	color: var(--ink2);
	font-size: 16px;
	line-height: 24px;
	text-wrap: pretty;
}

/* ── run it ────────────────────────────────────────────── */
.run {
	max-width: calc(var(--text) + 2 * var(--margin));
	margin: 0 auto;
	padding: 144px var(--margin) 0;
	text-align: center;
}
.run .block {
	margin: 28px 0 0;
	text-align: left;
	font-size: 15px;
	line-height: 24px;
}
.run p {
	margin-top: 20px;
	color: var(--ink2);
	font-size: 16px;
	line-height: 24px;
	text-align: left;
	text-wrap: pretty;
}

/* ── footer ────────────────────────────────────────────── */
footer {
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 24px 40px;
	align-items: center;
	max-width: calc(var(--wide) + 2 * var(--margin));
	margin: 144px auto 0;
	padding: 32px var(--margin) 48px;
	border-top: 1px solid var(--edge);
	font-size: 14px;
	line-height: 20px;
}
.maker {
	display: flex;
	align-items: center;
	gap: 12px;
	font-weight: 600;
}
.maker a {
	text-decoration: none;
}
.maker a:hover {
	text-decoration: underline;
}
footer .quiet {
	color: var(--ink3);
}
footer nav {
	display: flex;
	gap: 20px;
	color: var(--ink2);
}
footer nav a {
	text-decoration: none;
}
footer nav a:hover {
	color: var(--ink);
	text-decoration: underline;
}

/* ── between: a narrow window, a tablet ────────────────── */
@media (max-width: 1100px) {
	.agents {
		grid-template-columns: minmax(0, 1fr);
		gap: 32px;
		max-width: calc(760px + 2 * var(--margin));
	}
	.facts dl {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 32px 40px;
	}
	footer {
		grid-template-columns: 1fr;
		gap: 16px;
	}
}

/* ── compact: phones ───────────────────────────────────── */
@media (max-width: 720px) {
	:root {
		--margin: 20px;
	}
	body {
		font-size: 17px;
		line-height: 26px;
	}
	.top {
		padding-top: 12px;
		padding-bottom: 12px;
	}
	.top nav a:not(.key) {
		padding: 12px 10px;
	}
	.hero {
		padding-top: 40px;
		padding-bottom: 32px;
	}
	h1 {
		font-size: 42px;
		line-height: 44px;
		letter-spacing: -0.04em;
	}
	h1 br {
		display: none;
	}
	.lead {
		margin-top: 18px;
		font-size: 18px;
		line-height: 27px;
		text-wrap: pretty;
	}
	.ways {
		margin-top: 28px;
	}
	.ways .key {
		flex: 1 1 100%;
		justify-content: center;
		min-height: 48px;
	}
	.notice {
		margin-bottom: 32px;
	}
	.notice a {
		white-space: normal;
	}
	.window,
	.hint {
		display: none;
	}
	.phone {
		display: block;
	}
	.names {
		display: flex;
		gap: 6px;
		overflow-x: auto;
		margin: 0 calc(-1 * var(--margin)) 20px;
		padding: 2px var(--margin);
		scrollbar-width: none;
		scroll-snap-type: x proximity;
	}
	.names::-webkit-scrollbar {
		display: none;
	}
	.names button {
		flex: none;
		min-height: 40px;
		padding: 0 16px;
		border: 1px solid var(--edge);
		border-radius: 999px;
		background: transparent;
		color: var(--ink2);
		font: inherit;
		font-size: 15px;
		font-weight: 600;
		scroll-snap-align: center;
		cursor: pointer;
	}
	.names button[aria-selected='true'] {
		background: var(--ink);
		border-color: var(--ink);
		color: var(--on-ink);
	}
	.screen {
		width: min(300px, 78vw);
		margin: 0 auto;
		border-radius: 32px;
		overflow: hidden;
		box-shadow:
			0 0 0 1px var(--edge),
			0 0 0 7px var(--surface),
			0 0 0 8px var(--edge),
			0 24px 48px -12px light-dark(rgb(36 35 29 / 0.2), rgb(0 0 0 / 0.6));
	}
	.caption {
		margin-top: 32px;
		font-size: 16px;
		line-height: 24px;
	}
	.agents,
	.facts,
	.run {
		padding-top: 96px;
	}
	h2 {
		font-size: 30px;
		line-height: 34px;
	}
	.block {
		font-size: 13px;
		line-height: 20px;
		padding: 16px;
		border-radius: 12px;
	}
	.facts dl {
		grid-template-columns: 1fr;
		gap: 24px;
	}
	footer {
		margin-top: 96px;
	}
	footer nav {
		flex-wrap: wrap;
		gap: 8px 20px;
	}
}
