/* docs.moonwalk.now: one sheet for every page. Tokens on :root, the same
   names again for dark. No web font: the system stack. */

:root {
  --bg: #ffffff;
  --fg: #1f1e1c;
  --muted: #6b6862;
  --line: #e7e4de;
  --soft: #f6f4ef;
  --accent: #9a7414;
  --gold: #e8c050;
  --code-bg: #f1eee7;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191816;
    --fg: #ecebe6;
    --muted: #a19d95;
    --line: #34322e;
    --soft: #222120;
    --accent: #e8c050;
    --code-bg: #2a2825;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

header {
  border-bottom: 1px solid var(--line);
}

.bar {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 16px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-weight: 600;
  text-decoration: none;
}

.brand img {
  width: 26px;
  height: 26px;
}

.brand span {
  color: var(--muted);
  font-weight: 400;
}

nav {
  display: flex;
  gap: 4px;
  margin-top: 12px;
}

nav a {
  padding: 8px 12px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
}

nav a:hover {
  color: var(--fg);
}

nav a[aria-current="page"] {
  border-bottom-color: var(--gold);
  color: var(--fg);
  font-weight: 600;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

h1 {
  margin: 0 0 12px;
  font-size: 32px;
  line-height: 1.25;
}

h2 {
  margin: 40px 0 12px;
  padding-top: 8px;
  font-size: 22px;
  line-height: 1.3;
}

h3 {
  margin: 24px 0 8px;
  font-size: 17px;
}

.lead {
  color: var(--muted);
  font-size: 18px;
}

code {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--code-bg);
  font: 0.9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

ul,
ol {
  padding-left: 24px;
}

li + li {
  margin-top: 6px;
}

/* A walkthrough: each step a sentence and the screen it lands on. */
ol.steps {
  padding: 0;
  list-style: none;
  counter-reset: step;
}

ol.steps > li {
  margin-top: 28px;
  counter-increment: step;
}

ol.steps > li > p:first-child::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--gold);
  color: #1f1e1c;
  font-size: 13px;
  font-weight: 700;
}

figure {
  margin: 12px 0 0;
}

figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

figcaption,
.note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

/* Grouped facts: what the connector can do, by area. */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.box {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--soft);
}

.box > :first-child {
  margin-top: 0;
}

.box > :last-child {
  margin-bottom: 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.cards a {
  display: block;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--fg);
  text-decoration: none;
}

.cards a:hover {
  border-color: var(--gold);
}

.cards strong {
  display: block;
  margin-bottom: 4px;
}

.cards span {
  color: var(--muted);
  font-size: 14px;
}

footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

footer .bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding-top: 20px;
  padding-bottom: 32px;
}

footer a {
  color: var(--muted);
}

@media (max-width: 480px) {
  h1 {
    font-size: 26px;
  }

  nav a {
    padding: 8px 10px;
  }
}

/* A phone has no room for four columns: each row stacks, its area as the
   head and every cell named by its column. */
@media (max-width: 560px) {
  thead {
    display: none;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
  }

  tr {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }

  td {
    padding: 2px 0;
    border: 0;
  }

  td:first-child {
    font-weight: 600;
  }

  td:empty {
    display: none;
  }

  td:nth-child(2)::before {
    content: "Reads: ";
  }

  td:nth-child(3)::before {
    content: "Adds: ";
  }

  td:nth-child(4)::before {
    content: "Changes: ";
  }

  td:not(:first-child)::before {
    color: var(--muted);
  }
}
