/* Capsule nav + gooey dropdown. Metrics from template-spec/01-nav.md. */

.nav-fixed {
  position: fixed;
  top: 30px;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  transform: translateY(-85px);
  pointer-events: none;
}

.nav-goo-svg {
  position: absolute;
  width: 0;
  height: 0;
}

.nav-root {
  --nav-ball: 30px;
  --nav-collapsed-margin: -31px;
  --nav-columns: 3;
  --nav-item-width: 98px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: url(#goo-nav);
  pointer-events: auto;
}

.nav-capsule {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  height: 51px;
  padding: 16px;
  gap: 52px;
  background: #fff;
  border-radius: 12px;
  color: #000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-logo {
  font-size: 20px;
  line-height: 19px;
  font-weight: 600;
  letter-spacing: normal;
  color: #000;
  white-space: nowrap;
  cursor: pointer;
}

.nav-burger {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50px;
  background: transparent;
}

.burger-icon {
  position: relative;
  width: 16px;
  height: 16px;
}

.burger-icon i {
  position: absolute;
  left: 0;
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 12px;
  background: #000;
}

.burger-icon i:first-child {
  top: 5px;
}

.burger-icon i:last-child {
  top: 9px;
}

.nav-panel {
  position: absolute;
  top: 100%;
  left: 50%;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: var(--nav-ball);
  height: var(--nav-ball);
  margin-top: var(--nav-collapsed-margin);
  padding: 4px;
  gap: 4px;
  overflow: hidden;
  background: #fff;
  border-radius: 50px;
  pointer-events: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: translateX(-50%);
}

.nav-root.is-open .nav-panel {
  pointer-events: auto;
}

.nav-items {
  display: grid;
  grid-template-columns: repeat(var(--nav-columns), var(--nav-item-width));
  gap: 4px;
  width: max-content;
  opacity: 0;
}

.nav-item {
  display: block;
  width: var(--nav-item-width);
  height: 42px;
  text-decoration: none;
}

.nav-item-fade {
  display: block;
  width: 100%;
  height: 100%;
}

.nav-item-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 16px;
  line-height: 15.2px;
  font-weight: 500;
  color: #000;
  white-space: nowrap;
  transition: background 0.4s cubic-bezier(0.44, 0, 0.56, 1);
}

.nav-item-visual:hover,
.nav-item:focus-visible .nav-item-visual {
  background: rgba(0, 0, 0, 0.1);
}

.nav-langs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 42px;
  opacity: 0;
  font-size: 16px;
  line-height: 15.2px;
  font-weight: 500;
}

.nav-lang {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 8px;
  border-radius: 8px;
  color: rgba(0, 0, 0, 0.4);
  transition: background 0.4s cubic-bezier(0.44, 0, 0.56, 1);
}

.nav-lang.is-current {
  color: #000;
}

.nav-lang:hover,
.nav-lang:focus-visible {
  background: rgba(0, 0, 0, 0.1);
}

.nav-lang-sep {
  width: 1px;
  height: 10px;
  background: rgba(0, 0, 0, 0.2);
}

@media (max-width: 809.98px) {
  .nav-fixed {
    top: 16px;
  }

  .nav-root {
    --nav-ball: 8px;
    --nav-collapsed-margin: -11px;
  }

  .nav-burger {
    width: 40px;
    height: 40px;
    margin: -5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-fixed {
    transform: none;
  }
}

@supports (-webkit-touch-callout: none) {
  .nav-root {
    filter: none;
  }
}
