/*
  MOBILE NAVIGATION
  -----------------
  Add after your main stylesheet.
*/

.mobile-menu-toggle {
  display: none;
}

/* Full-screen overlay */
.mobile-menu {
  position: fixed;
  z-index: 10000;
  inset: 0;

  min-height: 100dvh;

  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;

  padding:
    max(33px, env(safe-area-inset-top))
    35px
    max(40px, env(safe-area-inset-bottom));

  overflow-y: none;

  background: #212422;
  color: #fbf1e6;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transform: translateY(-10px);

  transition:
    opacity 180ms ease,
    visibility 180ms ease,
    transform 180ms ease;
}

.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  overscroll-behavior: none;
  touch-action: none;
}

.mobile-menu__nav,
.mobile-menu__submenu,
.mobile-menu__submenu-inner {
  overscroll-behavior: none;
}

/* Header */
.mobile-menu__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-menu__logo {
  width: 177px;
  height: 25px;
  display: block;
}

.mobile-menu__logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: left center;
}

/* Close button */
.mobile-menu__close {
  position: relative;

  width: 36px;
  height: 36px;

  padding: 0;
  border: 0;

  cursor: pointer;

  background: transparent;
  color: #fbf1e6;
}

.mobile-menu__close span {
  position: absolute;
  top: 50%;
  left: 50%;

  width: 33px;
  height: 3px;

  background: currentColor;
  transform-origin: center;
}

.mobile-menu__close span:first-child {
  transform:
    translate(-50%, -50%)
    rotate(45deg);
}

.mobile-menu__close span:last-child {
  transform:
    translate(-50%, -50%)
    rotate(-45deg);
}

/* Main navigation */
.mobile-menu__nav {
  width: 100%;

  margin-top: 38px;
  padding-bottom: 30px;

  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/*
  Main-level links and accordion headings.
*/
.mobile-menu__nav > a,
.mobile-menu__accordion {
  width: 100%;

  display: block;

  margin: 0;
  padding: 0;

  border: 0;

  background: transparent;
  color: #fbf1e6;

  cursor: pointer;
  text-align: left;
  text-decoration: none;

  font-family: var(--display);
  font-size: var(--fifty-two-mobile);
  font-weight: 300;
  line-height: 1.18;
  letter-spacing: -0.04em;

  transition:
    color 180ms ease,
    opacity 180ms ease;
}

.mobile-menu__nav > a:hover,
.mobile-menu__nav > a:focus-visible,
.mobile-menu__accordion:hover,
.mobile-menu__accordion:focus-visible {
  opacity: 0.65;
}

/* Active/open heading colour */
.mobile-menu__accordion[aria-expanded="true"] {
  color: #868585;
}

.mobile-menu__nav > a[aria-current="page"] {
  color: #868585;
}

/* Accordion group */
.mobile-menu__group {
  width: 100%;
}

/*
  Animated accordion container.

  The 0fr/1fr layout allows the submenu height to animate
  without setting a fixed max-height.
*/
.mobile-menu__submenu {
  display: grid;
  grid-template-rows: 0fr;

  margin: 0;

  opacity: 0;
  visibility: hidden;

  transition:
    grid-template-rows 260ms ease,
    margin 260ms ease,
    opacity 180ms ease,
    visibility 180ms ease;
}

.mobile-menu__submenu.is-open {
  grid-template-rows: 1fr;

  margin-top: 20px;
  margin-bottom: 29px;

  opacity: 1;
  visibility: visible;
}

.mobile-menu__submenu-inner {
  min-height: 0;
  overflow: hidden;

  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Smaller submenu links */
.mobile-menu__submenu a {
  display: block;

  padding: 6px 0;

  color: #fbf1e6;

  text-decoration: none;

  font-family: var(--sans);
  font-size: var(--twenty-four-mobile);
  font-weight: 300;
  line-height: 1.35;
  letter-spacing: -0.02em;

  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.mobile-menu__submenu a:hover,
.mobile-menu__submenu a:focus-visible {
  opacity: 0.62;
  transform: translateX(5px);
}

/* Contact button */
.mobile-menu__talk {
  width: min(100%, 293px);
  min-height: 58px;

  margin-inline: auto;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  padding: 14px 24px;

  border-radius: 999px;

  background: rgba(251, 241, 230, 0.8);
  color: #000;

  -webkit-backdrop-filter: blur(13.5px);
  backdrop-filter: blur(13.5px);

  font-family: var(--sans);
  font-size: var(--sixteen-mobile);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
}

body.mobile-menu-open {
  overflow: hidden;
}

/* Tablet/mobile menu trigger */
@media (max-width: 1200px) {
  .header-actions {
    justify-self: end;
  }

  .mobile-menu-toggle {
    width: 51px;
    height: 36px;

    display: flex;
    flex-direction: column;
    justify-content: center;

    gap: 7px;

    padding: 8px;
    border: 0;
    border-radius: 100px;

    cursor: pointer;

    background: transparent;
    color: currentColor;
  }

  .mobile-menu-toggle span {
    width: 35px;
    height: 2px;

    display: block;

    background: currentColor;
  }
}

/* Mobile header */
@media (max-width: 760px) {
  .site-header {
    min-height: 72px;

    padding:
      max(18px, env(safe-area-inset-top))
      35px
      16px;

    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .wordmark--header {
    width: 140px;
  }

  .header-talk-button {
    display: none;
  }

  .header-actions {
    gap: 0;
  }

  .mobile-menu-toggle {
    margin-right: -8px;
  }

  .mobile-menu {
    grid-template-rows: auto minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-menu,
  .mobile-menu__submenu,
  .mobile-menu__submenu a,
  .mobile-menu__accordion,
  .mobile-menu__nav > a {
    transition: none;
  }
}