/* Tokens. Grayscale throughout: the only colour on the site is the green
   of the mark. Four type sizes, two weights, space on a 4-pixel scale. */
:root {
  color-scheme: light dark;
  --page: #ffffff;
  --text: #1d1d1f;
  --muted: #5f5f5d;
  --hover: rgba(0, 0, 0, 0.06);
  --button: #1d1d1f;
  --button-hover: #3a3a3c;
  --button-text: #ffffff;
  /* Where code sits: a command, a terminal, a block in the documentation. */
  --well: #f5f5f6;
  --line: rgba(0, 0, 0, 0.1);
  /* A hairline and a soft shadow: the edge of anything that floats. */
  --window-edge: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 16px 36px rgba(0, 0, 0, 0.1);

  --caption: 0.8125rem;
  --body: 1rem;
  --lede: 1.1875rem;
  --title: 2.125rem;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s6: 24px;
  --s8: 32px;
  --s16: 64px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #121213;
    --text: #ededed;
    --muted: #a1a1a3;
    --hover: rgba(255, 255, 255, 0.08);
    --button: #ededed;
    --button-hover: #ffffff;
    --button-text: #121213;
    --well: #1c1c1e;
    --line: rgba(255, 255, 255, 0.14);
    --window-edge: 0 0 0 1px rgba(255, 255, 255, 0.16);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: var(--body) / 1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main, footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--s6);
}

main { padding-top: 72px; }

h1, h2, h3, p, dl, dd, ul, ol, pre, figure, table { margin: 0; }

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 4px;
}

main a, footer a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

code {
  font: var(--caption) / 1.5 var(--mono);
  overflow-wrap: anywhere;
}

.meta {
  font-size: var(--caption);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* The way to the other pages: small, and out of the way of the name. */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  margin-bottom: var(--s4);
}

.top ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  padding: 0;
  list-style: none;
  font-size: var(--caption);
}

.top ul a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 var(--s3);
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
}

.top ul a[aria-current="page"] { color: var(--text); font-weight: 600; }

@media (hover: hover) {
  .top ul a:hover { background: var(--hover); color: var(--text); }
}

/* The mark is drawn to the edge of its box, so it needs no pulling in. */
.icon {
  display: block;
  width: 64px;
  height: 64px;
}

h1 {
  font-size: var(--title);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.lede {
  max-width: 34em;
  margin-top: var(--s3);
  font-size: var(--lede);
  line-height: 1.45;
  color: var(--muted);
}

/* The line that installs it, and the button that copies the line. */
.install { margin-top: var(--s8); }

.command {
  display: flex;
  align-items: stretch;
  gap: var(--s2);
}

.command pre {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s4);
  border-radius: 10px;
  background: var(--well);
  overflow-x: auto;
  white-space: nowrap;
}

.command code { overflow-wrap: normal; }

.install .meta { margin-top: var(--s3); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: var(--button);
  color: var(--button-text);
  font: 600 var(--body) var(--sans);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

@media (hover: hover) {
  .button:hover { background: var(--button-hover); }
}

.button:active { opacity: 0.85; }
.button:focus-visible { border-radius: 10px; }

@media (prefers-reduced-motion: no-preference) {
  .button { transition: background-color 120ms ease-out; }
}

/* Two terminals, for the two machines. Each is a window: a hairline, a
   soft shadow, and the three dots of a title bar. */
.windows {
  display: grid;
  gap: var(--s6);
  margin: 56px 0 var(--s16);
}

.window {
  min-width: 0;
  border-radius: 12px;
  background: var(--well);
  box-shadow: var(--window-edge);
}

.window figcaption {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4) 0;
  font-size: var(--caption);
  color: var(--muted);
}

.dots {
  display: flex;
  gap: 6px;
}

.dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}

.window pre {
  padding: var(--s3) var(--s4) var(--s4);
  font: var(--caption) / 1.7 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 9;
}

.window .typed { font-weight: 600; }
.window .said, .window .prompt { color: var(--muted); }
.window .prompt { user-select: none; -webkit-user-select: none; }

/* Where there is room, the windows are wider than the text and centred on it. */
@media (min-width: 900px) {
  .windows { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1128px) {
  .windows {
    width: 1080px;
    margin-left: -184px;
  }
}

section + section { margin-top: 56px; }

h2 {
  margin-bottom: var(--s4);
  font-size: var(--body);
  font-weight: 600;
}

/* Name on the left, what it means on the right. */
.facts > div {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  column-gap: var(--s6);
}

.facts > div + div { margin-top: var(--s3); }
.facts dd { color: var(--muted); }
.facts dd a, .facts dd code { color: var(--text); }

footer {
  padding-top: var(--s16);
  padding-bottom: var(--s16);
  font-size: var(--caption);
  color: var(--muted);
}

/* A page of documentation: the same column, with what Markdown gives. */
.doc .home {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: 40px;
  font-weight: 600;
  text-decoration: none;
}

.doc .home img {
  width: 28px;
  height: 28px;
}

.doc h1 { margin-top: var(--s6); }

.prose { margin-top: var(--s6); }

.prose > * + * { margin-top: var(--s4); }

.prose h2 {
  margin: 48px 0 0;
  font-size: var(--lede);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.prose h3 {
  margin-top: var(--s8);
  font-size: var(--body);
  font-weight: 600;
}

.prose h2 + *, .prose h3 + * { margin-top: var(--s3); }

.prose h2 code, .prose h3 code { font-size: 0.9em; }

.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: var(--s2); }
.prose li > ul, .prose li > ol { margin-top: var(--s2); }

.prose pre {
  padding: var(--s3) var(--s4);
  border-radius: 10px;
  background: var(--well);
  overflow-x: auto;
  font: var(--caption) / 1.6 var(--mono);
  tab-size: 9;
}

.prose pre code {
  font: inherit;
  overflow-wrap: normal;
}

.prose :not(pre) > code {
  padding: 0.1em 0.3em;
  border-radius: 4px;
  background: var(--well);
}

/* A table scrolls inside its own box, so a wide one does not push the
   page sideways on a phone. */
.table {
  overflow-x: auto;
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--line);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--caption);
  line-height: 1.5;
}

.prose th, .prose td {
  padding: var(--s2) var(--s3);
  text-align: left;
  vertical-align: top;
}

.prose th[align="right"], .prose td[align="right"] { text-align: right; }
.prose th[align="center"], .prose td[align="center"] { text-align: center; }
.prose th { font-weight: 600; white-space: nowrap; }
.prose tbody tr { border-top: 1px solid var(--line); }
.prose td { color: var(--muted); }
.prose td:first-child { color: var(--text); }

.prose strong { font-weight: 600; }

.contents {
  margin-top: var(--s6);
  padding: 0;
  list-style: none;
  font-size: var(--caption);
  color: var(--muted);
  columns: 2;
  column-gap: var(--s6);
}

.contents li { break-inside: avoid; padding: var(--s1) 0; }

@media (max-width: 560px) {
  main, footer { padding-left: 20px; padding-right: 20px; }
  main { padding-top: 40px; }
  .windows { margin: 40px 0 48px; }
  .facts > div { grid-template-columns: 1fr; }
  .facts > div + div { margin-top: var(--s4); }
  .contents { columns: 1; }
}
