/* keepreading.org. The same visual language as the car tools
   (www/platform/design.md): white paper, black ink, Overpass (the open-source
   Highway Gothic), and highway-sign green for the one bold thing, the
   destinations sign that leads to the tools. */

/*! Overpass: Copyright 2021 The Overpass Project Authors. SIL Open Font License 1.1; the licence is at /fonts/OFL.txt. */
@font-face {
	font-family: "Overpass";
	src: url("/fonts/overpass.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

:root {
	--paper: #ffffff;
	--ink: #000000;
	--muted: #4d5560;
	--rule: #c9ced6;
	/* Form field borders: at least 3:1 against the page (WCAG 1.4.11). */
	--field: #6b7480;
	--guide: #006747;
	--guide-ink: #ffffff;
	--link: #006747;
	--warning: #ffcd00;
	--stop: #c8102e;
	--font: "Overpass", "Helvetica Neue", Arial, sans-serif;
	color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
	:root {
		--paper: #121619;
		--ink: #f1f3f4;
		--muted: #a9b1ba;
		--rule: #39414a;
		--field: #8a939e;
		--guide: #00805a;
		--link: #4fd1a1;
		--stop: #ff6b6b;
	}
}

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

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 400 17px/1.55 var(--font);
}

a {
	color: var(--link);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}
a:hover {
	text-decoration-thickness: 2px;
}

/* Focus: yellow with a black edge, visible on every background. */
:focus-visible {
	outline: 3px solid var(--warning);
	outline-offset: 0;
	box-shadow: 0 0 0 6px #000;
}
a:focus-visible {
	background: var(--warning);
	color: #000;
	box-shadow: none;
	outline: none;
	text-decoration: none;
}

.wrap {
	width: min(100% - 2rem, 74rem);
	margin-inline: auto;
}
main > :not(.destinations) {
	max-width: 42rem;
}

/* ---------- Header and footer ---------- */

.top {
	padding: 1rem 0 0;
}
.brand {
	display: inline-flex;
	text-decoration: none;
}
/* The sign would hide the usual yellow link background, so the wordmark gets a ring instead. */
.brand:focus-visible {
	background: none;
	border-radius: 7px;
	outline: 3px solid var(--warning);
	outline-offset: 2px;
	box-shadow: 0 0 0 5px #000;
}
.brand-sign {
	display: inline-block;
	background: var(--guide);
	color: var(--guide-ink);
	border-radius: 7px;
	padding: 3px;
}
.brand-sign span {
	display: block;
	border: 2px solid currentColor;
	border-radius: 5px;
	padding: 0.22rem 0.6rem 0.08rem;
	font-weight: 800;
	font-size: 18px;
	line-height: 1.2;
	letter-spacing: 0.01em;
}

.foot {
	border-top: 2px solid var(--ink);
	margin-top: 3.5rem;
	padding: 1.5rem 0 2.5rem;
	color: var(--muted);
	font-size: 15px;
}
.foot p {
	margin: 0 0 0.75rem;
}
.foot a {
	color: inherit;
}
ul.inline {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1.25rem;
}

/* ---------- Type ---------- */

h1,
h2 {
	font-weight: 800;
	line-height: 1.08;
	letter-spacing: -0.015em;
	text-wrap: balance;
}
h1 {
	font-size: clamp(40px, 8.5vw, 72px);
	margin: 2.5rem 0 0;
}
h2 {
	font-size: 24px;
	margin: 0 0 0.4rem;
}
.lede {
	font-size: 21px;
	line-height: 1.45;
	color: var(--muted);
	margin: 1rem 0 0;
	text-wrap: pretty;
}
p {
	text-wrap: pretty;
}

/* ---------- The destinations sign: the way to the tools ---------- */

.destinations {
	margin: 2.5rem 0 0;
	background: var(--guide);
	color: var(--guide-ink);
	border-radius: 16px;
	padding: 7px;
}
.destinations > div {
	border: 3px solid currentColor;
	border-radius: 11px;
	padding: 0.4rem 1.4rem;
}
.destinations ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.destinations li + li {
	border-top: 2px solid rgb(255 255 255 / 0.55);
}
.destinations a {
	display: grid;
	grid-template-columns: 1fr auto;
	column-gap: 1.25rem;
	align-items: center;
	padding: 1rem 0;
	color: inherit;
	text-decoration: none;
}
.destinations strong {
	font-size: clamp(22px, 3.2vw, 30px);
	font-weight: 800;
	line-height: 1.12;
	letter-spacing: -0.005em;
}
.destinations small {
	grid-column: 1;
	display: block;
	margin-top: 0.3rem;
	font-size: 16px;
	line-height: 1.4;
	opacity: 0.92;
	max-width: 40rem;
}
.destinations svg {
	grid-column: 2;
	grid-row: 1 / span 2;
	width: 2.4rem;
	height: 2.4rem;
}
.destinations a:hover strong,
.destinations a:focus-visible strong {
	text-decoration: underline;
	text-decoration-thickness: 3px;
	text-underline-offset: 0.16em;
}
.destinations a:focus-visible {
	background: none;
	color: inherit;
	outline: 3px solid var(--warning);
	outline-offset: 4px;
	box-shadow: none;
}
@media (min-width: 52rem) {
	.destinations ul {
		display: grid;
		grid-template-columns: 1fr 1fr;
		column-gap: 2.5rem;
	}
	.destinations li + li {
		border-top: 0;
	}
	.destinations li {
		border-bottom: 2px solid rgb(255 255 255 / 0.55);
	}
	.destinations li:nth-last-child(-n + 2):nth-child(odd),
	.destinations li:last-child {
		border-bottom: 0;
	}
	.destinations li:last-child:nth-child(odd) {
		grid-column: 1 / -1;
	}
}

.promise {
	margin: 1.5rem 0 0;
	color: var(--muted);
}

/* ---------- Note form: a plain paper form ---------- */

.note {
	margin-top: 3.5rem;
	border-top: 2px solid var(--ink);
	padding-top: 1.5rem;
}
.sub {
	margin: 0 0 1.5rem;
	color: var(--muted);
}

form > * + * {
	margin-top: 1.25rem;
}
.pair {
	display: grid;
	gap: 1.25rem;
}
@media (min-width: 34rem) {
	.pair {
		grid-template-columns: 1fr 1fr;
	}
}
.field {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	min-width: 0;
}
label {
	font-weight: 700;
}

input,
textarea {
	font: inherit;
	color: var(--ink);
	background: var(--paper);
	border: 2px solid var(--field);
	border-radius: 0;
	padding: 0.6rem 0.7rem;
	width: 100%;
	min-height: 2.9rem;
}
input:focus-visible,
textarea:focus-visible {
	border-color: var(--ink);
}
textarea {
	resize: vertical;
	min-height: 8rem;
}

/* The Turnstile widget (300 × 65) loads after the page; hold its space so the button doesn't jump. */
.cf-turnstile {
	min-height: 65px;
}

/* Honeypot: off-screen for people, still filled in by naive bots. */
.gotcha {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

button {
	font: 700 17px/1 var(--font);
	color: var(--guide-ink);
	background: var(--guide);
	border: 2px solid var(--guide);
	border-radius: 4px;
	padding: 0.85rem 1.4rem;
	min-height: 3rem;
	cursor: pointer;
}
button:hover:not(:disabled) {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}
button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.status {
	min-height: 1.4rem;
	margin: 0.6rem 0 0;
	font-size: 15px;
}
.status[data-tone="error"] {
	color: var(--stop);
	font-weight: 700;
}
.fine {
	font-size: 14px;
	color: var(--muted);
	margin-top: 1rem;
}
.fine a {
	color: inherit;
}

.done h2 {
	font-size: 24px;
	margin: 0;
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
		animation: none !important;
	}
}
