.header {
  position: absolute;
  z-index: 99;
  inset: 0 0 auto 0;
  
  & .header__logo {
    width: 8.75rem;
    position: absolute;
    top: 0.875rem;
    /* 414px以下：ロゴを左寄りに配置 */
    left: 0.125rem;
    transform: none;
    z-index: 1;

    & img {
      width: 100%;
    }

    /* 415px〜1023px：ロゴを中央に配置 */
    @media (min-width: 415px) and (max-width: 1023px) {
      left: 50%;
      transform: translateX(-50%);
    }

    /* 1024px〜1199px：重なり回避のためロゴを左端へ */
    @media (min-width: 1024px) and (max-width: 1199px) {
      z-index: 10;
      position: absolute;
      left: 0.5rem;
      transform: none;
      width: 9.5rem;
    }

    /* 1200px以上：元のデザイン（中央） */
    @media (min-width: 1200px) {
      z-index: 0;
      position: relative;
      width: 15.25rem;
      align-self: center;
      left: auto;
      transform: none;
      margin: 0 auto; /* 確実に中央へ */
    }
  }
  
  & .header-link {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transition: transform ease 200ms;
    & img {
      align-self: center;
      height: 0.75rem;
      object-fit: contain;
      position: relative;
    }
    & p {
      white-space: nowrap;
      position: relative;
      line-height: 1;
      font-weight: 700;
      font-size: 1.125rem;
      @media (min-width: 1024px) and (max-width: 1199px) {
        font-size: 0.75rem;
      }
    }
    &::before {
      content: "";
      aspect-ratio: 1 / 1;
      width: 3rem;
      border-radius: 9999px;
      background-color: var(--yellow);
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      @media (min-width: 1024px) and (max-width: 1199px) {
        width: 1.7rem;
      }
    }
    &:hover {
      text-decoration: none;
      transform: scale(1.1);
    }
  }
}

.header-nav__trigger {
  width: 2rem;
  height: 2rem;
  display: flex;
  cursor: pointer;
  position: relative;
  border-radius: 9999px;
  background-color: var(--logo-color);

  & .header-nav__trigger-toggle {
    top: 50%;
    left: 50%;
    transform-origin: center;
    transform: translate(-50%, -50%);
    border-radius: 1px;
    height: 1px;
    width: 0.875rem;
    display: block;
    background-color: var(--white);
    position: absolute;
    transition: all 150ms ease;

    &::before,
    &::after {
      content: "";
      top: 0;
      left: 0;
      border-radius: 1px;
      height: 1px;
      width: 0.875rem;
      display: block;
      background-color: var(--white);
      position: absolute;
      transition: all 150ms ease;
    }

    &::before {
      animation: toggler-top 800ms ease forwards;
    }

    &::after {
      animation: toggler-bottom 800ms ease forwards;
    }
  }

  &.active .header-nav__trigger-toggle {
    transition-delay: 200ms;
    transform: translate(-50%, -50%) rotate(135deg);

    &::before {
      animation: toggler-top-open 800ms ease forwards;
    }

    &::after {
      animation: toggler-bottom-open 800ms ease forwards;
    }
  }
}

.header-nav__content {
  position: fixed;
  top: 0;
  left: 0;
  padding-top: 18rem;
  height: 100%;
  width: 100%;
  background-color: var(--white);
  background-image: var(--paper);
  transition: all 400ms ease;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  z-index: -1;
  color: var(--ink);
}

@media screen and (min-width: 1200px) {
  /* PC用スタイルがあればここに記述 */
}

/** Keyframes **/
@keyframes toggler-top-open { 0% { transform: translateY(6px); } 30% { transform: translateY(0); } to { transform: translateY(0); } }
@keyframes toggler-bottom-open { 0% { transform: translateY(-6px); } 30% { transform: translateY(0); } to { transform: translateY(0) rotate(90deg); } }
@keyframes toggler-bottom { 0% { transform: translateY(0); } 30% { transform: translateY(0); } to { transform: translateY(6px); } }
@keyframes toggler-top { 0% { transform: translateY(0) rotate(90deg); } 30% { transform: translateY(0); } to { transform: translateY(-6px); } }

.loading-spinner { display: none; }