:root {
  --paper: #f7f2e9;
  --paper-deep: #efe7d8;
  --card: #fffdf8;
  --ink: #2a2521;
  --ink-soft: #645a50;
  --line: #e2d8c6;
  --accent: #8a3b12;
  --accent-deep: #6b2c0c;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "URW Palladio L", P052, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --radius: 12px;
  /* The white of a colour e-paper screen: a warm light grey */
  --epaper: #ece6da;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 20px/1.7 var(--serif);
}

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: var(--accent-deep); }

.wrap { margin: 0 auto; padding: 0 26px; }
.wrap.narrow { max-width: 720px; }

/* Site header: just the name and two links */
.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 24px;
  padding-bottom: 8px;
}
.brand {
  font-size: 19px;
  color: var(--ink-soft);
  text-decoration: none;
  letter-spacing: 0.04em;
  font-variant: small-caps;
}
.brand:hover { color: var(--ink); }
.site-header nav { display: flex; gap: 22px; font-size: 17px; }
.site-header nav a { color: var(--ink-soft); text-decoration: none; }
.site-header nav a:hover { color: var(--ink); }

/* Text pages, set like a book */
.prose { padding-top: 40px; padding-bottom: 64px; }
.prose h1 {
  font-size: clamp(40px, 7vw, 56px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 28px;
}
.home h1 { text-align: center; margin-bottom: 8px; }
.subtitle {
  text-align: center;
  font-style: italic;
  font-size: 22px;
  color: var(--ink-soft);
  margin: 0 0 48px;
}
.prose h2 {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  margin: 56px 0 14px;
}
.home h2 { text-align: center; }
.home h2::before {
  content: "❦";
  display: block;
  font-size: 22px;
  color: var(--accent);
  margin-bottom: 18px;
  font-weight: normal;
}
.prose p, .prose ul, .prose ol { margin: 0 0 18px; }
.prose li { margin: 6px 0; }
.small { font-size: 17px; color: var(--ink-soft); }
/* 64 hex digits don't fit a phone's width */
.checksum code { word-break: break-all; }
.signature { margin-top: 32px !important; font-style: italic; }

/* Illustrations of a Kobo page */
.illustration { margin: 40px 0; }
.illustration-device { max-width: 360px; margin: 0 auto; }
.illustration-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  margin: 36px auto 40px;
  max-width: 600px;
}
.illustration-pair figure { margin: 0; }
figcaption {
  margin-top: 14px;
  text-align: center;
  font-size: 16px;
  font-style: italic;
  color: var(--ink-soft);
}

.device {
  background: linear-gradient(145deg, #3a3633, #1f1c1a);
  border-radius: 7% / 5.25%;
  padding: 7% 6%;
  box-shadow: 0 24px 48px -20px rgba(60, 40, 20, 0.45), 0 2px 6px rgba(0, 0, 0, 0.2);
}
.screen {
  aspect-ratio: 1264 / 1680;
  border-radius: 1.5%;
  overflow: hidden;
  background: var(--epaper);
  isolation: isolate;
}
/* Kobo screenshots have the colours as drawn; a colour e-paper screen shows
   them much paler, on a warm light grey. Multiplying onto --epaper gives
   that white; a neutral grey looked blue next to the cream page. */
.screen img {
  display: block;
  width: 100%;
  height: 100%;
  filter: saturate(0.2) contrast(0.9);
  mix-blend-mode: multiply;
}
.small-device { max-width: 280px; }

/* The settings pages, each next to what it does */
.walkthrough { margin: 36px 0; }
.step {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  align-items: center;
  margin: 0 0 36px;
}
.step h3 { font-size: 22px; font-weight: 600; margin: 0 0 8px; }
.step-text p { margin: 0; }

/* Screenshots open full size when clicked */
a.zoom { display: block; cursor: zoom-in; }
a.zoom:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.zoom-view {
  border: none;
  padding: 0;
  background: var(--epaper);
  isolation: isolate;
  border-radius: 6px;
  max-width: 100vw;
  max-height: 100vh;
  cursor: zoom-out;
}
.zoom-view::backdrop { background: rgba(30, 25, 20, 0.85); }
.zoom-view img {
  display: block;
  max-width: 96vw;
  max-height: 96vh;
  width: auto;
  height: auto;
  border-radius: 6px;
  filter: saturate(0.2) contrast(0.9);
  mix-blend-mode: multiply;
}
/* A bar at the size it has on the device, since it's tiny on a whole page */
.bar-closeup {
  margin: 28px auto 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--epaper);
  isolation: isolate;
  box-shadow: 0 8px 24px -12px rgba(60, 40, 20, 0.45);
}
.bar-closeup img {
  display: block;
  width: 100%;
  height: auto;
  filter: saturate(0.2) contrast(0.9);
  mix-blend-mode: multiply;
}

code, kbd {
  font: 0.8em/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: var(--paper-deep);
  border-radius: 5px;
  padding: 1px 6px;
}
kbd { border: 1px solid var(--line); border-bottom-width: 2px; }
pre {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  overflow-x: auto;
  font-size: 16px;
}
pre code { background: none; padding: 0; }

table { width: 100%; border-collapse: collapse; margin: 18px 0; font: 15px/1.5 var(--sans); }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { border-bottom: 2px solid var(--ink); }
td:first-child { white-space: nowrap; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 44px;
  font-size: 16px;
  color: var(--ink-soft);
}
.site-footer p { margin: 0; }

@media (max-width: 640px) {
  body { font-size: 18px; }
  .illustration-pair { grid-template-columns: 1fr; max-width: 300px; }
  .illustration-device { max-width: 300px; }
  .step { grid-template-columns: 1fr; gap: 16px; }
  .step-shot { max-width: 240px; margin: 0 auto; }
}
