/* The look of the pages Jekyll lays out for visitors (the guide in _layouts/guide.html, the
   privacy policy in _layouts/page.html), so they read as part of the home page: its faces, its
   palette in both themes, its header on the cream band and its footer. docs/index.html and
   docs/fr/index.html keep their own copy of the same tokens, header and footer in their
   <style>, so they stay single files: a change to one side is made to the other. The tokens are
   DESIGN.md's. */

/* The app's three faces, Latin subset, under the SIL Open Font License (home/fonts/*-OFL.txt).
   Served from here: no font service. */
@font-face {
	font-family: 'Instrument Sans Variable';
	font-style: normal;
	font-display: swap;
	font-weight: 400 700;
	src: url('home/fonts/instrument-sans-latin-wght-normal.woff2') format('woff2');
}
@font-face {
	font-family: 'Source Serif 4 Variable';
	font-style: normal;
	font-display: swap;
	font-weight: 200 900;
	src: url('home/fonts/source-serif-4-latin-opsz-normal.woff2') format('woff2');
}
@font-face {
	font-family: 'IBM Plex Mono';
	font-style: normal;
	font-display: swap;
	font-weight: 400;
	src: url('home/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}

:root {
	color-scheme: light;
	--chrome: #efece6;
	--surface: #fdfcfa;
	--surface-quiet: #f8f6f2;
	--surface-raised: #ffffff;
	--line: #e5e1d9;
	--line-strong: #d6d1c7;
	--ink: #171612;
	--ink-hover: #2e2c27;
	--on-ink: #ffffff;
	--text-body: #1e1d19;
	--text-secondary: #4d4a42;
	--text-muted: #615d54;
	--marker: #ffd84d;
	--hand: #2456d6;
	--wash: rgba(23, 22, 18, 0.05);
	--shadow: 0 24px 60px -24px rgba(40, 32, 20, 0.35);
	--raised: 0 0 0 1px var(--line), 0 1px 2px rgba(23, 22, 18, 0.06);
	--focus: #2456d6;

	/* The band: the hero illustration's own cream and graphite, the same in both themes. */
	--band: #f2eada;
	--band-deep: #ebe1cd;
	--band-ink: #171612;
	--band-text: #3b3831;
	--band-line: rgba(23, 22, 18, 0.14);

	--sans: 'Instrument Sans Variable', 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
	--serif: 'Source Serif 4 Variable', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
	--mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, Menlo, monospace;
	--radius-control: 7px;
	--radius-card: 10px;
	--gutter: 16px;
	--max: 1160px;
}
@media (prefers-color-scheme: dark) {
	:root {
		color-scheme: dark;
		--chrome: #171614;
		--surface: #1d1c1a;
		--surface-quiet: #222120;
		--surface-raised: #272522;
		--line: #2f2d29;
		--line-strong: #3d3a35;
		--ink: #eeece6;
		--ink-hover: #ffffff;
		--on-ink: #171612;
		--text-body: #e4e0d8;
		--text-secondary: #c4bfb5;
		--text-muted: #a09a8f;
		--marker: #e8c547;
		--hand: #7fa2ff;
		--wash: rgba(232, 230, 225, 0.06);
		--shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.75);
		--raised: 0 0 0 1px var(--line-strong);
		--focus: #7fa2ff;
	}
}
@media (min-width: 720px) {
	:root {
		--gutter: 32px;
	}
}

*,
*::before,
*::after {
	box-sizing: border-box;
}
html {
	scroll-behavior: smooth;
	scroll-padding-top: 16px;
	-webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}
body {
	margin: 0;
	background: var(--surface);
	color: var(--text-body);
	font-family: var(--sans);
	font-size: 1.0625rem;
	line-height: 1.55;
	overflow-x: hidden;
}
a {
	color: var(--hand);
	text-underline-offset: 0.18em;
}
:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 2px;
}
h1,
h2,
h3,
h4 {
	color: var(--ink);
	line-height: 1.15;
	margin: 0;
	text-wrap: balance;
}
p {
	margin: 0;
}
.skip {
	position: absolute;
	left: var(--gutter);
	top: -100px;
	z-index: 10;
	padding: 8px 12px;
	background: var(--band-ink);
	color: #fff;
	border-radius: var(--radius-control);
	font-weight: 600;
}
.skip:focus {
	top: 12px;
}
.wrap {
	max-width: var(--max);
	margin: 0 auto;
	padding: 0 var(--gutter);
}
/* A label in the machine's voice, as each section of the home page has. */
.kicker {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: var(--mono);
	font-size: 0.8125rem;
	color: var(--text-muted);
	margin-bottom: 14px;
}
.kicker::after {
	content: '';
	flex: 0 0 40px;
	height: 1px;
	background: var(--line-strong);
}

/* The band: the header and the page's title, in the home page's cream in both themes. */
.band {
	background-color: var(--band);
	background-image:
		radial-gradient(70% 90% at 78% 40%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 70%),
		linear-gradient(var(--band), var(--band-deep));
	color: var(--band-text);
	color-scheme: light;
	--focus: #2456d6;
	border-bottom: 1px solid var(--band-line);
}
.band a {
	color: #1f48b8;
}
.top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding-top: 18px;
	padding-bottom: 18px;
}
.logo {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 650;
	font-size: 1.1875rem;
	letter-spacing: -0.01em;
	text-decoration: none;
}
.band .logo {
	color: var(--band-ink);
}
.logo svg {
	width: 32px;
	height: 32px;
	flex: none;
}
.top nav ul {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 22px;
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.9375rem;
}
.band .top nav a {
	color: var(--band-text);
	text-decoration: none;
}
.band .top nav a:hover {
	color: var(--band-ink);
	text-decoration: underline;
}
.band .top nav a[aria-current='page'] {
	color: var(--band-ink);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.35em;
}
.band .top nav a.lang {
	font-family: var(--mono);
	font-size: 0.8125rem;
	padding: 2px 8px;
	border: 1px solid var(--band-line);
	border-radius: 999px;
}
@media (max-width: 639px) {
	.top nav li.wide {
		display: none;
	}
}
.page-head {
	padding-top: 24px;
	padding-bottom: 48px;
}
@media (min-width: 980px) {
	.page-head {
		padding-top: 36px;
		padding-bottom: 64px;
	}
}
.band .kicker {
	color: #5d5950;
}
.band .kicker::after {
	background: var(--band-line);
}
.page-head h1 {
	color: var(--band-ink);
	font-size: clamp(2.05rem, 1.35rem + 2.6vw, 3.25rem);
	font-weight: 650;
	letter-spacing: -0.03em;
	line-height: 1.06;
	max-width: 24ch;
}
.page-head .lede {
	margin-top: 18px;
	max-width: 42rem;
	font-size: 1.1875rem;
	color: var(--band-text);
}

.page-head .byline {
	margin-top: 10px;
	font-size: 0.9375rem;
	color: var(--band-text);
}

/* The page: what it holds beside the text (the guide's chapters, a page's sections), the text. */
.doc {
	display: grid;
	gap: 48px;
	padding-top: 48px;
	padding-bottom: 88px;
}
@media (min-width: 900px) {
	.doc {
		grid-template-columns: 15.5rem minmax(0, 1fr);
		gap: 64px;
		padding-top: 56px;
	}
	.side {
		position: sticky;
		top: 24px;
		align-self: start;
		max-height: calc(100vh - 48px);
		overflow-y: auto;
		/* Room for the current chapter's ring and the focus outline. */
		padding: 2px;
		margin: -2px;
	}
}
/* Narrow: the text first; the guide's chapters follow it, a page's sections are left out. */
@media (max-width: 899px) {
	.side {
		order: 2;
		padding-top: 32px;
		border-top: 1px solid var(--line);
	}
	.side .sections,
	.side-sections {
		display: none;
	}
}
.side-title {
	font-family: var(--mono);
	font-size: 0.8125rem;
	color: var(--text-muted);
	margin: 0 0 10px;
	padding: 0 10px;
}
.chapters {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 2px;
	counter-reset: chapter;
}
@media (max-width: 899px) {
	.chapters {
		grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
	}
}
.chapters > li {
	counter-increment: chapter;
}
.chapters > li > a {
	display: flex;
	align-items: baseline;
	gap: 10px;
	padding: 7px 10px;
	border-radius: var(--radius-control);
	color: var(--text-secondary);
	text-decoration: none;
	font-size: 0.9375rem;
	line-height: 1.3;
}
.chapters > li > a::before {
	content: counter(chapter, decimal-leading-zero);
	font-family: var(--mono);
	font-size: 0.75rem;
	color: var(--text-muted);
}
.chapters > li > a:hover {
	background: var(--wash);
	color: var(--ink);
}
/* The chapter being read is lifted onto white, as the app marks the one you are on. */
.chapters > li > a[aria-current='page'] {
	background: var(--surface-raised);
	box-shadow: var(--raised);
	color: var(--ink);
	font-weight: 600;
}
.sections {
	list-style: none;
	margin: 6px 0 10px 20px;
	padding: 0 0 0 10px;
	border-left: 1px solid var(--line);
}
.sections a {
	display: block;
	padding: 4px 8px;
	border-radius: 5px;
	color: var(--text-muted);
	text-decoration: none;
	font-size: 0.875rem;
	line-height: 1.35;
}
.sections a:hover {
	color: var(--ink);
	background: var(--wash);
}
.side-sections .sections {
	margin: 0;
	padding: 0;
	border: 0;
}
.side-sections .sections a {
	padding: 5px 10px;
	font-size: 0.9063rem;
	color: var(--text-secondary);
}

/* The text. */
.prose {
	max-width: 44rem;
	min-width: 0;
}
.prose > :first-child {
	margin-top: 0;
}
/* A chapter's first line links to the other language for readers on GitHub; here the header
   has the switch. */
.guide > p:first-child:has(> a:only-child) {
	display: none;
}
.guide > p:first-child:has(> a:only-child) + * {
	margin-top: 0;
}
/* A text that opens on a heading needs no rule above it. */
.prose > h2:first-child,
.guide > p:first-child:has(> a:only-child) + h2 {
	border-top: 0;
	padding-top: 0;
}
.prose p,
.prose ul,
.prose ol,
.prose pre,
.prose table {
	margin: 0 0 1.1em;
}
.prose ul,
.prose ol {
	padding-left: 1.3em;
}
.prose li + li,
.prose li > ul,
.prose li > ol {
	margin-top: 0.4em;
}
.prose li > ul,
.prose li > ol {
	margin-bottom: 0;
}
.prose li::marker {
	color: var(--text-muted);
}
.prose a {
	overflow-wrap: anywhere;
}
.prose h2 {
	font-size: clamp(1.45rem, 1.15rem + 1vw, 1.875rem);
	font-weight: 650;
	letter-spacing: -0.02em;
	margin: 56px 0 14px;
	padding-top: 28px;
	border-top: 1px solid var(--line);
}
.prose h3 {
	font-size: 1.1875rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	margin: 32px 0 8px;
}
.prose h4 {
	font-size: 1.0625rem;
	font-weight: 600;
	margin: 24px 0 6px;
}
.prose strong {
	color: var(--ink);
	font-weight: 600;
}
.prose hr {
	border: 0;
	border-top: 1px solid var(--line);
	margin: 40px 0;
}
.anchor {
	margin-left: 0.15em;
	color: var(--text-muted);
	font-weight: 400;
	text-decoration: none;
	opacity: 0;
	transition: opacity 0.15s;
}
h2:hover .anchor,
h3:hover .anchor,
.anchor:focus-visible {
	opacity: 1;
}
.anchor:hover {
	color: var(--hand);
}
@media (hover: none) {
	.anchor {
		opacity: 1;
	}
}
code,
kbd {
	font-family: var(--mono);
	font-size: 0.86em;
	background: var(--wash);
	border-radius: 5px;
	padding: 0.1em 0.35em;
}
kbd {
	border: 1px solid var(--line-strong);
	border-bottom-width: 2px;
	background: var(--surface-raised);
}
pre {
	background: var(--chrome);
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
	padding: 14px 16px;
	overflow-x: auto;
	font-size: 0.9375rem;
	line-height: 1.5;
}
pre code {
	background: none;
	padding: 0;
	font-size: 0.875rem;
}
/* Screenshots as the home page's tour shows them: a card with a soft shadow, the caption
   (an emphasised line under the picture) in small muted type. */
.prose img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 28px 0 12px;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius-card);
	box-shadow: var(--shadow);
	background: var(--chrome);
}
.prose img + em {
	display: block;
	font-size: 0.875rem;
	font-style: normal;
	color: var(--text-muted);
	margin-bottom: 32px;
}
/* A note: a quiet card, like the home page's. */
.prose blockquote {
	margin: 28px 0;
	padding: 16px 20px;
	background: var(--surface-quiet);
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
	color: var(--text-secondary);
	font-size: 0.97rem;
}
.prose blockquote > :last-child {
	margin-bottom: 0;
}
.prose table {
	border-collapse: collapse;
	width: 100%;
	font-size: 0.9375rem;
	display: block;
	overflow-x: auto;
}
.prose th,
.prose td {
	text-align: left;
	vertical-align: top;
	padding: 10px 16px 10px 0;
	border-bottom: 1px solid var(--line);
}
.prose th {
	color: var(--ink);
	font-weight: 600;
	border-bottom-color: var(--line-strong);
}
/* The privacy policy's opening paragraph, which dates it against the policies before, in a
   quiet card of its own above the policy. */
.privacy > p:first-child {
	padding: 18px 20px;
	margin-bottom: 8px;
	background: var(--surface-quiet);
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
	color: var(--text-secondary);
	font-size: 0.9375rem;
}
.privacy > p:first-child + h2 {
	border-top: 0;
}

/* Before and after, as cards like the home page's list of chapters. */
.pager {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-top: 64px;
}
.pager a {
	display: block;
	padding: 14px 16px;
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
	background: var(--surface);
	color: var(--ink);
	font-weight: 600;
	text-decoration: none;
}
.pager a:hover {
	border-color: var(--line-strong);
	background: var(--wash);
}
.pager a span {
	display: block;
	margin-bottom: 2px;
	font-family: var(--mono);
	font-size: 0.75rem;
	font-weight: 400;
	color: var(--text-muted);
}
.pager .next {
	grid-column: 2;
	text-align: right;
}
@media (max-width: 599px) {
	.pager {
		grid-template-columns: 1fr;
	}
	.pager .next {
		grid-column: 1;
		text-align: left;
	}
}

.site-footer {
	border-top: 1px solid var(--line);
	background: var(--chrome);
	padding: 40px 0 56px;
	font-size: 0.875rem;
	color: var(--text-muted);
}
.site-footer ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
	list-style: none;
	margin: 0 0 20px;
	padding: 0;
}
.site-footer p + p {
	margin-top: 6px;
}
.site-footer .issue {
	color: var(--text-secondary);
	margin-bottom: 14px;
}

@media print {
	.band {
		background: none;
		border: 0;
	}
	.top nav,
	.side,
	.pager,
	.skip,
	.anchor,
	.site-footer {
		display: none;
	}
	.doc {
		display: block;
		padding: 0;
	}
	.prose img {
		box-shadow: none;
	}
}
