:root {
  --cursor-dot-size: 1px;
  --color-text-main: #ffffff;
}

/* ==== 右上ツリーメニュー ==== */
.menu-button {
  position: fixed;
  top: 0;
  right: 0;
  width: 128px; /*vwにすると崩れる*/
  height: 128px; /*vwにすると崩れる*/
  z-index: 1000;
}
#tree-icon {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
@media (max-width: 960px) {
  .menu-button {
    width: 70px; /*vwにすると崩れる*/
    height: 70px; /*vwにすると崩れる*/
    z-index: 980;
  }
  .menu-button.is-active {
    z-index: 1000;
  }
  #tree-icon {
    width: 70px;
    height: 70px;
  }
}
/* ==== カーソルの粒子尾・バースト ==== */

#cursor-trail {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

.cursor-dot {
  position: absolute;
  width: var(--cursor-dot-size);
  height: var(--cursor-dot-size);
  border-radius: 50%;
  background: var(--color-text-main);
  will-change: transform, opacity;
  opacity: 0;
  transition: opacity 0.06s linear, transform 0.08s linear;
}

/* 先頭ドット本体（JSで .cursor-head クラスが適用される） */
.cursor-head {
  box-shadow: 0 0 10px rgba(255, 255, 255, 1), 0 0 24px rgba(255, 255, 255, 0.9);
}

/* 先頭ドットのグロー */
.cursor-head::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 0.6) 35%,
    rgba(255, 255, 255, 0) 100%
  );
  opacity: var(--glowOpacity, 0.9);
  transform: scale(var(--glowScale, 1));
  transform-origin: center;
  pointer-events: none;
  transition: opacity 0.06s linear, transform 0.08s linear;
}

/* 2番目、3番目のドットの軽いハイライト */
.cursor-dot:nth-child(2),
.cursor-dot:nth-child(3) {
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.9),
    0 0 14px rgba(255, 255, 255, 0.7);
}

/* 停止時に下にこぼれる星（ドリフト粒子） */
.cursor-drift-dot {
  position: absolute;
  width: var(--cursor-dot-size);
  height: var(--cursor-dot-size);
  border-radius: 50%;
  background: var(--color-text-main);
  pointer-events: none;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
  opacity: 0;
  will-change: transform, opacity;
}

/* クリック／タップ時のバースト */

.cursor-burst {
  position: fixed;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 10000;
}

.cursor-burst-dot {
  position: absolute;
  width: var(--cursor-dot-size);
  height: var(--cursor-dot-size);
  border-radius: 50%;
  background: var(--color-text-main);
  opacity: 0;
  will-change: transform, opacity;
  /* ベース値。JSから --sizeBase / --glowBase / --alphaBase を上書き */
  --sizeBase: 1;
  --glowBase: 1;
  --alphaBase: 1;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
  animation: cursor-burst-dot 0.9s ease-out forwards;
}

/* ツリーっぽい明滅＋立体感を意識したバーストのキーアニメ */
@keyframes cursor-burst-dot {
  0% {
    transform: translate3d(0, 0, 0) scale(calc(0.4 * var(--sizeBase)));
    opacity: 0;
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
  15% {
    transform: translate3d(
        calc(var(--dx, 0px) * 0.35),
        calc(var(--dy, 0px) * 0.35),
        0
      )
      scale(calc(1 * var(--sizeBase)));
    opacity: calc(1 * var(--alphaBase));
    box-shadow: 0 0 calc(18px * var(--glowBase)) rgba(255, 255, 255, 1);
  }
  35% {
    transform: translate3d(
        calc(var(--dx, 0px) * 0.55),
        calc(var(--dy, 0px) * 0.55),
        0
      )
      scale(calc(0.9 * var(--sizeBase)));
    opacity: calc(0.45 * var(--alphaBase));
    box-shadow: 0 0 calc(7px * var(--glowBase)) rgba(255, 255, 255, 0.6);
  }
  60% {
    transform: translate3d(
        calc(var(--dx, 0px) * 0.8),
        calc(var(--dy, 0px) * 0.8),
        0
      )
      scale(calc(1.2 * var(--sizeBase)));
    opacity: calc(0.95 * var(--alphaBase));
    box-shadow: 0 0 calc(22px * var(--glowBase)) rgba(255, 255, 255, 1);
  }
  100% {
    transform: translate3d(var(--dx, 0px), var(--dy, 0px), 0)
      scale(calc(0.5 * var(--sizeBase)));
    opacity: 0;
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
}

.cursor-sparkle-dot {
  position: absolute;
  width: var(--cursor-dot-size);
  height: var(--cursor-dot-size);
  border-radius: 50%;
  background: var(--color-text-main);
  opacity: 0;
  will-change: transform, opacity;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
  animation: cursor-sparkle 520ms ease-out forwards;
}

@keyframes cursor-sparkle {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  60% {
    opacity: 0.35;
  }
  100% {
    transform: translate3d(var(--sx, 0px), var(--sy, 0px), 0) scale(1.7);
    opacity: 0;
  }
}

/* =========================
   Menu Overlay
========================== */
:root {
  /* 背景色: 黒 */
  --bg: #000000;
  /* 文字色: 白 */
  --fg: #ffffff;
  /* 帯の色: 赤 */
  --band: #d00000;

  /* レイアウト設定 */
  --side: clamp(262px, 27.29vw, 393px);
  --gap: 1.389vw;
  --band-in-ms: 280ms;
  --band-out-ms: 620ms;
}
/* メニュー全体（初期状態は画面外上部に配置） */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000; /* 黒い下地 */
  color: #fff;
  z-index: 990; /* menu-button (z-index: 1000) の下、cursor (z-index: 9999) の下に配置 */

  /* 初期状態を画面外上部に設定 */
  transform: translateY(-100%);
  transition: transform 1s cubic-bezier(0.2, 1, 0.3, 1); /* 開閉アニメーション */

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* メニューが開いた状態 */
.menu-overlay.is-active {
  transform: translateY(0);
}

.menu-overlay .pc {
  width: 100%;
}

/* ===============================
       Layout
       =============================== */
.list-section {
  width: 100%;
  height: 100vh; /* 画面いっぱいに表示 */
  display: flex;
  align-items: center;
  overflow: hidden;
}

.layout {
  width: 100%;
  height: 100%;
  display: grid;
  /* 左カラム(番号) | 中央(画像) | 右カラム(名前) */
  grid-template-columns: 
    /* 左右のカラム幅を、コンテンツ幅と var(--side) の最小値で制限 */
    minmax(max-content, 13vw)
    1fr
    minmax(max-content, 13vw);
  align-items: center;
  padding: 0 var(--gap);
}

.col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  z-index: 10; /* 画像より手前に表示 */
}

/* ===============================
       List Styling
       =============================== */
.list {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.list li {
  position: relative;
  display: inline-block;
  width: fit-content;
  cursor: pointer;
  font-size: 1.667vw;
  letter-spacing: 0.04em;
  line-height: 1.6;
  color: var(--fg);
  transition: color 0.2s ease;
}

/* 右カラム（名前）の設定 */
.col-right .list {
  align-items: flex-end; /* 右寄せ */
}
.col-right li {
  text-align: right;
  padding: 0 0 0 0.8333333333vw; /* 文字周りの余白 */
}
.col-left li {
  padding: 0 0.5555555556vw 0 0; /* 文字周りの余白 */
}
.list li a {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

/* ===============================
       Band Animation (赤帯)
       =============================== */
.list li::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--band);

  /* アニメーション設定 */
  transform: scaleX(0);
  transform-origin: left center; /* 左カラムは左から伸びる */
  transition: transform var(--band-out-ms) ease;
  z-index: -1; /* 文字の後ろへ */
}

/* 右カラムは右から帯を伸ばす */
.col-right .list li::before {
  transform-origin: right center;
}

/* Active / Hover 状態 */
.list li.band-in::before,
.list li:hover::before {
  transform: scaleX(1);
  transition-duration: var(--band-in-ms);
}

/* 文字色の変化（帯が出ている間は見やすく黒にする場合など調整可、今回は白のまま維持または微調整） */
.list li.band-in,
.list li:hover {
  color: #000;
}

/* ===============================
       Center Image (Stage)
       =============================== */
.stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.viewport {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.list-photo {
  display: block;
  max-width: fit-content;
  max-height: 100svh;
  width: auto;
  /*object-fit: contain;*/
  opacity: 0;
  transition: opacity 0.4s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); /* 少し影をつけて立体的に */
}

.list-photo.is-loaded {
  opacity: 1;
}

/* ===============================
       Mobile Layout
       =============================== */
@media (max-width: 960px) {
  .menu-overlay {
    /* inset: 0; top:0, right:0, bottom:0, left:0 で常に全画面 */
    width: 100%;
    height: calc(100% + 150px);
    min-height: 0; /* 不要な min-height をクリア */
    /*overflow-y: auto;*/
    overflow-x: hidden; /*←必須*/
    align-items: flex-start;
    justify-content: flex-start;
    transform: translateY(calc(-100% + -150px));
    -webkit-overflow-scrolling: touch;
  }
  .menu-overlay .sp {
    height: calc(100% + 150px);
    overflow-y: auto;
    min-height: calc(100% + 150px);
  }
  .sp-menu_logo_burberry {
    padding: 5.3333vw 0vw 6.9333vw 5.3333vw;
    width: 69.552vw;
  }
  .sp-menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6.4vw 1.667vw;
    padding-bottom: 15.2vw;
  }

  .sp-menu-item a {
    display: block;
    text-decoration: none;
    color: #fff;
    height: 100%;
  }

  .sp-menu-img {
    position: relative;
  }

  .sp-menu-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
  }

  .sp-menu-num {
    position: absolute;
    font-size: max(12px, 3.2vw);
    bottom: 2vw;
    left: 2vw;
  }

  .sp-menu-name {
    font-size: max(12px, 3.2vw);
    padding: 2vw 0 0 2vw;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0.04em;
  }
  .sp-menu_logo_lucick {
    width: 20vw;
    margin: auto;
    display: block;
    padding-bottom: 7.4667vw;
  }
  .sp-menu-item.logo .sp-menu-img {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
  }
  .sp-menu-item.logo img {
    width: 18.3386vw;
    margin: auto;
  }
}
/* ===============================
   Click Fade Curtain (修正版)
   =============================== */
#fade-curtain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: #000;
  z-index: 20000; /* MenuやCursorよりも手前に配置 */

  /* 初期状態: 画面の下に隠しておく */
  transform: translateY(100%);
  pointer-events: none; /* アニメーションしていない時はクリックを透過 */
}
