.top-nav {
  position: relative;
  z-index: 40;
  background: rgba(7, 12, 29, 0.98);
  border-bottom: 1px solid rgba(111, 155, 255, 0.14);
}

header.site {
  position: relative;
}

.brand-home-link {
  position: static;
  display: inline-flex;
  width: fit-content;
  max-width: max-content;
  flex: 0 0 auto;
  align-self: center;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
  border-radius: 18px;
}

.brand-home-link:focus-visible {
  outline: 3px solid rgba(123, 249, 200, .8);
  outline-offset: 8px;
}

.brand-home-link .brand {
  transition: transform .18s ease, filter .18s ease;
}

.brand-home-link:hover .brand {
  transform: translateY(-2px);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .22));
}

.site-us-flag {
  position: absolute;
  top: 50%;
  right: clamp(28px, 7vw, 120px);
  transform: translateY(-50%);
  display: block;
  width: clamp(112px, 10vw, 170px);
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: none;
  pointer-events: none;
  user-select: none;
}

.nav-shell {
  width: min(100% - 24px, 1100px);
  min-height: 66px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(.2rem, 1.5vw, 1rem);
}

.top-nav .nav-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .65rem clamp(.65rem, 1.7vw, 1rem);
  border: 1px solid transparent;
  border-radius: 999px;
  color: #d9e3ff;
  background: transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.nav-primary small {
  padding: .16rem .34rem;
  border-radius: 999px;
  background: rgba(123, 249, 200, .13);
  color: #7bf9c8;
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .05em;
}

.top-nav .nav-link:hover,
.top-nav .nav-link:focus-visible {
  color: #fff;
  background: rgba(79, 140, 255, .12);
  border-color: rgba(111, 155, 255, .26);
  outline: none;
}

.top-nav .nav-link.is-active {
  color: #07121f;
  background: #7bf9c8;
  border-color: #7bf9c8;
  box-shadow: 0 0 18px rgba(123, 249, 200, .28);
}

.top-nav .nav-link.is-active small {
  color: #07121f;
  background: rgba(7, 18, 31, .12);
}

.more-tools {
  position: relative;
}

.more-tools-button span {
  margin-left: .35rem;
  transition: transform .18s ease;
}

.more-tools.is-open .more-tools-button span {
  transform: rotate(180deg);
}

.more-tools-menu {
  position: absolute;
  top: calc(100% + .55rem);
  right: 0;
  width: min(310px, calc(100vw - 24px));
  padding: .65rem;
  background: #111a35;
  border: 1px solid rgba(111, 155, 255, .28);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .48);
}

.more-tools-menu[hidden] {
  display: none;
}

.menu-label {
  margin: .25rem .65rem .45rem;
  color: #8f9abc;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.menu-item {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem .75rem;
  color: #edf2ff;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 650;
}

.menu-item[href]:hover,
.menu-item[href]:focus-visible {
  background: rgba(79, 140, 255, .14);
  outline: none;
}

.menu-coming {
  color: #aeb7d4;
  cursor: default;
}

.menu-coming small {
  color: #7bf9c8;
  font-size: .72rem;
  font-weight: 800;
}

.menu-divider {
  height: 1px;
  margin: .45rem .35rem;
  background: rgba(111, 155, 255, .18);
}

.home-return {
  display: none !important;
}

@media (max-width: 900px) {
  .site-us-flag {
    right: 22px;
    width: clamp(92px, 13vw, 128px);
  }
}

@media (max-width: 640px) {
  .brand-home-link {
    display: inline-flex;
    width: fit-content;
    max-width: max-content;
    align-self: center;
  }

  .site-us-flag {
    position: absolute;
    top: 39%;
    right: 12px;
    transform: translateY(-50%);
    width: clamp(48px, 15vw, 68px);
    box-shadow: none;
    pointer-events: none;
  }

  .nav-shell {
    min-height: 58px;
    width: 100%;
    padding: 0 4px;
    justify-content: space-between;
    gap: 0;
  }

  .top-nav .nav-link {
    min-height: 44px;
    padding: .56rem .45rem;
    font-size: clamp(.74rem, 3.25vw, .9rem);
  }

  .nav-primary small {
    display: none;
  }

  .more-tools-button span {
    display: none;
  }

  .more-tools-menu {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    max-height: min(72vh, 560px);
    overflow-y: auto;
    padding: .8rem;
    border-radius: 20px;
  }
}

@media (max-width: 390px) {
  .top-nav .nav-link {
    padding-inline: .34rem;
    font-size: .72rem;
  }

  .site-us-flag {
    width: 48px;
  }
}
