@charset "UTF-8";

/* Reset CSS */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  /* スクロールバー幅を常に確保してレイアウトシフトを防ぐ */
  scrollbar-gutter: stable;
}

/* モーダルオープン中は背景スクロールを禁止（スクロールバーは維持） */
html.modal-open {
  overflow: hidden;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #ffffff; /* 必ず白 */
  color: #333333;
  overflow-x: hidden; /* 横スクロールバーのみ隠し、縦スクロールを許可する */
  transition: color 0.8s ease; /* テキスト色の切り替えアニメーション */
}

/* ダークテーマ用オーバーレイ */
#dark-theme-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #000000;
  opacity: 0;
  z-index: 5; /* キャンバス(-1)より手前、コンテンツ(10)より奥 */
  pointer-events: none;
  transition: opacity 0.8s ease;
}

body.theme-dark #dark-theme-overlay {
  opacity: 0.8; /* ここで黒の透明度80%を実現 */
}

/* ダークテーマ時のテキスト色反転 */
body.theme-dark #section-philosophy .portfolio-title {
  color: #ffffff;
  text-shadow: none; /* 白い影を削除 */
}

/* 英語テキスト: プロフィール本文と同じ色に変更 */
body.theme-dark #section-philosophy .philosophy-copy-item {
  color: #555;
  font-weight: 500;
}

/* 日本語テキスト: グレー */
body.theme-dark #section-philosophy .philosophy-copy-ja {
  color: #777777;
}

/* Lenis Recommended CSS */
html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

#canvas-container {
  position: fixed; /* absolute から fixed に変更し、スクロールしても画面に固定されるようにする */
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  background-color: #ffffff; /* 背面の global-philosophy-image を隠すための白背景 */
  transition: opacity 0.4s ease-in-out;
}

canvas {
  display: block;
}

/* =========================================
   Typography & Hero Content
   ========================================= */

.hero-content {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  transform: translateY(-50%);
  z-index: 10;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none; 
}

#catchphrase {
  font-size: clamp(1.2rem, 2vw, 2rem); /* 元の80%のサイズ */
  font-weight: 400;
  letter-spacing: 0.02em;
  color: #111111;
  margin: 0;
  line-height: 1.2;
}

.hero-content h1 {
  font-size: 5rem;
  font-weight: 700;
  margin-bottom: 10px;
  
  --stroke-shadow: 
    -2px -2px 4px #fff, 2px -2px 4px #fff, -2px 2px 4px #fff, 2px 2px 4px #fff,
    -2px 0 4px #fff, 2px 0 4px #fff, 0 -2px 4px #fff, 0 2px 4px #fff;
  --glow-shadow: 
    0 0 10px transparent, 0 0 20px transparent, 
    0 0 40px transparent, 0 0 70px transparent, 
    0 0 100px transparent;
    
  text-shadow: var(--stroke-shadow), var(--glow-shadow);
  transition: text-shadow 0.5s ease;
}

.sub-catchphrase {
  margin-top: 0;
  margin-bottom: 1.2rem;
  font-size: clamp(0.9rem, 1.5vw, 1.2rem);
  font-weight: 400; /* 1段階細く */
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #555555;
  
  --stroke-shadow: 
    -2px -2px 3px #fff, 2px -2px 3px #fff, -2px 2px 3px #fff, 2px 2px 3px #fff,
    -2px 0 3px #fff, 2px 0 3px #fff, 0 -2px 3px #fff, 0 2px 3px #fff;
  --glow-shadow: 
    0 0 10px transparent, 0 0 20px transparent, 
    0 0 40px transparent, 0 0 70px transparent, 
    0 0 100px transparent;
    
  text-shadow: var(--stroke-shadow), var(--glow-shadow);
  transition: text-shadow 0.5s ease;
}

/* =========================================
   UI Elements
   ========================================= */

.logo {
  position: fixed;
  top: 2rem;
  left: 2rem;
  z-index: 100; /* 重なり順を最前面に */
  font-weight: 600; /* 少し太め */
  font-size: 1.2rem; /* 1.5remの80% */
  letter-spacing: 0;
  color: #fff; /* 反転エフェクト用 */
  mix-blend-mode: difference; /* 背景色に合わせて反転 */
  pointer-events: none;
  opacity: 0;
  transition: opacity 2s ease-in-out;
}

.system-info {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 30;
  text-align: right;
  font-size: 0.65rem;
  font-family: monospace, sans-serif;
  color: #888888;
  letter-spacing: 0.05em;
  line-height: 1.5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}

.copyright {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 30;
  font-weight: 400;
  font-size: 0.75rem; /* 12px相当のREM */
  color: #888888;
  pointer-events: none;
}

/* =========================================
   Animations
   ========================================= */

@keyframes glitch-shake {
  0% { transform: translate(calc(1px * var(--shake-intensity, 1)), calc(1px * var(--shake-intensity, 1))) rotate(0deg); }
  10% { transform: translate(calc(-1px * var(--shake-intensity, 1)), calc(-1.5px * var(--shake-intensity, 1))) rotate(calc(-0.3deg * var(--shake-intensity, 1))); }
  20% { transform: translate(calc(-1.5px * var(--shake-intensity, 1)), 0px) rotate(calc(0.3deg * var(--shake-intensity, 1))); }
  30% { transform: translate(calc(1.5px * var(--shake-intensity, 1)), calc(1.5px * var(--shake-intensity, 1))) rotate(0deg); }
  40% { transform: translate(calc(1px * var(--shake-intensity, 1)), calc(-1px * var(--shake-intensity, 1))) rotate(calc(0.3deg * var(--shake-intensity, 1))); }
  50% { transform: translate(calc(-1px * var(--shake-intensity, 1)), calc(1.5px * var(--shake-intensity, 1))) rotate(calc(-0.3deg * var(--shake-intensity, 1))); }
  60% { transform: translate(calc(-1.5px * var(--shake-intensity, 1)), calc(1px * var(--shake-intensity, 1))) rotate(0deg); }
  70% { transform: translate(calc(1.5px * var(--shake-intensity, 1)), calc(1px * var(--shake-intensity, 1))) rotate(calc(-0.3deg * var(--shake-intensity, 1))); }
  80% { transform: translate(calc(-1px * var(--shake-intensity, 1)), calc(-1px * var(--shake-intensity, 1))) rotate(calc(0.3deg * var(--shake-intensity, 1))); }
  90% { transform: translate(calc(1px * var(--shake-intensity, 1)), calc(1.5px * var(--shake-intensity, 1))) rotate(0deg); }
  100% { transform: translate(calc(1px * var(--shake-intensity, 1)), calc(-1.5px * var(--shake-intensity, 1))) rotate(calc(-0.3deg * var(--shake-intensity, 1))); }
}

.shake {
  animation: glitch-shake 0.12s infinite;
  display: inline-block;
}

/* =========================================
   Background Switcher UI
   ========================================= */

.bg-switcher {
  margin-top: 4rem; /* テキストとの間隔を再び広げる */
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  pointer-events: auto; /* ボタンはクリック可能にする */
}

.bg-btn {
  background: #ffffff;
  border: 1px solid #cccccc;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: #111111;
  cursor: pointer;
  position: relative;
  /* ボタン自体の外側にも2pxの白い境界線を設定（少しぼかす） */
  box-shadow: 0 0 6px 2px #ffffff;
  /* フェードインの初期状態 */
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease, opacity 0.6s ease-out, transform 0.6s ease-out;
}

.bg-btn.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.bg-btn:hover, .bg-btn.active {
  border-color: #111111;
}

.btn-inner {
  z-index: 2;
  position: relative;
  
  --stroke-shadow: 
    -2px -2px 3px #fff, 2px -2px 3px #fff, -2px 2px 3px #fff, 2px 2px 3px #fff,
    -2px 0 3px #fff, 2px 0 3px #fff, 0 -2px 3px #fff, 0 2px 3px #fff;
  text-shadow: var(--stroke-shadow);
}

.hover-text-container {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 1;
  animation: rotateText 8s linear infinite;
}

.char-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.char-span {
  position: absolute;
  transform: translateY(0) scale(0);
  transform-origin: bottom center;
  opacity: 0;
  font-size: 11px;
  font-weight: 400;
  color: #111111;
  letter-spacing: 0.1em;
  
  /* テキストが潰れないように外側だけを白く縁取る */
  --stroke-shadow: 
    -1px -1px 4px #fff, 1px -1px 4px #fff, -1px 1px 4px #fff, 1px 1px 4px #fff,
    -1px 0 4px #fff, 1px 0 4px #fff, 0 -1px 4px #fff, 0 1px 4px #fff;
  text-shadow: var(--stroke-shadow);
  
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

@keyframes rotateText {
  from { transform: rotate(var(--start-deg, 0deg)); }
  to { transform: rotate(calc(var(--start-deg, 0deg) + 360deg)); }
}

.bg-btn:hover .char-span {
  /* ボタン中心(0)から外側(-36px)へ移動して現れる */
  transform: translateY(-36px) scale(1);
  opacity: 1;
}

/* スクロール用ダミーセクション */
.scroll-sections {
  position: relative;
  width: 100%;
  z-index: 10;
  pointer-events: none; /* 下のキャンバスのイベントを阻害しない */
}

.scroll-section {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-section h2 {
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #111;
  opacity: 1; /* 見えるように変更 */
}
/* =========================================
   Section Portfolio (Section 3)
   ========================================= */

.section-portfolio,
.section-common {
  height: auto;
  min-height: 100vh;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 6rem 0;
  pointer-events: auto;
}

.portfolio-inner {
  width: 100%;
}

/* ヘッダー行：タイトル左・フィルター右 */
.portfolio-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0 8vw;
  margin-bottom: 2rem;
  gap: 1rem;
}

.scroll-section .portfolio-title {
  font-size: 1.5rem; /* 24px = 1.5rem */
  font-weight: 400;
  letter-spacing: 0.1em;
  color: #3a3a3a;
  margin: 0;
}

/* =========================================
   Philosophy Section Content
   ========================================= */
#section-philosophy {
  position: relative;
  width: 100%;
}

.philosophy-image-container {
  width: 100%;
  margin-bottom: 2rem; /* 本文テキストとの余白 */
  overflow: hidden;
}

.parallax-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin-bottom: 2rem;
}

.parallax-image {
  position: absolute;
  top: -15%; /* パララックス用に上下に余白を持たせる */
  left: 0;
  width: 100%;
  height: 130%; /* コンテナより少し大きくして動かせるようにする */
  object-fit: cover;
  display: block;
}

.philosophy-image-container {
  aspect-ratio: 16 / 10;
}

.philosophy-inner-content {
  position: relative;
  z-index: 1;
  padding-top: 100px;
}

#section-philosophy .portfolio-header {
  align-items: center;
}

/* タイトルを最前面にし、背景色と反転するエフェクトを追加（PC・スマホ共通） */
#section-philosophy .portfolio-title {
  text-align: center;
  position: relative;
  z-index: 10;
  mix-blend-mode: difference;
  color: #fff;
}

/* アニメーション用初期状態設定を削除 */

.philosophy-content {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  padding: 0 8vw;
  margin-top: 3rem;
  align-items: center;
}

.philosophy-copy-list {
  display: block; /* flexに依存せず確実なマージン計算をさせる */
  text-align: center;
  width: 100%;
  position: relative;
  /* 画像の高さを「もう少し高く」するため、上下に2remずつ余白を追加（11rem -> 13rem, 16rem -> 18rem） */
  /* コピーのグループをさらに80px(5rem)上に移動するため、topから5rem引き、bottomに5rem足す（3rem, 28rem） */
  /* 本文テキスト（高さ120px + マージン60px = 計180px = 11.25rem）を内部に移動したため、その分だけ下の余白を削って元の画像高さを復元 */
  padding: 3rem 2rem 16.75rem 2rem;
}

.philosophy-row {
  display: flex;
  justify-content: center;
  gap: 1.5rem; /* 各列の横の間隔を少し広げました（0.25rem -> 1.5rem） */
  width: 100%;
  position: relative;
  z-index: 1;
}

/* PCのみ: 5つのコンセプトと本文テキストのグループ全体を60px上に移動 */
@media (min-width: 769px) {
  .philosophy-row,
  .philosophy-desc-container {
    transform: translateY(-60px);
  }
}

.philosophy-row + .philosophy-row {
  margin-top: 20px; /* 上段と下段の間隔をさらに半分（40px -> 20px）に変更 */
}

.philosophy-copy-list .philosophy-image-container {
  position: absolute;
  top: 0;
  left: 50%;
  margin-left: -11.9%; /* transformを使わずに中央揃え（GSAPの上書き対策） */
  width: 23.8%; /* 初期幅 (親84vwの23.8% ≒ 20vw幅) */
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.philosophy-copy-list .philosophy-image-container img {
  position: absolute;
  top: 0;
  left: 50%;
  margin-left: -50vw; /* transformを使わずに中央揃え (width 100vw の半分) */
  width: 100vw; /* 親コンテナが100vwに広がるのに合わせて100vwに固定 */
  height: 100vh; /* ブラウザの縦幅と一致させる */
  object-fit: cover;
  max-width: none;
}

.philosophy-copy-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  position: relative;
  z-index: 1;
  mix-blend-mode: difference;
  width: auto; /* 幅をテキストぴったりに合わせる（余分な空白をなくす） */
}

.philosophy-copy-item {
  font-size: clamp(0.768rem, 1.28vw, 1.28rem);
  font-weight: 500; /* 英文は濃く */
  letter-spacing: 0.02em;
  color: #555; /* プロフィール本文と同じ色 */
  line-height: 1.2;
}

.philosophy-copy-ja {
  font-size: clamp(0.55rem, 0.7vw, 0.75rem); /* 少し小さく調整 */
  font-weight: 500;
  color: #777777; /* グレー */
  letter-spacing: 0.05em;
  line-height: 1.5;
}

.philosophy-description {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.philosophy-desc-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  height: 120px; /* 3行分の高さを確保 */
  margin: 60px auto 0; /* 中央寄せを適用（先ほどの左寄りを修正） */
}

.desc-block {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  line-height: 2.2;
  color: #555; /* プロフィール本文と同じ色 */
  margin: 0;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-align: center;
}

/* =========================================
   Profile Section Content
   ========================================= */
.profile-content {
  display: flex;
  gap: 6vw;
  padding: 0 8vw;
  margin-top: 3rem;
  align-items: flex-start;
}

.profile-left {
  flex: 4;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.profile-image-container {
  aspect-ratio: 3 / 4;
  margin-bottom: 0; /* 左カラム内での下余白はgapで調整されているため不要 */
}

.profile-right {
  flex: 6;
  min-width: 0; /* Flexboxの幅膨張（レイアウト崩れ）を完全に防ぐ */
  display: flex;
  flex-direction: column;
  gap: 4rem;
  margin-top: 200px; /* 右側のテキストグループを下方向に移動 */
}

.profile-intro p {
  font-size: clamp(0.85rem, 1.2vw, 1rem); /* 理念セクションの本文と同じに統一 */
  line-height: 2.2;
  color: #555;
  margin: 0;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.profile-subheading {
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: #111;
  margin-bottom: 2rem;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.5rem;
}

/* Skills Marquee */
.marquee-container {
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  position: relative;
  -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
  mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
}

.marquee-group {
  display: flex;
  flex-shrink: 0;
  gap: 2rem;
  padding-right: 2rem;
  animation: marquee 25s linear infinite;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  color: #333;
}

.skill-item img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: grayscale(100%);
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}


/* Skills */
.skill-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.skill-icons i {
  font-size: 2.5rem;
  color: #555;
  transition: color 0.3s ease, transform 0.3s ease;
}

.skill-icons i:hover {
  color: #111;
  transform: translateY(-3px);
}

/* Timeline */
.timeline-container {
  display: flex;
  flex-direction: column;
  position: relative;
}

.timeline-container::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 30px; /* 円の中心に合わせる */
  width: 1px;
  background-color: #ccc;
}

.timeline-item {
  position: relative;
  margin-bottom: 1.8rem; /* 元の3remから詰める */
  display: flex;
  align-items: center;
  gap: 2rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-date-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #ffffff;
  border: 1px solid #cccccc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111;
  z-index: 2; /* 縦線の上に表示するため */
  flex-shrink: 0;
}

.timeline-text {
  font-size: clamp(0.85rem, 1.1vw, 1rem);
  line-height: 1.8;
  color: #555;
}

/* フィルタータブ（タイトル下・右寄せ） */
.portfolio-filter {
  display: flex;
  gap: 2rem;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  align-self: flex-end;
}

.filter-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #aaa;
  cursor: pointer;
  padding: 0;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
  pointer-events: auto;
}

.filter-btn:hover {
  color: #3a3a3a;
}

.filter-btn.active {
  color: #3a3a3a;
  border-bottom-color: #3a3a3a;
}

/* サムネイルグリッド：4列・フルワイド・ギャップなし */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 0 8vw;
}

/* レスポンシブ：ブラウザ幅に応じて列数を変更 */
@media (max-width: 768px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .portfolio-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .portfolio-grid {
    grid-template-columns: repeat(1, 1fr);
  }
}

.portfolio-item {
  overflow: hidden;
  cursor: pointer;
  position: relative;
  /* 初期状態：中央に向かって折り畳まれたマスク */
  clip-path: inset(50% 50% 50% 50%);
  transition: clip-path 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* スクロールで表示：中央から外側へマスクが広がる */
.portfolio-item.is-visible {
  clip-path: inset(0% 0% 0% 0%);
}

.portfolio-item.hidden {
  display: none;
}

/* 16:9 比率 */
.portfolio-thumb {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background-color: #d0d0d0;
  overflow: hidden;
  border-radius: 0; /* スクエア */
}

/* サムネイル画像 */
.thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  filter: grayscale(100%);
  transition: filter 0.3s ease;
}

.portfolio-item:hover .thumb-img {
  filter: grayscale(0%);
}

/* ホバーオーバーレイ（スペックテキスト用） */
.thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.2rem 1.4rem;
  gap: 0.3rem;
  opacity: 0;
  transition: background 0.3s ease, opacity 0.3s ease;
}

.portfolio-item:hover .thumb-overlay {
  background: rgba(0, 0, 0, 0.5);
  opacity: 1;
}

/* カテゴリータグ */
.thumb-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 0.2rem 0.55rem;
  align-self: flex-start;
  transform: translateY(8px);
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* プロジェクト名 */
.thumb-title {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #fff;
  line-height: 1.4;
  margin: 0;
  transform: translateY(8px);
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.04s;
}

/* 制作年 */
.thumb-year {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  transform: translateY(8px);
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.08s;
}

.portfolio-item:hover .thumb-tag,
.portfolio-item:hover .thumb-title,
.portfolio-item:hover .thumb-year {
  transform: translateY(0);
}

/* モーダル（準備） */
.portfolio-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  pointer-events: none; /* 非表示時はクリック無効 */
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.portfolio-modal.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto; /* 表示時はクリック有効 */
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
  pointer-events: auto;
}

.modal-content {
  position: relative;
  background: #fff;
  width: 60vw;
  max-width: none;
  height: 92vh;
  max-height: 92vh;
  overflow: hidden; /* コンテナ自体はスクロールしない */
  z-index: 1;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
}

.modal-close {
  position: absolute;
  /* modal-contentの右端の外側に配置 */
  left: calc(50% + 30vw + 0.75rem);
  top: 4vh; /* モーダルの上端に小間 = 92vhの上端 */
  background: rgba(0, 0, 0, 0.45);
  border: none;
  border-radius: 50%;
  width: 2.4rem;
  height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  color: #fff;
  line-height: 1;
  pointer-events: auto;
  transition: background 0.2s ease;
  backdrop-filter: blur(4px);
  z-index: 2;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.7);
}

.modal-body {
  display: flex;
  flex: 1;
  height: 100%;
  overflow: hidden;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
}

/* 左カラム：テキスト情報 40% */
.modal-left {
  width: 40%;
  flex-shrink: 0;
  padding: 3rem 2rem 3rem 2.5rem;
  overflow-y: auto;
  border-right: 1px solid #eee;
}

/* モーダル情報リスト */
.modal-info {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.modal-info dt {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #999;
  margin-top: 2rem;
}

.modal-info dt:first-child {
  margin-top: 0;
}

.modal-info dd {
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.85;
  color: #222;
  letter-spacing: 0.02em;
  margin: 0.5rem 0 0;
}

/* 右カラム：画像 70% */
.modal-right {
  width: 60%;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

/* 画像スクロールエリア — スクロールバーは非表示 */
.modal-img-scroll {
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch; /* スマホ・タブレット（iOS等）での慣性スクロールを有効化 */
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* IE/Edge */
  overscroll-behavior-y: contain;
  touch-action: pan-y;
}

.modal-img-scroll::-webkit-scrollbar {
  display: none;               /* Chrome/Safari */
}

.modal-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: top;
}

/* モーダル内スクロールナビゲーション */
.modal-scroll-indicator {
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
  mix-blend-mode: difference;
}

.modal-scroll-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  animation: spinText 10s linear infinite;
}

@keyframes spinText {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.modal-scroll-line-box {
  width: 2px;
  height: 16px;
  overflow: hidden;
  position: relative;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 1px;
}

.modal-scroll-line {
  position: absolute;
  top: -16px;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  animation: scrollLineAnim 1.5s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes scrollLineAnim {
  0% { top: -16px; }
  100% { top: 16px; }
}

.hero-spacer { }

/* =========================================
   Portfolio Links
   ========================================= */
.portfolio-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 60px;
  padding-bottom: 40px;
}

.portfolio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  background-color: transparent;
  color: #d0d0d0;
  border: 1px solid #d0d0d0;
  border-radius: 50px;
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
}

.portfolio-btn:hover {
  background-color: transparent;
  color: #d0d0d0;
  opacity: 0.5;
}

/* =========================================
   Contact Section
   ========================================= */

.contact-section {
  pointer-events: auto;
  background-color: transparent;
  position: relative;
}

.contact-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background: linear-gradient(to top, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  z-index: 0;
}

.contact-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 800px;
  padding: 3rem 5rem;
  position: relative;
  z-index: 1;
  background: #ffffff;
  border-radius: 0;
  box-shadow: 0 4px 48px rgba(0, 0, 0, 0.08);
}

.contact-section .contact-title {
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: #3a3a3a;
  margin-bottom: 1.8rem;
  text-shadow: 0 4px 20px rgba(255,255,255,0.7);
  align-self: center;
  text-align: center;
}

/* フォームコンテナ */
.contact-right {
  width: 100%;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #3a3a3a;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: #111;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  resize: none;
  backdrop-filter: blur(4px);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #bbb;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #111;
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08);
}

/* チェックボックス */
.form-label-block {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #3a3a3a;
  margin-bottom: 0.2rem;
  display: block;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.2rem 0;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.checkbox-item input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: 1.5px solid #bbb;
  border-radius: 3px;
  background: #fff;
  position: relative;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.checkbox-custom::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 8px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: translate(-50%, -60%) rotate(45deg) scale(0);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.checkbox-item input[type="checkbox"]:checked + .checkbox-custom {
  background: #111;
  border-color: #111;
}

.checkbox-item input[type="checkbox"]:checked + .checkbox-custom::after {
  transform: translate(-50%, -60%) rotate(45deg) scale(1);
}

.checkbox-text {
  font-size: 0.88rem;
  font-weight: 400;
  color: #3a3a3a;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

.checkbox-item:hover .checkbox-text {
  color: #111;
}

.checkbox-item:hover .checkbox-custom {
  border-color: #111;
}

/* フォーム全体が無効化された際（送信完了ポップアップ表示中など）の設定 */
.contact-form.is-disabled {
  pointer-events: none;
  opacity: 0.6;
}

.contact-submit {
  align-self: center;
  margin-top: 2.4rem;
  padding: 0.85rem 2.5rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #fff;
  background: #111;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
  pointer-events: auto;
}

.contact-submit:hover:not(:disabled) {
  background: #333;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.contact-submit:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}

.contact-submit:disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}



.footer-section {
  position: relative;
  z-index: 20; /* キャンバスより上に配置 */
  background-color: transparent; /* 背景を透明に（キャンバスを透かすため） */
  height: 100vh; /* 高さをブラウザの表示高さに合わせる */
  display: flex;
  align-items: flex-end; /* 必ず下端に揃える */
  justify-content: center;
}

.footer-img-wrapper {
  position: relative;
  width: 100%;
  height: 100vh;
}

/* 画像の上から30%に白→透明のグラデーションをかける */
.footer-img-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 30%; /* 画像の高さに対して上から30% */
  background: linear-gradient(to bottom, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none; /* 操作を邪魔しないように */
  z-index: 21;
}

.footer-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: bottom;
  display: block;
  pointer-events: auto; /* 画像への操作を許可 */
}

/* ThirdAnimation選択時専用の背景ぼかし（視認性向上） */
.hero-content.hero-third-active h1,
.hero-content.hero-third-active .sub-catchphrase {
  --glow-shadow: 
    0 0 10px rgba(255, 255, 255, 1), 
    0 0 20px rgba(255, 255, 255, 1), 
    0 0 40px rgba(255, 255, 255, 1), 
    0 0 70px rgba(255, 255, 255, 0.9),
    0 0 100px rgba(255, 255, 255, 0.9);
}

/* ボタンにも同様の白い影（光彩）と2pxの境界線を適用 */
.hero-content.hero-third-active .bg-btn {
  box-shadow: 
    0 0 0 2px #ffffff,
    0 0 15px rgba(255, 255, 255, 1), 
    0 0 30px rgba(255, 255, 255, 1), 
    0 0 50px rgba(255, 255, 255, 0.8);
}

/* =========================================
   Template Section (3D Cylinder)
   ========================================= */

.section-template {
  height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.template-cylinder-container {
  width: 100%;
  height: 500px;
  perspective: 1200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2rem;
}

.template-cylinder {
  position: relative;
  width: 300px;
  height: 400px;
  transform-style: preserve-3d;
  /* GSAP will animate rotateY and translateZ */
  transform: translateZ(-280px) rotateY(0deg);
}

.cylinder-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 300px;
  height: 400px;
  transform: rotateY(calc(var(--panel-idx) * 60deg)) translateZ(280px);
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  border-radius: 8px;
  overflow: hidden;
  /* To show the back of the cylinder, we don't use backface-visibility: hidden. 
     Instead we can keep it visible or hide it. Let's keep it visible so it looks like a real 3D cylinder. */
}

.panel-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.panel-inner img {
  width: 100%;
  height: 80%;
  object-fit: cover;
}

.panel-caption {
  height: 20%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  color: #333;
}


/* =========================================
   Mobile Styles (Modal)
   ========================================= */
@media (max-width: 768px) {
  .pc-only {
    display: none !important;
  }
  .modal-content {
    width: 92vw;
    height: auto;
    max-height: 92vh;
  }
  .modal-body {
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* iOSでの慣性スクロール（するする動く）を有効化 */
    overscroll-behavior-y: contain;
    touch-action: pan-y;
  }
  .modal-left {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #eee;
    padding: 2rem 1.5rem;
  }
  .modal-right {
    width: 100%;
    overflow: visible;
    font-size: 0;
    line-height: 0;
  }
  .modal-scroll-indicator {
    display: none;
  }
  .modal-img-scroll {
    overflow-y: visible;
    height: auto;
  }
  .modal-img {
    margin-bottom: 0;
    display: block;
  }
  .modal-close {
    left: auto;
    right: calc(4vw + 0.8rem);
    top: calc(4vh + 0.8rem);
    background: rgba(0, 0, 0, 0.6);
  }
  .system-info {
    top: 2rem;
    right: 1rem;
    font-size: 0.55rem;
  }
  
  /* PC版で設定されている画像下部の固定マージンを打ち消す */
  .parallax-container,
  .philosophy-image-container,
  .profile-image-container {
    margin-bottom: 0 !important;
  }

  #section-philosophy .portfolio-header {
    margin-bottom: 0 !important;
  }

  .bg-switcher {
    gap: 0.8rem !important;
  }

  .bg-btn:hover .char-span {
    transform: translateY(-31px) scale(0.8) !important; /* 現在の80%の大きさ＆ボタンにギリギリまで近づける */
  }

  .philosophy-content {
    flex-direction: column !important;
    gap: 1rem !important; /* スマホ時はスペースを4分の1に縮小（強制適用） */
    margin-top: 40px !important;
    padding: 0 !important;
  }

  .philosophy-copy-list .philosophy-image-container {
    width: 0;
    height: 500px;
    top: 0;
    left: 50%;
    margin-left: 0;
    transform: none;
  }

  .philosophy-copy-list .philosophy-image-container img {
    width: 100vw;
    left: 50%;
    margin-left: -50vw;
  }

  .philosophy-row {
    flex-direction: column !important;
    gap: 1rem !important;
    transform: translateY(-40px); /* スマホ時: 5つのコンセプトを少し上に移動 */
  }

  .philosophy-desc-container {
    transform: translateY(-40px); /* 本文テキストも合わせて上に移動 */
  }

  .philosophy-copy-container {
    width: 100% !important;
  }
  
  .philosophy-copy-list {
    padding-top: 2rem !important;
  }

  .philosophy-desc-container {
    position: absolute !important;
    top: 5rem !important;
    left: 0;
    right: 0;
    width: 85vw !important;
    margin: 0 auto !important;
    transform: none !important;
    height: auto !important;
  }
  
  .profile-content {
    flex-direction: column !important;
    gap: 3rem !important; /* スマホ時はスペースを調整（さらに2倍） */
  }
  
  .profile-left, .profile-right {
    flex: none;
    width: 100%;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
  }

  .portfolio-links {
    flex-direction: column !important;
    gap: 12px;
    padding: 0 8vw;
  }

  .portfolio-btn {
    width: 100%;
    box-sizing: border-box;
  }
  
  .contact-section {
    z-index: 25;
    padding-bottom: 15rem;
    margin-top: 15rem;
  }
  
  .contact-inner {
    width: 92vw;
    padding: 3rem 1.5rem;
    margin: 0 auto;
  }

  .footer-section, .footer-img-wrapper {
    height: auto;
    overflow: hidden;
  }
  
  .footer-img-wrapper img {
    width: 130%;
    margin-left: -15%;
    height: auto;
    object-fit: contain;
  }
}
