:root {
  --sidebar-width: 20rem;
  --background: #f2f1f0;
  --sidebar-background: #3d3838;
  --title-color: #939496;
  --sidebar-link: #948468;
  --sidebar-link-active: #b0a28a;
  --footer-color: #72664f;
  --footer-link: #b0a28a;
  --link: #82615b;
  --visited-link: #624844;
  --text: #3d3838;
  --rule: #948468;
  --code-background: #2b2b2b;
  --code-text: #f8f8f2;
  --table-background: #dedbd8;
  --heading-font: "Fira Sans Condensed", "Arial Narrow", sans-serif;
  --content-font: "Open Sans", system-ui, sans-serif;
  --code-font: "Source Code Pro", ui-monospace, monospace;
}

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

html {
  min-height: 100%;
}

body {
  display: grid;
  grid-template-areas:
    "header main"
    "footer main";
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: var(--content-font);
  line-height: 1.6;
}

.site-header,
.site-footer {
  color: var(--sidebar-link);
  background: var(--sidebar-background);
  text-align: center;
}

.site-header {
  grid-area: header;
  padding: 2rem 1rem;
}

.site-title {
  color: var(--title-color);
  font-family: var(--heading-font);
  font-size: 2rem;
  font-weight: 900;
  text-decoration: none;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  color: var(--sidebar-link);
  font-family: var(--heading-font);
  font-size: 1.2rem;
  text-decoration: none;
}

.nav-link[aria-current="page"] {
  color: var(--sidebar-link-active);
}

.site-footer {
  grid-area: footer;
  padding: 1rem;
  color: var(--footer-color);
  font-size: 0.8rem;
  line-height: 1.5;
}

.site-footer p {
  margin: 0 0 1rem;
}

.site-footer p:last-child {
  margin-bottom: 0;
}

.site-footer a {
  color: var(--footer-link);
}

.footer-links {
  font-family: var(--heading-font);
  font-size: 1.3rem;
}

.site-notice {
  font-size: 0.7rem;
}

main {
  grid-area: main;
  width: min(100%, 53rem);
  padding: 1.5rem;
}

article > :first-child {
  margin-top: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-block: 1.25em 0.5em;
  font-family: var(--heading-font);
  font-weight: 900;
  line-height: 1.25;
}

h1 {
  font-size: 1.8rem;
}

h2 {
  padding-bottom: 0.2em;
  border-bottom: 1px solid var(--text);
  font-size: 1.5rem;
}

h3 {
  font-size: 1.2rem;
}

.content-header {
  margin-bottom: 2rem;
  text-align: center;
}

.content-headline {
  margin-top: 0;
  padding-bottom: 0.2em;
  border-bottom: 1px solid var(--text);
  font-size: clamp(2rem, 7vw, 2.5rem);
}

p {
  margin-block: 0 1.25rem;
}

ol,
ul {
  padding-inline-start: 1.5rem;
}

li {
  margin-block: 0.3rem;
}

dt {
  font-weight: 700;
}

dd {
  margin-inline-start: 1.5rem;
}

main a {
  color: var(--link);
}

main a:visited {
  color: var(--visited-link);
}

a:hover {
  text-decoration-thickness: 0.12em;
}

a:focus-visible {
  outline: 3px solid var(--sidebar-link-active);
  outline-offset: 3px;
}

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

.profile-image {
  display: block;
  width: min(18rem, 100%);
  margin-inline: auto;
}

pre,
code {
  border: 1px solid #222;
  border-radius: 0.2rem;
  color: var(--code-text);
  background: var(--code-background);
  font-family: var(--code-font);
  font-size: 0.9rem;
}

code {
  padding: 0.1em 0.3em;
}

pre {
  overflow-x: auto;
  margin-block: 0 1.5rem;
  padding: 0.75rem;
}

pre code {
  border: 0;
  padding: 0;
}

blockquote {
  margin-inline: 0;
  padding-inline-start: 0.75rem;
  border-left: 4px solid var(--rule);
  font-style: italic;
}

table {
  width: 100%;
  margin-bottom: 1.5rem;
  border-collapse: collapse;
  background: var(--table-background);
}

th,
td {
  padding: 0.5rem 0.6rem;
  border: 1px solid #c8c3be;
  text-align: left;
}

tbody tr:nth-child(even) {
  background: #e6e3e0;
}

.error-page {
  max-width: 38rem;
  margin-inline: auto;
  text-align: center;
}

.error-page h1 {
  margin-block: 2rem;
  font-size: clamp(4rem, 18vw, 7rem);
  line-height: 1;
}

@media (max-width: 50rem) {
  body {
    display: grid;
    grid-template-areas:
      "header"
      "main"
      "footer";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
  }

  .site-header {
    padding: 1rem;
  }

  .nav-list {
    flex-flow: row wrap;
    justify-content: center;
    gap: 0.5rem 1.25rem;
    margin-top: 1rem;
  }

  main {
    padding: 1.5rem;
  }
}
