@font-face {
	font-family: 'Literata';
	src: url('/assets/fonts/literata-variable.woff2') format('woff2');
	font-weight: 200 900;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Literata';
	src: url('/assets/fonts/literata-italic-variable.woff2') format('woff2');
	font-weight: 200 900;
	font-style: italic;
	font-display: swap;
}

:root {
	/* The app's colors: paper, ink, and the one red. */
	--paper: #f5efe3;
	--sheet: #fcf9f3;
	--ink: #221e19;
	--pulp: #6f665a;
	--rubric: #b23a2b;
	--rubric-deep: #9a2e21;
	--hairline: rgb(34 30 25 / 0.16);
	--measure: 36rem;
	--gutter: clamp(1.25rem, 5vw, 4rem);
}

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

html {
	background: var(--paper);
	color: var(--ink);
	font-family: 'Literata', 'New York', Georgia, serif;
	font-size: 100%;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	font-size: 1.125rem;
	line-height: 1.65;
}

h1,
h2,
dt {
	text-wrap: balance;
	font-weight: 640;
	line-height: 1.1;
	letter-spacing: -0.012em;
	margin: 0;
}

h1 {
	font-size: clamp(2.75rem, 6.6vw, 5rem);
	line-height: 1;
	letter-spacing: -0.02em;
}

h2 {
	font-size: clamp(1.7rem, 3.2vw, 2.4rem);
}

p {
	margin: 0;
}

a {
	color: inherit;
	text-decoration-color: var(--rubric);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.2em;
}

:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
	border-radius: 4px;
}

.wrap {
	max-width: 76rem;
	margin: 0 auto;
	padding: 0 var(--gutter);
}

/* The red field from the app icon. The home page opens on it. */

.field {
	background: linear-gradient(var(--rubric), var(--rubric-deep));
	color: var(--paper);
}

.field a {
	text-decoration-color: currentColor;
}

/* Masthead and footer */

.masthead {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: 1.5rem;
	padding-bottom: 1.5rem;
}

.brand {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	text-decoration: none;
	font-weight: 700;
	font-size: 1.35rem;
	letter-spacing: -0.01em;
}

.brand img {
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 22%;
	display: block;
}

/* On the red field the icon would vanish into it without an edge. */
.field .brand img {
	box-shadow: 0 0 0 1px rgb(245 239 227 / 0.35);
}

.masthead nav,
.footer nav {
	display: flex;
	gap: 1.75rem;
	font-size: 1rem;
}

.masthead nav a,
.footer nav a {
	text-decoration: none;
	opacity: 0.72;
}

.masthead nav a:hover,
.footer nav a:hover,
.masthead nav a[aria-current='page'] {
	opacity: 1;
}

.footer {
	position: relative;
	padding-top: 2rem;
	padding-bottom: 3rem;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 2rem;
	justify-content: space-between;
	color: var(--pulp);
	font-size: 1rem;
}

/* Hero */

.hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr) min(23.5rem, 100%);
	align-items: center;
	gap: clamp(2.5rem, 6vw, 6rem);
	padding-top: clamp(2rem, 5vw, 4rem);
	padding-bottom: clamp(3.5rem, 8vw, 7rem);
}

.hero-copy {
	max-width: 36rem;
}

.hero-copy p {
	margin-top: 1.75rem;
	font-size: clamp(1.15rem, 1.6vw, 1.4rem);
	line-height: 1.5;
	max-width: 29rem;
}

.hero-copy .availability {
	margin-top: 2.5rem;
	font-size: 1rem;
	font-style: italic;
	opacity: 0.85;
}

/* The short rule that sits under the name in the app. */
.availability::before {
	content: '';
	display: block;
	width: 1.75rem;
	height: 3px;
	margin-bottom: 1.1rem;
	background: currentColor;
}

/* The sheet: a few paragraphs set in pages, the way the app sets an article. */

.sheet {
	position: relative;
	width: min(23.5rem, 100%);
	margin: 0;
	padding: 2.25rem 2.1rem 0.75rem;
	color: var(--ink);
}

/* The paper itself, with the rough edge a deckle leaves. Kept behind the text so the words stay sharp. */
.sheet::before {
	content: '';
	position: absolute;
	inset: 0;
	background: var(--sheet);
	filter: url('#deckle-edge') drop-shadow(0 0.9rem 1.1rem rgb(58 14 8 / 0.35));
}

.pages {
	position: relative;
	height: 23.5rem;
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	cursor: pointer;
}

.pages::-webkit-scrollbar {
	display: none;
}

/* One column the width of the sheet. The text that does not fit makes more columns to the right: those are the pages. */
.flow {
	height: 100%;
	column-count: 1;
	column-gap: 4.2rem;
	column-fill: auto;
	font-size: 1rem;
	line-height: 1.6;
	text-align: justify;
	hyphens: auto;
	hyphenate-limit-chars: 7 3 3;
	orphans: 2;
	widows: 2;
}

.flow h2 {
	font-size: 1.6rem;
	text-align: left;
}

.flow .source {
	margin-top: 0.35rem;
	margin-bottom: 1.4rem;
	font-size: 0.875rem;
	font-style: italic;
	color: var(--pulp);
	text-align: left;
}

.flow p + p {
	margin-top: 0.7rem;
}

/* The mark at the end of the piece. It rides on the last line so it never gets a page to itself. */
.flow .end {
	margin-left: 0.3em;
	color: var(--rubric);
}

/* Where each page comes to rest. The script adds one stop per page. */
.stops {
	position: absolute;
	top: 0;
	left: 0;
	height: 1px;
	display: flex;
	gap: 4.2rem;
	pointer-events: none;
}

.stops i {
	flex: none;
	width: var(--page);
	scroll-snap-align: start;
}

.turner {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 2.75rem;
	margin-top: 0.5rem;
	font-size: 0.875rem;
	color: var(--pulp);
	font-variant-numeric: tabular-nums;
}

.turner .folio {
	min-width: 4rem;
	text-align: center;
}

.turner button {
	display: none;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
}

.js .turner button {
	display: block;
}

.turner button:hover:not(:disabled) {
	color: var(--ink);
}

.turner button:disabled {
	opacity: 0.3;
	cursor: default;
}

/* Sections on paper */

.section {
	position: relative;
	padding-top: clamp(3rem, 8vw, 7rem);
	padding-bottom: clamp(3rem, 8vw, 7rem);
}

/* Dividers line up with the text, not with the padded edge of the page. */
.section + .section::before,
.footer::before {
	content: '';
	position: absolute;
	top: 0;
	left: var(--gutter);
	right: var(--gutter);
	border-top: 1px solid var(--hairline);
}

.section-intro {
	max-width: 46rem;
}

.section-intro p {
	max-width: var(--measure);
	margin-top: 1.25rem;
	color: var(--pulp);
}

/* Phone frame around a screenshot */

.phone {
	--w: min(15.5rem, 72vw);
	width: var(--w);
	margin: 0;
	padding: calc(var(--w) * 0.03);
	border-radius: calc(var(--w) * 0.17);
	background: #2b2621;
	box-shadow:
		inset 0 0 0 1px #4a433b,
		0 2rem 3.5rem rgb(34 30 25 / 0.22);
}

.phone img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: calc(var(--w) * 0.14);
}

.screens {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(2.5rem, 5vw, 4rem);
	justify-items: center;
	margin-top: clamp(2.5rem, 5vw, 4rem);
}

.screens figure {
	margin: 0;
	display: grid;
	justify-items: center;
	align-content: start;
	gap: 1.75rem;
}

.screens figcaption {
	max-width: 19rem;
	text-align: center;
	color: var(--pulp);
}

/* Plain facts */

.facts {
	margin: clamp(2.5rem, 5vw, 4rem) 0 0;
	border-top: 1px solid var(--hairline);
}

.facts > div {
	display: grid;
	grid-template-columns: minmax(0, 18rem) minmax(0, var(--measure));
	gap: 0.5rem 3rem;
	padding: 1.6rem 0;
	border-bottom: 1px solid var(--hairline);
}

.facts dt {
	font-size: 1.3rem;
}

.facts dd {
	margin: 0;
	color: var(--pulp);
}

/* Privacy and support pages */

.prose {
	max-width: var(--measure);
	padding-top: clamp(2rem, 6vw, 5rem);
	padding-bottom: clamp(3rem, 8vw, 6rem);
}

.prose h1 {
	font-size: clamp(2.25rem, 5vw, 3.5rem);
}

.prose .updated {
	margin-top: 1rem;
	color: var(--pulp);
	font-size: 1rem;
	font-style: italic;
}

.prose h2 {
	font-size: 1.4rem;
	margin-top: 2.75rem;
}

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

.prose .lead {
	margin-top: 2rem;
	font-size: 1.3rem;
	line-height: 1.5;
}

@media (max-width: 56rem) {
	.hero {
		grid-template-columns: minmax(0, 1fr);
		justify-items: center;
	}

	.hero-copy {
		justify-self: start;
	}

	.screens {
		grid-template-columns: 1fr;
	}

	.facts > div {
		grid-template-columns: 1fr;
	}
}
