:root {
  color-scheme: dark;
  --bg: #161310;
  --sunk: #0f0d0a;
  --ink: #ece4d6;
  --soft: #a89e8d;
  --rule: #2f2a23;
  --accent: #e8a34f;
  --on-accent: #1c1206;
  --t-comment: #8a8172;
  --t-string: #c7b98c;
  --t-keyword: #e8a34f;
  --t-call: #f2dcb6;
  --t-number: #dc9470;
  --t-punct: #958c7b;
  --t-prop: #cfc6b4;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "URW Palladio L", "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --column: 43rem;
  --gutter: 1.5rem;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.1875rem/1.65 var(--serif);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
.wrap {
  max-width: calc(var(--column) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Words */
h1, h2, h3 { font-weight: 500; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 7vw, 3.75rem); line-height: 1.08; letter-spacing: -0.012em; margin: 0 0 1.5rem; }
h2 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 1rem; }
h3 { font-size: 1.25rem; line-height: 1.3; margin: 2.25rem 0 0.75rem; }
p { margin: 0 0 1.1em; text-wrap: pretty; }
a {
  color: inherit;
  text-decoration: underline 1px var(--accent);
  text-underline-offset: 0.18em;
}
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--on-accent); }
.lede { font-size: 1.35rem; line-height: 1.5; margin: 0 0 2rem; }
.quiet { color: var(--soft); font-size: 1rem; }

/* Code */
code, pre { font-family: var(--mono); }
:not(pre) > code { font-size: 0.84em; }
pre {
  margin: 0;
  padding: 1.1rem 0.5rem 1.1rem var(--gutter);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  tab-size: 2;
}
/* The block overhangs the column by one gutter, so its text lines up with the words around it. */
.code, .prose > pre {
  margin: 1.75rem calc(-1 * var(--gutter));
  background: var(--sunk);
  border-radius: 4px;
}
.code figcaption {
  padding: 0.9rem var(--gutter) 0;
  color: var(--soft);
  font: 0.8rem var(--mono);
}
.code figcaption + pre { padding-top: 0.6rem; }
.dim { color: var(--t-comment); }
.hot { color: var(--accent); }

.token.comment { color: var(--t-comment); font-style: italic; }
.token.string, .token.attr-value, .token.template-string, .token.template-punctuation { color: var(--t-string); }
.token.keyword, .token.boolean, .token.atrule { color: var(--t-keyword); }
.token.function, .token.class-name, .token.builtin { color: var(--t-call); }
.token.number { color: var(--t-number); }
.token.punctuation, .token.operator { color: var(--t-punct); }
.token.property, .token.attr-name, .token.key { color: var(--t-prop); }

/* Frame */
.site-head .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-block: 1.5rem;
}
.icon { width: 1em; height: 1em; margin-right: 0.35em; vertical-align: -0.125em; }
.brand { font-weight: 600; text-decoration: none; }
.logo { color: var(--accent); margin-right: 0.35em; }
.site-head nav { display: flex; flex-wrap: wrap; gap: 0.25rem clamp(0.5rem, 2.5vw, 1.25rem); font-size: 1rem; }
.site-head nav a { color: var(--soft); text-decoration: none; }
.site-head nav a:hover, .site-head nav a[aria-current] { color: var(--ink); }
.site-foot {
  margin-top: 6rem;
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--rule);
  color: var(--soft);
  font-size: 1rem;
}
.site-foot p { margin: 0 0 0.25rem; }

/* Home */
.hero { padding-top: 4.5rem; }
.cta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.75rem 1.5rem; margin-bottom: 2rem; }
.btn {
  display: inline-block;
  padding: 0.55rem 1.25rem;
  border-radius: 4px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}
.btn:hover { color: var(--on-accent); filter: brightness(1.08); }
.install { margin-bottom: 0.9rem; }
.install + .quiet { margin: 0; }
.prompt { color: var(--accent); user-select: none; margin-right: 0.6em; }
.chapter { margin-top: 5rem; }

/* Other pages */
.prose { padding-top: 3.5rem; }
.prose h1 { font-size: clamp(2.25rem, 5vw, 3rem); margin-bottom: 1rem; }
.prose h2 { margin-top: 3.5rem; }
.prose li { margin: 0.4em 0; }
.prose table {
  display: block;
  width: 100%;
  margin: 1.5rem 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 1.0625rem;
}
.prose th, .prose td { padding: 0.55rem 1.25rem 0.55rem 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.prose th { color: var(--soft); font-weight: 400; font-size: 1rem; }
.prose td code { white-space: nowrap; }

/* A two-column table can't fit a phone, so each row stacks: the name, then its meaning. */
@media (max-width: 40rem) {
  .prose table, .prose tbody, .prose tr, .prose td { display: block; }
  .prose thead { display: none; }
  .prose tr { padding-block: 0.7rem; border-bottom: 1px solid var(--rule); }
  .prose td { padding: 0; border: 0; }
  .prose td:first-child { margin-bottom: 0.15rem; }
  .prose td code { white-space: normal; overflow-wrap: anywhere; }
}
