/* ヒーローエリアのコンテナを定義 */
.hero-section {
  position: relative;
  width: 100%;
  min-height: var(--app-height);
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: visible;
  background-color: var(--pale-marron);
}

/* Revealer (GSAP用遮りエフェクト) */
.revealers {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: var(--app-height);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  z-index: 2;
  pointer-events: none; /* 背後の操作を邪魔しないよう追加 */
}

.revealer {
  flex: 1;
  width: 100%;
  background-color: var(--pale-marron);
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
}

/* Navigation (Common) */
.nav {
  position: fixed; /* 上部に固定 */
  top: 0;
  left: 0;
  width: 100%;
  height: 10vh;
  padding: 0 var(--side-gutter); /* 余白を共通変数に統合 */
  display: flex;
  justify-content: space-between; /* 両サイドに振り分け */
  align-items: center;
  z-index: 3000; /* 他のセクション（Footer:1000等）より上に配置 */
}

.nav-logo img {
  height: 10vh; /* ロゴのサイズを10vhに調整 */
  width: auto;
}

.nav-items {
  display: flex;
  gap: 2.5em;
}

/* ハンバーガーボタンの基本スタイル（PCでは非表示） */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  padding: 10px;
  outline: none;
  cursor: pointer;
  z-index: 1001;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.menu-toggle:active {
  transform: scale(0.96);
}

.menu-toggle .bar {
  width: 100%;
  height: 2px;
  background-color: var(--text-main);
  transition: all 0.3s ease;
}

.nav-items a {
  text-decoration: none;
  color: inherit;
}

.nav-item p {
  font-size: 20px;
  font-weight: 500;
  position: relative;
}

/* ==========================================================================
   Images / Main Gallery
   ========================================================================== */
.images {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  transform-origin: center;
  will-change: transform;
}

.img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1.5);
  width: 100%;
  height: 100%;
  opacity: 0;
  will-change: transform;
}

.img:first-child {
  opacity: 1;
}

/* Stacked Layout (アニメーション後半で左下に整列するスタイル) */
.images.stacked-container {
  position: fixed;
  left: var(--side-gutter); /* 左端の位置を統一 */
  bottom: 2em;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 1em;
  width: auto;
  height: auto;
  transform: none;
  top: auto;
}

.img.stacked {
  position: relative;
  width: 150px;
  height: 100px;
  transform: none;
  top: auto;
  left: auto;
  opacity: 1;
}

/* ==========================================================================
   Hero Content
   ========================================================================== */
.hero-content {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Logo */
.site-logo {
  position: absolute;
  top: calc(10vh + 2em); /* ナビゲーションの高さ(10vh)分下に配置 */
  left: var(--side-gutter); /* 左端の位置を統一 */
  display: flex;
  gap: 1em;
}

.site-logo h1 {
  color: var(--text-main);
  font-size: clamp(2.5rem, 5vw, 4rem); /* 最小2.5rem、最大4remに制限して統一感を出す */
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.site-logo h1 sup {
  position: absolute;
  top: -0.125em;
  font-size: 2rem;
}

/* Cover Image */
.cover-img {
  position: absolute;
  right: var(--side-gutter);
  bottom: 2em;
  width: 40%;
  height: 50%;
  clip-path: polygon(0% 100%, 100% 100%, 100% 100%, 0% 100%);
}

.cover-img img {
  filter: saturate(0);
}

/* Info Section */
.site-info {
  position: absolute;
  bottom: 3em;
  left: var(--side-gutter); /* 左端の位置を統一 */
  width: 50%;
  height: 50%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none; /* リンク等の邪魔をしないよう必要に応じて */
}

.site-info .row {
  display: flex;
  gap: 2em;
}

.site-info .col {
  flex: 1;
}

/* H2を含むカラムの独立設定（文長と位置の調整用） */
.site-info .col-h2 {
  flex: 0 0 40vw; /* 画面幅の40％に固定 */
  max-width: 50vw;
  transform: translateX(100px); /* 右へ100px移動 */
}

.site-info h2 {
  display: block; /* Page TitleのFlexを解除 */
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;      /* Page Titleの大きなマージンを解除 */
  opacity: 1;     /* GSAPで別途制御するため、初期状態を表示に設定 */
  transform: none;
}

.site-info h2::before {
  display: none; /* ヒーローセクションには横線を表示しない */
}

.site-info p {
  text-transform: uppercase;
  font-family: "Apercu Mono Pro", monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-main);
}

.address p,
.socials p {
  line-height: 1.25;
  margin-left: 0px;
}

/* ==========================================================================
   Animation Initial State (登場前のアニメーション初期状態)
   ========================================================================== */
.word,
.nav-item,
.line {
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
}

.word h1,
.nav-item p,
.line p,
.site-info h2.line span {
  transform: translateY(130%);
  position: relative;
  will-change: transform;
}

.site-info h2.line span {
  display: flex;
}

/* ==========================================================================
   Responsive (788px以下)
   ========================================================================== */
@media (max-width: 788px) {
  
    .revealers {
    position: absolute; /* ← fixed を解除 */
    height: auto;       /* ← 高さ固定を解除 */
    min-height: 100%;   /* ← 必要なら追加 */
  }
  
  .hero-section {
    min-height: var(--app-height);
    min-height: 100dvh;
    height: auto; /* 縦に伸びるように自動調整 */
    display: auto;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: visible;
  }

  /* メニュー展開時に背景のスクロールを禁止 */
  body.nav-open {
    overflow: hidden;
  }

  .menu-toggle {
    display: flex; /* モバイルで表示 */
    margin-right: 0; /* 位置の微調整が必要な場合 */
    z-index: 3002; /* メニューが開いた際もボタンが上にくるように */
    position: relative;
  }

  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 3000;
    pointer-events: none;
  }

  .nav-open .nav-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-items-wrapper {
    position: fixed;
    top: 0;
    right: -280px; /* 幅に合わせて画面外に配置 */
    width: 280px;  /* メニューの幅を制限 */
    height: auto;  /* コンテンツに合わせて高さを最小化 */
    background-color: var(--pale-marron);
    display: flex;
    flex-direction: column;
    align-items: center; /* コンテンツ全体を中央に配置 */
    padding: 12vh 1em 3em; /* 左右の余白を均等に調整 */
    transition: right 0.6s cubic-bezier(0.77, 0, 0.175, 1), visibility 0.6s, opacity 0.3s ease;
    z-index: 3001;
    visibility: hidden; /* 閉じている時は非表示（クリック防止） */
    opacity: 0;
    pointer-events: none;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.05); /* スライドを視認しやすく */
    border-bottom-left-radius: 20px; /* 角を丸くして背景との境界を柔らかく */
  }

  /* メニュー展開時のクラス */
  .nav-open .nav-items-wrapper {
    right: 0;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .nav-items {
    flex-direction: column;
    align-items: center; /* 各項目を中央に配置 */
    text-align: center;   /* テキストを中央揃えに */
    gap: 2em; /* 縦の間隔を少し詰める */
  }

  .nav-item {
    background-color: var(--accent-marron); /* タグの背景色を設定 */
    padding: 10px 40px; /* 上下左右の余白を調整してタグ風に */
    border-radius: 50px; /* カプセル型の形状 */
    width: 200px; /* すべてのタグの横幅を揃える */
    transition: background-color 0.3s ease, transform 0.2s ease;
  }

  .nav-item p {
    font-size: 20px; /* タグに収まるサイズに微調整 */
    color: #fff; /* 背景色が濃いため、文字色を白に変更 */
    transition: color 0.3s ease;
  }

  /* タップ時またはホバー時の色変更 */
  .nav-item:active,
  .nav-item:hover {
    background-color: var(--text-main); /* ホバー時にオレンジレッドへ変更 */
    transform: scale(1.05); /* 少し大きくしてインタラクションを強調 */
  }

  /* ハンバーガーボタンのアニメーション（バツ印に変化） */
  .nav-open .menu-toggle .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }
  .nav-open .menu-toggle .bar:nth-child(2) {
    opacity: 0;
  }
  .nav-open .menu-toggle .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }

  .site-logo {
    position: relative;
    top: 0;
    left: 0;
    margin-top: 12vh;
    margin-bottom: 2em;
    padding: 0 var(--side-gutter);
    order: 1; /* ロゴを一番上 */
  }

  .images {
    position: relative;
    width: 100%;
    height: 40vh; /* アニメーションエリアの高さ */
    top: 0;
    left: 0;
    transform: none;
    order: 2; /* アニメーションを2番目 */
  }

  .cover-img {
    position: relative;
    width: 100%;
    height: auto;
    right: 0;
    bottom: 0;
    clip-path: none !important; /* JSのアニメーションを無効化して全表示 */
    order: 3; /* img12を3番目 */
  }

  .site-info {
    position: relative;
    width: calc(100% - (var(--side-gutter) * 2));
    left: 0;
    height: auto;
    bottom: 0;
    padding: 4em var(--side-gutter);
    order: 4; /* テキストを一番下 */
    pointer-events: auto;
  }

  .site-info .row {
    flex-direction: column;
    gap: 2em;
  }

  .site-info .col-h2 {
    flex: 1;
    max-width: 100%;
    transform: none;
  }

  /* Stacked表示（左への移動）をCSSレベルでも無効化 */
  .images.stacked-container, .img.stacked {
    display: none !important;
  }
}