@font-face {
  font-family: "HelveticaNeueBd";
  src: url("/assets/fonts/HelveticaNeueLTStd-Bd.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

#nav {
  justify-content: flex-start;
}

#desktop-nav-links {
  display: inline-flex;
  align-items: center;
  gap: 0;
  position: relative;
  z-index: 40;
}

.desktop-nav-link,
.desktop-nav-slash {
  font-family: "HelveticaNeueRoman", Helvetica, Arial, sans-serif;
  font-size: 18px;
  line-height: 1;
  text-transform: uppercase;
  color: var(--fg);
  text-decoration: none;
}

.desktop-nav-link {
  opacity: 1;
}

.desktop-nav-link:hover,
.desktop-nav-link:focus-visible {
  opacity: 0.45;
  outline: none;
}

.desktop-nav-link.is-current,
.desktop-nav-link[aria-current="page"] {
  opacity: 0.45;
}

.desktop-nav-slash {
  margin: 0 4px;
  user-select: none;
}

#dark-mode-button {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 16px;
  height: 16px;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.22);
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  transition: background 180ms ease;
  z-index: 40;
}

html.dark-mode #dark-mode-button {
  background: rgba(255, 255, 255, 0.26);
}

#dark-mode-button:hover,
#dark-mode-button:focus-visible {
  background: #000;
  outline: none;
}

html.dark-mode #dark-mode-button:hover,
html.dark-mode #dark-mode-button:focus-visible {
  background: #fff;
}

#mobile-menu-button,
#mobile-menu-overlay {
  display: none;
}

@media (pointer: coarse) and (max-width: 900px) {
  #desktop-nav-links {
    display: none;
  }

  #nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  #mobile-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    padding: 0;
    margin: 0;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 0;
    box-shadow: none;
    z-index: 120;
    position: relative;
    top: -2px;
  }

  #mobile-menu-button::before {
    content: "";
    display: block;
    width: 30px;
    height: 30px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    background-image: url("/assets/icons/dd_b.svg");
  }

  html.dark-mode #mobile-menu-button::before {
    background-image: url("/assets/icons/dd_w.svg");
  }

  #dark-mode-button {
    position: fixed;
    top: 24px;
    left: 16px;
    right: auto;
    bottom: auto;
    width: 22px;
    height: 22px;
    border: none;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.22);
    appearance: none;
    -webkit-appearance: none;
    border-radius: 0;
    box-shadow: none;
    cursor: pointer;
    transition: background 180ms ease;
    z-index: 100;
    pointer-events: auto;
  }

  html.dark-mode #dark-mode-button {
    background: rgba(255, 255, 255, 0.26);
  }

  #dark-mode-button:hover,
  #dark-mode-button:focus-visible {
    background: #000;
    outline: none;
  }

  html.dark-mode #dark-mode-button:hover,
  html.dark-mode #dark-mode-button:focus-visible {
    background: #fff;
  }

  #mobile-menu-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 110;
    pointer-events: none;
  }

  #mobile-menu-backdrop {
    position: absolute;
    inset: 0;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    background: rgba(0, 0, 0, 0);
    transition:
      backdrop-filter 420ms cubic-bezier(0.22, 1, 0.36, 1),
      -webkit-backdrop-filter 420ms cubic-bezier(0.22, 1, 0.36, 1),
      background 420ms cubic-bezier(0.22, 1, 0.36, 1),
      opacity 420ms cubic-bezier(0.22, 1, 0.36, 1);
    opacity: 0;
  }

  #mobile-menu-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50svh;
    min-height: 340px;
    max-height: 520px;
    background: var(--bg);
    color: var(--fg);
    transform: translateY(-104%);
    opacity: 1;
    transition:
      transform 620ms cubic-bezier(0.22, 1, 0.36, 1),
      opacity 420ms cubic-bezier(0.22, 1, 0.36, 1);
    box-sizing: border-box;
    padding: 34px 18px 0 38px;
    overflow: hidden;
  }

  #mobile-menu-top {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 16px;
    width: 100%;
    box-sizing: border-box;
  }

  .mobile-menu-top-control {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    height: 32px;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    color: var(--fg);
    font-family: "HelveticaNeueRoman", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1;
    text-transform: uppercase;
    text-decoration: none;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 0;
    box-shadow: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-menu-home {
    justify-self: start;
    position: relative;
    opacity: 0;
    transform: translateY(-12px);
    transition:
      opacity 760ms cubic-bezier(0.22, 1, 0.36, 1),
      transform 980ms cubic-bezier(0.22, 1, 0.36, 1),
      color 180ms ease;
  }

  #mobile-menu-close {
    justify-self: end;
    cursor: pointer;
    min-width: 44px;
    justify-content: flex-end;
  }

  #mobile-menu-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    margin-top: 10px;
  }

  .mobile-menu-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--fg);
    font-family: "HelveticaNeueRoman", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(-12px);
    transition:
      opacity 760ms cubic-bezier(0.22, 1, 0.36, 1),
      transform 980ms cubic-bezier(0.22, 1, 0.36, 1),
      color 180ms ease;
  }

  .mobile-menu-link[aria-current="page"] {
    color: rgba(255, 255, 255, 0.26);
  }

  html:not(.dark-mode) .mobile-menu-link[aria-current="page"] {
    color: rgba(0, 0, 0, 0.22);
  }

  .mobile-menu-link[aria-current="page"]::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -20px;
    width: 8px;
    height: 8px;
    background: #000;
    transform: translateY(-50%);
    pointer-events: none;
  }

  html.dark-mode .mobile-menu-link[aria-current="page"]::before {
    background: #fff;
  }

  #mobile-menu-overlay.is-open {
    pointer-events: auto;
  }

  #mobile-menu-overlay.is-open #mobile-menu-backdrop {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.18);
    opacity: 1;
  }

  #mobile-menu-overlay.is-open #mobile-menu-panel {
    transform: translateY(0);
  }

  #mobile-menu-overlay.is-open .mobile-menu-home,
  #mobile-menu-overlay.is-open #mobile-menu-list .mobile-menu-link {
    opacity: 1;
    transform: translateY(0);
  }

  #mobile-menu-overlay.is-open .mobile-menu-home {
    transition-delay: 260ms;
  }

  #mobile-menu-overlay.is-open #mobile-menu-list .mobile-menu-link:nth-child(1) {
    transition-delay: 420ms;
  }

  #mobile-menu-overlay.is-open #mobile-menu-list .mobile-menu-link:nth-child(2) {
    transition-delay: 600ms;
  }

  #mobile-menu-overlay.is-open #mobile-menu-list .mobile-menu-link:nth-child(3) {
    transition-delay: 780ms;
  }

  #mobile-menu-overlay.is-open #mobile-menu-list .mobile-menu-link:nth-child(4) {
    transition-delay: 960ms;
  }
}

@media (pointer: coarse) and (max-width: 600px) {
  #mobile-menu-button {
    width: 36px;
    height: 36px;
    padding: 0;
    top: -2px;
  }

  #mobile-menu-button::before {
    width: 30px;
    height: 30px;
    background-size: 100% 100%;
  }

  #mobile-menu-panel {
    min-height: 320px;
    padding: 32px 16px 0 36px;
  }

  .mobile-menu-top-control,
  .mobile-menu-link {
    font-size: 15px;
  }

  #mobile-menu-list {
    gap: 22px;
    margin-top: 12px;
  }

  .mobile-menu-link[aria-current="page"]::before {
    left: -18px;
    width: 7px;
    height: 7px;
  }

  #dark-mode-button {
    top: 24px;
    left: 16px;
    width: 20px;
    height: 20px;
    z-index: 100;
  }
}