/* Flip site. Accent, highlight and reader-screen colours come from the app's design tokens
   (handoff/design/tokens/tokens.json in the flip repo: Paper, and Night for dark).
   Figtree is the site's voice, as it is the app's UI; Literata is only for book text. */
@font-face {
	font-family: 'Literata';
	font-style: normal;
	font-weight: 200 900;
	font-display: swap;
	src: url(/fonts/literata-latin-opsz-normal.woff2) format('woff2');
}
@font-face {
	font-family: 'Literata';
	font-style: italic;
	font-weight: 200 900;
	font-display: swap;
	src: url(/fonts/literata-latin-opsz-italic.woff2) format('woff2');
}
@font-face {
	font-family: 'Figtree';
	font-weight: 400;
	font-display: swap;
	src: url(/fonts/figtree-latin-400-normal.woff2) format('woff2');
}
@font-face {
	font-family: 'Figtree';
	font-weight: 600;
	font-display: swap;
	src: url(/fonts/figtree-latin-600-normal.woff2) format('woff2');
}

:root {
	color-scheme: light dark;
	--page: #fbfcfb;
	--surface: #ffffff;
	--tint: #eef3f2;
	--line: #e2e8e6;
	--ink: #1b2422;
	--ink-muted: #5b6866;
	--accent: #2e5e5a;
	--accent-strong: #1f4340;
	--band: #1f4340;
	--band-ink: #eef4f2;
	--band-muted: #b5ccc7;
	--cta: #f1dfae;
	--cta-hover: #ecd393;
	--cta-ink: #27221c;
	--device: #121716;
	/* The reader screen inside the phone uses the app's Paper theme */
	--screen: #f7f1e5;
	--screen-ink: #27221c;
	--screen-muted: #8a7f72;
	--anchor: #f1dfae;
	--anchor-ink: #27221c;
	--anchor-dot: #b07a1e;
	--focus-ring: #2e5e5a;
	--sans: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--serif: 'Literata', Georgia, 'Times New Roman', serif;
	--radius: 1rem;
}
@media (prefers-color-scheme: dark) {
	:root {
		--page: #0f1312;
		--surface: #161c1b;
		--tint: #18211f;
		--line: #26302e;
		--ink: #e3e9e7;
		--ink-muted: #9aa8a5;
		--accent: #7fb3aa;
		--accent-strong: #a3ccc4;
		--band: #173431;
		--band-ink: #eef4f2;
		--band-muted: #a9c2bd;
		--device: #050707;
		/* ...and Night in dark mode */
		--screen: #1a1816;
		--screen-ink: #d9cfbe;
		--screen-muted: #8a8174;
		--anchor: #4a3b1c;
		--anchor-ink: #f1e3c2;
		--anchor-dot: #c79a45;
		--focus-ring: #a3ccc4;
	}
}

*,
*::before,
*::after {
	box-sizing: border-box;
}
html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}
body {
	margin: 0;
	background: var(--page);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 1.0625rem;
	line-height: 1.6;
	overflow-wrap: break-word;
}
.wrap {
	width: min(100% - 2rem, 70rem);
	margin-inline: auto;
}
a {
	color: var(--accent);
	text-underline-offset: 0.2em;
	text-decoration-thickness: 1px;
}
a:hover {
	color: var(--accent-strong);
	text-decoration-thickness: 2px;
}
:focus-visible {
	outline: 2px solid var(--focus-ring);
	outline-offset: 3px;
	border-radius: 4px;
}
.skip {
	position: absolute;
	left: 1rem;
	top: -4rem;
	background: var(--accent);
	color: var(--page);
	padding: 0.75rem 1rem;
	z-index: 10;
}
.skip:focus {
	top: 1rem;
	color: var(--page);
}
h1,
h2,
h3 {
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.015em;
	margin: 0;
}
p {
	margin: 0 0 1em;
}

/* Header and footer */
.bar .wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0 1.5rem;
	padding-block: 0.5rem;
}
.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	min-height: 3rem;
	font-weight: 600;
	font-size: 1.25rem;
	color: var(--ink);
	text-decoration: none;
}
.brand:hover {
	color: var(--ink);
}
.brand img {
	width: 1.5rem;
	height: 1.5rem;
}
.bar nav {
	display: flex;
	gap: 0.25rem;
}
.bar nav a {
	display: inline-flex;
	align-items: center;
	min-height: 3rem;
	padding-inline: 0.75rem;
	color: var(--ink);
	text-decoration: none;
	border-radius: 0.5rem;
}
.bar nav a:hover,
.bar nav a[aria-current='page'] {
	background: var(--tint);
}
.foot {
	margin-top: 5rem;
	border-top: 1px solid var(--line);
	padding-block: 2rem 3rem;
	font-size: 0.9375rem;
	color: var(--ink-muted);
}
.foot .wrap {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.5rem 2rem;
}
.foot p {
	margin: 0;
}
.foot a {
	display: inline-flex;
	align-items: center;
	min-height: 3rem;
	margin-right: 1.25rem;
	color: var(--ink);
}

/* Hero: a deep teal panel with the phone demo */
.hero {
	background: var(--band);
	color: var(--band-ink);
	border-radius: calc(var(--radius) * 1.75);
	padding: clamp(2rem, 6vw, 4.5rem) clamp(1.25rem, 5vw, 4.5rem);
	display: grid;
	gap: 3rem;
	align-items: center;
}
.hero h1 {
	font-size: clamp(2.5rem, 7vw, 4.25rem);
	letter-spacing: -0.03em;
	line-height: 1.02;
}
.lede {
	font-size: clamp(1.125rem, 2.5vw, 1.3125rem);
	line-height: 1.5;
	color: var(--band-muted);
	margin: 1.25rem 0 2rem;
	max-width: 30rem;
}
.get {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	min-height: 3.25rem;
	padding: 0 1.5rem 0 1.25rem;
	background: var(--cta);
	color: var(--cta-ink);
	font-weight: 600;
	text-decoration: none;
	border-radius: 999px;
}
.get svg {
	width: 1.1rem;
	height: 1.1rem;
}
.get:hover {
	background: var(--cta-hover);
	color: var(--cta-ink);
}
.note {
	font-size: 0.9375rem;
	color: var(--band-muted);
	margin: 1rem 0 0;
}

/* The phone. Everything inside scales with --u so it fits a 320px screen. */
.demo {
	--u: min(1rem, calc((100vw - 4.5rem) / 24));
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
}
.device {
	position: relative;
	height: calc(26 * var(--u));
	width: calc(23.5 * var(--u));
	padding: calc(0.55 * var(--u));
	border-radius: calc(1.6 * var(--u));
	background: var(--device);
	box-shadow:
		0 1.5rem 3rem -1rem rgb(0 0 0 / 0.45),
		inset 0 0 0 1px rgb(255 255 255 / 0.08);
}
.device[data-posture='folded'] {
	width: calc(11.5 * var(--u));
}
.screen {
	position: absolute;
	inset: calc(0.55 * var(--u));
	border-radius: calc(1.1 * var(--u));
	background: var(--screen);
	color: var(--screen-ink);
	overflow: hidden;
	font-family: var(--serif);
	font-size: calc(0.74 * var(--u));
	line-height: 1.6;
}
.spread {
	display: grid;
	grid-template-columns: 1fr 1fr;
}
.spread::after {
	content: '';
	position: absolute;
	inset: 0 auto 0 50%;
	width: calc(1.2 * var(--u));
	translate: -50% 0;
	background: linear-gradient(90deg, transparent, rgb(0 0 0 / 0.07), transparent);
}
.device[data-posture='folded'] .spread,
.device[data-posture='open'] .cover {
	opacity: 0;
	visibility: hidden;
}
.pg {
	position: relative;
	padding: calc(2.2 * var(--u)) calc(1.2 * var(--u)) calc(2 * var(--u)) calc(1.4 * var(--u));
	height: 100%;
}
.pg p {
	margin: 0 0 0.8em;
	min-width: calc(8.6 * var(--u));
}
.pg .run,
.pg .loc {
	font-family: var(--sans);
	font-size: calc(0.6 * var(--u));
	color: var(--screen-muted);
	position: absolute;
	left: calc(1.4 * var(--u));
	right: calc(1.2 * var(--u));
}
.pg .run {
	top: calc(0.8 * var(--u));
}
.pg .loc {
	bottom: calc(0.7 * var(--u));
}
.anchor {
	background: var(--anchor);
	color: var(--anchor-ink);
	padding: 0.05em 0.15em;
	margin-inline: -0.15em;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}
.dot::before {
	content: '';
	position: absolute;
	left: calc(0.55 * var(--u));
	width: calc(0.4 * var(--u));
	height: calc(0.4 * var(--u));
	margin-top: 0.55em;
	border-radius: 50%;
	background: var(--anchor-dot);
}
.seg {
	display: inline-flex;
	margin-top: 1.75rem;
	padding: 0.25rem;
	border-radius: 999px;
	background: rgb(0 0 0 / 0.22);
}
.seg button {
	min-height: 2.75rem;
	min-width: 6rem;
	padding: 0 1.1rem;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--band-muted);
	font: 600 0.9375rem var(--sans);
	cursor: pointer;
}
.seg button[aria-pressed='true'] {
	background: var(--band-ink);
	color: var(--band);
}
.demo figcaption {
	font-size: 0.875rem;
	color: var(--band-muted);
	margin-top: 0.75rem;
	text-align: center;
}

/* Formats strip */
.formats {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin-top: 2rem;
	color: var(--ink-muted);
	font-size: 0.9375rem;
}
.formats span {
	padding: 0.3rem 0.75rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	color: var(--ink);
	font-weight: 600;
	font-size: 0.875rem;
	letter-spacing: 0.02em;
}

/* Sections */
.section {
	margin-top: clamp(4rem, 10vw, 6.5rem);
}
.section > h2 {
	font-size: clamp(1.75rem, 4vw, 2.5rem);
	max-width: 32rem;
}
.section > .intro {
	color: var(--ink-muted);
	font-size: 1.125rem;
	max-width: 36rem;
	margin-top: 0.75rem;
}
.cards {
	display: grid;
	gap: 1rem;
	margin-top: 2.5rem;
}
.card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 1.75rem 1.5rem 1.25rem;
}
.card h3 {
	font-size: 1.25rem;
	margin: 1.25rem 0 0.5rem;
}
.card p {
	color: var(--ink-muted);
}
.icon {
	display: grid;
	place-items: center;
	width: 3rem;
	height: 3rem;
	border-radius: 0.75rem;
	background: var(--tint);
	color: var(--accent);
}
.icon svg {
	width: 1.5rem;
	height: 1.5rem;
}

/* Flip Plus */
.plus {
	display: grid;
	gap: 2rem;
	background: var(--tint);
	border-radius: calc(var(--radius) * 1.75);
	padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 5vw, 3.5rem);
}
.plus h2 {
	font-size: clamp(1.75rem, 4vw, 2.5rem);
}
.plus .intro {
	color: var(--ink-muted);
	font-size: 1.125rem;
	margin-top: 0.75rem;
	max-width: 30rem;
}
.ticks {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.75rem;
	align-content: center;
}
.ticks li {
	position: relative;
	padding-left: 2rem;
}
.ticks li::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0.3em;
	width: 1.1rem;
	height: 1.1rem;
	border-radius: 50%;
	background: var(--cta);
	box-shadow: inset 0 0 0 0.3rem var(--tint);
	outline: 2px solid var(--anchor-dot);
	outline-offset: -2px;
}

/* Privacy policy and 404 */
.prose {
	max-width: 42rem;
	padding-top: clamp(2.5rem, 7vw, 4rem);
}
.prose h1 {
	font-size: clamp(2.25rem, 6vw, 3rem);
	letter-spacing: -0.025em;
	margin-bottom: 0.5rem;
}
.prose h2 {
	font-size: 1.375rem;
	margin: 2.5rem 0 0.6rem;
}
.prose ul {
	margin: 0 0 1em;
	padding-left: 1.25rem;
}
.prose li {
	margin-bottom: 0.5em;
}
.prose li::marker {
	color: var(--accent);
}
.updated {
	color: var(--ink-muted);
	font-size: 0.9375rem;
}
.short {
	background: var(--tint);
	border-radius: var(--radius);
	padding: 1.1rem 1.25rem;
	margin: 1.5rem 0;
}
.short strong {
	display: block;
	margin-bottom: 0.25rem;
}

@media (min-width: 52rem) {
	.hero {
		grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	}
	.demo {
		--u: 1rem;
	}
	.cards {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
	.plus {
		grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
	}
}
@media (prefers-reduced-motion: no-preference) {
	.device {
		transition: width 0.55s cubic-bezier(0.3, 0.7, 0.2, 1);
	}
	.screen {
		transition:
			opacity 0.3s ease,
			visibility 0.3s;
	}
	a,
	.get,
	.seg button,
	.bar nav a {
		transition:
			background-color 0.15s ease,
			color 0.15s ease;
	}
}
.pg .ch {
	margin: calc(1.5 * var(--u)) 0 calc(1.2 * var(--u));
	font-family: var(--sans);
	font-size: calc(0.6 * var(--u));
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--screen-muted);
}
.pg .ch span {
	display: block;
	margin-top: 0.3em;
	font-family: var(--serif);
	font-size: calc(1.35 * var(--u));
	letter-spacing: 0;
	text-transform: none;
	color: var(--screen-ink);
}

/* App screenshots, framed as the phone's screens */
.shots {
	display: grid;
	gap: 2rem 1.25rem;
	margin: 2.5rem 0.4rem 0;
	align-items: start;
}
.shots figure {
	margin: 0;
}
.shots img {
	display: block;
	width: 100%;
	height: auto;
	/* An outline, not a border, so the frame does not change the image's proportions */
	outline: 0.4rem solid var(--device);
	border-radius: 0.9rem;
	box-shadow: 0 1rem 2rem -1.25rem rgb(0 0 0 / 0.4);
}
.shots figcaption {
	font-size: 0.9375rem;
	color: var(--ink-muted);
	margin-top: 1.1rem;
}
.shots .cover {
	max-width: 15rem;
}
@media (min-width: 40rem) {
	/* Open shots are 1100x1140 and cover shots 560x1120: these columns give both the same height */
	.shots {
		grid-template-columns: minmax(0, 1.93fr) minmax(0, 1fr);
		gap: 2.5rem 1.5rem;
	}
	.shots .cover {
		max-width: none;
	}
}
