html {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

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

body {
  color: var(--fg);
  background: var(--bg);
  font-size: 20px;
  font-family: var(--proportional-fonts);
  line-height: 1.45;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  margin: 0;
  display: flex;
  flex-flow: row wrap;
  position: relative;
  overflow-x: clip;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("../img/background.svg");
  background-repeat: repeat;
  background-size: 460px auto;
  opacity: 0.028;
  pointer-events: none;
  z-index: 0;
}

@media (min-width: 1367px) {
  body {
    width: 82%;
    padding-right: 18%;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 1366px) {
  body {
    width: 87%;
    padding-right: 13%;
    max-width: 960px;
    margin-right: 2em;
    margin-left: auto;
    font-size: 19px;
  }
}

@media (max-width: 960px) {
  body {
    width: 100%;
    padding-right: 0;
    margin-right: 0;
    text-align: left;
  }
}

.text-space {
  display: inline-block;
  width: 79%;
  position: relative;
  z-index: 2;
}

.navbar-space {
  position: relative;
  z-index: 2;
}

#content {
  margin-left: auto;
  margin-right: auto;
  max-width: 35em;
}

#content a {
  color: var(--fg-link);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--title-fonts);
}

h1 {
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
  font-size: 2em;
  text-align: center;
}

h1.post-title {
  line-height: 1;
  text-align: left;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  font-size: clamp(2.8rem, 7vw, 4.7rem);
}

#title-underline {
  max-width: 50rem;
  border-top: solid 1px var(--fg-header);
  padding-bottom: 2rem;
}

.header {
  font-size: 0.92em;
  text-align: left;
  margin-top: 2.8rem;
  margin-bottom: 0.8rem;
  color: var(--fg-header);
}

pre {
  text-align: left;
  font-size: 0.84em;
  font-family: var(--monospace-fonts);
  white-space: pre;
  overflow-x: auto;
}

code {
  font-size: 0.87em;
  font-family: var(--monospace-fonts);
  background: var(--bg-inline-code);
  border-radius: 0.25rem;
  padding: 0 2px;
  border: 1px solid var(--border-inline-code);
}

blockquote {
  font-size: 0.95em;
  border-left: 4px solid var(--border-inline-code);
  margin: 20px 0;
  padding-left: 20px;
}

#footer {
  border-top: solid 1px var(--fg-divider);
  color: var(--fg-footer);
  font-size: 0.78em;
  margin-top: 30px;
  padding: 9px 0 12px;
  text-align: center;
  max-width: 50rem;
  margin-left: auto;
  margin-right: auto;
}

.footer-links {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  justify-content: center;
  flex-wrap: wrap;
}

.post-endnote {
  margin-top: 2rem;
  border-top: solid 1px var(--fg-divider);
  padding-top: 1rem;
  text-align: center;
  color: var(--fg-footer);
  font-size: 0.9em;
}

.small-caps {
  font-variant-caps: all-small-caps;
}

.tags-inline {
  margin-left: 0.5rem;
}

.tag {
  color: var(--fg-link);
  text-decoration: none;
  margin-right: 0.3rem;
}

.post-cards .card {
  border-bottom: 1px solid var(--fg-divider);
  padding-bottom: 0.8rem;
  margin-bottom: 1.2rem;
}

.post-teaser {
  color: var(--fg-header);
  margin-top: 0.4rem;
}

.tag-cloud {
  line-height: 2.1;
}

@media (max-width: 767px) {
  .text-space {
    width: 100%;
  }

  #content {
    margin-left: 1em;
    margin-right: 1em;
    max-width: none;
  }

  .header {
    margin-top: 0.6rem;
  }
}

@media (max-width: 900px) {
  body::before {
    opacity: 0.02;
    background-size: 380px auto;
  }
}
