/* Nav */
.nav {
  position: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  top: 0;
  left: 0;
  user-select: none;
  -ms-user-select: none;
  -webkit-user-select: none;
  width: 100%;
  height: auto;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  z-index: 100;
  backdrop-filter: blur(0.75em);
  -webkit-backdrop-filter: blur(0.75em);
}

.nav.active {
  background-color: white;
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
}

@media (max-width: 768px) {
  .nav.active {
    background-color: var(--color-blue-400);
  }

  .nav.active svg {
    filter: invert(100%) sepia(24%) saturate(0%) hue-rotate(255deg) brightness(101%) contrast(104%);
  }
}

/* Nav container */
.nav__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: var(--nav-height);
  padding: 0 var(--space-lg);
  position: relative;
  z-index: 103;
  background-color: transparent;
}

/* Left logo */
.nav__logo {
  align-items: center;
  display: flex;
}

.nav__logo svg {
  display: flex;
  width: 100%;
  height: 100%;
}

.nav__logo a:hover {
  transform: scale(var(--transition-scale-up));
  transition: transform var(--transition-speed) var(--transition-curve);
}

/* Right toggle (burger) */
.nav__toggle {
  display: grid;
  font-size: var(--font-size-normal);
  width: 1.5rem;
  height: 1.25rem;
  position: relative;
  place-items: center;
  cursor: pointer;
  /* Reset native <button> styling */
  appearance: none;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
}

.nav__toggle::before,
.nav__toggle::after {
  position: absolute;
  content: "";
  width: 1.45em;
  height: 0.125em;
  background: var(--color-text);
  transition: transform var(--transition-speed) var(--transition-curve);
  will-change: transform;
  pointer-events: none;
  transform-origin: center;
}

/* Initial Burger state */
.nav__toggle::before {
  transform: translateY(-0.275em);
}

.nav__toggle::after {
  transform: translateY(0.275em);
}

/* Active "X" state for Toggle */
.nav__toggle.active {
  margin-top: var(--space-xs);
}
.nav__toggle.active::before {
  transform: translateY(0) rotate(45deg);
  background: var(--color-white);
}

.nav__toggle.active::after {
  transform: translateY(0) rotate(-45deg);
  background: var(--color-white);
}

@media (max-width: 768px) {
  .nav__toggle.active {
    margin-top: 0;
  }
}

/* Page Overlay */
.nav__overlay {
  display: none;
  position: fixed;
  inset: 0;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.25);
  z-index: 101;
}

.nav__overlay.active {
  display: block;
}

@media (max-width: 768px) {
  .nav__overlay.active {
    top: var(--nav-height);
  }
}

/* Menu (Dropdown) */
.nav__menu {
  position: absolute;
  top: var(--space-xs);
  right: calc(var(--space-sm) / 2);
  display: none;
  flex-direction: column;
  align-items: stretch;
  width: auto;
  max-width: 20rem;
  min-width: 20rem;
  gap: var(--space-xs);
  padding: var(--space-sm);
  background-color: #272e38;
  z-index: 102;
  border-radius: var(--border-radius-lg);
  /* box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); */
  overflow: hidden;
}

@media (max-width: 768px) {
  .nav__menu {
    top: var(--nav-height);
    right: 0px;
    left: 0px;
    max-width: 100%;
    border-radius: 0px 0px var(--border-radius-lg) var(--border-radius-lg);
  }
}

.nav__menu.active {
  display: flex;
}

.nav__menu-container {
  padding-inline: var(--space-xs);
  display: flex;
  align-items: start;
  flex-direction: column;
  justify-content: space-between;
}

.nav__title p {
  margin: 0;
  color: var(--color-white);
  font-weight: 700;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
@media (max-width: 768px) {
  .nav__title {
    padding-left: var(--space-xxs);
  }
}

/* Links within the Menu */
.nav__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-top: var(--space-md);
  padding-inline: var(--space-xxs);
}

.nav__link {
  display: block;
  white-space: nowrap;
  color: white;
  text-decoration: none;
  font-size: var(--font-h3);
  line-height: 1;
}

.nav__link:hover,
.nav__link:focus {
  text-decoration: underline;
}
