@font-face {
  font-family: "Source Serif";
  src: url("fonts/source-serif.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif";
  src: url("fonts/source-serif-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
}

@font-face {
  font-family: "Plex Mono";
  src: url("fonts/plex-mono-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Plex Mono";
  src: url("fonts/plex-mono-600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f3efe5;
  --ink: #25231f;
  --muted: #716c62;
  --rule: #c9c1b2;
  --accent: #9b3529;
  --serif: "Source Serif", Iowan Old Style, Baskerville, Georgia, serif;
  --mono: "Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.48;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body { margin: 0; }

::selection {
  color: var(--paper);
  background: var(--accent);
}

.masthead,
main,
footer {
  width: min(100% - 2.5rem, 78rem);
  margin-inline: auto;
}

.masthead {
  padding: 2.25rem 0 clamp(3rem, 4vw, 3.5rem);
}

.wordmark,
.number,
nav,
code,
kbd,
pre {
  font-family: var(--mono);
}

.wordmark {
  color: var(--accent);
  font-size: clamp(1.55rem, 2.8vw, 2.5rem);
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
}

h1 {
  margin: clamp(3.5rem, 6vw, 4.5rem) 0 1.8rem;
  font-size: clamp(2.35rem, 3.8vw, 3.25rem);
  font-weight: 350;
  font-style: italic;
  line-height: 1;
  letter-spacing: -.045em;
}

.notation {
  max-width: 40rem;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.notation b {
  color: var(--ink);
  font-family: var(--mono);
  font-size: .88em;
  font-weight: 600;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1.4rem;
  margin-top: 2.5rem;
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent);
  text-underline-offset: .18em;
}

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

section {
  padding: clamp(3.5rem, 5vw, 5.25rem) 0;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 1rem;
}

.section-heading {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  align-items: baseline;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.number {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  margin: 0;
  color: var(--accent);
  font-size: .68rem;
}

.section-heading > h2 {
  grid-column: 2;
  grid-row: 1;
}

h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 450;
  line-height: 1;
  letter-spacing: -.035em;
}

.top-link {
  color: var(--accent);
  font-family: var(--mono);
  text-decoration: none;
}

.section-heading > .top-link {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  margin-left: 1.35rem;
  font-size: .68rem;
  font-weight: 400;
  line-height: inherit;
}

.top-link:hover { color: var(--ink); }

.top-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: .25rem;
}

h3 {
  margin: 0 0 1.25rem;
  font-size: .72rem;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.essential-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(2rem, 7vw, 8rem);
}

.command {
  display: grid;
  grid-template-columns: 6.2rem 1fr;
  gap: 1rem;
  align-items: baseline;
  min-height: 4.25rem;
  padding: .8rem 0;
  border-bottom: 1px solid var(--rule);
}

kbd {
  color: var(--accent);
  font-size: 1.03rem;
  font-weight: 600;
  white-space: nowrap;
}

.command strong {
  display: block;
  font-weight: 550;
}

code {
  color: var(--muted);
  font-size: .68rem;
  overflow-wrap: anywhere;
}

.command code { display: block; margin-top: .15rem; }

.reference-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(3rem, 8vw, 9rem);
}

.reference-columns.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(2rem, 5vw, 5rem);
}

dl { margin: 0; }

dl > div {
  display: grid;
  grid-template-columns: 6.2rem 1fr;
  gap: .75rem;
  padding: .7rem 0 .8rem;
  border-bottom: 1px solid var(--rule);
}

dt, dd { margin: 0; }

dd {
  font-size: .94rem;
  line-height: 1.35;
}

dd code {
  display: block;
  margin-top: .2rem;
}

.aside {
  max-width: 34rem;
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: .88rem;
}

.aside kbd { font-size: .8rem; }

.boundary {
  width: min(100% - 2.5rem, 78rem);
  margin: clamp(3rem, 7vw, 7rem) auto;
  padding: clamp(2rem, 5vw, 4.5rem);
  color: var(--paper);
  background: var(--ink);
}

.boundary h2 {
  margin-bottom: 2rem;
  color: #f8f3e9;
}

.boundary p {
  max-width: 48rem;
  margin: 1rem 0 0;
  color: #d8d0c2;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.boundary kbd { color: #e98977; }

pre {
  margin: 0 0 1.2rem;
  padding: 1.35rem 1.5rem;
  overflow-x: auto;
  color: #f5efe4;
  background: var(--ink);
  font-size: .82rem;
  line-height: 1.65;
}

pre code { color: inherit; font-size: inherit; }

.prose p {
  max-width: 32rem;
  color: var(--muted);
  font-size: .94rem;
}

footer {
  padding: 2rem 0 5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: .82rem;
}

footer p { max-width: 48rem; }

@media (max-width: 800px) {
  :root { font-size: 17px; }
  .essential-grid,
  .reference-columns,
  .reference-columns.three { grid-template-columns: 1fr; }
  .reference-columns { gap: 3.5rem; }
  h1 { font-size: clamp(2.35rem, 9vw, 3.25rem); }
}

@media (max-width: 480px) {
  .masthead,
  main,
  footer,
  .boundary { width: min(100% - 1.5rem, 78rem); }
  .section-heading { grid-template-columns: 2.5rem 1fr; }
  .command,
  dl > div { grid-template-columns: 5.3rem 1fr; }
  nav { gap: .7rem 1rem; }
}

@media print {
  :root { font-size: 10pt; --paper: white; --ink: black; --muted: #444; --rule: #bbb; }
  nav { display: none; }
  .masthead { padding: 0 0 2rem; }
  h1 { margin: 1.5rem 0 1rem; font-size: 42pt; }
  section { padding: 2rem 0; break-inside: avoid; }
  .boundary { margin: 2rem auto; color: black; background: white; border: 1px solid #999; }
  .boundary h2, .boundary p, .boundary kbd { color: black; }
  footer { padding-bottom: 0; }
}
