@import url('https://fonts.googleapis.com/css2?family=PT+Mono&family=PT+Sans:wght@400;700&display=swap');

/* === Grid and base layout === */

:root {
  --highlight: #91cb3e;
  --body-pad-top: 70px;
  margin: 0;
  padding: 0;
}

body {
  display: grid;
  margin: 0;
  padding:  var(--body-pad-top) 45px;
  min-width: 350px;
  grid: auto / 200px minmax(300px, 500px);
  align-items: start;
  justify-content: center;
  gap: 20px;
  font: 16px/1.3 'PT Sans', sans-serif;
  color: #333;
  background: #edf2f4;
}

nav {
  position: sticky;
  left: 0;
  top: var(--body-pad-top);
  line-height: 2;
}

article {
  margin-top: -50px;
  padding-top: 50px;
}

/* === Navbar and marker === */

nav ul {
  margin: 0;
  padding-left: 10px;
  list-style: none;
}

nav li > ul {
  padding-left: 30px;
}

nav a {
  display: inline-block;
  color: #7f7f7f;
  text-decoration: none;
  transition: all 300ms ease-in-out;
}
  
nav li.visible > a {
  color: #222;
  transform: translate(5px);
}

nav svg {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

nav path {
  transition: all 300ms ease;
  fill: transparent;
  stroke: var(--highlight);
  stroke-width: 3px;
  stroke-dasharray: 0 0 0 1000;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* === Body contents === */

section[id] {
  margin: 25px 0;
  padding: 25px 0;
}

h1, h2 {
  margin: 0;
  padding: 0;
  font-size: 36px;
}

h2 {
  padding-left: 10px;
  border-left: 4px solid var(--highlight);
  font-size: 24px;
}

h1 span,
.subheading {
  display: block;
  color: #666;
  font: 700 20px sans-serif;
}

article a {
  color: #222;
  -webkit-text-decoration-color: var(--highlight);
          text-decoration-color: var(--highlight);
}

article a:hover {
  margin: -2px;
  padding: 2px;
  border: 0;
  background: var(--highlight);
}

code {
  margin: -2px;
  padding: 2px;
  background: rgba(0,0,0,.05);
  font-family: 'PT Mono', monospace;
  color: #333;
}

/* === Adjustments === */

/* Scroll all the way up even if the first section starts a couple hundred pixels down the page */
section:first-of-type {
  margin-top: -300px;
  padding-top: 350px;
}

article,
section:last-of-type,
section:last-of-type p:last-of-type {
  margin-bottom: 0;
  padding-bottom: 0;
}