:root.light-mode {
  --foreground: #222222;
  --background: #eeeeee;
  --secondary: #808080;
  --tertiary: #dddddd;
  --accent: #3d3cba;
  --accent-highlight: #171746;
  --table-border: #d0d0d0;
  --table-row: #f7f7f7;
}
:root.light-mode #dark-mode-on {
  display: inline;
}
:root.light-mode #dark-mode-off {
  display: none;
}

:root.dark-mode {
  --foreground: #eeeeee;
  --background: #000000;
  --secondary: #999999;
  --tertiary: #444444;
  --accent: #959bf0;
  --accent-highlight: #c2c5f6;
  --table-border: var(--tertiary);
  --table-row: #1e1e1e;
}
:root.dark-mode #dark-mode-on {
  display: none;
}
:root.dark-mode #dark-mode-off {
  display: inline;
}

.dark-mode-buttons {
  position: fixed;
  top: 1em;
  right: 1em;
}

.dark-mode-button {
  border: none;
  background-color: transparent;
  /* <button> does not inherit color, so the inlined icon's currentColor would
     otherwise resolve to the UA default (buttontext). Match the header icons. */
  color: var(--secondary);
}
.dark-mode-button:hover {
  cursor: pointer;
}

@media (prefers-color-scheme: light) {
  :root {
    --foreground: #222222;
    --background: #eeeeee;
    --secondary: #808080;
    --tertiary: #dddddd;
    --accent: #3d3cba;
    --accent-highlight: #171746;
    --table-border: #d0d0d0;
    --table-row: #f7f7f7;
  }
  :root #dark-mode-on {
    display: inline;
  }
  :root #dark-mode-off {
    display: none;
  }
}
@media (prefers-color-scheme: dark) {
  :root {
    --foreground: #eeeeee;
    --background: #000000;
    --secondary: #999999;
    --tertiary: #444444;
    --accent: #959bf0;
    --accent-highlight: #c2c5f6;
    --table-border: var(--tertiary);
    --table-row: #1e1e1e;
  }
  :root #dark-mode-on {
    display: none;
  }
  :root #dark-mode-off {
    display: inline;
  }
}
body {
  color: var(--foreground);
  background-color: var(--background);
}

.secondary {
  color: var(--secondary);
}

a, a:link, a:visited {
  color: var(--accent);
}

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

blockquote {
  border-left: 2px solid var(--secondary);
}

code {
  background-color: var(--tertiary);
}

pre code {
  background-color: transparent;
}

.footnote-ref a,
.footnote-backref {
  color: var(--secondary);
}

table th, table td {
  border-color: var(--table-border);
}
table thead, table tr:nth-child(even) {
  background-color: var(--table-row);
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14pt;
  line-height: 1.6em;
  padding: 5em 25%;
}

.header-links {
  display: flex;
  align-items: center;
  margin: 0 0 0 auto;
}
.header-links a {
  margin-right: 0.5em;
  display: flex;
  color: var(--secondary);
}
.header-links a:last-of-type {
  margin-right: 0;
}
.header-links .icons {
  width: 1.6em;
  height: 1.6em;
}

.space {
  margin-bottom: 2em;
  display: flex;
}

.doublespace {
  margin-bottom: 4em;
}

.small {
  font-size: 75%;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
}

a {
  text-decoration: none;
}

img {
  max-width: 100%;
}

blockquote {
  margin-left: 0;
  padding-left: 1em;
}

code {
  padding: 0.1em 0.2em;
  font-size: 12pt;
}

pre {
  overflow: auto;
  padding: 0.3em;
}
pre code {
  padding: 0;
}

.footnotes {
  margin-top: 3em;
}
.footnotes-sep {
  display: none;
}
.footnotes-list {
  padding-left: 1.5em;
}
.footnotes-list > li {
  margin-top: 1em;
}
.footnotes-list > li > p {
  display: inline;
}

table {
  border-spacing: 0;
}
table th, table td {
  border-width: 1px;
  border-style: solid;
  border-left-style: none;
  padding: 0.2em;
}
table th:first-child, table td:first-child {
  border-left-width: 1px;
  border-left-style: solid;
}
table th {
  border-top-width: 1px;
  border-top-style: solid;
}
table td {
  border-top-style: none;
}

@media all and (max-width: 1200px) {
  body {
    padding: 3em 15%;
  }
}
@media all and (max-width: 800px) {
  body {
    padding: 1em 1em;
  }
}
footer {
  margin-top: 3em;
}
