:root {
  --cf-nav-radius: 28px;
}

.nav {
  position: fixed;
  z-index: 1000;
  inset: 14px auto auto 50%;
  width: min(1240px, calc(100% - 36px));
  height: 76px;
  margin: 0;
  border: 1px solid color-mix(in srgb, #b39aff 24%, var(--line));
  border-radius: var(--cf-nav-radius);
  overflow: visible;
  background: color-mix(in srgb, var(--bg) 48%, transparent);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  box-shadow: 0 14px 48px #00000018, inset 0 1px 0 #ffffff16, 0 0 0 1px #ffffff03;
  transform: translateX(-50%);
  transition: width .42s cubic-bezier(.2, .75, .25, 1), height .35s ease, top .35s ease,
    transform .48s cubic-bezier(.2, .8, .2, 1), background .32s ease, border-color .32s ease,
    box-shadow .32s ease;
  isolation: isolate;
  will-change: transform;
}

.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: linear-gradient(115deg, #c6b6ff66, #ffffff08 34%, #8f79ff22 70%, #ffffff1b);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: -1;
}

.nav .container.nav-inner {
  width: 100%;
  max-width: none;
  height: 100%;
  padding-inline: clamp(16px, 2.2vw, 28px);
  gap: clamp(12px, 2vw, 26px);
}

.nav .brand {
  flex: 0 0 auto;
  gap: 9px;
  font-size: 19px;
  letter-spacing: -.055em;
  transition: opacity .25s ease, transform .3s ease;
}

.nav .brand:hover {
  opacity: .9;
  transform: translateY(-1px);
}

.nav .brand-logo {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 3px 10px #8d6aff30);
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(15px, 2.1vw, 29px);
  min-width: 0;
  font-size: 13px;
  font-weight: 560;
  letter-spacing: -.01em;
}

.nav-links a {
  position: relative;
  z-index: 0;
  padding: 10px 2px;
  white-space: nowrap;
  color: color-mix(in srgb, var(--text) 68%, var(--muted));
  transition: color .24s ease, transform .24s ease;
}

.nav-links a::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 1px -11px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  opacity: 0;
  transform: scale(.88);
  transition: opacity .25s ease, transform .25s ease, background .25s ease, border-color .25s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 80%;
  bottom: 3px;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, #a58aff, #70c5ff);
  box-shadow: 0 0 12px #9b7bff66;
  transition: left .28s cubic-bezier(.2, .75, .25, 1), right .28s cubic-bezier(.2, .75, .25, 1);
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.active,
.nav-links a[aria-current="page"] {
  color: var(--text);
}

.nav-links a:hover {
  transform: translateY(-1px);
}

.nav-links a:hover::before,
.nav-links a:focus-visible::before,
.nav-links a.active::before,
.nav-links a[aria-current="page"]::before {
  opacity: 1;
  transform: scale(1);
  background: color-mix(in srgb, #9270ff 10%, var(--surface));
  border-color: color-mix(in srgb, #a58aff 22%, transparent);
}

.nav-links a:hover::after,
.nav-links a.active::after,
.nav-links a[aria-current="page"]::after {
  left: 22%;
  right: 22%;
}

.nav-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
}

.nav .btn {
  position: relative;
  min-height: 43px;
  padding: 0 17px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, #b6a1ff 25%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 96%, #bbaaff), color-mix(in srgb, var(--accent) 86%, #7e66dc));
  box-shadow: 0 5px 18px #0000000d, inset 0 1px 0 #ffffff38;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  transition: transform .28s cubic-bezier(.2, .75, .25, 1), box-shadow .28s ease, filter .28s ease;
}

.nav .btn::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border-top: 1px solid #ffffff38;
  pointer-events: none;
}

.nav .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 9px 25px color-mix(in srgb, #8e6cff 23%, transparent), inset 0 1px 0 #ffffff55;
  filter: saturate(1.08);
}

.nav .theme-toggle,
.nav .menu-toggle {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  padding: 0;
  flex: 0 0 43px;
  border: 1px solid color-mix(in srgb, #b39aff 30%, var(--line));
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 48%, transparent);
  color: var(--text);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 #ffffff16, 0 4px 15px #0000000a;
  transition: transform .28s cubic-bezier(.2, .75, .25, 1), background .28s ease, border-color .28s ease, box-shadow .28s ease;
}

.nav .theme-toggle {
  font-size: 18px;
  line-height: 1;
}

.nav .theme-toggle:hover,
.nav .menu-toggle:hover {
  transform: translateY(-2px) rotate(5deg);
  border-color: color-mix(in srgb, #a58aff 68%, var(--line));
  background: color-mix(in srgb, #8d6aff 14%, var(--surface));
  box-shadow: 0 7px 23px #8a5cff20, inset 0 1px 0 #ffffff25;
}

.nav .menu-toggle {
  display: none;
}

.nav .menu-glyph {
  width: 18px;
  height: 14px;
}

.nav .menu-glyph i {
  width: 16px;
  height: 1.6px;
}

.wf-page .nav {
  background: color-mix(in srgb, var(--bg) 48%, transparent);
}

.nav.nav-scrolled,
.wf-page .nav.nav-scrolled {
  top: 10px;
  width: min(1160px, calc(100% - 44px));
  height: 70px;
  background: color-mix(in srgb, var(--bg) 38%, transparent);
  border-color: color-mix(in srgb, #a58aff 34%, var(--line));
  box-shadow: 0 17px 52px #00000020, inset 0 1px 0 #ffffff1c, 0 0 30px #8e6cff08;
}

.nav.nav-hidden {
  transform: translate(-50%, calc(-100% - 26px));
}

.mobile-menu {
  display: none;
  position: fixed;
  z-index: 999;
  top: 99px;
  left: 50%;
  right: auto;
  width: min(1240px, calc(100% - 36px));
  max-height: min(72vh, 560px);
  overflow: auto;
  padding: 12px;
  border: 1px solid color-mix(in srgb, #b39aff 28%, var(--line));
  border-radius: 27px;
  background: color-mix(in srgb, var(--bg) 52%, transparent);
  -webkit-backdrop-filter: blur(32px) saturate(185%);
  backdrop-filter: blur(32px) saturate(185%);
  box-shadow: 0 28px 90px #0000002b, inset 0 1px 0 #ffffff18;
  transform: translateX(-50%);
  transform-origin: top center;
}

.mobile-menu.open {
  display: grid;
  gap: 5px;
  animation: cf-nav-menu-in .32s cubic-bezier(.2, .85, .2, 1) both;
}

@keyframes cf-nav-menu-in {
  from {
    opacity: 0;
    transform: translate(-50%, -9px) scale(.975);
    filter: blur(5px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
    filter: blur(0);
  }
}

.mobile-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 49px;
  padding: 13px 16px;
  border: 1px solid transparent;
  border-radius: 17px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: color .22s ease, background .22s ease, border-color .22s ease, transform .22s ease;
}

.mobile-menu a::after {
  content: "↗";
  color: #b4a0ff;
  opacity: 0;
  transform: translate(-4px, 2px);
  transition: opacity .2s ease, transform .2s ease;
}

.mobile-menu a:hover,
.mobile-menu a:focus-visible,
.mobile-menu a[aria-current="page"] {
  color: var(--text);
  background: color-mix(in srgb, #8e6cff 13%, var(--surface));
  border-color: color-mix(in srgb, #a58aff 26%, transparent);
  transform: translateX(2px);
}

.mobile-menu a:hover::after,
.mobile-menu a:focus-visible::after,
.mobile-menu a[aria-current="page"]::after {
  opacity: 1;
  transform: none;
}

html[data-theme="light"] .nav,
html[data-theme="light"] .wf-page .nav {
  background: color-mix(in srgb, #ffffff 63%, transparent);
  box-shadow: 0 14px 45px #25213b0e, inset 0 1px 0 #ffffffc9;
}

html[data-theme="light"] .nav.nav-scrolled,
html[data-theme="light"] .wf-page .nav.nav-scrolled {
  background: color-mix(in srgb, #ffffff 57%, transparent);
}

html[data-theme="light"] .mobile-menu {
  background: color-mix(in srgb, #ffffff 68%, transparent);
  box-shadow: 0 28px 90px #25213b20, inset 0 1px 0 #ffffffd9;
}

html[data-theme="light"] .nav .btn {
  background: linear-gradient(135deg, #17151f, #302644);
  color: #fff;
}

@media (max-width: 1020px) {
  .nav-links {
    gap: 13px;
    font-size: 12px;
  }

  .nav .brand {
    font-size: 17px;
  }

  .nav .brand-logo {
    width: 29px;
    height: 29px;
  }

  .nav .btn {
    padding-inline: 13px;
  }
}

@media (max-width: 900px) {
  .nav {
    height: 68px;
    border-radius: 24px;
    width: calc(100% - 28px);
    top: 10px;
  }

  .nav.nav-scrolled {
    height: 64px;
    width: calc(100% - 36px);
    top: 7px;
  }

  .nav .container.nav-inner {
    padding-inline: 14px;
  }

  .nav-links,
  .nav-actions>.btn {
    display: none;
  }

  .nav .menu-toggle {
    display: grid;
  }

  .nav .theme-toggle,
  .nav .menu-toggle {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .nav-actions {
    gap: 7px;
  }

  .mobile-menu {
    top: 87px;
    width: calc(100% - 28px);
    border-radius: 24px;
  }

  .nav.nav-scrolled+.mobile-menu {
    top: 82px;
  }
}

@media (max-width: 420px) {
  .nav {
    width: calc(100% - 20px);
  }

  .nav .container.nav-inner {
    padding-inline: 11px;
  }

  .nav .brand {
    gap: 7px;
    font-size: 16px;
  }

  .nav .brand-logo {
    width: 27px;
    height: 27px;
  }

  .nav .theme-toggle,
  .nav .menu-toggle {
    width: 37px;
    height: 37px;
    flex-basis: 37px;
  }

  .mobile-menu {
    width: calc(100% - 20px);
    top: 83px;
  }
}

@media (prefers-reduced-motion: reduce) {

  .nav,
  .nav *,
  .mobile-menu,
  .mobile-menu * {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }

  .nav.nav-hidden {
    transform: translateX(-50%);
  }
}

.nav,
.wf-page .nav {
  inset: 14px auto auto 50%;
  left: 50%;
  right: auto;
  width: min(1240px, calc(100% - 36px));
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  transform: translateX(-50%);
  padding: 0;
  overflow: visible;
}

.nav .container.nav-inner,
.wf-page .nav .container.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  max-width: none;
  gap: clamp(8px, 1.4vw, 22px);
}

.nav .brand {
  min-width: 0;
  flex-shrink: 0;
}

.nav .brand-name {
  white-space: nowrap;
}

.nav-links {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: center;
  gap: clamp(10px, 1.55vw, 24px);
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 10px;
  border-radius: 999px;
  white-space: nowrap;
  transform: none;
}

.nav-links a::before {
  inset: 0;
  border-radius: inherit;
  background: color-mix(in srgb, #9b7bff 12%, transparent);
  border-color: color-mix(in srgb, #b8a5ff 19%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.active,
.nav-links a[aria-current="page"] {
  transform: none;
}

.nav-links a:hover::before,
.nav-links a:focus-visible::before,
.nav-links a.active::before,
.nav-links a[aria-current="page"]::before {
  opacity: 1;
  transform: scale(1);
  background: color-mix(in srgb, #9b7bff 16%, transparent);
  border-color: color-mix(in srgb, #b8a5ff 30%, transparent);
  box-shadow: inset 0 1px 0 #ffffff1a, 0 4px 18px #8f70ff12;
}

.nav-links a::after,
.wf-page .nav-links a::after {
  display: block;
  left: 32%;
  right: 68%;
  bottom: 3px;
  height: 2px;
  border-radius: 999px;
  transition: left .28s cubic-bezier(.2, .75, .25, 1), right .28s cubic-bezier(.2, .75, .25, 1), opacity .25s ease;
  opacity: .75;
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after,
.nav-links a.active::after,
.nav-links a[aria-current="page"]::after {
  left: 32%;
  right: 32%;
}

.nav .nav-actions {
  flex: 0 0 auto;
}

.nav .btn,
.nav .theme-toggle,
.nav .menu-toggle {
  transform: none !important;
}

.nav .btn:hover {
  transform: translateY(-1px) !important;
}

.nav .theme-toggle:hover,
.nav .menu-toggle:hover {
  transform: translateY(-1px) !important;
}

.nav.nav-hidden,
.wf-page .nav.nav-hidden {
  transform: translate(-50%, calc(-100% - 26px));
}

.nav.nav-scrolled,
.wf-page .nav.nav-scrolled {
  transform: translateX(-50%);
}

.mobile-menu,
.wf-page .mobile-menu {
  left: 50%;
  right: auto;
  width: min(1240px, calc(100% - 36px));
  max-width: calc(100vw - 24px);
  transform: translateX(-50%);
  border-radius: 27px;
  overflow: auto;
}

@media (max-width: 1080px) {
  .nav .container.nav-inner {
    gap: 10px;
    padding-inline: 17px;
  }

  .nav-links {
    gap: 8px;
  }

  .nav-links a {
    padding-inline: 8px;
    font-size: 12px;
  }

  .nav .brand {
    font-size: 17px;
  }

  .nav .brand-logo {
    width: 29px;
    height: 29px;
  }

  .nav .btn {
    padding-inline: 12px;
    font-size: 11px;
  }
}

@media (max-width: 940px) {

  .nav,
  .wf-page .nav {
    top: 10px;
    width: calc(100% - 28px);
    height: 68px;
    border-radius: 24px;
  }

  .nav.nav-scrolled,
  .wf-page .nav.nav-scrolled {
    top: 7px;
    width: calc(100% - 36px);
    height: 64px;
  }

  .nav .nav-links,
  .nav .nav-actions>.btn {
    display: none;
  }

  .nav .menu-toggle {
    display: grid;
  }

  .nav .container.nav-inner {
    padding-inline: 15px;
  }

  .nav .theme-toggle,
  .nav .menu-toggle {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .mobile-menu,
  .wf-page .mobile-menu {
    top: 88px;
    width: calc(100% - 28px);
    border-radius: 24px;
  }

  .nav.nav-scrolled+.mobile-menu {
    top: 82px;
  }
}

@media (max-width: 420px) {

  .nav,
  .wf-page .nav {
    width: calc(100% - 18px);
  }

  .nav .container.nav-inner {
    padding-inline: 11px;
  }

  .nav .brand {
    gap: 6px;
    font-size: 15px;
  }

  .nav .brand-logo {
    width: 26px;
    height: 26px;
  }

  .nav .theme-toggle,
  .nav .menu-toggle {
    width: 37px;
    height: 37px;
    flex-basis: 37px;
  }

  .mobile-menu,
  .wf-page .mobile-menu {
    width: calc(100% - 18px);
  }
}

@media (prefers-reduced-motion: reduce) {

  .nav,
  .nav *,
  .mobile-menu,
  .mobile-menu * {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }

  .nav.nav-hidden,
  .wf-page .nav.nav-hidden {
    transform: translateX(-50%);
  }
}

.nav.nav-scrolled.nav-hidden,
.wf-page .nav.nav-scrolled.nav-hidden {
  transform: translate(-50%, calc(-100% - 26px));
}
