/* The site's look: the app's paper, ink and type, so the site and the app are
   one thing. Every page links it. */
:root {
	--bg: #f6f1e7;
	--fg: #23201b;
	--muted: #6f675b;
	--border: #ddd4c3;
	--surface: #fbf8f1;
	--accent: #2c4566;
	--serif: Literata, Georgia, serif;
	color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #1b1916;
		--fg: #e9e2d4;
		--muted: #a59c8c;
		--border: #3a352e;
		--surface: #23201c;
		--accent: #9fb6d6;
	}
}
* {
	box-sizing: border-box;
}
body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font: 17px/1.55 "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
}
[hidden] {
	display: none !important;
}
a {
	color: var(--accent);
}
.page {
	max-width: 1040px;
	margin: 0 auto;
	padding: 0 20px;
}
h1,
h2,
h3 {
	font-family: var(--serif);
	font-weight: 600;
	line-height: 1.2;
}

/* The top bar. */
.top {
	display: flex;
	align-items: center;
	gap: 22px;
	padding: 18px 0;
}
.top .brand {
	font: 700 1.2rem/1 var(--serif);
	color: var(--fg);
	text-decoration: none;
	margin-right: auto;
	display: flex;
	gap: 8px;
	align-items: center;
}
.top .brand svg {
	width: 22px;
	height: 22px;
}
.top a {
	color: var(--fg);
	text-decoration: none;
}
.top a[aria-current] {
	text-decoration: underline;
	text-underline-offset: 6px;
}
.top .button {
	padding: 8px 14px;
	min-height: 0;
}
.top .links {
	display: flex;
	gap: 22px;
}
/* A phone: the name, Open Inklings and a menu of the pages. */
.menu {
	display: none;
	position: relative;
}
.menu summary {
	list-style: none;
	cursor: pointer;
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	border: 1px solid var(--border);
	border-radius: 10px;
	color: var(--fg);
}
.menu summary::-webkit-details-marker {
	display: none;
}
.menu summary svg {
	width: 22px;
	height: 22px;
}
.menu nav {
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	z-index: 10;
	min-width: 200px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
	box-shadow: 0 12px 32px -16px rgba(0, 0, 0, 0.35);
	padding: 6px;
	display: grid;
}
.menu nav a {
	padding: 12px 14px;
	border-radius: 8px;
	font-size: 1.05rem;
}
.menu nav a[aria-current] {
	text-decoration: none;
	background: var(--bg);
	font-weight: 600;
}
@media (max-width: 560px) {
	.top {
		gap: 10px;
	}
	.top .links {
		display: none;
	}
	.menu {
		display: block;
	}
	.top .button {
		min-height: 44px;
	}
	.hero h1 {
		margin-top: 4vh;
	}
}

/* Buttons. */
.actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	align-items: center;
}
.button {
	display: inline-flex;
	align-items: center;
	padding: 12px 22px;
	border-radius: 10px;
	font-weight: 600;
	text-decoration: none;
	min-height: 48px;
}
.button.primary,
.top .button {
	background: var(--accent);
	color: var(--bg);
}
.button.secondary {
	color: var(--accent);
	border: 1px solid var(--border);
}
.small {
	color: var(--muted);
	font-size: 0.9rem;
}

/* The first screen. */
.hero h1 {
	font-size: clamp(2rem, 5.5vw, 3.1rem);
	margin: 9vh 0 0.4em;
	max-width: 20ch;
	letter-spacing: -0.01em;
}
.hero .what {
	font-size: 1.2rem;
	color: var(--muted);
	max-width: 44ch;
	margin: 0 0 1.4em;
}
.hero .small {
	margin-top: 0.8em;
}

/* The tour: the app itself, working, in a phone, beside what to show. */
.tour {
	display: grid;
	grid-template-columns: auto minmax(0, 440px);
	justify-content: center;
	gap: 56px;
	align-items: center;
	margin: 8vh 0 6vh;
}
.device {
	display: grid;
	gap: 10px;
	justify-items: center;
}
.device .small {
	max-width: 30ch;
	text-align: center;
	margin: 0;
}
.phone-frame {
	/* A phone's shape, as tall as the screen allows. */
	height: clamp(460px, calc(100vh - 280px), 660px);
	aspect-ratio: 9 / 16;
	border-radius: 40px;
	border: 10px solid #23201b;
	background: var(--bg);
	overflow: hidden;
	position: relative;
	box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.45);
}
.phone-frame iframe {
	border: 0;
	width: 100%;
	height: 100%;
	display: block;
}
.poster {
	position: absolute;
	inset: 0;
	display: block;
}
/* The picture keeps its own proportions, cropped at the foot to the frame. */
.poster img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top;
	display: block;
}
.poster .button {
	position: absolute;
	left: 50%;
	bottom: 28px;
	transform: translateX(-50%);
	box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.4);
}
.tabs {
	display: grid;
	gap: 8px;
}
.tabs a {
	display: block;
	padding: 16px 20px;
	border-radius: 14px;
	border: 1px solid transparent;
	color: inherit;
	text-decoration: none;
}
.tabs a[aria-selected="true"] {
	background: var(--surface);
	border-color: var(--border);
}
.tabs h2 {
	font-size: 1.3rem;
	margin: 0 0 0.25em;
}
.tabs a[aria-selected="true"] h2 {
	color: var(--accent);
}
.tabs p {
	margin: 0;
	color: var(--muted);
	max-width: 46ch;
}
/* A phone: the picture, a tap opens the app to try, full screen; each of
   what to show opens it there. */
@media (max-width: 760px) {
	.tour {
		grid-template-columns: 1fr;
		gap: 24px;
	}
	.phone-frame {
		width: min(300px, 80vw);
		height: auto;
		aspect-ratio: 9 / 15;
		border-width: 8px;
		border-radius: 32px;
	}
	.tabs a[aria-selected="true"] {
		background: none;
		border-color: transparent;
	}
	.tabs a[aria-selected="true"] h2 {
		color: inherit;
	}
	.tabs h2::after {
		content: " ›";
		color: var(--accent);
	}
}
.shot {
	border: 1px solid var(--border);
	border-radius: 14px;
	background: var(--surface);
	overflow: hidden;
	height: 320px;
	position: relative;
}
.shot img {
	width: 100%;
	display: block;
}
/* A live page is a peek: it fades out at the picture's foot. */
.shot:has(iframe)::after {
	content: "";
	position: absolute;
	inset: auto 0 0;
	height: 56px;
	background: linear-gradient(transparent, var(--surface));
	pointer-events: none;
}
.shot iframe {
	border: 0;
	width: 100%;
	height: 100%;
	display: block;
}
.live {
	font: 600 0.7rem/1 system-ui, sans-serif;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--accent);
	display: flex;
	gap: 6px;
	align-items: center;
	margin-bottom: 8px;
}
.live.app {
	color: var(--muted);
}
.live.app::before {
	background: var(--muted);
}
.live::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #3f8a5a;
}

/* Bands of two. */
.band {
	border-top: 1px solid var(--border);
	padding: 2em 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 32px;
}
.band h2 {
	font-size: 1.45rem;
	margin: 0 0 0.3em;
}
.band p {
	margin: 0 0 0.8em;
	color: var(--muted);
	max-width: 52ch;
}

/* Questions people ask. */
.faq {
	border-top: 1px solid var(--border);
	padding: 2em 0;
}
.faq h2 {
	font-size: 1.45rem;
	margin: 0 0 0.6em;
}
.faq details {
	border-bottom: 1px solid var(--border);
	padding: 12px 0;
}
.faq summary {
	cursor: pointer;
	font-weight: 600;
	min-height: 32px;
}
.faq details p {
	color: var(--muted);
	margin: 0.6em 0 0.4em;
	max-width: 62ch;
}

/* Pricing. */
.plans {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 16px;
	margin: 2em 0;
}
.plan {
	border: 1px solid var(--border);
	border-radius: 14px;
	padding: 20px;
	background: var(--surface);
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.plan.pick {
	border: 2px solid var(--accent);
	padding: 19px;
}
.plan h2 {
	font-size: 1.15rem;
	margin: 0;
}
.plan .price {
	font: 600 2rem/1 var(--serif);
}
.plan .price small {
	font: 400 0.9rem/1 "Source Sans 3", system-ui, sans-serif;
	color: var(--muted);
}
.plan ul {
	margin: 4px 0 0;
	padding-left: 1.1em;
	color: var(--muted);
	display: grid;
	gap: 4px;
}
.plan .save {
	font: 600 0.75rem/1 system-ui, sans-serif;
	color: var(--bg);
	background: var(--accent);
	padding: 5px 9px;
	border-radius: 12px;
	justify-self: start;
	align-self: flex-start;
}
/* The buttons sit at the bottom of the cards; side by side the group has one height, so they line up. */
.plan .cta {
	margin-top: auto;
	padding-top: 12px;
	display: grid;
	gap: 8px;
}
.plan .cta .button {
	justify-content: center;
}
.plan .cta-note {
	margin: 0;
	color: var(--muted);
	font-size: 0.85rem;
	line-height: 1.4;
	text-align: center;
}
@media (min-width: 700px) {
	.plan .cta {
		min-height: calc(12px + 48px + 8px + 2.4em);
		align-content: start;
	}
}
table.terms {
	width: 100%;
	border-collapse: collapse;
	margin: 1em 0 3em;
}
table.terms th,
table.terms td {
	text-align: left;
	vertical-align: top;
	padding: 12px 8px;
	border-bottom: 1px solid var(--border);
}
table.terms th {
	width: 28%;
	font-weight: 600;
}
table.terms td {
	color: var(--muted);
}
table.terms .actions {
	margin-top: 10px;
}
@media (max-width: 560px) {
	table.terms th,
	table.terms td {
		display: block;
		width: auto;
		padding: 4px 0;
		border: 0;
	}
	table.terms tr {
		display: block;
		border-bottom: 1px solid var(--border);
		padding: 10px 0;
	}
}

/* The blog. */
.posts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 28px;
	margin: 2em 0 4em;
}
.posts a {
	color: inherit;
	text-decoration: none;
}
.posts h2 {
	font-size: 1.2rem;
	margin: 0.8em 0 0.2em;
}
.posts p {
	margin: 0;
	color: var(--muted);
}
/* (A card's live page is its picture: a tap opens the post.) */
.posts iframe {
	pointer-events: none;
	/* (The page's empty top cropped, as on every collection.) */
	margin-top: -24px;
	height: calc(100% + 24px);
}
.posts .shot {
	height: 220px;
}
.posts time,
.meta {
	font-size: 0.85rem;
	color: var(--muted);
}
article {
	max-width: 660px;
	margin: 4vh auto 6vh;
}
article h1 {
	font-size: clamp(1.8rem, 5vw, 2.4rem);
	margin: 0.2em 0 0.6em;
}
article h2 {
	font-size: 1.3rem;
	margin: 1.6em 0 0.4em;
}
article p,
article li {
	font: 400 1.08rem/1.7 var(--serif);
}
article pre {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 14px 16px;
	overflow-x: auto;
	font-size: 0.95rem;
	line-height: 1.5;
}
.try {
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 16px 18px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 2em;
}
.try b {
	font: 600 1.1rem/1.3 var(--serif);
}

/* Plain pages (privacy, terms). */
.prose {
	max-width: 680px;
	margin: 4vh auto 8vh;
}
.prose h2 {
	font-size: 1.2rem;
	margin-top: 2em;
}
.prose .eff {
	color: var(--muted);
	margin-top: -0.4em;
}
/* The terms' plans: a small table, scrolled on its own if it must. */
.prose .wrap {
	overflow-x: auto;
}
.prose .plans-table {
	border-collapse: collapse;
	width: 100%;
	margin: 0.4em 0 1em;
}
.prose .plans-table th,
.prose .plans-table td {
	text-align: left;
	padding: 8px 10px;
	border-bottom: 1px solid var(--border);
}
.prose .plans-table th {
	color: var(--muted);
	font-weight: 600;
}

footer {
	padding-bottom: 3em;
	font-size: 0.95rem;
}
footer nav {
	border-top: 1px solid var(--border);
	padding-top: 1.4em;
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
}
footer a,
footer span {
	color: var(--muted);
}

/* One collection to try: the app on it alone, in a card. */
.try-it {
	margin: 1.4em 0;
}
/* The card: the app's page, its empty top (where the way back would be,
   with nothing to go back to) cropped away. */
.try-it .frame {
	border: 1px solid var(--border);
	border-radius: 14px;
	overflow: hidden;
	background: var(--surface);
}
.try-it iframe {
	border: 0;
	width: 100%;
	display: block;
	margin-top: -24px;
}
/* Faded in once the app has drawn it and said its height. */
.try-it iframe {
	opacity: 0;
	transition: opacity 0.25s ease;
}
.try-it iframe.ready {
	opacity: 1;
}
.try-it figcaption {
	font-size: 0.9rem;
	color: var(--muted);
	margin-top: 8px;
}

/* How it works. */
.how {
	border-top: 1px solid var(--border);
	padding: 2em 0;
	max-width: 720px;
}
.how h2 {
	font-size: 1.5rem;
	margin: 0 0 0.4em;
}
.how p {
	color: var(--muted);
	max-width: 62ch;
}
code {
	font: 0.95em ui-monospace, "SF Mono", Menlo, monospace;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 1px 6px;
	white-space: nowrap;
}
table.bullets {
	border-collapse: collapse;
	margin-top: 1em;
}
table.bullets td {
	padding: 8px 16px 8px 0;
	border-bottom: 1px solid var(--border);
	color: var(--muted);
}
.flow {
	list-style: none;
	padding: 0;
	margin: 1.2em 0;
	display: grid;
	gap: 0;
}
.step {
	display: grid;
	grid-template-columns: 40px 1fr;
	gap: 16px;
	position: relative;
	padding-bottom: 24px;
}
/* The line from one step to the next. */
.step:not(:last-child)::before {
	content: "";
	position: absolute;
	left: 19px;
	top: 40px;
	bottom: 0;
	border-left: 2px solid var(--border);
}
.step .n {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: var(--accent);
	color: var(--bg);
	font: 600 1.05rem/1 var(--serif);
}
.step h3 {
	font-size: 1.2rem;
	margin: 6px 0 0.3em;
}
.step p {
	margin: 0 0 0.5em;
}
.choices {
	margin: 0.4em 0 0;
	padding-left: 1.1em;
	color: var(--muted);
	display: grid;
	gap: 6px;
}
.choices b {
	color: var(--fg);
}

/* The landing page's story beside the tour. */
.story {
	display: grid;
	gap: 12px;
}
.eyebrow {
	font: 600 0.75rem/1 system-ui, sans-serif;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--muted);
	margin: 0 0 0 20px;
}
.story .more {
	margin-left: 20px;
}
.tabs code {
	font-size: 0.9em;
}
.band.price {
	align-items: center;
}
.band.price .actions {
	justify-content: flex-end;
}
@media (max-width: 760px) {
	.band.price .actions {
		justify-content: flex-start;
	}
}
article .next {
	font: 600 1rem/1.4 "Source Sans 3", system-ui, sans-serif;
	margin-top: 1.4em;
}

/* ── The first page, redrawn (/draft/) ───────────────────────────────────── */
/* The hero: words and the app side by side, on a notebook's dot grid. */
.d-hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 56px;
	align-items: center;
	margin: 0 -20px;
	padding: 6vh 20px 7vh;
	background-image: radial-gradient(circle, var(--border) 1.2px, transparent 1.4px);
	background-size: 22px 22px;
	border-bottom: 1px solid var(--border);
}
.d-hero h1 {
	font-size: clamp(2.2rem, 5vw, 3.4rem);
	margin: 0 0 0.4em;
	letter-spacing: -0.01em;
}
.d-hero .what {
	font-size: 1.2rem;
	color: var(--muted);
	max-width: 40ch;
	margin: 0 0 1.4em;
	background: var(--bg);
}
.d-hero .small {
	background: var(--bg);
	display: inline-block;
}
.d-parts,
.d-kinds {
	padding: 9vh 0 4vh;
}
.d-parts h2,
.d-kinds h2 {
	font-size: clamp(1.7rem, 3.5vw, 2.3rem);
	margin: 0.2em 0 0.3em;
}
.d-parts .what,
.d-kinds .what {
	color: var(--muted);
	max-width: 60ch;
	font-size: 1.1rem;
}
.d-parts .eyebrow,
.d-kinds .eyebrow {
	margin: 0;
}
/* The four parts: one strip, read left to right, joined. */
.d-map {
	list-style: none;
	padding: 0;
	margin: 2em 0 0.8em;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 18px;
	counter-reset: part;
}
.d-map li {
	position: relative;
}
.d-map li:not(:last-child)::after {
	content: "›";
	position: absolute;
	right: -14px;
	top: 34px;
	color: var(--muted);
	font: 1.4rem/1 var(--serif);
}
.d-map a {
	display: block;
	height: 100%;
	padding: 18px;
	border: 1px solid var(--border);
	border-radius: 14px;
	background: var(--surface);
	color: inherit;
	text-decoration: none;
}
.d-map a[aria-selected="true"] {
	border-color: var(--accent);
	box-shadow: 0 0 0 1px var(--accent);
}
.d-map svg {
	width: 28px;
	height: 28px;
	color: var(--accent);
}
.d-map h3 {
	font-size: 1.15rem;
	margin: 0.5em 0 0.3em;
}
.d-map p {
	margin: 0;
	color: var(--muted);
	font-size: 0.95rem;
}
.d-hint a {
	margin-left: 8px;
}
/* Every kind: what you type, then what it's drawn as. */
.d-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
	gap: 24px;
	margin-top: 2em;
	align-items: start;
}
.d-kind {
	/* (Not a post: the whole cell.) */
	margin: 0;
	max-width: none;
	border: 1px solid var(--border);
	border-radius: 16px;
	padding: 18px;
	background: var(--bg);
}
.d-kind h3 {
	font-size: 1.2rem;
	margin: 0;
}
.d-kind p {
	margin: 0.2em 0 0.8em;
	color: var(--muted);
	font-size: 0.95rem;
}
.d-kind .try-it {
	margin: 10px 0 0;
}
/* A phone: one kind at a time, chosen by name (the rest aren't loaded). */
.d-chips {
	display: none;
}
@media (max-width: 760px) {
	.d-chips {
		display: flex;
		flex-wrap: wrap;
		gap: 8px;
		margin-top: 1.4em;
	}
	.d-chips button {
		font: 600 0.95rem/1 "Source Sans 3", system-ui, sans-serif;
		padding: 10px 14px;
		min-height: 44px;
		border-radius: 22px;
		border: 1px solid var(--border);
		background: var(--surface);
		color: var(--fg);
		text-transform: capitalize;
	}
	.d-chips button[aria-selected="true"] {
		background: var(--accent);
		border-color: var(--accent);
		color: var(--bg);
	}
	.d-grid {
		margin-top: 1em;
		position: relative;
	}
	.d-kind:not([data-shown]) {
		position: absolute;
		inset: 0 0 auto;
		visibility: hidden;
		pointer-events: none;
	}
}
@media (max-width: 860px) {
	.d-hero {
		grid-template-columns: 1fr;
		gap: 32px;
	}
	.d-map {
		grid-template-columns: 1fr 1fr;
	}
	.d-map li:nth-child(2)::after {
		content: none;
	}
}
@media (max-width: 560px) {
	.d-map {
		grid-template-columns: 1fr;
	}
	.d-map li::after {
		content: none !important;
	}
}

/* Under the app: its parts as a progress strip (each fills as it's shown;
   choose one to see it from there), and what it's doing, said. */
.d-steps {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
	width: 100%;
	max-width: min(300px, 80vw);
}
.d-steps button {
	border: 0;
	padding: 6px 0 0;
	background: none;
	cursor: pointer;
	font: 600 0.72rem/1.2 system-ui, sans-serif;
	letter-spacing: 0.04em;
	color: var(--muted);
	display: grid;
	gap: 6px;
	min-height: 36px;
}
.d-steps .bar {
	display: block;
	height: 3px;
	border-radius: 2px;
	background: var(--border);
	overflow: hidden;
}
.d-steps .fill {
	display: block;
	height: 100%;
	width: 0;
	background: var(--accent);
}
.d-steps [data-done] .fill {
	width: 100%;
}
.d-steps [aria-selected="true"] {
	color: var(--fg);
}
.d-steps [aria-selected="true"] .fill {
	animation: d-fill var(--chapter, 0s) linear forwards;
}
/* Out of sight, the app waits, and so does its bar; handed over (or asked
   for less motion), the part shown is simply marked. */
.d-steps[data-paused] .fill {
	animation-play-state: paused;
}
.d-steps[data-still] [aria-selected="true"] .fill {
	animation: none;
	width: 100%;
}
@keyframes d-fill {
	from {
		width: 0;
	}
	to {
		width: 100%;
	}
}
.d-caption [data-say] {
	transition: opacity 0.2s;
}
.d-again {
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--accent);
	font: 600 0.95rem/1 "Source Sans 3", system-ui, sans-serif;
	padding: 10px 16px;
	border-radius: 20px;
	cursor: pointer;
	min-height: 40px;
}
.d-caption {
	margin: 0;
	text-align: center;
	min-height: 2.6em;
	max-width: 32ch;
	color: var(--muted);
}
.d-caption b {
	color: var(--fg);
	font: 600 1.05rem/1.3 var(--serif);
	display: block;
}

/* The smallest phones: the top bar's button says only "Open", and the
   collections' cards keep more of the width for the app. */
.top .button {
	white-space: nowrap;
}
@media (max-width: 380px) {
	.top .long {
		display: none;
	}
	.d-kind {
		padding: 12px;
	}
	.phone-frame {
		border-width: 6px;
	}
}

/* Dark: the phone's edge shows against the dark page. */
@media (prefers-color-scheme: dark) {
	.phone-frame {
		border-color: #4a443b;
		box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
	}
}
