:root {
  --text: #141414;
  --muted: #444;
  --rule: #e8e8e8;
  --half-rule: #f4f4f4;
  --link: #2f65a7; /* Arboretum Blue */
  --bg: #fff;
  --panel: transparent;
}

html {
  min-height: 100%;
  background: var(--bg);
}

html[data-theme="dark"] {
  --text: #dad7d0;
  --muted: #a29d94;
  --rule: #33312d;
  --half-rule: #211f1c;
  --link: #a9c1f5;
  --bg: #161514;
  --panel: transparent;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px / 1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.16em;
}

.layout {
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  gap: 48px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 24px 88px;
}

.menu {
  width: 180px;
  flex: 0 0 180px;
  margin-top: 40px;
  text-align: right;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

.menu-title {
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 600;
}

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

.menu li {
  margin: 0 0 4px;
}

.menu-gap {
  height: 14px;
}

.menu li:last-child a {
  font-size: 15px;
  text-decoration: none;
}

.menu a.active {
  color: var(--text);
  text-decoration: none;
}

.appearance-controls {
  margin-top: 0;
}

.appearance-link {
  display: inline-block;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  line-height: 1;
  margin-bottom: 4px;
}

.appearance-link:last-child {
  margin-bottom: 0;
}

.appearance-link:hover {
  color: var(--text);
  text-decoration: none;
}

.content {
  flex: 1 1 auto;
  max-width: 66ch;
  min-height: 60vh;
  margin-top: 20px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

.content h1,
.content h2,
.content h3 {
  margin: 0 0 0.7em;
  font-weight: 600;
  line-height: 1.18;
}

.content h1 {
  max-width: 24ch;
  font-size: 1.7em;
}

.page-header {
  margin-bottom: 2.1em;
}

.page-header h1 {
  margin-bottom: 0.35em;
}

.page-date {
  display: block;
  color: var(--text);
  font-size: 1em;
}

.content h2 {
  margin-top: 2em;
  font-size: 1.18em;
}

.content h3 {
  margin-top: 1.65em;
  font-size: 1em;
}

.content h2[id],
.content h3[id] {
  scroll-margin-top: 20px;
}

.content h2 > a.heading-link,
.content h2 > a.heading-link:link,
.content h2 > a.heading-link:visited,
.content h2 > a.heading-link:hover,
.content h2 > a.heading-link:focus,
.content h2 > a.heading-link:active,
.content h3 > a.heading-link,
.content h3 > a.heading-link:link,
.content h3 > a.heading-link:visited,
.content h3 > a.heading-link:hover,
.content h3 > a.heading-link:focus,
.content h3 > a.heading-link:active {
  color: inherit !important;
  cursor: pointer;
  text-decoration: none !important;
}

.heading-anchor {
  color: var(--muted);
  font-weight: 400;
  opacity: 0;
}

.content h2:hover .heading-anchor,
.content h3:hover .heading-anchor,
.heading-link:focus .heading-anchor {
  opacity: 1;
}

.content p,
.content ul,
.content ol,
.content blockquote {
  margin: 0 0 1.05em;
}

.content ul,
.content ol {
  padding-left: 1.3em;
}

.content li {
  margin-bottom: 0.45em;
}

.table-wrap {
  margin: 0 0 1.05em;
  overflow-x: auto;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94em;
}

.content th,
.content td {
  padding: 0.42em 0.55em;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.content th {
  font-weight: 600;
  border-top: 1px solid var(--rule);
  background: var(--half-rule);
}

.content blockquote {
  margin: 0 0 10px;
  padding: 4px;
  padding-left: 14px;
  border-left: 6px solid var(--rule);
  /* background: var(--half-rule); */
}

.content blockquote p {
  margin: 0;
}

.content code {
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.88em;
}

.content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 0 16px;
}

.footnote-ref {
  font-size: 0.75em;
  vertical-align: super;
}

.footnote-ref a {
  text-decoration: none;
}

.footnotes {
  margin-top: 3.5em;
  color: var(--text);
  font-size: 0.92em;
}

.footnotes h2 {
  margin: 0 0 1em;
  font-size: 1em;
  font-weight: 600;
}

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

.footnote-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 1.35em;
  line-height: 1.4;
}

.footnote-label {
  flex: 0 0 auto;
  min-width: 2.4em;
}

.footnote-body {
  flex: 1 1 auto;
}

.footnote-body p,
.footnote-body blockquote,
.footnote-body ul {
  margin: 0 0 0.7em;
}

.footnote-body > :last-child {
  margin-bottom: 0;
}

.footnote-back {
  display: inline;
  margin-left: 0.28em;
  color: var(--muted);
  font-size: 0.82em;
  text-decoration: none;
}

.footnote-back:hover,
.footnote-back:focus {
  color: var(--link);
  text-decoration: none;
}

.genius-mode .content,
.genius-mode .content * {
  font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace !important;
}

.genius-mode .content {
  max-width: 700px;
  font-size: 14px;
  line-height: 1.5;
}

.genius-terminal {
  padding-left: 16px;
  border-left: 1px solid var(--rule);
  background: var(--panel);
}

.genius-line {
  white-space: pre-wrap;
}

.genius-line a {
  text-decoration: none;
}

.genius-line a:hover {
  text-decoration: underline;
}

.genius-prompt,
.genius-note {
  color: var(--muted);
}

.genius-spacer {
  height: 1em;
}

@media (max-width: 760px) {
  .layout {
    display: block;
    padding: 20px 18px 56px;
  }

  .menu {
    width: auto;
    margin-top: 0;
    margin-bottom: 28px;
    text-align: left;
  }

  .menu li {
    display: inline-block;
    margin-right: 12px;
  }

  .menu-gap {
    display: block;
    height: 8px;
  }

  .content {
    max-width: none;
    font-size: 15px;
  }

  .content h1 {
    max-width: none;
    font-size: 1.55em;
  }

}
