:root,
::backdrop {
  --mono-font: Consolas, Menlo, Monaco, "Andale Mono", "Ubuntu Mono", monospace;

  /* default colors */
  --bg: #EEEEEE;
  --text: #41474E;
  --text-light: #646868;
  --accent: #D26878;
  --link: #5690AF;
}

/* theme media queries */
@media (prefers-color-scheme: dark) {
  :root,
  ::backdrop {
    color-scheme: dark;
    --bg: #222529;
    --text: #D6D6D6;
    --text-light: #DBD5BC;
    --accent: #78B6AD;
    --link: #E2AEA2;
  }
}

[data-theme="light"] {
  /* default (light) theme */
  color-scheme: light;
    --bg: #EEEEEE;
    --text: #41474E;
    --text-light: #646868;
    --accent: #D26878;
    --link: #5690AF;
}

[data-theme="dark"] {
  color-scheme: dark;
    --bg: #222529;
    --text: #D6D6D6;
    --text-light: #DBD5BC;
    --accent: #78B6AD;
    --link: #E2AEA2;
}

::selection,
::-moz-selection {
  color: var(--bg);
  background: var(--accent)
}

html {
  color-scheme: light dark;
  font-family: var(--mono-font);
  scroll-behavior: smooth;
}

body {
  min-height: 100svh;
  color: var(--text);
  background-color: var(--bg);
  font-size: 1rem;
  display: grid;
  grid-template-columns: 1fr min(47rem, 90%) 1fr;
  grid-template-rows: auto 1fr auto;
  grid-row-gap: .625rem;
}
body > * {
  grid-column: 2;
}

body > footer {
  color: var(--text-light);
  font-size: .875rem;
}

/* Format headers */
h1 {
  font-size: 2rem;
}
h2 {
  font-size: 1.75rem;
}
h3 {
  font-size: 1.5rem;
}
h4 {
  font-size: 1.25rem;
}
h5 {
  font-size: 1rem;
}
h6 {
  font-size: .75rem;
}

h1, h2,
h3, h4,
h5, h6 {
  margin: .5em 0  .5em 0;
}

/* Fix line height when title wraps */
h1, h2, h3 {
  line-height: 1.1;
}

h1::before, h2::before,
h3::before, h4::before,
h5::before, h6::before {
  color: var(--accent);
  content: '# '
}

@media only screen and (max-width: 720px) {
  h1 {
    font-size: 1.5rem;
  }
  h2 {
    font-size: 1.25rem;
  }
  h3 {
    font-size: 1rem;
  }
  h4 {
    font-size: .75rem;
  }
  h5 {
    font-size: .5rem;
  }
  h6 {
    font-size: .25rem;
  }
}

p {
  margin: 1rem 0;
}

p, li {
  text-wrap: pretty;
}

/* format links */
a,
a:visited {
  text-decoration: none;
  border-radius: .125rem;
  color: var(--link);
}

a:hover {
  background-color: var(--link);
  color: var(--bg);
}

/* format lists */
ul {
  list-style: square;
  margin-top: .25rem;
  margin-bottom: .25rem;
}

li {
  margin-bottom: .125rem;
}

ul li::marker {
  content: '» ';
  color: var(--accent);
}

ul li:hover::marker {
  content: '# ';
  font-weight: 700;
  color: var(--link);
}

/* misc body elements */
hr {
  border: 1px dashed var(--accent);
  margin: .5rem 0 .5rem 0;
}
