@layer layout {
  .msk-header {
    position: fixed;
    top: 0;
    inset-inline: 0;
    z-index: 60;
    height: 70px;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    color: var(--fg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid transparent;
    transition: border-color .3s, color .25s, background-color .25s;
  }

  .msk-header.is-on {
    border-color: var(--line);
  }

  .msk-wrap {
    width: 100%;
    max-width: var(--msk-maxw);
    margin-inline: auto;
    padding-inline: var(--msk-gutter);
  }

  .msk-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
  }

  .msk-nav-mobile {
    margin-inline-start: auto;
  }

  .msk-nav ul {
    display: flex;
    align-items: center;
    gap: 30px;
    list-style: none;
    font-size: .9rem;
    font-weight: 900;
  }

  .msk-nav a {
    text-decoration: none;
  }

  .msk-nav a:hover {
    text-decoration-line: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: .35em;
  }

  .msk-burger {
    display: none;
    flex: 0 0 44px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    color: var(--fg);
    background: transparent;
    border: 0;
    cursor: pointer;
  }

  .msk-burger span {
    display: block;
    width: 24px;
    height: 2px;
    margin-inline: auto;
    background: currentColor;
    transition: opacity .25s, transform .25s;
  }

  .msk-burger.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .msk-burger.is-open span:nth-child(2) {
    opacity: 0;
  }

  .msk-burger.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  section {
    padding: 96px 0;
  }

  .msk-section--dark {
    background: var(--bg);
    color: var(--fg);
  }

  .msk-sec-top {
    display: flex;
    align-items: baseline;
    gap: 20px;
    padding-bottom: 14px;
    margin-bottom: 44px;
    border-bottom: 1px solid var(--rule);
  }

  .msk-sec-top h2 {
    letter-spacing: .01em;
  }

  .msk-sec-top__num,
  .msk-sec-top__en {
    color: var(--fg-muted);
    font-family: var(--msk-font-mono);
    font-size: .68rem;
    font-weight: 400;
    letter-spacing: .22em;
    text-transform: uppercase;
  }

  .msk-sec-top__num {
    color: var(--fg);
    font-weight: 700;
  }

  .msk-sec-top .en,
  .msk-sec-top__en {
    align-self: center;
    margin-left: auto;
  }

  .msk-footer {
    padding: 56px 0 40px;
    background: var(--bg);
    color: var(--fg);
    border-top: 1px solid var(--rule);
  }

  .msk-footer__grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 30px;
  }

  .msk-footer__brand {
    margin-bottom: 16px;
  }

  .msk-footer p {
    max-width: 24em;
    color: var(--fg-muted);
    font-size: .84rem;
    line-height: 1.8;
  }

  .msk-footer h2,
  .msk-footer h3 {
    margin-bottom: 12px;
    color: var(--fg-muted);
    font-family: var(--msk-font-mono);
    font-size: .7rem;
    letter-spacing: .14em;
  }

  .msk-footer ul {
    list-style: none;
  }

  .msk-footer li + li {
    margin-top: 8px;
  }

  .msk-footer a {
    font-size: .88rem;
  }

  .msk-footer a:hover {
    text-decoration-line: underline;
    text-underline-offset: .25em;
  }

  .msk-foot-b {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    padding-top: 20px;
    margin-top: 44px;
    color: var(--fg-muted);
    font-family: var(--msk-font-mono);
    font-size: .72rem;
    border-top: 1px solid var(--line);
  }

  @media (max-width: 900px) {
    .msk-wrap {
      --msk-gutter: 22px;
    }

    .msk-burger {
      display: flex;
    }

    /*
     * primary メニュー1本を画面幅でドロワーへ変形する。
     * CMS側に同内容の mobile メニューを複製しない。
     */
    .msk-nav-mobile {
      position: fixed;
      top: 70px;
      inset-inline: 0;
      display: flex;
      flex-direction: column;
      max-height: 0;
      padding-inline: 22px;
      margin: 0;
      overflow: hidden;
      opacity: 0;
      pointer-events: none;
      background: var(--bg-raised);
      border-bottom: 1px solid var(--line);
      transform: translateY(-8px);
      transition: max-height .3s ease, opacity .25s, transform .25s;
    }

    .msk-nav-mobile.is-open {
      max-height: 82vh;
      padding-block: 6px 16px;
      opacity: 1;
      pointer-events: auto;
      box-shadow: 0 12px 24px color-mix(in srgb, var(--fg) 8%, transparent);
      transform: none;
    }

    .msk-nav-mobile ul,
    .msk-nav ul.msk-nav-mobile {
      flex-direction: column;
      align-items: stretch;
      gap: 0;
      width: 100%;
    }

    .msk-nav-mobile li {
      border-bottom: 1px solid var(--line);
    }

    .msk-nav-mobile li:last-child {
      border-bottom: 0;
    }

    .msk-nav-mobile a {
      display: block;
      padding: 16px 2px;
      font-size: 1.02rem;
    }

    section {
      padding: 66px 0;
    }

    .msk-sec-top {
      margin-bottom: 34px;
    }

    .msk-footer__grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  @media (max-width: 560px) {
    .msk-wrap {
      --msk-gutter: 18px;
    }

    .msk-nav-mobile {
      padding-inline: 18px;
    }

    .msk-sec-top .en,
    .msk-sec-top__en {
      display: none;
    }

    .msk-footer__grid {
      grid-template-columns: 1fr;
    }
  }
}
