:root {
  --bg: #f7f5f0;
  --paper: #fffdf8;
  --ink: #202124;
  --muted: #66645f;
  --line: #ded8cc;
  --accent: #0f766e;
  --accent-2: #9a3412;
  --soft: #eef6f4;
  --code: #f1eee7;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 18px;
  line-height: 1.68;
}

body > header,
body > nav,
body > main,
body > footer {
  max-width: 980px;
  margin: 0 auto;
}

body > header {
  padding: 56px 24px 24px;
}

body > header h1 {
  margin: 0 0 8px;
  font-size: 56px;
  line-height: 1.02;
  letter-spacing: 0;
}

body > header .subtitle {
  margin: 0;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
}

nav#TOC {
  margin: 0 auto 28px;
  padding: 18px 24px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}

nav#TOC > ul {
  columns: 2;
  column-gap: 44px;
  margin: 0;
  padding-left: 20px;
}

nav#TOC li {
  break-inside: avoid;
  margin: 4px 0;
}

main {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 28px 56px 72px;
  box-shadow: 0 12px 40px rgba(42, 37, 28, 0.08);
}

h1,
h2,
h3 {
  line-height: 1.18;
  letter-spacing: 0;
}

main h1 {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 2px solid var(--line);
  font-size: 38px;
}

main h1:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

main h2 {
  margin-top: 36px;
  font-size: 27px;
}

main h3 {
  margin-top: 28px;
  font-size: 22px;
}

p {
  margin: 0 0 1em;
}

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

blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  border-left: 4px solid var(--accent);
  background: var(--soft);
  color: #173b37;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

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

th {
  background: #eee8dd;
  text-align: left;
}

code {
  background: var(--code);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

pre {
  overflow-x: auto;
  background: var(--code);
  padding: 16px;
  border-radius: 6px;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 42px 0;
}

body > footer {
  padding: 24px;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

.download-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 0;
}

.download-links a {
  display: inline-block;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 7px 10px;
  border-radius: 4px;
  text-decoration: none;
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  body > header {
    padding: 34px 18px 16px;
  }

  body > header h1 {
    font-size: 40px;
  }

  nav#TOC {
    padding: 12px 18px;
  }

  nav#TOC > ul {
    columns: 1;
  }

  main {
    border-left: 0;
    border-right: 0;
    padding: 20px 18px 48px;
  }

  main h1 {
    font-size: 30px;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
