:root {
  --width: calc((80 * 18px / 2) + 2rem);
  --color_code: #f6f8fa;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  font: 18px Times New Roman, serif;
  height: 100%;
  margin: 0;
  width: 100%;
}

body {
  display: flex;
  flex-direction: column;
  overflow-y: scroll;
  line-height: 1.5;
}

h1,
h2,
h3 {
  line-height: 1.1;
}

h1,
h2,
h3,
p {
  margin: 18px 0;
  text-wrap: balance;
}

h2,
h3 {
  margin-top: calc(18px * 3);
}

h1 {
  font-size: 3rem;
}

h2 {
  font-size: 2rem;
}

article {
  flex: 1;
  padding: 2rem 0 4rem;
}

nav,
article > *:not(pre):not(figure),
footer {
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  max-width: var(--width);
  width: 100%;
}

code {
  /*font-size: 0.95em;*/
  font-size: 0.90em;
  padding: 0.15em 0.35em;
  border-radius: 4px;
  background: var(--color_code);
  white-space: nowrap;
}

pre {
  font-size: 0.90em;
  max-width: 80ch;
  width: 100%;
  overflow-x: auto;
  padding: 1rem;
  margin: 2rem auto;
  border-radius: 6px;
  background: var(--color_code);
  line-height: 1.45;
}

pre > code {
  font-size: 0.90em;
  padding: 0;
  white-space: pre;
}

figure {
  display: block;
  margin: 2rem auto;
}

figure img {
  display: block;
  width: 100%;
  margin: 0 0 .5rem 0;
  max-height: 500px;
  object-fit: contain;
}

figcaption {
  color: #000;
  width: 100%;
  font-style: italic;
  text-align: center;
}

a {
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

li {
  list-style-position: inside;
}

q {
  font-style: italic;
}

blockquote {
  border-left: 10px solid var(--color_code);
  padding: 1rem;
}

blockquote span {
  display: block;
  margin: 1rem 0;
}

.g {
  display: flex;
}

.g > *:first-child {
  margin-right: 1ch;
  white-space: nowrap;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g > *:nth-child(2) {
  margin-left: auto;
}

ul {
    list-style: none;
}

ul li::before {
    content:  "⤷";
    margin-right: 0.5rem;
}

@media (max-width: 500px) {
  .g > *:first-child {
    max-width: 100%;
  }

  article .g > *:nth-child(2) {
    display: none;
  }
}

.r {
  text-align: center;
  font-size: 90%
}

.c {
  text-align: center;
  font-size: 90%
}

.d {
  font-family: monospace, monospace;
  font-size: 80%;
}

.n {
  font-size: 0.75em;
  font-weight: bold;
  vertical-align: super;
  line-height: 0;
}

#q {
  height: 4rem;
}
