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

:root {
  --bgColor: white;
  --bodyColor: #555;
  --faintBodyColor: #7b7b7b;
  --strongColor: #333;
  --fadeColor: #999;
  --faintFadeColor: #bfbfbf;
  --accentColor: #3498db;
  --faintAccentColor: #c6e6fc;
}

::selection {
  background-color: var(--accentColor);
}

html {
  font-size: 15pt;
  min-height: 100%;
  position: relative;
}

body {
  height: 100%;
  background-color: var(--bgColor);
  font-family: "Nunito", sans-serif;
  margin: 0;
  color: var(--bodyColor);
}

.grid {
  position: absolute;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 5000;
  background-image: linear-gradient(transparent 93%, rgba(0, 0, 0, 0.3) 93%, rgba(0, 0, 0, 0.3));
  background-size: 1.5rem 1.5rem;
  pointer-events: none;
}
.grid.hidden {
  display: none;
}

button.grid-button {
  position: fixed;
  bottom: 0.75rem;
  right: 0.75rem;
  height: 3rem;
  padding: 0 1.5rem;
  margin: 0;
  border: 0;
  outline: none;
  font: inherit;
  font-size: 0.8rem;
  background: var(--accentColor);
  color: white;
  z-index: 6000;
  border-radius: 0.3rem;
  box-shadow: 0 0.15rem 0.15rem 0.01875rem rgba(0, 0, 0, 0.3);
}

header {
  height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 60rem;
  max-width: 100%;
  margin: 0 auto;
}
header h1.title {
  margin: 0;
  line-height: 4.5rem;
  color: var(--strongColor);
  font-size: 1.8rem;
  padding: 0 1.5rem;
}
header img {
  height: 80%;
  margin: 0 0.75rem;
}
header nav {
  display: flex;
  height: 100%;
}
header nav a {
  color: var(--strongColor);
  text-decoration: none;
  display: block;
  line-height: 4.5rem;
  padding: 0 1.5rem;
  position: relative;
  height: 100%;
}
header nav a:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0.15rem;
  background: white;
  opacity: 0;
  transition: all 0.1s ease-in-out;
}
header nav a:hover:before {
  opacity: 1;
}

main {
  width: 60rem;
  max-width: 100%;
  margin: 6rem auto 3rem;
}

article {
  padding: 3rem;
  border-radius: 0.3rem;
  margin: 1.5rem 0 0;
}
article date {
  font-size: 0.9rem;
  height: 1.5rem;
  line-height: 1.5rem;
  display: block;
  font-weight: 400;
}
article h1 {
  font-size: 2.6rem;
  margin: 1.5rem 0 0;
  line-height: 3rem;
  color: var(--strongColor);
}
article h2 {
  font-size: 1.4rem;
  font-weight: 300;
  font-style: italic;
  color: var(--fadeColor);
  line-height: 1.5rem;
  margin: 1.5rem 0 0;
}
article h3 {
  line-height: 1.5rem;
  margin: 1.5rem 0;
  font-size: 1.3rem;
  color: var(--strongColor);
}
article h4 {
  line-height: 1.5rem;
  margin: 1.5rem 0;
  font-size: 1rem;
  color: var(--strongColor);
}
article p {
  line-height: 1.5rem;
  margin: 1.5rem 0 0;
  color: var(--bodyColor);
}
article blockquote {
  margin: 1.5rem 0;
  padding: 0 1.5rem;
  border-left: 0.2rem solid var(--fadeColor);
  color: var(--fadeColor);
  font-style: italic;
}
article blockquote p {
  margin: 0;
}
article code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85em;
  color: var(--strongColor);
}
article pre {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9em;
  margin: 3rem 0;
  line-height: 1.5rem;
  max-width: 100%;
  overflow-x: auto;
  padding: 0 1.5rem;
}
article pre code {
  font-size: 1em;
  line-height: 1.5rem;
  display: block;
  color: inherit;
}
article figure {
  margin: 3rem 0 0;
}
article figure img {
  width: 100%;
  display: block;
}
article figure img.vertical {
  max-width: 20rem;
  object-fit: contain;
}
article figure .twitter-tweet, article figure img.vertical {
  margin-left: auto;
  margin-right: auto;
}
article figure figcaption {
  margin: 1.5rem 0;
  line-height: 1.5rem;
  text-align: center;
  font-style: italic;
  color: var(--fadeColor);
  font-size: 0.8rem;
}
article section.content a {
  color: var(--strongColor);
  text-decoration: none;
  background-image: linear-gradient(transparent 72.5%, var(--faintAccentColor) 72.5%, var(--faintAccentColor) 92.5%, transparent 92.5%);
}
article section.content a:hover {
  background-image: linear-gradient(transparent 0%, var(--faintAccentColor) 0%, var(--faintAccentColor) 92.5%, transparent 92.5%);
}
article section.content ul, article section.content ol {
  color: var(--bodyColor);
  margin: 1.5rem 0;
  padding: 0 0 0 1.5rem;
  line-height: 1.5rem;
}
article section.content ul ul, article section.content ul ol, article section.content ol ul, article section.content ol ol {
  margin: 0;
}
article section.content ul li {
  list-style: none;
  position: relative;
}
article section.content ul li:before {
  content: "·";
  height: 1.5rem;
  width: 1.5rem;
  display: block;
  position: absolute;
  top: 0;
  left: -1.5rem;
  text-align: center;
  line-height: 1.5rem;
  font-weight: bold;
  color: var(--strongColor);
}
article li pre {
  margin: 1.5rem 0;
}
article a.load-content {
  display: block;
  height: 4.5rem;
  line-height: 4.5rem;
  color: var(--accentColor);
  text-align: center;
  text-decoration: none;
}
article hr {
  margin: 3rem 1.5rem 1.5rem;
}
article .mastodon-embed {
  display: block;
  margin: 1.5rem auto;
  width: 100%;
  max-width: 30rem !important;
  border: 0;
}

footer {
  text-align: center;
  padding: 0;
}
footer p {
  margin: 1.5rem 0;
}
footer p a {
  color: var(--strongColor);
  text-decoration: none;
  background-image: linear-gradient(transparent 72.5%, var(--faintAccentColor) 72.5%, var(--faintAccentColor) 92.5%, transparent 92.5%);
}
footer p a:hover {
  background-image: linear-gradient(transparent 0%, var(--faintAccentColor) 0%, var(--faintAccentColor) 92.5%, transparent 92.5%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bgColor: #2b3d4f;
    --bodyColor: #ccd;
    --faintBodyColor: #9e9ebe;
    --strongColor: #eaeaf5;
    --fadeColor: #99b;
    --faintFadeColor: #6b6b9c;
    --accentColor: #3498db;
    --faintAccentColor: #316b92;
  }
  pre {
    filter: invert(100%);
    background-color: #d4c2b0 !important;
    color: #15150a;
  }
  pre::selection, pre ::selection {
    background-color: #cb6724;
  }
}
@media (max-width: 500px) {
  header {
    height: 9rem;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    text-align: center;
  }
  header nav {
    justify-content: center;
  }
  header nav a {
    padding: 0 0.75rem;
    flex: 1;
  }
  header nav a:before {
    top: auto;
    bottom: 0;
  }
  main {
    margin: 1.5rem 0;
  }
  article {
    padding: 1.5rem;
  }
  article date {
    font-size: 0.75rem;
  }
  article h1 {
    font-size: 1.5rem;
    line-height: 1.5rem;
    margin: 1.5rem 0 0;
  }
  article h2 {
    font-size: 1rem;
  }
  article pre {
    margin: 1.5rem 0;
    padding: 0;
  }
}