.planest-mobile-menu {
  display: none;
}

@media (width < 768px) {
  :root {
    /* PDFの固定バーは 287.35 × 63.005。 */
    --planest-menu-bar-height: 21.926vw;
    --planest-menu-safe-bottom: env(safe-area-inset-bottom, 0px);
    --planest-menu-footer-height: calc(var(--planest-menu-bar-height) + var(--planest-menu-safe-bottom));
    --planest-menu-active-bar-height: var(--planest-menu-bar-height);
    --planest-menu-active-footer-height: calc(var(--planest-menu-active-bar-height) + var(--planest-menu-safe-bottom));
    --planest-menu-header-height: 4.375rem;
    --planest-menu-fade: 0.4s;
  }

  body {
    padding-bottom: var(--planest-menu-footer-height);
  }

  html.planest-menu-open,
  .planest-menu-open body {
    overflow: hidden;
  }

  html.planest-menu-open {
    --planest-menu-active-bar-height: min(var(--planest-menu-bar-height), 22dvh);
  }

  .l-header::before {
    position: fixed;
    z-index: 0;
    inset: 0;
    background: #000;
    content: "";
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--planest-menu-fade) ease-in-out;
  }

  .planest-menu-open .l-header::before {
    opacity: 1;
    pointer-events: auto;
  }

  .l-header__logo {
    position: relative;
    z-index: 2;
    pointer-events: none;
  }

  .l-header__logo a {
    pointer-events: auto;
  }

  .l-header .l-header__nav {
    z-index: 1;
    inset: var(--planest-menu-header-height) 0
      calc(var(--planest-menu-active-footer-height) + var(--planest-menu-banner-height, 0px));
    box-sizing: border-box;
    width: 100%;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    background: transparent;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity var(--planest-menu-fade) ease-in-out,
      visibility 0s linear var(--planest-menu-fade);
  }

  .l-header .l-header__nav::-webkit-scrollbar {
    display: none;
  }

  .l-header .l-header__nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }

  .l-header__nav-list > li,
  .l-header__nav-button > li,
  .l-header__nav-banner > li {
    min-width: 0;
  }

  .l-header__nav-list > li > a {
    box-sizing: border-box;
  }

  .planest-mobile-menu {
    position: fixed;
    z-index: 120;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: 91.264fr 91.265fr 52.411fr 52.41fr;
    grid-template-rows: var(--planest-menu-active-bar-height);
    box-sizing: border-box;
    height: var(--planest-menu-active-footer-height);
    padding-bottom: var(--planest-menu-safe-bottom);
    background: #000 url("../images/mobile-menu.webp") no-repeat top / 100% var(--planest-menu-bar-height);
    pointer-events: none;
  }

  .planest-mobile-menu__link,
  .planest-mobile-menu__toggle {
    display: block;
    min-width: 0;
    pointer-events: auto;
  }

  .planest-mobile-menu__toggle {
    grid-column: 4;
    grid-row: 1;
    cursor: pointer;
  }

  .planest-mobile-menu__link:focus-visible,
  .planest-mobile-menu__toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
  }

  .planest-menu-open .planest-mobile-menu {
    background: transparent;
  }

  .planest-menu-open .planest-mobile-menu__link {
    visibility: hidden;
    pointer-events: none;
  }

  .planest-menu-open .planest-mobile-menu__toggle {
    background: transparent url("../images/mobile-menu-close.webp?v=2") no-repeat right center / auto 100%;
  }

  .l-cta {
    --planest-menu-banner-limit: max(
      0px,
      calc(100dvh - var(--planest-menu-header-height) - var(--planest-menu-active-footer-height) - 2.75rem)
    );
    bottom: var(--planest-menu-active-footer-height);
    left: 50%;
    width: min(100%, calc(var(--planest-menu-banner-limit) * 751 / 485));
    transform: translateX(-50%);
  }

  .l-cta__link {
    display: block;
  }

  .l-cta__link img {
    display: block;
    width: 100%;
  }

  .l-cta__close {
    top: -0.8125rem;
    bottom: auto;
  }
}

@media (width < 768px) and (prefers-reduced-motion: reduce) {
  :root {
    --planest-menu-fade: 0s;
  }
}
