:root {
  --text: #000;
  --text-accent: #33004b;

  --bg: #f7deff;
  --bg2: #faeffe;
  --highlight1: #d980fa;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Text */
emph {
  font-family: "Inter", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: italic;
}

strong {
  font-family: "Inter", sans-serif;
  font-optical-sizing: auto;
  font-weight: 700;
  font-style: normal;
}

/* Body layout */
body {
  background-color: var(--bg2);

  font-family: "Inter", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-size: medium;
  color: var(--text);

  line-height: 1.5;

  display: flex;
  flex-direction: row;
  min-height: 100vh;
}

body > * {
  --layout-spacing: max(8vh, 3rem);
  --mid-spacing: max(4vh, 1.5rem);
  --small-spacing: 0.5rem;
  --max-width: 70ch;
  width: min(100%, var(--max-width));
  margin-left: auto;
  margin-right: auto;
}

.middle-content {
  display: flex;
  flex-direction: column;
  width: 100vw;
  padding: 5vh clamp(1rem, 5vw, 3rem) 1rem;
  gap: var(--layout-spacing);
}

/* Nav bar */
.nav_container {
  width: fit-content;
}

nav {
  width: 15vw;
  height: 100vh;

  background-color: var(--bg);
  box-shadow: 4px 0px 6px 0px rgba(0, 0, 0, 0.6);

  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-wrap: wrap;
  order: 0;

  position: sticky;
  top: 0;
}

nav ul {
  display: flex;
  flex-direction: column;
  list-style: none;
  list-style-position: inside;
  /* justify-content: stretch; */
}

nav ul li {
  list-style: none;
  padding-left: 1rem;
  font-size: 26pt;
  cursor: pointer;
}

nav ul li:hover {
  background-color: var(--highlight1);
}

.nav_checkbox {
  display: none;
  order: 1;
}

.nav_button {
  display: none;
  height: 50px;
  width: 50px;
  border-radius: 50%;
  z-index: 2000;
  text-align: center;
  cursor: pointer;
  order: 2;
}

.menu_icon {
  display: none;
  position: relative;
  margin: 25px 0 0 10px;
  order: 3;
}
.menu_icon,
.menu_icon::before,
.menu_icon::after {
  width: 40px;
  height: 2.5px;
  background-color: #1e1f26;
  display: inline-block;
}
.menu_icon::before,
.menu_icon::after {
  content: "";
  position: absolute;
  left: 0;
}
.menu_icon::before {
  top: -8px;
}
.menu_icon::after {
  top: 8px;
}

.nav_checkbox:checked + .nav_button .menu_icon {
  background-color: transparent;
}
.nav_checkbox:checked + .nav_button .menu_icon::before {
  top: 0;
  transform: rotate(135deg);
}
.nav_checkbox:checked + .nav_button .menu_icon::after {
  top: 0;
  transform: rotate(-135deg);
}

@media screen and (max-width: 760px) {
  nav {
    width: 0;
    visibility: hidden;
    transition: all 0.2s;
  }

  .nav_button,
  .menu_icon {
    display: block;
  }

  .nav_checkbox:checked ~ nav {
    width: 25vw;
    visibility: visible;
  }
}

@media screen and (max-width: 450px) {
  .menu_icon,
  .menu_icon::before,
  .menu_icon::after {
    width: 30px;
  }
  .nav_checkbox:checked ~ nav {
    width: 60vw;
    visibility: visible;
  }
}

/* Main elements */
header {
  font-size: 40pt;
  background-color: var(--bg);
  padding: var(--mid-spacing);
}

main {
  font-size: 1.3rem;
  border-radius: 20px;
  background-color: var(--bg);
  padding: var(--mid-spacing);
}

footer {
  font-size: small;
  background-color: var(--bg);
  padding: var(--mid-spacing);
}

h1 {
  font-size: 2.7rem;
  color: var(--text-accent);
  margin: var(--mid-spacing);
}

h2 {
  font-size: 2.2rem;
  color: var(--text-accent);
  margin: var(--small-spacing);
}

h3 {
  font-size: x-large;
  color: var(--text-accent);
  margin: var(--small-spacing);
}

a {
  color: var(--text-accent);
}

p {
  margin: var(--small-spacing);
}

main ul, main ol, main li {
  margin: var(--small-spacing);
}

main ol, main ul {
  padding-left: var(--mid-spacing);
}

hr {
  border-style: none;
  border-top: 2px solid var(--text-accent);
  margin: auto;
}

.horizontal-scroll {
  overflow-x: auto;
}

/*
Article anchoring
Usage:

  <h1 id="anchor-title">Heading</h3>
  <a href="#anchor-title">
    <span aria-hidden="true">#</span>
    <span class="article-anchor-hidden">Section titled Heading</span>
  </a>
*/
.article-anchor {
  display: grid;
  grid-template-columns: min-content auto;
  position: relative;
  margin-top: 2em;
  /* You could pull this property out and
  generalize it under the selector `[id]` as
  it won't affect flow layout or regular margins */
  scroll-margin-top: 2em;
}

.article-anchor:target::before {
  content: "Anchor link";
  position: absolute;
  font-size: 0.9rem;
  top: -1.25rem;
  left: 0;
  font-style: italic;
  color: currentColor;
}

.article-anchor a {
  grid-row-start: 1;
  align-self: start;
  font-size: 1rem;
  line-height: 1;
  /* We're using `transform` vs. margins */
  transform: translateX(-50%) translateY(25%);
  text-decoration: none;
  /* Be sure to check that your own colors still meet
  or exceed 4.5:1 contrast when using lowering opacity */
  opacity: 0.75;
}

.article-anchor a:hover {
  text-decoration: underline;
  text-underline-offset: 0.25em;
  opacity: 1;
}

.article-anchor a:focus {
  outline: 2px solid currentColor;
  outline-offset: 0.15em;
}

/* Visually hidden while remaining accessible to
assistive tech like screen readers */
.article-anchor-hidden {
  width: 0;
  height: 0;
  overflow: hidden;
  position: absolute;
}
