/* The documentation site's whole stylesheet.
 *
 * Read mode: the visitor is here to understand something, so structure for
 * comprehension first and then make the reading worth staying in. That rules
 * out most of what a landing page would do — there is no hero, no gradient, no
 * card grid. What it rules in is a measure you can actually read, a type scale
 * with real steps between its sizes, and an index that stays in reach while you
 * are three screens into a tool's arguments.
 *
 * The palette is ink on warm paper rather than slate on white, with one accent
 * used for links and the current item and nowhere else. Identifiers are set in
 * a monospace face throughout, including inside prose, because half the nouns
 * on this site are things you type.
 */

@import url("https://fonts.googleapis.com/css2?family=Newsreader:opsz,wght@6..72,400;6..72,500;6..72,600&family=IBM+Plex+Mono:wght@400;500;600&family=Inter+Tight:wght@400;500;600&display=swap");

:root {
  color-scheme: light dark;

  --paper: #faf8f4;
  --paper-sunk: #f2efe8;
  --rule: #e2ddd2;
  --rule-strong: #cdc6b6;
  --ink: #1d1b16;
  --ink-soft: #57524a;
  --ink-faint: #8a8377;
  --accent: #9a3412;
  --accent-soft: #c2410c;
  --flag: #7c5e10;

  --display: "Newsreader", Georgia, "Times New Roman", serif;
  --text: "Inter Tight", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --measure: 68ch;
  --rail: 18.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14130f;
    --paper-sunk: #1c1a15;
    --rule: #2d2a23;
    --rule-strong: #443f35;
    --ink: #eae5d9;
    --ink-soft: #b0a996;
    --ink-faint: #7d7768;
    --accent: #f97316;
    --accent-soft: #fb923c;
    --flag: #d9b64a;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1rem;
  line-height: 1.65;
  font-feature-settings: "kern", "liga";
}

/* -- shell ---------------------------------------------------------------- */

.shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  align-items: start;
  max-width: 82rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  gap: 3.5rem;
}

@media (max-width: 62rem) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}

/* -- the rail ------------------------------------------------------------- */

.rail {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100dvh;
  overflow-y: auto;
  padding: 2.5rem 0 3rem;
  border-right: 1px solid var(--rule);
  padding-right: 1.5rem;
  font-size: 0.875rem;
}

@media (max-width: 62rem) {
  .rail {
    position: static;
    max-height: none;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: 1.5rem 0;
  }

  /* Thirty-five tool links above the content is a wall to scroll past before
   * reaching the page you asked for. Boxed and scrollable, the index is still
   * there and the article starts within a screen of the top. */
  .rail nav {
    max-height: 42vh;
    overflow-y: auto;
    margin-top: 1.25rem;
    padding-right: 0.75rem;
    border-left: 1px solid var(--rule);
    padding-left: 1rem;
  }

  .rail h2:first-of-type {
    margin-top: 0;
  }
}

.wordmark {
  display: block;
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.1;
}

.wordmark span {
  display: block;
  font-family: var(--text);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 0.4rem;
}

.rail nav {
  margin-top: 2rem;
}

.rail h2 {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 1.75rem 0 0.5rem;
}

.rail ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rail li {
  margin: 0;
}

.rail a {
  display: block;
  padding: 0.24rem 0.6rem;
  margin-left: -0.6rem;
  border-radius: 0.25rem;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 120ms ease, background-color 120ms ease;
}

.rail a:hover {
  color: var(--ink);
  background: var(--paper-sunk);
}

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

.rail .tool-link {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: -0.01em;
}

/* -- the page ------------------------------------------------------------- */

main {
  padding: 3.5rem 0 6rem;
  min-width: 0;
}

.lede {
  max-width: var(--measure);
}

h1 {
  font-family: var(--display);
  font-size: clamp(2.25rem, 1.6rem + 2.2vw, 3.25rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
}

h1 .eyebrow {
  display: block;
  font-family: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

h2 {
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 3.5rem 0 1rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}

h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 2.25rem 0 0.6rem;
}

p,
ul,
ol {
  max-width: var(--measure);
}

p {
  margin: 0 0 1.1rem;
}

.standfirst {
  font-family: var(--display);
  font-size: 1.3125rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-bottom: 2rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--accent-soft);
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--paper-sunk);
  border: 1px solid var(--rule);
  border-radius: 0.25rem;
  padding: 0.08em 0.32em;
}

pre {
  background: var(--paper-sunk);
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 0 0 1.5rem;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
}

/* -- tool entries --------------------------------------------------------- */

.group {
  margin-top: 4rem;
}

.group > p {
  color: var(--ink-soft);
}

.tool {
  border-top: 1px solid var(--rule);
  padding: 1.75rem 0 0.5rem;
  scroll-margin-top: 1.5rem;
}

.tool h3 {
  font-family: var(--mono);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.15rem;
  overflow-wrap: anywhere;
}

.tool h3 a {
  color: var(--ink);
  text-decoration: none;
}

.tool h3 a:hover {
  color: var(--accent);
}

.tool .title {
  font-family: var(--display);
  font-size: 1.125rem;
  color: var(--ink-soft);
  margin: 0 0 0.85rem;
}

.tool .description {
  max-width: var(--measure);
}

.args {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0 0.5rem;
  font-size: 0.8125rem;
  text-align: left;
}

.args th {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--rule-strong);
  padding: 0 0.75rem 0.4rem 0;
  vertical-align: bottom;
  white-space: nowrap;
}

.args td {
  border-bottom: 1px solid var(--rule);
  padding: 0.55rem 0.75rem 0.55rem 0;
  vertical-align: top;
  color: var(--ink-soft);
}

.args td:first-child {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink);
  white-space: nowrap;
}

.args td:nth-child(2) {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  white-space: nowrap;
}

.req {
  display: inline-block;
  font-family: var(--text);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--flag);
  margin-left: 0.5rem;
  vertical-align: 0.1em;
}

/* A table wide enough to need it scrolls inside its own box. Left to the page,
 * a long argument description drags the whole document sideways on a phone and
 * every other line then starts off-screen. */
.scroller {
  overflow-x: auto;
  margin: 1.25rem 0 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.scroller > table {
  margin: 0;
  min-width: 34rem;
}

/* -- notes and tables ----------------------------------------------------- */

.note {
  border-left: 2px solid var(--rule-strong);
  padding: 0.1rem 0 0.1rem 1.25rem;
  margin: 1.75rem 0;
  max-width: var(--measure);
  color: var(--ink-soft);
}

.note strong {
  color: var(--ink);
}

.wide {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0 2rem;
  font-size: 0.8125rem;
  text-align: left;
}

.wide th {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--rule-strong);
  padding: 0 1rem 0.45rem 0;
  vertical-align: bottom;
}

.wide td {
  border-bottom: 1px solid var(--rule);
  padding: 0.6rem 1rem 0.6rem 0;
  vertical-align: top;
  color: var(--ink-soft);
}

.wide td.figure {
  font-family: var(--mono);
  color: var(--ink);
  white-space: nowrap;
}

.wide td.where {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  overflow-wrap: anywhere;
}

/* -- footer --------------------------------------------------------------- */

footer {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  color: var(--ink-faint);
  max-width: var(--measure);
}

.count {
  font-size: 0.875rem;
  color: var(--ink-faint);
}
