@import url('https://fonts.googleapis.com/css2?family=Roboto+Slab&display=swap');

:root {
  --primary: #222;
  --bg: #eee;
  --accent: #eaff00;
}

body {
  font: 16px / 1.6 'Roboto Slab', sans-serif;
  color: var(--primary);
  margin: 0;
  padding: 1.5rem;
  cursor: crosshair;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

header,
main {
  width: 40rem;
  max-width: 100%;
  margin: 0 auto;
}

@media (min-width: 600px) {
  nav {
    display: flex;
  }
}

nav a {
  display: block;
  color: #777;
  border-top: 3px solid var(--accent);
  padding: 0 8px;
  text-decoration: none;
}

nav a[aria-current="true"] {
  color: var(--primary);
  border-top: 3px solid var(--primary);
}

nav a:last-child {
  margin-left: auto;
  border: none;
}

nav a:last-child:hover {
  background: none;
  color: red;
}

main {
  padding: 1rem 0;
}

h2 {
  margin-top: 2rem;
  border-top: 1px dashed;
  padding-top: .75rem;
  font-size: 2rem;
  line-height: 1.2;
}

h2,
h3,
h4 {
  margin-bottom: .5rem;
}

ul {
  margin-top: 0;
}

a {
  color: inherit;
  text-decoration: underline dashed 2px;
  text-underline-offset: 4px;
  cursor: crosshair;
}

a:hover,
a:focus {
  background: var(--accent);
}

.header-anchor {
  opacity: .5;
  text-decoration: none;
  transition: opacity .3s ease;
}

.table-of-contents ul {
  padding: 0;
  list-style: none;
}

.table-of-contents ul ul {
  padding-left: 1rem;
}

@media (min-width: 800px) {
  main {
    padding: 2rem 0;
  }
}
