/* =====================================================
   基本レイアウト
   ===================================================== */
   :root{
    /* スライドメニュー用カスタムプロパティ */
    --w-menu: 80%;
    --w-menu-max: 300px;
    --p-menu-y: 80px 0 40px;
    --dur: .4s;
    --ease: cubic-bezier(.4,0,.2,1);
    --c-bg-menu:#fff;
    --c-overlay:rgba(0,0,0,.5);
  }
  
  header{
    padding:30px 3%;
    width:94%;
    position:fixed; top:0; left:0;
    display:flex; justify-content:space-between; align-items:center;
    background:rgba(255,255,255,.8);
    z-index:10;
  }
  header h1{ display:flex; align-items:center;  margin:0; letter-spacing:2px; font-family:sans-serif;}
  header h1 .logo{width:70px; margin-right:10px;}
  header ul li{margin:0 14px; font-size:15px; letter-spacing:1px; text-decoration:underline;}
  header ul li a{color:inherit;}
  header ul li:last-child{margin: 0 0 0 14px;}
  
  /* PC ではハンバーガー非表示・スライドメニューを隠す */
  .hamburger{display:none;}
  #responsive-nav{display:none;}
  #nav-overlay{display:none;}
  
  /* =====================================================
     1280px 以下 – モバイルメニュー
     ===================================================== */
  @media (max-width:1280px){
    header h1{display:flex; align-items:center;  margin:0; letter-spacing:2px; align-items: center;}
    /* 1. PC メニューを非表示、ハンバーガーを表示 */
    header > ul:not(#responsive-nav){display:none;
      font-size: 25px;
    }   /* 通常メニューだけ消す */
    .hamburger{
      display:flex; flex-direction:column; justify-content:space-between;
      width:30px; height:20px; cursor:pointer; position:relative; z-index:1002;
    }
    .hamburger span{
      width:100%; height:2px; background:#333; transition:.3s;
    }
  
    /* 2. ハンバーガー → × 変形 */
    .hamburger.is-active span:nth-child(1){transform:translateY(9px) rotate(45deg);}
    .hamburger.is-active span:nth-child(2){opacity:0;}
    .hamburger.is-active span:nth-child(3){transform:translateY(-10px) rotate(-45deg);}
  
    /* 3. スライドメニュー */
    #responsive-nav{
      position:fixed; top:0; right:-100%;
      width:var(--w-menu); max-width:var(--w-menu-max); height:100vh;
      padding:var(--p-menu-y); list-style:none;
      background:var(--c-bg-menu); box-shadow:-5px 0 20px rgba(0,0,0,.1);
      overflow-y:auto; transition:right var(--dur) var(--ease);
      display:block;                     /* 必ず表示に戻す */
      z-index:1001;
    }
    #responsive-nav.is-open{right:0;}
  
    /* メニュー項目アニメーション */
    #responsive-nav li{opacity:0; transform:translateX(30px); transition:var(--dur) var(--ease);}
    #responsive-nav.is-open li{opacity:1; transform:translateX(0);}
    #responsive-nav.is-open li:nth-child(1){transition-delay:.1s;}
    #responsive-nav.is-open li:nth-child(2){transition-delay:.15s;}
    #responsive-nav.is-open li:nth-child(3){transition-delay:.2s;}
    #responsive-nav.is-open li:nth-child(4){transition-delay:.25s;}
    #responsive-nav.is-open li:nth-child(5){transition-delay:.3s;}
    #responsive-nav.is-open li:nth-child(6){transition-delay:.35s;}
    #responsive-nav.is-open li:nth-child(7){transition-delay:.4s;}
  
    /* メニューリンク ＋ サブタイトル */
    #responsive-nav a{
      display:block; padding:20px 40px; font-size:16px; font-weight:300;
      letter-spacing:1px; color:#333; text-decoration:none; position:relative; transition:.3s;
    }
    #responsive-nav a::before{
      content:''; position:absolute; left:0; bottom:0; width:0; height:1px;
      background:#333; transition:.3s;
    }
    #responsive-nav a:hover{padding-left:50px; color:#000;}
    #responsive-nav a:hover::before{width:100%;}
    .menu-link-ja{display:block; font-size:11px; color:#999; margin-top:4px; letter-spacing:.5px;}
  
    /* 4. 背景オーバーレイ */
    #nav-overlay{
      position:fixed; inset:0; background:var(--c-overlay);
      opacity:0; visibility:hidden; transition:.3s; z-index:999;
    }
    #nav-overlay.is-active{opacity:1; visibility:visible;}

      /* …すでにある #nav-overlay の定義に追記するか、直後に書いてください */
  #nav-overlay{           /* ← 初期状態（非表示時） */
    display:block;        /* ★ これを追加 ★ */
  }


  #nav-overlay.is-active{ /* ← オーバーレイ表示時 */
    display:block;        /* ★ これを追加 ★ */
    opacity:1;
    visibility:visible;
  }
  }
  
  /* =====================================================
     600px 以下 – 小型スマホ
     ===================================================== */
  @media (max-width:600px){
    header{height:30px; padding:15px 3%;}
    header h1{ font-size: 20px;}
    header h1 .logo{width:40px;}
    .hamburger{width:24px; height:18px;}
  }
  
  /* =====================================================
     420px 以下 – 極小画面
     ===================================================== */
  @media (max-width:420px){
    /* header h1{width:250px; line-height:15px;}
    header h1 .logo{width:100px;}
    header h1 text{display: none;} */

  }
  


  /* =====================================================
   ① 共通リセット
   ===================================================== */
ul{list-style:none;margin:0;padding:0;}   /* 黒い●を消す */
button{border:none;background:transparent;padding:0;}

/* =====================================================
   ② メディアクエリ外（PC）
   ===================================================== */
.hamburger{display:none;}                 /* PC では隠す */
#responsive-nav,#nav-overlay{display:none;}

/* =====================================================
   ③ 1280px 以下
   ===================================================== */
@media (max-width:1280px){
  /* 1) ハンバーガー */
  .hamburger{
    display:flex; flex-direction:column; justify-content:space-between;
    width:30px; height:20px; cursor:pointer; position:relative; z-index:1002;
  }
  .hamburger span{
    width:100%; height:2px; background:#333; transition:.3s;
  }
  /* 2. ハンバーガー → × 変形 */
  .hamburger.is-active span:nth-child(1){transform:translateY(9px) rotate(45deg);}
  .hamburger.is-active span:nth-child(2){opacity:0;}
  .hamburger.is-active span:nth-child(3){transform:translateY(-10px) rotate(-45deg);}

  /* 2) スライドメニュー */
  #responsive-nav{
    position:fixed; top:0; right:-100%;
    width:80%; max-width:300px; height:100vh;
    padding:80px 0 40px;
    background:#fff; box-shadow:-5px 0 20px rgba(0,0,0,.1);
    overflow-y:auto; transition:right .4s cubic-bezier(.4,0,.2,1);
    display:block; z-index:1001;
  }
  #responsive-nav.is-open{right:0;}
  #responsive-nav li{opacity:0; transform:translateX(30px); transition:.4s ease;}
  #responsive-nav.is-open li{opacity:1; transform:translateX(0);}
  #responsive-nav.is-open li:nth-child(n){transition-delay:calc(.05s*var(--n));}
  #responsive-nav a{display:block;padding:20px 40px;font:300 16px/1 'Helvetica Neue',sans-serif;color:#333;text-decoration:none;}

  /* 3) 背景オーバーレイ */
  #nav-overlay{
    position:fixed; inset:0;
    background:rgba(0,0,0,.5);
    opacity:0; visibility:hidden; transition:.3s; z-index:999;
    display:block;                       /* ← 重要：常に block */
  }
  #nav-overlay.is-active{opacity:1; visibility:visible;}
}

/* =====================================================
   ④ 600px 以下（任意の微調整）
   ===================================================== */
@media (max-width:600px){
  .hamburger{width:24px;height:18px;}
}

.back-to-top {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 60px;
  height: 60px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 9999;
  display: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.back-to-top.show {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

/* 片方が欠けた上向き矢印 */
.back-to-top-arrow {
  width: 14px;
  height: 14px;
  border-top: 2px solid #888888;
  border-left: 2px solid #888888;
  transform: rotate(45deg) translateY(2px); /* 上向きに見せる */
  margin-bottom: 4px;
}

/* テキスト */
.back-to-top-text {
  font-size: 10px;
  color: #888888;
  text-align: center;
  line-height: 1;
}