:root {
  --bg: #f8f8f8;
  --text: #1f2933;
  --link: #c72538;
  --link-visited: #a8486c;
  --border: rgba(0, 0, 0, 0.08);
  --font-main: Inconsolata;
  --font-code: Inconsolata;
  --size-body: 14pt;
  --size-pre: 12pt;
  --line-body: 1.45em;
  --content-max: 50rem;
  --space-body: 1rem;
  --radius: 0.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1720;
    --text: #e6edf3;
    --link: #ff6b6b;
    --link-visited: #ffa0c0;
    --border: rgba(255, 255, 255, 0.12);
  }
}

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

body {
  font-family: var(--font-main);
  font-weight: 400;
  font-size: var(--size-body);
  line-height: var(--line-body);
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
  padding: var(--space-body);
  background: var(--bg);
  color: var(--text);
}

main {
  overflow-x: auto;
}

header p.header,
header h1.header {
  font-size: 1.5em;
}

:is(h1, h2, h3, h4, h5, h6) {
  margin-bottom: 1em;
}

:is(h1, h2, h3, h4, h5, h6, strong) {
  font-weight: 500;
}

ul,
ol {
  padding-left: 2em;
}

p {
  margin: 0 0 1em;
}

code {
  font-family: var(--font-code);
}

pre {
  padding: 0.75rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: var(--size-pre);
}

code:not(pre code) {
  padding: 0.1rem 0.25rem;
  border-radius: var(--radius);
}

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

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

header {
  padding-bottom: 0.5em;
  box-shadow: 0 0.1em 0 var(--border);
}

footer {
  padding-top: 0.5em;
  box-shadow: 0 -0.1em 0 var(--border);
}

@media (max-width: 600px) {
  body {
    padding: 0.75rem;
    font-size: 13pt;
  }

  pre {
    font-size: 11pt;
  }
}
