:root {
  /* 背景色 */
  --bg-color: #fcfcfc;
  /* 文字色 */
  --text-color: #1a1a1a;
  /* アクセントカラー（必要に応じて使用） */
  --accent: #a3907a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  max-width: 100%;
}

img {
  display: block; /* 画像の下の謎の隙間対策 & 横ズレを減らす */
}

/* 基本スタイル設定 */
body {
  font-family: 'Oranienbaum', 'Noto Serif JP', serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* 横スクロール防止 */
}

h1, h2, h3 {
  font-family: 'Oranienbaum', serif;
  font-weight: 400;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

/* --- ヘッダーエリア --- */
header {
  min-height: 90vh;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 2rem;
}

.header-text {
  z-index: 2;
  padding-right: 3rem;
}

.main-title {
  font-size: 8vw;
  line-height: 1.1;
  margin: 0 0 2rem 0;
  padding: 0;
  display: block;
  word-break: keep-all;
  text-transform: uppercase;
}

/* =========================================================
   Hamburger Menu (Common)
   ========================================================= */

.hamburger {
  position: fixed;
  top: 1.8rem;
  right: 1.8rem;
  width: 44px;
  height: 44px;
  display: grid;
  place-content: center;
  gap: 6px;
  background: transparent;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 999px;
  cursor: pointer;
  z-index: 1001;
  transition: 0.25s;
}
.hamburger:hover { border-color: rgba(0,0,0,0.35); }

.hamburger__line {
  width: 18px;
  height: 1px;
  background: rgba(0,0,0,0.85);
  display: block;
}

/* Overlay */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
}

/* Off-canvas */
.site-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 88vw);
  height: 100vh;
  background: var(--bg-color);
  border-left: 1px solid rgba(0,0,0,0.12);
  transform: translateX(100%);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1002;
}
.site-menu.is-open { transform: translateX(0); }

.site-menu__inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 2rem;
}

.site-menu__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.12);
}

.site-menu__brand {
  font-family: 'Oranienbaum', serif;
  font-size: 1.6rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  color: var(--text-color);
}

.menu-close {
  background: transparent;
  border: 1px solid rgba(0,0,0,0.15);
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: 0.25s;
}
.menu-close:hover { border-color: rgba(0,0,0,0.35); }

.site-menu__list {
  list-style: none;
  padding: 2rem 0 0;
  margin: 0;
  display: grid;
  gap: 1.2rem;
}

.site-menu__list a {
  text-decoration: none;
  color: var(--text-color);
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: inline-block;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s;
}
.site-menu__list a:hover { border-bottom-color: rgba(0,0,0,0.5); }

/* =========================================================
   Modal open state
   - モーダル表示中はハンバーガーを表示しない
   ========================================================= */
body.is-modal-open .hamburger{
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* body scroll lock */
body.is-menu-open { overflow: hidden; }

/* ヒーロー画像（メインビジュアル） */
.hero-img-wrap {
  max-width: 100%;
  height: 70vh;
  overflow: hidden;
  position: relative;
}

.hero-img {
  max-width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: #eee;
  will-change: transform; /* アニメーション最適化 */
  transform: translateY(0);
}

.bio-text {
  font-size: 2.5vw;
  line-height: 2.2;
  color: #555;
  margin-top: 2rem;
  /* max-width: 400px; */
}

/* --- テキストコンテンツエリア --- */
.text-section {
  padding: 8rem 0 2rem 0; /* 上下にゆったりとした余白 */
  max-width: 700px; /* 読みやすい幅に制限 */
  margin: 0 auto;
}

.text-section h2 {
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 4rem;
  letter-spacing: 0.1em;
  position: relative;
}

/* タイトルの下に短い装飾線を入れる */
.text-section h2::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background-color: var(--text-color);
  margin: 2rem auto 0;
}

.text-content {
  font-size: 1.05rem;
  line-height: 2.4; /* 読みやすい広めの行間 */
  color: #333;
  text-align: justify; /* 両端揃えで雑誌のような見た目に */
  font-feature-settings: "palt"; /* 文字詰め */
}

/* --- ギャラリーエリア --- */
.gallery-section {
  padding: 5rem 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2rem;
  row-gap: 8rem;
}

/* 作品アイテムの基本スタイル */
.work-item {
  grid-column: span 6;
  position: relative;
  cursor: pointer;
  display: block;

  /* ふわっと表示されるアニメーションの初期状態 */
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1),
              transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 画面に入った時に付与されるクラス */
.work-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* グリッドレイアウトの配置調整（ジグザグ配置） */
.work-item:nth-child(odd) {
  grid-column: 1 / 8;
}
.work-item:nth-child(even) {
  grid-column: 6 / 13;
  margin-top: 5rem;
}

.work-img-container {
  width: 100%;
  aspect-ratio: 4/5;
  overflow: hidden;
  position: relative;
  background-color: #f0f0f0;
}

.work-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1);
  display: block;
}

/* ホバー時の画像拡大効果 */
.work-item:hover .work-img {
  transform: scale(1.05);
}

.work-info {
  position: absolute;
  bottom: -2rem;
  left:  0rem;
  background: var(--bg-color);
  padding: 1rem 1rem 0 0;
  z-index: 1;
}

.work-title {
  font-size: 1.5rem;
  margin: 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.work-item:hover .work-title {
  border-bottom-color: #000;
}

.work-cat {
  font-size: 0.8rem;
  color: #888;
  font-style: italic;
  margin-top: 0.5rem;
  display: block;
}

/* --- フッターエリア --- */
footer {
  margin-top: 10rem;
  text-align: center;
  padding-bottom: 4rem;
}

.footer-logo {
  font-family: 'Oranienbaum', serif;
  font-size: 2rem;
  margin-bottom: 2rem;
  display: inline-block;
  text-transform: uppercase;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 3rem;
  list-style: none;
  padding: 0;
}

.social-links a {
  text-decoration: none;
  color: #000;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-copy {
  margin-top: 2rem;
  font-size: 0.75rem;
  color: #999;
  text-transform: uppercase;
}

/* --- モーダル（拡大表示）エリア --- */
.modal {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 1004;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  opacity: 0;
  visibility: hidden;
  transition: 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  transform: translateY(20px);
}

.modal.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* クリック機能を削除 */
.modal-img-area {
  height: 100%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 100vh;
}

.modal-info-area {
  padding: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 2rem;
  right: 2rem;

  /* ↓ menu-close と同じ見た目 */
  background: transparent;
  border: 1px solid rgba(0,0,0,0.15);
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: 0.25s;
}
.modal-close:hover { border-color: rgba(0,0,0,0.35); }

/* 追加：元HTMLのstyle属性をクラス化 */
.modal-title {
  font-size: 2.5rem;
  margin: 2rem 0;
}

.modal-cat {
  color: #888;
  margin: 0 0 2rem 0;
}

.modal-desc {
  line-height: 1.8;
  color: #555;
  margin: 0;
}

/* --- レスポンシブ対応（スマホ・タブレット） --- */
@media (max-width: 768px) {
  header { 
    grid-template-columns: 1fr;
    gap: 0;
    min-height: auto; /* 高さをコンテンツに合わせる */
    padding-bottom: 3rem;
  }
  .header-text {
    padding-right: 0; 
  }
  .hamburger {
    top: 1.2rem;
    right: 1.2rem;
  }
  
  /* 【修正1】タイトルの改行許可とサイズ調整 */
  .main-title { 
    font-size: 13vw; /* 固定の4remだと長すぎる場合に溢れるため、画面幅比率(vw)に変更 */
    line-height: 1.2;
    margin: 4rem 0 1.5rem 0;
    word-break: break-word; /* 長い単語でも画面端で改行させる */
    overflow-wrap: break-word;
  }
  
  .bio-text {
    font-size: 1.2rem; /* vwだと小さくなりすぎる場合があるためrem推奨 */
  }

  /* 【修正2】グリッドシステムの簡略化（計算ズレ防止） */
  .gallery-grid {
    grid-template-columns: 1fr; /* 12分割をやめ、単純な1カラムにする */
    gap: 3rem; /* 上下の余白 */
  }

  .work-item { 
    grid-column: auto !important; /* span 12 を解除 */
    margin-top: 0 !important; 
    margin-bottom: 0; 
  }

  /* コンテナのパディング調整 */
  .container {
    padding: 2rem 1.5rem; /* シンプルに左右均等の余白を設定 */
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
  }

  .hero-img-wrap { 
    height: 50vh; 
    margin-top: 2rem; 
  }

  /* テキストエリア */
  .text-section { padding: 4rem 1rem; }
  .text-content { text-align: left; }

  /* フッター */
  .social-links {
    flex-direction: column;
    gap: 1.5rem;
  }

  /* モーダル調整 */
  .modal {
    display: block;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal-img-area {
    height: auto;
    padding: 2rem 0;
    min-height: 300px;
  }
  .modal-img {
    max-height: 60vh;
    width: auto;
    max-width: 100%;
  }
  .modal-info-area{
    position: relative;
    padding-top: 2.75rem;
  }
  .modal-close{
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    left: auto;
    margin: 0;
    z-index: 2;
    background: rgba(255,255,255,0.9);
  }
}

/* 【修正3】入れ子を解消し、420px以下の記述を外に出す */
@media (max-width: 420px){
  .gallery-section{
    /* 画面幅が狭いときにギャラリーが端に寄りすぎないようコンテナ同様の余白を与える */
    padding-left:  1.25rem;
    padding-right: 1.25rem;
    padding-left: max(1.25rem, env(safe-area-inset-left));
    padding-right: max(1.25rem, env(safe-area-inset-right));
  }

  .main-title {
    font-size: 14vw; /* スマホ小画面では少し大きめに */
  }
}