/* One palette for the site shell and native Org HTML. */
:root {
  color-scheme: light;
  --paper: #fdfaf3;
  --ink: #292d32;
  --muted: #68675f;
  --accent: #005bd8;
  --hover-background: #222222;
  --line: #ded8cc;
  --surface: #f2eee4;
  --code-ink: #343b45;
  --code-keyword: #704b89;
  --code-string: #39674a;
  --code-comment: #727164;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 2rem; }
body {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
::selection { background: #dce6f5; color: var(--ink); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { background: var(--hover-background); color: var(--paper); text-decoration: underline; }
a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px;
}
.site-header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1.25rem; padding: 2.5rem 0 1.5rem; border-bottom: 1px solid var(--line);
}
.site-nav, .site-footer { font-family: var(--mono); font-size: .75rem; }
.site-nav { display: flex; flex-wrap: wrap; gap: 1.35rem; }
.site-nav a, .social-links a { text-decoration: none; }
.site-nav a:hover, .social-links a:hover { text-decoration: underline; }
#content { position: relative; margin: 2rem 0 3rem; min-width: 0; }
h1, h2, h3, h4, h5, h6 { color: var(--ink); line-height: 1.3; font-weight: 650; }
h1 { margin: 0 0 1.5rem; font-size: clamp(1.8rem, 5vw, 2rem); letter-spacing: -.045em; }
h2 { margin: 2rem 0 1rem; font-size: 1.5rem; letter-spacing: -.025em; }
h3 { margin: 2rem 0 1rem; font-size: 1.15rem; letter-spacing: -.015em; }
h4, h5, h6 { margin: 1.75rem 0 .65rem; font-size: 1rem; }
p { margin: 0 0 1rem; }
.subtitle { display: block; margin-top: .7rem; color: var(--muted); font-size: 1.05rem; font-weight: 400; letter-spacing: 0; line-height: 1.6; }
.timestamp, .timestamp-wrapper, .section-number-2, .section-number-3, .section-number-4 { color: var(--muted); }
.timestamp { font-family: var(--mono); font-size: .8em; }
ul, ol { margin: .75rem 0 1.5rem; padding-left: 1.5rem; }
ul { list-style-type: disc; }
li { margin: .35rem 0; padding-left: .15rem; }
li::marker { color: var(--muted); }
li > ul, li > ol { margin: .35rem 0 .65rem; }
li > p { margin-bottom: .5rem; }
dt { margin-top: 1rem; font-weight: 650; }
dd { margin-left: 1.5rem; }
#table-of-contents {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr);
  align-items: start; gap: 1.5rem;
  margin: 2rem 0; padding: 0 0 1rem;
  border-bottom: 1px dashed var(--line); font-family: var(--mono); font-size: .9rem;
}
#table-of-contents h2 { margin: 1rem 0 0; font-size: 1.5rem; font-weight: 600; letter-spacing: 0; }
#table-of-contents ul { list-style: none; margin: 0; padding: 0; }
#table-of-contents li { display: flex; flex-direction: column; margin: 0 0 .75rem; padding: 0; }
#table-of-contents li > ul { margin: .35rem 0 0; padding-left: .75rem; }
#table-of-contents a { text-decoration: none; }
#table-of-contents a:hover { text-decoration: underline; }
code, kbd, samp, pre { font-family: var(--mono); font-size: .9em; }
code, kbd, samp { background: var(--surface); padding: .15em .35em; border-radius: 3px; }
pre {
  margin: 1.5rem 0; padding: 1.15rem 1.3rem;
  background: var(--surface); color: var(--code-ink);
  border: 1px solid var(--line); border-radius: 4px;
  line-height: 1.5; overflow: auto; white-space: pre; overflow-wrap: normal;
  tab-size: 4;
}
pre code { background: none; padding: 0; font-size: inherit; }
pre.example { border-left: 3px solid var(--line); background: transparent; color: var(--muted); }
.org-src-container { position: relative; min-width: 0; margin: 1.5rem 0; }
.org-src-container pre { margin: 0; }
.code-block { position: relative; }
.code-language { position: absolute; right: 1rem; top: 0; transform: translateY(-50%); padding: 0 .4rem; background: var(--paper); font: .65rem var(--mono); color: var(--muted); line-height: 1; pointer-events: none; }
.org-src-name, .caption { display: block; margin: .6rem 0; font-size: .8rem; color: var(--muted); }
.org-keyword, .org-builtin, .org-preprocessor { color: var(--code-keyword); }
.org-string, .org-doc { color: var(--code-string); }
.org-comment, .org-comment-delimiter { color: var(--code-comment); font-style: italic; }
.org-function-name, .org-function-call { color: var(--accent); }
.org-type, .org-constant, .org-number, .org-tuareg-font-lock-constructor, .org-tuareg-font-lock-module { color: #8a5429; }
.org-variable-name, .org-variable-use { color: var(--code-ink); }
blockquote, .org-quote-container { margin: 1.75rem 0; padding: .15rem 0 .15rem 1.25rem; border-left: 2px solid var(--accent); color: var(--muted); }
blockquote p:last-child { margin-bottom: 0; }
.org-center { text-align: center; }
.org-right { text-align: right; }
.org-left { text-align: left; }
.org-verse { white-space: pre-wrap; }
table { display: block; max-width: 100%; width: max-content; overflow-x: auto; border-collapse: collapse; margin: 1.5rem 0; font-size: .9rem; font-variant-numeric: tabular-nums; }
th, td { padding: .65rem 1rem; border-bottom: 1px solid var(--line); text-align: left; }
th { background: var(--surface); font-weight: 600; }
thead { border-bottom: 2px solid var(--line); }
td.org-right, th.org-right { text-align: right; }
figure, .figure { margin: 2rem 0; }
figure p, .figure p { margin-bottom: .5rem; }
img, svg, video { max-width: 100%; height: auto; }
figure img, .figure img { display: block; margin: 0 auto; border-radius: 3px; }
figcaption, .figure-number, .table-number { color: var(--muted); font-size: .8rem; }
.MathJax, mjx-container[display="true"] { max-width: 100%; overflow-x: auto; overflow-y: hidden; }
.footref, .footnum { font-family: var(--mono); font-size: .75em; }
#footnotes { margin-top: 3rem; border-top: 1px solid var(--line); font-size: .85rem; }
#footnotes h2 { font-size: 1rem; }
.footdef { display: flex; gap: .75rem; margin: .5rem 0; }
.footpara p { margin-bottom: .5rem; }
.todo, .done, .tag { font-family: var(--mono); font-size: .7em; font-weight: 400; }
.todo { color: #975331; }
.done { color: var(--code-string); }
.tag { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.site-footer { display: grid; grid-template-columns: 1fr auto; gap: .75rem 1rem; border-top: 1px solid var(--line); padding: 1.5rem 0 2rem; color: var(--muted); }
.social-links { display: flex; gap: 1.25rem; align-items: flex-start; }
.footer-flavor { margin: 0; text-align: right; }
.eof { grid-column: 1 / -1; font-size: .65rem; color: var(--muted); letter-spacing: .08em; }
@media (max-width: 540px) {
  body { padding: 0 1.25rem; font-size: 16px; }
  .site-header { padding-top: 1.5rem; flex-wrap: wrap; gap: .75rem; }
  .site-nav { gap: 1.15rem; }
  #content { margin: 2rem 0 3rem; }
  #table-of-contents { grid-template-columns: 1fr; gap: 1rem; }
  #table-of-contents h2 { margin-top: 0; font-size: 1.15rem; }
  pre { padding: 1rem; }
  .site-footer { grid-template-columns: 1fr; }
  .footer-flavor { text-align: left; }
}
@media print {
  body { max-width: none; padding: 0; background: white; font-size: 11pt; }
  .site-header, .site-footer, #table-of-contents { display: none; }
  #content { margin: 0; }
  pre, table, figure { break-inside: avoid; }
  pre { white-space: pre-wrap; }
  a { color: inherit; }
}

.org-tuareg-font-lock-governing, .org-tuareg-font-lock-operator { color: var(--code-keyword); }
.org-tuareg-font-lock-label { color: var(--accent); }
.margin-note { display: none; }
@media screen and (min-width: 1240px) {
  .margin-note {
    display: block; position: absolute; left: calc(100% + 2rem); width: 12rem;
    padding-left: .8rem; border-left: 1px solid var(--line);
    font-size: .8rem; line-height: 1.5; color: var(--muted);
  }
  .margin-note-number { font-family: var(--mono); font-size: .7rem; margin-right: .35rem; }
  .margin-note p { display: inline; margin: 0; }
}
