/* The manual. The look is the grain article's: its header, its narrow column
   beside a column of text, its type. The narrow column holds the contents. */
:root {
  color-scheme: dark;
  --bg: #121212;
  --plate: #1c1b1a;
  --fg: #ffffff;
  --body: rgba(255,255,255,0.78);
  --muted: rgba(255,255,255,0.6);
  --dim: rgba(255,255,255,0.4);
  --line: rgba(255,255,255,0.08);
  --accent: #F4B400;
  --display: "Work Sans", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
ul { list-style: none; margin: 0; padding: 0; }
.wrap { max-width: 920px; margin: 0 auto; padding: 32px 28px 0; }

/* The header and the App Store button come from site.css, shared with the home page. */

h1 {
  font-weight: 400; color: var(--accent);
  font-size: clamp(36px, 6.4vw, 56px); line-height: 1.04; letter-spacing: -0.035em;
  margin: 0 0 24px; text-wrap: balance;
}

/* ─── Contents ─────────────────────────────────────────────────────────── */
.contents a { color: var(--muted); text-decoration: none; transition: color 120ms ease; }
.contents a:hover { color: var(--fg); }
.contents a[aria-current] { color: var(--accent); }
/* A tab of the editor: its name over its tools. A tab with one tool has no name. */
.contents .tab > span { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--dim); }

/* Beside a tool's page. */
aside .contents { font-size: 13.5px; line-height: 1.3; }
aside .contents .tab + .tab { margin-top: 16px; }
aside .contents .tab > span { display: block; margin-bottom: 7px; }
aside .contents .tab > span:empty { display: none; }
aside .contents .tab li + li { margin-top: 6px; }

/* As a page of its own: the tab at the left, its tools beside it, each with its sections. */
.front { padding: 56px 0 24px; }
.contents.full { font-size: 19px; line-height: 1.3; letter-spacing: -0.01em; border-top: 1px solid var(--line); }
.contents.full > .tab { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 0 32px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.contents.full > .tab > span { padding-top: 5px; }
.contents.full .tab ul a { color: var(--fg); }
.contents.full .tab ul a:hover { color: var(--accent); }
.contents.full .tab li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 18px; }
.contents.full .tab li + li { margin-top: 11px; }
.contents.full .parts { display: flex; flex-wrap: wrap; gap: 2px 0; font-family: var(--mono); font-size: 12.5px; letter-spacing: 0; }
.contents.full .tab ul .parts a { color: var(--muted); }
.contents.full .tab ul .parts a:hover { color: var(--fg); }
.contents.full .parts a + a::before { content: "·"; margin: 0 9px; color: var(--dim); }

/* ─── A tool's page ────────────────────────────────────────────────────── */
.page { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 0 32px; align-items: start; padding: 48px 0 24px; }
.page aside { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; scrollbar-width: none; padding-top: 6px; }
.page aside::-webkit-scrollbar { display: none; }
.page article { min-width: 0; }

figure { margin: 0; }
.fig { margin: 0 0 36px; }
.fig img { width: 100%; background: #0a0a0a; }

.text p { margin: 0 0 16px; max-width: 64ch; text-wrap: pretty; }
.text p.first { color: var(--fg); }
.text a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.text a:hover { color: var(--accent); }
.text .read { margin-top: 28px; font-family: var(--mono); font-size: 13px; }
h2 { font-weight: 400; color: var(--fg); font-size: clamp(24px, 3.2vw, 30px); line-height: 1.15; letter-spacing: -0.025em; margin: 44px 0 14px; }

/* The page before and the page after, in the order of the contents. */
.turn { display: flex; justify-content: space-between; gap: 24px; margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 17px; letter-spacing: -0.01em; }
.turn a { color: var(--fg); text-decoration: none; }
.turn a:hover { color: var(--accent); }
.turn .back::before { content: "←"; margin-right: 10px; color: var(--accent); }
.turn .on::after { content: "→"; margin-left: 10px; color: var(--accent); }

.get { margin: 48px 0 0; }


/* On a phone the page comes first and the contents follow it. */
@media (max-width: 760px) {
  .wrap { padding: 22px 18px 0; }
  .page { grid-template-columns: minmax(0, 1fr); padding-top: 28px; }
  .page aside { position: static; max-height: none; order: 2; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
  aside .contents { font-size: 16px; columns: 2; column-gap: 24px; }
  aside .contents .tab { break-inside: avoid; margin: 0 0 18px; }
  aside .contents .tab + .tab { margin-top: 0; }
  aside .contents .tab li + li { margin-top: 9px; }
  .front { padding-top: 36px; }
  .contents.full > .tab { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 18px 0; }
  .contents.full > .tab > span { padding-top: 0; }
  .contents.full > .tab > span:empty { display: none; }
}
