.site-masthead {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
}

.header-size {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 3rem);
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 1.5rem;
  padding-bottom: 1rem;
}

/* Logo */

.header-logo {
  display: flex;
  align-items: center;
}

.header-logo a {
  display: flex;
  align-items: center;
}

.masthead-logo {
  display: block;
  width: 12.6rem;
  max-width: 45vw;
  height: auto;
  flex-shrink: 0;
}

/* Main navigation */

.header-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.5rem;
}

.header-size a {
  color: var(--misc-dark);
  text-decoration: none;
  transition: color 300ms ease;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-right: 0.5rem;
}

.nav-links a:hover,
.nav-links a.active {
  text-decoration: underline;
  text-underline-offset: 7px;
  text-decoration-thickness: 3px;
  text-decoration-color: var(--primary);
}

.header-size a:focus-visible,
.hamburger:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 4px;
}

/* Search */

.search-container {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 15rem;
  height: 2.5rem;
  padding-right: 0.75rem;
  padding-left: 0.75rem;
  border: 1px solid var(--neutral-n75);
  border-radius: 4rem;
}

.site-search {
  display: flex;
  align-items: center;
  gap: 0.38rem;
}

.search-bar {
  border: none;
  outline: none;
  background-color: transparent;
  padding-top: 5px;
  padding-left: 0.25rem;
}

input::placeholder {
  color: var(--misc-dark);
  font-size: 1rem;
  font-style: normal;
  line-height: 1.3rem;
}

input:focus::placeholder {
  color: transparent;
}

/* Get started button */

.header-button {
  box-sizing: border-box;
  display: flex;
  width: 8.8rem;
  height: 2.5rem;
  padding: 1px;
  border-radius: 8rem;
  background-image: var(--gradient-brand);
  color: var(--primary-p400);
  text-decoration: none;
}

.header-button svg path {
  transition: stroke 0.5s ease;
}

.header-button:hover {
  color: #fff;
}

.header-button:hover svg path {
  stroke: #fff;
}

.get-started {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 5px;
  margin: 1px;
  padding: 0.5rem 0.4rem 0.5rem 0.75rem;
  border-radius: 4rem;
  background: #fff;
  color: var(--primary-p400);
  line-height: 1;
  transition: background 0.5s ease;
}

.header-button:hover .get-started {
  background: var(--primary-p400);
  color: #fff;
}

/* Mobile menu control */

.nav-mobile {
  display: none;
  align-items: center;
  gap: 0.7rem;
}

.menu-label {
  margin: 0;
}

.hamburger {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--misc-dark);
  cursor: pointer;
}

.bar {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px auto;
  border-radius: 25px;
  background-color: currentColor;
  transition:
    transform 0.3s ease-in-out,
    opacity 0.3s ease-in-out;
}

/* Mobile navigation */

@media (max-width: 1080px) {
  .header-size {
    width: calc(100% - 2rem);
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .header-nav {
    position: absolute;
    top: 100%;
    left: 0;
    box-sizing: border-box;
    flex-direction: column;
    width: 100%;
    max-height: 0;
    gap: 0;
    overflow: hidden;
    background-color: #fff;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    box-shadow: 0 8px 12px rgb(0 0 0 / 8%);
    transition:
      max-height 0.3s ease,
      opacity 0.2s ease,
      visibility 0s linear 0.3s;
  }

  .header-nav.active {
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition:
      max-height 0.3s ease,
      opacity 0.2s ease,
      visibility 0s;
  }

  .nav-mobile {
    display: flex;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0;
    margin: 0.5rem 0 0;
    padding-top: 0.5rem;
    border-top: 1px solid var(--neutral-n75);
  }

  .nav-links a {
    box-sizing: border-box;
    display: block;
    width: 100%;
    margin: 0;
    padding: 0.75rem 1.5rem 1rem;
    border-bottom: 1px solid var(--neutral-n75);
    text-decoration: none !important;
  }

  .dropdown {
    width: 100%;
  }

  .search-container {
    width: calc(100% - 3rem);
    height: 2.5rem;
    margin: 0.5rem 1.5rem;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }

  .header-button {
    align-items: center;
    width: 100%;
    margin: 0.5rem 0;
    padding: 1.5rem 0;
    border-radius: 0;
  }

  .get-started {
    flex-direction: column;
    align-items: flex-start;
    margin: 0.5rem;
    background: none;
    color: #fff;
  }

  .get-started svg {
    display: none;
  }

  .hamburger.active .bar:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .header-nav,
  .bar {
    transition: none;
  }
}