nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  margin-bottom: 1rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  position: relative;
  padding: 0 3rem;
}

.nav-brand {
  grid-column: 2;
  justify-self: center;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.menu-button {
  position: absolute;
  right: 0;
  top: 0.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-shrink: 0;
  gap: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.menu-button span[aria-hidden="true"] {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  border-radius: 1px;
}

#nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
}

#nav-links a {
  color: inherit;
}

@media (max-width: 1349px) {
  #nav-links {
    display: none;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    margin-top: 1rem;
    padding: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
  }

  #menu-checkbox:checked ~ #nav-links {
    display: flex;
  }
}

@media (min-width: 1350px) {
  nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }

  .nav-top {
    display: contents;
  }

  .menu-button {
    display: none;
  }

  #nav-links {
    grid-column: 3;
    justify-self: end;
    flex-direction: row;
    justify-content: flex-end;
  }
}
