:root {
  --text-color: white;
  --background-color: black;
  --heading-color: turquoise;
  font-size: calc(0.7em + 1vw);
  background: var(--background-color);
  background: linear-gradient(#000, #111);
}
@media (min-width: 1200px) {
  :root {
    font-size: 1.2em;
  }
}

body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0 1em;
  margin: 0 auto;
  max-width: 960px;
  min-height: 100vh;
  color: var(--text-color);
  font-family: serif;
}

h1 {
  text-align: center;
  font-size: 3em;
}
h2 {
  text-align: center;
  text-decoration: underline;
}
h3,
h4,
h5 {
  text-align: center;
  text-transform: lowercase;
}
h2,
h3 {
  margin: 1.2em 0em;
  color: var(--heading-color);
}
h2 a, h3 a {
    color: var(--heading-color);
    text-decoration: none;
  }
h2 a:hover, h3 a:hover {
    color: var(--heading-color);
    background-color: transparent;
    text-decoration: underline;
  }

ul {
  margin: 0.2em 0;
  padding: 0 2em;
}
div > ul {
    margin: 1em;
    padding: 0;
  }
div > ul li {
      margin: 0.1em;
    }

.hidden {
  display: none;
}

/* article nav aka TOC */
nav#table-of-contents {
  border-bottom: 1px solid grey;
  padding-bottom: 0.5em;
  margin-bottom: 1.2em;
}
nav#table-of-contents h2 {
    text-align: left;
  }
nav#table-of-contents ul {
    text-transform: lowercase;
    font-family: monospace;
  }
nav#table-of-contents a {
    text-decoration: none;
  }

/* profile nav */
nav p {
  display: flex;
  justify-content: center;
  gap: 1em;
  margin: 0;
}

figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2em;
}

figure img {
    background: white;
    max-width: 100%;
    height: auto;
  }

figure figcaption {
    font-size: 0.7em;
    font-style: italic;
  }

.portrait img {
  margin: 0 auto;
  display: block;
}

@media (min-width: 600px) {
  .portrait {
    float: right;
    width: 40%;
  }
}

.outline-text-2:after {
  clear: both;
  content: "";
  display: block;
}

pre.src,
pre.example {
  max-width: 100vh;
  padding: 0.5em;
  font-size: 1.1em;
  background: #111;
  border: 1px solid #333;
  border-radius: 5px;
  overflow: scroll;
}

@media (max-width: 600px) {
  pre.src,
  pre.example {
    max-width: 40vh; /* NOTE: magic value*/
  }
}

div.org-src-container > pre.src {
  margin: 0.5em 0;
}

div#content,
div.outline-text-1,
div.outline-text-2,
div.outline-text-3,
div.outline-text-4,
div.outline-text-5 {
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
}

li > table {
  margin: 0.4em 0;
}

table {
  margin: 1em 0;
  border-collapse: collapse;
}

table caption {
    color: #ccc;
    margin: 0.2em auto;
    font-size: 0.8em;
  }

table tbody:nth-last-child(n + 2) {
    border-bottom: 4px double #222;
  }

table th {
    text-transform: uppercase;
  }

table td {
    border: 1px solid #222;
    padding: 0.3em 0.5em;
  }

table td.org-left {
    text-align: left;
  }

table td.org-right {
    text-align: right;
  }

table td.org-center {
    text-align: center;
  }

@media (max-width: 600px) {
  ol.org-ol {
    padding-left: 1em;
  }
  ul.org-ul {
    padding-left: 1em;
  }
}

/* for items that have a code block */
li p {
  margin: 0;
}

/* org's =text= */
code {
  color: orange;
}

a {
  color: var(--text-color);
}

a:hover {
  background: var(--text-color);
  color: var(--background-color);
  text-decoration: none;
}

a[href^="http"] {
  text-decoration-style: dotted;
}

#preamble div {
    font-size: 0.8em;
    font-family: "Courier New", Courier, monospace;
    text-align: right;
  }

#postamble ul {
    list-style: none;
    display: flex;
    justify-content: space-around;
    padding: 0;
  }

#postamble ul li a {
      text-decoration: none;
      padding: 0.2em;
    }

#progress-bar {
  width: 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 6px;
  background: linear-gradient(
    to right,
    var(--background-color),
    var(--text-color)
  );
}
