:root {
  --size: 24px;
}

body {
  background: #f9f5d7;
  color: #352f36;
  background-image: radial-gradient(circle, #CCCCCC 1px, transparent 1px);
  background-position: 50% 0%;
  background-size: var(--size) var(--size);
  padding: calc(var(--size)/2) 0px;
  margin: 0px;
  font-family: Arial;
  font-family: "Atkinson Hyperlegible Next", sans-serif;
  font-size:var(--size);
  font-optical-sizing: auto;
  line-height: calc(var(--size)*2);
}

nav {
  font-size: calc(var(--size));
  height: calc(var(--size)*3);
  width: 100%;
  display: flex;
  justify-content: space-between;
}

nav > a {
  display: inline-block;
  height: calc(var(--size)*3);
  line-height: calc(var(--size)*3);
  padding: 0px 5px;
  text-decoration: none;
  color: #352f36;
  font-weight: bold;
}

main {
  margin: 0px auto;
  margin-bottom: 50vh;
}

table, p {
  background-color: hsla(53deg, 74%, 91%, 70%);
}

p {
  padding: 0px 6px;
}

.katex-display {
  height: calc-size(max-content, round(up, size, var(--size)));
  min-height: calc(var(--size)*2);
  text-align: center;
  margin: var(--size) 0px;
}

pre[class*="language-"] {
  background: hsla(53deg, 74%, 91%, 70%);
  padding: var(--size) calc(var(--size) + 3px);
  line-height: calc(var(--size)*2);
  margin: var(--size) 0px;
}

blockquote {
  border-left: 4px solid #352f36;
  position: relative;
  left: -2px;
  padding-left: calc(var(--size));
  box-sizing: border-box;
}

table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0px;
  max-width: calc(var(--size)*40);
  margin: calc(var(--size)*2) auto;
}

td {
  border: 1px solid black;
  line-height: var(--size);
  padding: calc(var(--size) - 0.5px);
}

th {
  line-height: var(--size);
  padding: calc(var(--size)/2 - 0.5px);
}

nav, h2, h3, h4, h5, h6, p, ul, ol, details, blockquote {
  max-width: calc(var(--size)*27);
  margin: var(--size) auto;
}

img {
  margin: calc(var(--size)*2) auto;
  max-width: 100%;
}

main h1 {
  margin: calc(var(--size)*6) auto calc(var(--size)*4);
  font-size: 2em;
  font-weight: bold;
  line-height: calc(var(--size)*3);
  padding: 0px 6px;
  max-width: 100%;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 14px;
  text-decoration-thickness: 5px;
}

h2 {
  margin-top: calc(var(--size)*2);
  font-size: 1.5em;
  font-weight: bold;
  line-height: calc(var(--size)*2);
  padding: 0px 6px;
  text-decoration: underline;
  text-underline-offset: 8px;
}

li {
  display: block list-item;
  padding: 0px 0px 0px 0px;
}

@media print {
  :root {
    --size: 5mm;
  }
  body {
    background-color: white;
    margin: var(--size);
  }
  p {
    background-color: white;
  }

  h2, h3, h4, h5, h6, p, ul {
    max-width: unset;
  }
}
