/* ============================================================
   サイト共通スタイル  /css/main.css
   ============================================================ */

/* --- CSS 変数（テーマカラー） --- */
:root {
  --color-accent:      #c9a0dc;
  --color-bg:          #f0f0f0;
  --color-header-bg:   rgba(255, 255, 255, 0.85);
  --color-footer-bg:   rgba(255, 255, 255, 0.85);
  --color-text:        #333;
  --color-text-muted:  rgba(0, 0, 0, 0.7);
  --color-border:      rgba(0, 0, 0, 0.1);
  --font-main:         'Zen Maru Gothic', sans-serif;
  --header-height-sm:  44px;
  --header-height-md:  48px;
  --header-height-lg:  52px;
  --z-header:          4000;
  --z-nav-button:      5000;
  --z-particle:        10000;
  --z-footer:          1100;
  --z-back-to-top:     1200;
}
/* ===== ページローダー ===== */
#page-loader {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 99999;
  opacity: 1;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
/* ===== ベース ===== */
html { box-sizing: border-box; }
*,
*::before,
*::after { box-sizing: inherit; }

body {
  font-family: var(--font-main);
  margin: 0;
  font-size: 1.1em;
  color: var(--color-text);
  overflow-x: hidden; /* ← 追加 */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* グリッド背景 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    repeating-linear-gradient(90deg, #fff 0 1px, transparent 1px 50px),
    repeating-linear-gradient(0deg, #fff 0 1px, transparent 1px 50px),
    var(--color-bg);
}

/* ===== ヘッダーバー ===== */
.header-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height-sm);
  background: var(--color-header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  z-index: var(--z-header);
  transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.header-bar.menu-open {
  height: 100vh;
  background: rgba(255, 255, 255, 0.95);
}

/* ===== フルスクリーンメニュー ===== */
.menu-content {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.header-bar.menu-open .menu-content {
  opacity: 1;
  visibility: visible;
  transition-delay: 0.2s;
}

.menu-content ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: inline-block;
  text-align: left;
}

.menu-content li { margin: 25px 0; }

.menu-content a {
  text-decoration: none;
  color: var(--color-text);
  font-size: 24px;
  font-weight: bold;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 20px;
}

.menu-content a i {
  color: var(--color-accent);
  font-size: 20px;
  width: 30px;
  text-align: center;
}

.menu-content a:hover {
  color: var(--color-accent);
  transform: translateX(10px);
}

/* ===== HOME ボタン ===== */
.home-button {
  position: fixed;
  top: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  color: #000;
  column-gap: 3px;
  transition: all 0.3s ease;
  z-index: var(--z-nav-button);
}

.home-button.icon-only span { display: none; }
.home-button.icon-only i    { opacity: 0.3; }

.home-button i,
.home-button span {
  font-size: 18px;
  line-height: 1;
  display: inline-block;
}

/* ===== MENU トグルボタン ===== */
.menu-toggle {
  position: fixed;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0 5px;
  transition: all 0.3s ease;
  z-index: var(--z-nav-button);
  column-gap: 3px;
}

.menu-toggle .bars {
  display: flex;
  align-items: flex-end;
  position: relative;
  width: 16px;
  height: 14px;
}

.menu-toggle .bars span {
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: #000;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease, bottom 0.3s ease;
}

.menu-toggle .bars span:nth-child(3) { bottom: 0; }
.menu-toggle .bars span:nth-child(2) { bottom: 6px; }
.menu-toggle .bars span:nth-child(1) { bottom: 12px; }

/* × アニメーション */
.header-bar.menu-open ~ .menu-toggle .bars span:nth-child(1) { transform: rotate(-45deg); bottom: 6px; }
.header-bar.menu-open ~ .menu-toggle .bars span:nth-child(2) { opacity: 0; }
.header-bar.menu-open ~ .menu-toggle .bars span:nth-child(3) { transform: rotate(45deg);  bottom: 6px; }

.menu-toggle .label {
  font-size: 18px;
  line-height: 1;
  font-weight: bold;
  color: #000;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.menu-toggle.icon-only .label      { display: none; }
.menu-toggle.icon-only .bars span  { opacity: 0.3; }

/* ===== トップへ戻るボタン ===== */
#back-to-top {
  position: fixed;
  bottom: 25px;
  right: 15px;
  display: none;
  color: #ccc;
  background: #fff;
  border: none;
  border-radius: 6px;
  width: 50px;
  height: 50px;
  font-size: 30px;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px #ccc;
  transition: opacity 0.3s;
  z-index: var(--z-back-to-top);
}

/* ===== 四芒星エフェクト ===== */
.click-particle {
  position: fixed;
  pointer-events: none;
  z-index: var(--z-particle);
  clip-path: polygon(50% 0%, 61% 35%, 100% 50%, 61% 65%, 50% 100%, 39% 65%, 0% 50%, 39% 35%);
  transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.8s ease-out;
}

/* ===== フッター ===== */
.footer-band {
  background: var(--color-footer-bg);
  max-height: 150px;
  margin-top: auto;
  border-top: 1px solid var(--color-border);
  padding: 1.5em 0;
  position: relative;
  z-index: var(--z-footer);
  width: 100%;
  box-sizing: border-box;
}

.footer-links {
  text-align: center;
  margin-bottom: 0.8em;
  display: none;
}

.footer-links a {
  margin: 0 0.8em;
  color: #555;
  text-decoration: none;
  font-size: 0.9em;
  transition: color 0.2s ease;
}

.footer-links a:hover { color: #000; }

.footer-copy {
  text-align: center;
  font-size: 0.8em;
  color: var(--color-text-muted);
}

/* ===== レスポンシブ ===== */
@media (min-width: 600px) {
  .footer-links { display: block; }
}

@media (min-width: 900px) {
  .header-bar   { height: var(--header-height-md); }
  .home-button,
  .menu-toggle  { height: 28px; top: 10px; }

  .home-button i,
  .home-button span,
  .menu-toggle .label { font-size: 20px; }

  .menu-toggle .bars              { width: 18px; height: 16px; }
  .menu-toggle .bars span         { width: 18px; }
  .menu-toggle .bars span:nth-child(2) { bottom: 7px; }
  .menu-toggle .bars span:nth-child(1) { bottom: 14px; }
  .header-bar.menu-open ~ .menu-toggle .bars span:nth-child(1) { bottom: 7px; }
  .header-bar.menu-open ~ .menu-toggle .bars span:nth-child(3) { bottom: 7px; }

  .menu-content a { font-size: 32px; }
}

@media (min-width: 1200px) {
  .header-bar   { height: var(--header-height-lg); }
  .home-button,
  .menu-toggle  { height: 32px; top: 10px; }

  .home-button i,
  .home-button span,
  .menu-toggle .label { font-size: 22px; }

  .menu-toggle .bars              { width: 20px; height: 18px; }
  .menu-toggle .bars span         { width: 20px; }
  .menu-toggle .bars span:nth-child(2) { bottom: 8px; }
  .menu-toggle .bars span:nth-child(1) { bottom: 16px; }
  .header-bar.menu-open ~ .menu-toggle .bars span:nth-child(1) { bottom: 8px; }
  .header-bar.menu-open ~ .menu-toggle .bars span:nth-child(3) { bottom: 8px; }
}
