:root {
  /* Static pages load no web font: the platform font, as in the app's body text. */
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial,
    system-ui, sans-serif;
  --ink: #0b0b0f;
  --ink-soft: #5e5e66;
  --line: #e6e6eb;
  --surface: #f5f5f7;
  --accent: #b57a00;
  color: var(--ink);
  background: #fff;
  font-size: 15px;
  line-height: 1.6;
  text-align: left;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f2f2f5;
    --ink-soft: #a1a1aa;
    --line: #2a2a31;
    --surface: #17171c;
    --accent: #f0b429;
    background: #0b0b0f;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: inherit;
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.skip {
  position: absolute;
  top: -80px;
  left: 16px;
  padding: 8px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
}
.skip:focus {
  top: 8px;
}

/* Header and footer share the page column. */
header,
main,
footer {
  width: min(100% - 32px, 1040px);
  margin-inline: auto;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-block: 14px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.5px;
  text-decoration: none;
}
header nav a {
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
}
header nav a:hover {
  background: var(--line);
}

/* Mobile: one compact column. */
main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "intro" "toc" "body";
  gap: 20px;
  padding-top: 24px;
}
.intro {
  grid-area: intro;
}
.toc {
  grid-area: toc;
}
article {
  grid-area: body;
  max-width: 68ch;
}
.draft {
  background: #fdf0cc;
  color: #6b4500;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 16px;
}
h1 {
  font-size: clamp(26px, 6vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}
.summary {
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0 0 6px;
}
.version {
  color: var(--ink-soft);
  font-size: 13px;
  margin: 0;
}
h2 {
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
p {
  margin: 0 0 12px;
}
p,
li {
  overflow-wrap: anywhere;
}

/* Table of contents: a collapsed-looking card on mobile, a sticky rail on desktop. */
.toc {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface);
}
.toc h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.toc li + li {
  margin-top: 0;
}
.toc a {
  display: block;
  padding: 6px 0;
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
  color: var(--ink-soft);
}
.toc a:hover {
  color: var(--ink);
}

/* Body sections. */
section {
  padding-block: 18px;
  scroll-margin-top: 16px;
}
section + section {
  border-top: 1px solid var(--line);
}
section ul {
  margin: 0 0 12px;
  padding-left: 20px;
}
section li + li {
  margin-top: 6px;
}
/* Reference links read as a tidy list of chips, left-aligned, never as centered text. */
section ul.links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
section ul.links li + li {
  margin-top: 0;
}
section ul.links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
section ul.links a::after {
  content: "↗";
  font-size: 13px;
  line-height: 1;
  color: var(--ink-soft);
}
section ul.links a[href^="mailto:"]::after {
  content: "→";
}
section ul.links a:hover {
  background: var(--surface);
}
article p a,
article li a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

footer {
  margin-top: 32px;
  padding-block: 18px 32px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
footer a {
  text-decoration: none;
}
footer a:hover,
footer a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Desktop: intro across the top, sticky contents rail beside a readable text column. */
@media (min-width: 900px) {
  :root {
    font-size: 16px;
  }
  header {
    padding-block: 18px;
  }
  main {
    grid-template-columns: 240px minmax(0, 1fr);
    grid-template-areas: "intro intro" "toc body";
    column-gap: 56px;
    padding-top: 40px;
  }
  .intro {
    max-width: 68ch;
  }
  .toc {
    position: sticky;
    top: 24px;
    align-self: start;
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: none;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    padding: 0 0 0 16px;
  }
  .toc a {
    padding: 5px 0;
    font-size: 13px;
  }
  section {
    padding-block: 24px;
  }
  h2 {
    font-size: 19px;
  }
}

@media (prefers-color-scheme: dark) {
  .draft {
    background: #2b2108;
    color: #f5d68a;
  }
}
