/* The manual's look, in the app's help and on the website: Michroma for the wordmark and the
   headings, the system font for reading; the logo's colours. The help follows the Mac's
   appearance; the website is dark, as the invitation page is. */
@font-face {
  font-family: "Michroma";
  src: url("Michroma-Regular.ttf") format("truetype");
}

:root {
  color-scheme: light dark;
  --ink: #14202a;
  --muted: #5b6b78;
  --paper: #ffffff;
  --line: rgba(20, 32, 42, 0.12);
  --tip: rgba(26, 148, 248, 0.08);
  --blue: #1a94f8;
  --link: #1b6ff0;
  --pink: #db28ab;
  --orange: #f9b123;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f4f8fb;
    --muted: #9fb2c0;
    --paper: #12161b;
    --line: rgba(244, 248, 251, 0.12);
    --tip: rgba(26, 148, 248, 0.14);
    --link: #6bb8ff;
  }
}

/* The website is dark. On html too (class="site"): it paints the page beside and below the body,
   which is only 54rem wide. A class rather than :has(), which older browsers do not know. */
.site {
  color-scheme: dark;
  --ink: #f4f8fb;
  --muted: #9fb2c0;
  --paper: #020f18;
  --line: rgba(244, 248, 251, 0.12);
  --tip: rgba(26, 148, 248, 0.14);
  --link: #6bb8ff;
}

html {
  background: var(--paper);
}

body {
  margin: 0 auto;
  max-width: 54rem;
  padding: 1.5rem 1.25rem 3rem;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(26, 148, 248, 0.12), transparent 26rem),
    radial-gradient(circle at 95% 30%, rgba(219, 40, 171, 0.08), transparent 24rem),
    var(--paper);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  display: grid;
  grid-template-columns: 14rem 1fr;
  grid-template-areas: "header header" "nav main";
  gap: 1rem 2rem;
}

header {
  grid-area: header;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.wordmark,
h1,
h2 {
  font-family: "Michroma", ui-sans-serif, system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.wordmark {
  font-size: 1.3rem;
}

nav {
  grid-area: nav;
  border-right: 1px solid var(--line);
  padding-right: 1rem;
}

nav ol {
  list-style: none;
  margin: 0;
  padding: 0;
  /* The chapters stay in view while a long page scrolls, also when a help button opens it
     further down. */
  position: sticky;
  top: 1rem;
}

nav li {
  margin: 0.15rem 0;
}

nav a {
  color: var(--muted);
  text-decoration: none;
}

nav li[aria-current="page"] a {
  color: var(--ink);
  font-weight: 600;
}

main {
  grid-area: main;
  min-width: 0;
}

h1 {
  font-size: 1.45rem;
  line-height: 1.3;
  margin: 0.25rem 0 1rem;
}

h2 {
  font-size: 1.05rem;
  margin: 1.75rem 0 0.5rem;
}

h3 {
  font-size: 1rem;
  margin: 1.25rem 0 0.25rem;
}

a {
  color: var(--link);
}

kbd {
  font: 0.9em ui-monospace, "SF Mono", monospace;
  padding: 0.05em 0.35em;
  border: 1px solid var(--line);
  border-radius: 0.3em;
}

.tip {
  background: var(--tip);
  border-left: 3px solid var(--blue);
  border-radius: 0.4rem;
  padding: 0.25rem 1rem;
  margin: 1rem 0;
}

figure {
  margin: 1.25rem 0;
}

figure img {
  display: block;
  max-width: 100%;
  height: auto;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.links {
  color: var(--muted);
  font-size: 0.9rem;
}

.choose {
  grid-column: 1 / -1;
  font-size: 1.2rem;
}

@media (max-width: 40rem) {
  body {
    grid-template-columns: 1fr;
    grid-template-areas: "header" "nav" "main";
  }
  nav {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 1rem;
  }
  nav ol {
    position: static;
  }
}
