.header {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: transparent;
  backdrop-filter: blur(5px);
  color: var(--clr-dark);
  padding: 0.9em;
  border-radius: 8px;
  margin-top: 2em;
  display: flex;
  justify-content: flex-end;
  flex-direction: column;
  align-items: flex-end;
  box-shadow: 0px 0.1px 10px hsl(0, 20%, 60%);
}

/* Hamburger */
.hamburger {
  position: relative;
  width: 30px;
  height: 20px;
  cursor: pointer;
}

.hamburger > span {
  position: absolute;
  top: 50%;
  width: 100%;
  height: 3px;
  background-color: var(--clr-white-400);
  border-radius: 2px;
  transform: translateY(-50%);
  transition: all 0.3s ease-out;
}

.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 3px;
  background-color: var(--clr-white-400);
  border-radius: 2px;
  transition: all 0.3s ease-out;
}

.hamburger::before {
  top: 0;
}
.hamburger::after {
  bottom: 0;
}

.hamburger.active > span {
  display: none;
}
.hamburger.active::before {
  top: 50%;
  transform: rotate(45deg) translateY(-50%);
}
.hamburger.active::after {
  bottom: 50%;
  transform: rotate(-45deg) translateY(50%);
}

/* Navigation */
.nav {
  max-height: 0;
  text-align: center;
  overflow: hidden;
  visibility: hidden;
  transition: max-height 0.3s ease;
  width: 100%;
}
.nav.active {
  visibility: visible;
}

.nav__ul {
  margin: 1em 0;
  display: flex;
  list-style: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.nav__list {
  text-align: center;
  width: 100%;
}
.nav__link {
  display: inline-block;
  cursor: pointer;
  color: var(--clr-white-400);
  font: inherit;
  width: 100%;
  padding: 1em;
  text-decoration: none;
  transition: background-color 0.3s ease-out;
}
.nav__link:focus {
  background-color: var(--clr-white-400);
  border-radius: 4px;
}

@media (min-width: 768px) {
  .hamburger {
    display: none;
  }
  .header {
    flex-direction: row;
    justify-content: flex-end;
    padding: 1em 2em;
  }
  .nav {
    all: unset;
  }
  .nav__ul {
    margin: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    list-style: none;
    gap: 2em;
  }
  .nav__list {
    all: unset;
  }
  .nav__link {
    all: unset;
    width: auto;
    white-space: nowrap;
    font: inherit;
    cursor: pointer;
    color: var(--clr-white-400);
  }
  .nav__link::after {
    content: "";
    display: block;
    height: 2px;
    background-color: var(--clr-white-400);
    width: 0;
    border-radius: 2px;
    transition: width 0.2s ease-in;
  }
  .nav__link:focus {
    background-color: transparent;
  }

  .nav__link:hover::after,
  .nav__link:focus::after {
    width: 100%;
  }
}
