
header {
  white-space: nowrap;
  position: relative;
  z-index: 10001;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  transition: all 300ms;
  max-height: $topbar-height;
  line-height: $topbar-height;
  overflow: hidden;
  user-select: none;

  .bg {
    position: absolute;
    z-index: -1;
    width: 100%;
    height: 100%;
    background: $black;
  }
  .logo {
    color: $white !important;
    float: left;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
  }
  .menu-toggle {
    font-size: 24px;
    color: $white;
    float: right;
    cursor: pointer;
    display: none;
  }

  .links {
    float: right;

    a {
      line-height: 58px;
      color: $white-40;
      text-transform: uppercase;
      margin-left: 40px;
      border-style: solid;
      border-width: 3px 0 0 0;
      border-color: transparent;
    }
    a.external {
      margin-left: 8px;
    }
    a:hover {
      border-color: $white-40;
    }
    a.external:hover {
      border-color: transparent;
      color: $white;
    }
    a.active {
      color: $white;
      border-color: $primary;
    }
    .icon {
      line-height: 0;
      margin-left: 4px;
    }
  }
}


.site-links {
  position: fixed;
  padding-left: 24px;
  padding-right: 40px;
  margin-left: -24px;
  transition: all 300ms;
  max-height: $topbar-height;
  overflow: hidden;

  &:after {
    content: '▾';
    display: block;
    position: absolute;
    top: 0;
    right: 12px;
    color: $black-40;
  }

  .site-link {
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    width: 100%;

    a {
      width: 100%;
      color: $white;
    }

    &:nth-child(n+2) {
      opacity: 0.5;
    }
    &:hover {
      opacity: 1 !important;
    }
  }

  &:hover {
    background: $black;
    max-height: $topbar-height * 5;
  }
}


@media screen and (max-width: 768px) {

  header {
    .menu-toggle {
      display: block;
    }
    .links {
      display: none;
      margin-right: 40px;
      a {
        display: block;
        line-height: $topbar-height;
        border-width: 0;
        border-style: none;
      }
    }
  }
  header.open {
    max-height: 320px;
    .bg {
      opacity: 1 !important;
    }
    .links {
      display: block;
      padding-top: $topbar-height / 8;
      padding-bottom: $topbar-height / 4;

      a {
        line-height: $topbar-height * 3 / 4;
      }
    }
  }

}
