:root {
  scroll-snap-type: y proximity;
  scroll-padding: 1em;
  padding: 0;
}

body {
  font-size: 24px;
  margin: 1rem;
  display: flex;
  flex-direction: row;
  min-height: calc(100vh - 2rem);
  box-sizing: border-box;
}

h1, h2 {
  font-size: inherit;
}

h1 {
  margin: 0;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  display: flex;
  flex-direction: row;
}

button {
  color: inherit;
  appearance: none;
  display: none;
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  background: none;
  padding: 0;
  border: 0 none;
}

h2 {
  margin-bottom: 0;
}

a, a:visited, a:active {
  color: black;
  text-decoration: none;

}

nav {
  flex: 0 0 max-content;
  align-self: start;
  position: sticky;
  top: 0;
  padding-top: 1em;
  margin-right: 3rem;
}

nav > section {
  display: flex;
  flex-direction: column;
}


main {
  flex: auto 1 1;
  line-height: 0;
  text-align: center;
}

main > img {
  scroll-snap-align: end;
  scroll-snap-stop: always;
  max-width: 100%;
  max-height: calc(100vh - 2rem);
  object-fit: contain;
  padding: 0.8rem;
  padding-left: 0;
  box-sizing: border-box;
}

main > section {
  max-width: 100%;
  line-height: initial;
  display: block;
  margin: 1rem 0;
}

main a {
  display: block;
}

main.about > img {
  scroll-snap-align: unset;
  scroll-snap-stop: unset;
}

@media (max-width: 50em) {
  body {
    flex-direction: column;
    margin-top: 0;
  }

  nav {
    justify-self: start;
    padding-top: 0;
    width: 100%;
  }

  nav:not(.open) {
    overflow-y: hidden;
    max-height: 1.3lh;
  }

  nav.open + main {
    display: none;
  }

  nav.open button {
    text-decoration: line-through;
  }

  h1 {
    width: 100%;
    background-color: white;
  }

  h1 > a {
    flex: 1 1 auto;
  }

  button {
    display: initial;
    justify-self: end;
  }

  main > img {
    max-width: 100%;
    max-height: calc(100vh - 3rem);
  }
}
