/* ================================================================
   HUG Foundation — Global CSS  (global.css)
   全ページ共通スタイル
   読み込み順: 1番目
   ================================================================ */

:root {
  --cream: #F5F0E8;
  --warm-white: #FAF8F4;
  --charcoal: #1A1814;
  --mid: #3D3830;
  --gold: #C9A96E;
  --gold-light: #E8D5A8;
  --soft-brown: #8B7355;
  --rose: #C4826A;
  --text: #2C2820;
  --text-light: #6B6050;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body { 
  font-family: 'Zen Kaku Gothic New', sans-serif;
  background: var(--warm-white);
  color: var(--text);
  overflow-x: hidden;
  cursor: none;
}

/* ——— NOISE OVERLAY ——— */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9998;
  opacity: 0.4;
}

/* ——— CUSTOM CURSOR ——— */
#cursor {
  position: fixed;
  width: 10px; height: 10px;
  background: var(--gold);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s, width 0.3s, height 0.3s, opacity 0.3s;
  mix-blend-mode: difference;
}
#cursor-ring {
  position: fixed;
  width: 40px; height: 40px;
  border: 1px solid rgba(201,169,110,0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition: transform 0.12s ease-out, width 0.4s, height 0.4s, border-color 0.3s;
}
body:has(a:hover) #cursor { width: 18px; height: 18px; }
body:has(a:hover) #cursor-ring { width: 60px; height: 60px; border-color: rgba(201,169,110,0.9); }

/* ——— NAVIGATION ——— */
nav#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 28px 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.6s, padding 0.4s, box-shadow 0.6s;
}
nav#nav.scrolled {
  background: rgba(250, 248, 244, 0.94);
  backdrop-filter: blur(24px);
  padding: 18px 60px;
  border-bottom: 1px solid rgba(201,169,110,0.2);
  box-shadow: 0 4px 40px rgba(0,0,0,0.05);
}
.nav-logo {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--cream);
  text-decoration: none;
  transition: color 0.4s, letter-spacing 0.4s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.nav-logo img { max-height: 34px; width: auto; }
.nav-logo:hover { letter-spacing: 0.22em; }
nav#nav.scrolled .nav-logo { color: var(--charcoal); }
.nav-links { display: flex; gap: 40px; list-style: none; }
.nav-links a {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.85);
  text-decoration: none;
  transition: color 0.3s, letter-spacing 0.3s;
  font-weight: 400;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--gold);
  transition: width 0.35s;
}
.nav-links a:hover { color: var(--gold); letter-spacing: 0.3em; }
.nav-links a:hover::after { width: 100%; }
nav#nav.scrolled .nav-links a { color: var(--text-light); }
.nav-cta {
  padding: 10px 26px;
  border: 1px solid rgba(245,240,232,0.5);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cream);
  text-decoration: none;
  transition: all 0.4s;
  font-family: 'Zen Kaku Gothic New', sans-serif;
  position: relative;
  overflow: hidden;
}
.nav-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: translateX(-101%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}
.nav-cta:hover::before { transform: translateX(0); }
.nav-cta:hover { border-color: var(--gold); color: var(--charcoal); }
nav#nav.scrolled .nav-cta { border-color: var(--gold); color: var(--charcoal); }

/* ——— MOBILE HAMBURGER ——— */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 201;
  position: relative;
}
.nav-burger-line {
  display: block;
  width: 24px;
  height: 1px;
  background: var(--cream);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), opacity 0.25s, width 0.25s;
  transform-origin: center;
}
nav#nav.scrolled .nav-burger-line { background: var(--charcoal); }
.nav-burger.open .nav-burger-line:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger.open .nav-burger-line:nth-child(2) { opacity: 0; width: 0; }
.nav-burger.open .nav-burger-line:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ——— MOBILE NAV OVERLAY ——— */
#nav-mobile {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--charcoal);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.4,0,0.2,1);
}
#nav-mobile.open {
  opacity: 1;
  pointer-events: auto;
}
/* 背景装飾 */
#nav-mobile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 20% 40%, rgba(201,169,110,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 60%, rgba(201,169,110,0.04) 0%, transparent 40%);
  pointer-events: none;
}
.nav-mobile-links {
  list-style: none;
  text-align: center;
  width: 100%;
  position: relative;
  z-index: 1;
}
.nav-mobile-links li {
  border-bottom: 1px solid rgba(201,169,110,0.1);
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1), opacity 0.4s;
}
.nav-mobile-links li:first-child {
  border-top: 1px solid rgba(201,169,110,0.1);
}
#nav-mobile.open .nav-mobile-links li {
  transform: translateY(0);
  opacity: 1;
}
#nav-mobile.open .nav-mobile-links li:nth-child(1) { transition-delay: 0.05s; }
#nav-mobile.open .nav-mobile-links li:nth-child(2) { transition-delay: 0.10s; }
#nav-mobile.open .nav-mobile-links li:nth-child(3) { transition-delay: 0.15s; }
#nav-mobile.open .nav-mobile-links li:nth-child(4) { transition-delay: 0.20s; }
#nav-mobile.open .nav-mobile-links li:nth-child(5) { transition-delay: 0.25s; }
.nav-mobile-links a {
  display: block;
  padding: 22px 40px;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.4rem, 5.5vw, 1.8rem);
  font-style: italic;
  letter-spacing: 0.12em;
  color: var(--cream);
  text-decoration: none;
  transition: color 0.3s, padding-left 0.3s;
}
.nav-mobile-links a:hover {
  color: var(--gold);
  padding-left: 56px;
}
.nav-mobile-cta {
  margin-top: 40px;
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s 0.3s, transform 0.4s 0.3s;
}
#nav-mobile.open .nav-mobile-cta {
  opacity: 1;
  transform: translateY(0);
}
.nav-mobile-cta a {
  display: inline-block;
  padding: 14px 48px;
  border: 1px solid rgba(201,169,110,0.5);
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  transition: background 0.35s, color 0.35s, border-color 0.35s;
}
.nav-mobile-cta a:hover {
  background: var(--gold);
  color: var(--charcoal);
  border-color: var(--gold);
}

/* ——— BUTTONS ——— */
.btn-primary {
  padding: 17px 38px;
  background: var(--gold);
  color: var(--charcoal);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.4s;
  position: relative; overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.2);
  transform: translateX(-101%);
  transition: transform 0.4s;
}
.btn-primary:hover::after { transform: translateX(0); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(201,169,110,0.35); }
.btn-secondary {
  padding: 17px 38px;
  border: 1px solid rgba(245,240,232,0.3);
  color: var(--cream);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.4s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-secondary:hover {
  border-color: var(--gold); color: var(--gold);
  transform: translateY(-2px);
}
.btn-message {
  margin-top: 52px;
  display: inline-flex;
  padding: 15px 48px;
  border: 1px solid rgba(201,169,110,0.4);
  color: var(--gold);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.4s;
}
.btn-message:hover {
  background: var(--gold);
  color: var(--charcoal);
  border-color: var(--gold);
}

/* ——— SECTION BASE ——— */
.section-label { letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
  display: block;
}
.section-heading {
  font-family: 'Noto Serif JP', serif;
  font-weight: 400;
  line-height: 1.4;
  color: var(--charcoal);
  margin-bottom: 36px;
  white-space: nowrap;
}
.section-heading em {
  font-style: italic;
  color: var(--soft-brown);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1em;
  font-weight: 300;
}
.text-link { letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--charcoal);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 4px;
  transition: color 0.3s, letter-spacing 0.4s, padding-bottom 0.3s;
}
.text-link:hover { color: var(--gold); letter-spacing: 0.4em; padding-bottom: 8px; }


/* ——— DONATION CTA ——— */
.section-donation {
  position: relative;
  padding: 180px 60px;
  background: var(--mid);
  overflow: hidden; text-align: center;
}
.donation-line {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  animation: lineShimmer 4s ease-in-out infinite;
}
@keyframes lineShimmer {
  0%   { opacity: 0.6; }
  50%  { opacity: 1; }
  100% { opacity: 0.6; }
}
.donation-orbs { position: absolute; inset: 0; pointer-events: none; }
.orb {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,169,110,0.08) 0%, transparent 70%);
  animation: orbFloat var(--dur,10s) var(--delay,0s) ease-in-out infinite alternate;
}
@keyframes orbFloat {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(var(--dx,30px), var(--dy,-40px)) scale(1.2); }
}
.donation-inner { position: relative; z-index: 1; max-width: 600px; margin: 0 auto; }
.donation-inner .section-heading { color: var(--cream); margin-bottom: 24px; }
.donation-inner .section-heading em { color: var(--gold-light); }
.donation-text { line-height: 2.6;
  color: rgba(245,240,232,0.55);
  margin-bottom: 52px; font-weight: 300;
  letter-spacing: 0.08em;
  font-family: 'Noto Serif JP', serif;
}
.donation-btns { display: flex; gap: 16px; justify-content: center; }


/* ================================================================
   FOOTER CTA — 全ページ共通
   footer.php に配置。すべてのページで表示される
   ================================================================ */
.footer-cta {
  position: relative;
  padding: 180px 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: var(--charcoal);
}

/* 背景：グラデーションテクスチャ */
.footer-cta-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(201,169,110,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 50%, rgba(201,169,110,0.05) 0%, transparent 50%);
}
.footer-cta-overlay {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.3;
  pointer-events: none;
}

.footer-cta-content {
  position: relative;
  z-index: 2;
}

.footer-cta-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 11px;
  font-style: italic;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.footer-cta-label::before,
.footer-cta-label::after {
  content: '';
  display: block;
  width: 32px; height: 1px;
  background: var(--gold);
  opacity: 0.5;
}

.footer-cta-heading {
  font-family: 'Noto Serif JP', serif;
  font-size: clamp(32px, 4.5vw, 64px);
  font-weight: 400;
  color: var(--cream);
  line-height: 1.4;
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}
.footer-cta-heading em {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--gold-light);
  font-size: 1.1em;
}

.footer-cta-body {
  font-size: clamp(13px, 1.1vw, 16px);
  color: rgba(245,240,232,0.5);
  letter-spacing: 0.12em;
  line-height: 2;
  margin-bottom: 56px;
  font-weight: 300;
}

.footer-cta-btns {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 20px 56px;
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.45s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  overflow: hidden;
}
.footer-cta-btn--primary {
  background: var(--gold);
  color: var(--charcoal);
  border: 1px solid var(--gold);
}
.footer-cta-btn--primary:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
}
.footer-cta-btn--secondary {
  background: transparent;
  color: var(--gold);
  border: 1px solid rgba(201,169,110,0.35);
}
.footer-cta-btn--secondary::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.4,0,0.2,1);
  z-index: 0;
}
.footer-cta-btn--secondary:hover::before { transform: scaleX(1); }
.footer-cta-btn--secondary:hover { color: var(--charcoal); border-color: var(--gold); }
.footer-cta-btn span,
.footer-btn-arrow { position: relative; z-index: 1; }
.footer-btn-arrow { transition: transform 0.35s; }
.footer-cta-btn:hover .footer-btn-arrow { transform: translateX(6px); }

@media (max-width: 900px) {
  .footer-cta { padding: 100px 28px; }
  .footer-cta-btns { flex-direction: column; align-items: center; }
  .footer-cta-btn { width: 100%; max-width: 320px; justify-content: center; }
}

/* ——— FOOTER ——— */
footer {
  background: var(--charcoal);
  padding: 80px 60px 40px;
  border-top: 1px solid rgba(201,169,110,0.15);
}
.footer-top {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr;
  gap: 60px; margin-bottom: 60px;
  padding-bottom: 60px;
  border-bottom: 1px solid rgba(245,240,232,0.08);
}
.footer-brand .logo-text {
  font-family: 'Cormorant Garamond', serif; font-weight: 400;
  color: var(--cream); letter-spacing: 0.1em;
  margin-bottom: 20px; display: block;
  transition: letter-spacing 0.4s;
}
.footer-brand .logo-text:hover { letter-spacing: 0.22em; }
.footer-address { line-height: 2;
  color: rgba(245,240,232,0.4); font-weight: 300;
}
.footer-col-title { letter-spacing: 0.35em;
  text-transform: uppercase; color: var(--gold);
  margin-bottom: 24px; display: block;
}
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.footer-links a { color: rgba(245,240,232,0.5);
  text-decoration: none; letter-spacing: 0.05em;
  transition: color 0.3s, letter-spacing 0.3s, padding-left 0.3s;
  font-weight: 300;
}
.footer-links a:hover { color: var(--gold); letter-spacing: 0.12em; padding-left: 6px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; }
.footer-copy { color: rgba(245,240,232,0.5); letter-spacing: 0.1em; }
.footer-legal { display: flex; gap: 24px; }
.footer-legal a { color: rgba(245,240,232,0.5);
  text-decoration: none; letter-spacing: 0.08em;
  transition: color 0.3s;
}
.footer-legal a:hover { color: var(--gold); }

/* ——— SECTION CTA（「続きを見る」共通ボタン）——— */
/* PC・モバイル共通。セクション下部・中央に表示 */
.section-cta {
  display: flex;
  justify-content: center;
  margin-top: 56px;
  padding: 0 60px;
}
.section-cta a {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  padding: 20px 60px;
  border: 1px solid rgba(201,169,110,0.3);
  font-size: var(--fs-sm);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  transition: all 0.45s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  overflow: hidden;
}
.section-cta a::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.4,0,0.2,1);
  z-index: 0;
}
.section-cta a:hover::before { transform: scaleX(1); }
.section-cta a:hover { color: var(--charcoal); border-color: var(--gold); }
.section-cta a span { position: relative; z-index: 1; }
.section-cta a::after {
  content: '→';
  position: relative; z-index: 1;
  transition: transform 0.35s;
}
.section-cta a:hover::after { transform: translateX(6px); }

/* チャコール背景セクション用（Project・Story） */
.section-projects-wrap .section-cta,
.section-stories .section-cta {
  padding: 0;  /* グリッドが全幅のため padding 不要 */
  margin-top: 48px;
}

/* ——— REVEAL SYSTEM ——— */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.9s cubic-bezier(0.4,0,0.2,1), transform 0.9s cubic-bezier(0.4,0,0.2,1);
}
.reveal.from-left  { transform: translateX(-60px); }
.reveal.from-right { transform: translateX(60px); }
.reveal.scale-in   { transform: scale(0.9); }
.reveal.visible {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

@keyframes fadeUp  { from{opacity:0;transform:translateY(30px);} to{opacity:1;transform:translateY(0);} }
@keyframes fadeIn  { from{opacity:0;} to{opacity:1;} }

/* ——— PARALLAX TEXT ——— */
.parallax-text { will-change: transform; transition: transform 0.05s linear; }

/* ——— HORIZONTAL RULE ANIM ——— */
.gold-hr {
  width: 0; height: 1px;
  background: var(--gold);
  margin: 0 auto 40px;
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}
.gold-hr.visible { width: 120px; }


/* ================================================================
   SHARED UTILITIES — 全ページ共通クラス
   story / news / about / project 各ページ CSS から集約
   ================================================================ */

/* ——— ラベル（装飾線 + 英字小テキスト） ——— */
.label-en {
  font-family: 'Cormorant Garamond', serif;
  font-size: var(--fs-micro);
  font-style: italic;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--soft-brown);
  display: flex;
  align-items: center;
  gap: 16px;
}
.label-en::before {
  content: '';
  display: block;
  width: 32px; height: 1px;
  background: currentColor;
  opacity: 0.6;
}

/* ——— コンテンツ幅制限 ——— */
.inner {
  max-width: 1300px;
  margin: 0 auto;
}

/* ——— ヒーロー背景画像ズームアニメーション ——— */
@keyframes heroZoom {
  from { transform: scale(1.05); }
  to   { transform: scale(1.00); }
}

/* ——— スクロールインジケーターラインアニメーション ——— */
@keyframes scrollLineAnim {
  0%   { transform: scaleY(0); transform-origin: top;    opacity: 0; }
  50%  { transform: scaleY(1); transform-origin: top;    opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}


/* ================================================================
   MOBILE — 共通
   ================================================================ */
@media (max-width: 900px) {
  nav#nav { padding: 22px 28px; }
  nav#nav.scrolled { padding: 16px 28px; }
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: flex; }
  body.nav-open { overflow: hidden; }
  body { cursor: auto; }
  #cursor, #cursor-ring { display: none; }

  .section-about, .section-stories, .section-news,
  .section-stats, .section-message, .section-donation,
  .section-philosophy { padding: 100px 28px; }

  .philosophy-item { flex-direction: column; gap: 12px; }

  .footer-top { grid-template-columns: 1fr; gap: 40px; }
  footer { padding: 60px 28px 30px; }
  .footer-bottom { flex-direction: column; gap: 16px; text-align: center; }
  .donation-btns { flex-direction: column; align-items: center; }

  .section-cta { margin-top: 40px; padding: 0 28px; }
  .section-cta a { padding: 16px 25px; letter-spacing: 0.25em; }
}