body#index nav, body#index nav a {
  --tonic-primary: rgba(255, 255, 255, 1);
  color: var(--tonic-primary);
}

body > nav {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  height: 75px;
  font: 15px var(--tonic-monospace);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  transition: background 0.2s ease;
  overflow: hidden;
}

body > nav .background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--tonic-window);
  /* background: rgba(255, 255, 255, 1);*/
}

body#index > nav .background {
  background: rgba(14, 85, 152, 1);
}

@media (prefers-color-scheme: dark) {
  body#index nav img {
    filter: invert(1);
  }
}

body > nav a {
  -webkit-user-drag: none;
  transition: border-bottom .2s ease;
  border-bottom: 2px solid transparent;
  height: 20px;
}

body > nav a.with-hover:hover {
  border-bottom: 2px solid var(--tonic-primary);
}

body > nav a.logo {
  width: auto;
  display: block;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  transition: all 0.2s ease;
  text-align: center;
  margin: auto;
  padding-top: 14px;
}

body > nav a.logo img {
  width: 120px;
}

body#index > nav a.logo img {
  filter: invert(1);
}

@media (prefers-color-scheme: dark) {
  body:not(#index) nav img {
    filter: invert(1);
  }
}

body > nav.scrolling a.logo img {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.2s ease;
}

body > nav.scrolling a.logo:hover img {
  opacity: 0;
  transform: translateY(-50px);
}

body > nav a.logo .hover {
  opacity: 0;
  padding: 0px;
  line-height: 24px;
  text-align: center;
  transform: translateY(0px);
  transition: all 0.2s ease;
  font-family: var(--tonic-monospace);
}

body > nav.scrolling a.logo:hover .hover {
  opacity: 1;
  transform: translateY(-50px);
}

body > nav .links-left,
body > nav .links-right {
  position: absolute;
  top: 30px;
  display: grid;
  grid-template-columns: auto auto auto auto;
  gap: 20px;
  text-transform: uppercase;
}

body > nav .links-left {
  left: 20px;
}

body > nav .links-right {
  right: 20px;
}

body > nav .menu {
  display: none;
  width: 30px;
  height: 24px;
  position: absolute;
  top: 26px;
  right: 20px;
  cursor: pointer;
}

@media (max-width: 699px) {
  body.api > nav .background {
    opacity: 1;
  }

  body > nav .links-left,
  body > nav .links-right {
    display: none;
  }

  body main, #split-main {
    top: 0;
  }

  tonic-split-right {
    width: 100% !important;
  }

  .tonic--split-handle {
    display: none !important;
  }

  tonic-split-left {
    transform: translateX(-100%);
  }

  body > nav {
    padding-top: 0px;
  }

  body.api > nav .menu {
    display: block;
    position: absolute;
  }

  body > nav .menu {
    border-top: 2px solid;
    border-bottom: 2px solid;
  }

  body > nav .menu:after {
    position: absolute;
    content: ' ';
    top: 50%;
    border-top: 2px solid;
    left: 0;
    right: 0;
    margin-top: -1px;
  }

  tonic-split-left {
    width: 100% !important;
    transform: translate(-100%);
    transition: transform .2s ease;
  }

  tonic-split-right {
    transform: translate(0%);
    transition: transform .2s ease;
  }

  body[toc] tonic-split-right {
    transform: translate(100%);
  }

  body[toc] tonic-split-left {
    transform: translate(0%);
  }

  body#guides a:not(:first-of-type, .cyoa) {
    display: none;
  }
}
