header {
    position: fixed; /* ヘッダーを固定 */
    top: 0;
    left: 0;
    width: 320px;
    height: 100vh; /* 画面いっぱい */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #0A0A0A;
    transition:opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
    z-index: 10;
}

/* スクロール時に縮小するヘッダー */
header.shrink {
    height: 100vh; /* スクロール時の高さ */
    opacity: 0.9; /* 少し透明に */
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(0 0, 100% 0, 70% 50%, 70% 100%, 0% 100%); 
    background-color: #F3F0E7;;
    background-size: auto;
    z-index: 1;
    transition: opacity 0.5s ease-in-out;
}


header.shrink .header-overlay {
    opacity: 0;
}

.header-top {
    position: absolute;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    top: 40px;
    left: 16px;
    z-index: 999;
    transition: opacity 0.5s ease-in-out;
}

header.shrink .header-top {
    opacity: 1;
    pointer-events: auto;
}

.header-bottom{
    position: absolute;
    display: flex;
    flex-direction: column;
    bottom: 32px;
    left: 32px;
    z-index: 999;
    transition: opacity 0.5s ease-in-out;
}

header.shrink .header-bottom {
    opacity: 0;
    pointer-events: none;
}

.header-logo-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.logo-type {
    font-size: 16px; 
    font-weight: bold;
    transition: opacity 0.5s ease-in-out;
    text-align: left;
    padding: 0;
    display: flex;
    justify-content: space-between; /* 上下中央揃え */
    overflow: hidden;
}

.logo-type span {
    display: block; /* 各行をブロック要素に */
    margin: 0; /* マージンを削除 */
    padding: 0; /* パディングを削除 */
}

/* スクロール時にロゴ文字をフェードアウト */
header.shrink .logo-type {
    opacity: 0;
    pointer-events: none;
}

.logo-img {
    width: 72px;
    object-fit: contain; /* 画像の比率を維持しつつ、枠内に収める */
}

.header-menu li{
    margin-top: 8px;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 15%;
}

/* ヘッダーメニューのリンク */
.header-menu ul li a {
    position: relative;
    display: inline-block;
    text-decoration: none; /* デフォルトの下線を消す */
    padding-bottom: 5px; /* アンダーライン用のスペース */
    transition: color 0.3s ease-in-out; /* 色の変化をスムーズに */
}

.header-menu .outer-link{
    margin-top: 24px;
}

/* アンダーラインの設定（デフォルトは透明） */
.header-menu ul li a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px; /* 下線の太さ */
    background-color: #0A0A0A; /* 下線の色 */
    transform: scaleX(0); /* 初期状態は非表示 */
    transform-origin: left;
    transition: transform 0.3s ease-in-out; /* じわっと表示 */
}

.header-menu ul li a:hover::after {
    transform: scaleX(1);
}

.external-links {
  border-top: 2px solid #0A0A0A;
  padding-top: 8px;
  margin-top: 16px;
}

.outer-link {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  text-decoration: none;
  position: relative;
  padding-right: 20px;
  transition: color 0.3s ease;
}

.outer-link::after {
  content: '↗';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8em;
  opacity: 0.7;
  transition: opacity 0.3s ease, transform 0.3s ease;
  color: inherit;
}

/* ホバー時の矢印アニメーション */
.outer-link:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(10px);
}


.header-link{
    margin-top: 40px;
}

.header-link a{
    margin-right: 24px;
    position: relative;
    display: inline-block;
}

/* ホバー時に表示する縦書きテキスト */
.header-link a::after {
    content: attr(data-text); /* HTMLのdata-text属性を利用 */
    position: absolute;
    font-family: Noto+Sans+JP;
    font-weight: bold;
    bottom: 200%;
    left: 50%;
    writing-mode: vertical-rl; /* 縦書き（右→左） */
    text-orientation: upright; /* 文字を正立 */
    transform: translateX(-50%);
    font-size: 18px;
    background-color: antiquewhite;
    color: #0A0A0A;
    padding: 20px 10px;
    border-radius: 30px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    z-index: 999;
}

/* ホバー時にテキストを表示 */
.header-link a:hover::after {
    opacity: 1;
    visibility: visible;
}

.sp-header{
    display: none;
}

@media (max-width: 1024px) {
    header {
        display: none; /* PC用ヘッダーを非表示 */
    }

    .sp-header {
        position: fixed;
        top: 24px;
        left: 0;
        width: 95%;
        height: 100px;
        display: flex; /* スマホ用ヘッダーを表示 */
        align-items: center;
        justify-content: space-between;
        z-index: 95;
        transition: opacity 0.5s ease-in-out;
    }

    .sp-header-overlay{
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        clip-path: polygon(0 0, 100% 6%, 97% 96%, 0 100%);
        background-color: #fffaf0; /* 背景色を調整 */
        background-size: auto;
        z-index: -1;
    }

    .sp-logo{
        display: flex;
        flex-direction: row;
        align-items: center;
        margin-left: 16px;
    }

    .sp-logo a{
        display: flex;
        align-items: center;
    }

    .sp-logo-type p {
        color: #0A0A0A;
        text-align: center;
        font-family: "Noto Sans JP";
        font-size: 16px;
        font-weight: bold;
        letter-spacing: 2.4px;
        margin-left: 8px;
    }

    .sp-logo img {
        height: 40px; /* ロゴサイズ調整 */
        display: block;
    }


    .burger{
        --opacity: 1;
        --rotate: 0;
        --translate: 0.5rem;
        display: grid;
        place-items: center;
        width: 40px;
        aspect-ratio: 1;
        border: none;
        background-color: transparent;
        cursor: pointer;
        position: absolute;
        right: 20px;

        &.is-active{
            --opacity: 0;
            --rotate: 45deg;
            --translate: 0;
        }

        span{
            display: block;
            width: 70%;
            height: 2px;
            border-radius: 3px;
            background-color: #0A0A0A;
            grid-area: 1 / 1 / -1 /-1;
            transition: opacity .4s ease, rotate .4s ease, translate .4s ease;
            &:nth-child(1){
                opacity: var(--opacity);
            }
            &:nth-child(2){
                translate: 0 calc(var(--translate) * -1);
                rotate: var(--rotate)
            }
            &:nth-child(3){
                translate: 0 var(--translate);
                rotate: calc(var(--rotate) * -1 );
            }
        }
    }

    /* メニューの基本スタイル */
.menu {
    position: fixed;
    top: 0; /* ヘッダーの下に配置 */
    left: 0;
    width: 100%;
    height: 100vh;
    background-color:#fffaf0; /* わずかに透ける白背景 */
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    z-index: -1;
  }
  
  /* メニューを表示（フェードイン） */
  .menu.is-active {
    opacity: 1;
    visibility: visible;
  }
  
  /* メニュー内のリスト */
  .menu ul {
    list-style: none;
    padding: 0;
    margin: 120px 40px 0 0;
    text-align: right;
  }
  
  .menu li {
    margin: 8px 0;
  }

  .menu .outer-link{
    margin-top: 24px;
  }
  
  .menu a {
    text-decoration: none;
    color: #000;
    font-family: Not+Sans+JP;
    font-size: 18px;
    font-weight: medium;
    letter-spacing: 16%;
  }

  .menu-links {
    display: flex;
    justify-content: flex-end;
    gap: 24px; /* アイコンの間隔 */
    margin-top: 24px;
    margin-right: 42px;
  }
  
  .menu-links a {
    display: flex;
    align-items: center;
    text-decoration: none;
  }
  
  .menu-links img {
    width: 24px; /* アイコンサイズ */
    height: auto;
  }
  
  .sp-header.hidden {
    opacity: 0;
    pointer-events: none; /* 非表示時にクリックを無効化 */
  }

}