/* ============================================
   AETHER FRAME — 公式サイト v2 スタイルシート
   ============================================ */

:root {
  --bg-darkest: #05080f;
  --bg-dark: #0a1020;
  --bg-section: #0d1525;
  --bg-card: #111a2e;
  --bg-card-hover: #162040;
  --text-primary: #e8e6e3;
  --text-secondary: #8892a4;
  --text-muted: #556070;
  --accent-crystal: #7c5cbf;
  --accent-crystal-light: #a78bfa;
  --accent-cyan: #4ecdc4;
  --accent-gold: #d4a853;
  --crimson: #c0392b;
  --blaze: #ff4757;
  --iron: #5f8dd3;
  --night: #a55eea;
  --nexus: #2ed573;
  --gale: #1e90ff;
  --lifeline: #ffa502;
  --font-display: 'Orbitron', sans-serif;
  --font-serif: 'Noto Serif JP', serif;
  --font-sans: 'Noto Sans JP', sans-serif;
  --nav-height: 64px;
  --container-width: 1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--bg-darkest);
  color: var(--text-primary);
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { background: none; border: none; color: inherit; cursor: pointer; font-family: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

.container { max-width: var(--container-width); margin: 0 auto; padding: 0 24px; }
.section { padding: 120px 0; position: relative; overflow: hidden; }
.section-dark {
  background: var(--bg-section);
  background-image: url('assets/generated/tex_hex_pattern.png');
  background-size: 512px 512px;
  background-repeat: repeat;
}

/* --- スキャンライン・グレインオーバーレイ --- */
.scanlines {
  position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px);
}
.grain {
  position: fixed; inset: 0; z-index: 9997; pointer-events: none;
  opacity: 0.04;
  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)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

/* --- セクションラベル --- */
.section-label {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 6px;
  color: var(--accent-crystal-light);
  text-align: center;
  margin-bottom: 12px;
}
.section-divider-center {
  width: 200px; height: 40px;
  background: url('assets/generated/ui_divider_line.png') center/contain no-repeat;
  margin: 0 auto 24px;
}
.section-title {
  font-family: var(--font-serif);
  font-size: 36px; font-weight: 700;
  text-align: center; margin-bottom: 16px;
}
.section-subtitle {
  font-size: 15px; color: var(--text-secondary);
  text-align: center; margin-bottom: 48px;
}

/* --- 斜めセクションディバイダー --- */
.section-angle-top {
  position: absolute; top: -1px; left: 0; right: 0; height: 60px; overflow: hidden;
}
.section-angle-top svg { width: 100%; height: 100%; display: block; }
.section-angle-bottom {
  position: absolute; bottom: -1px; left: 0; right: 0; height: 60px; overflow: hidden;
}
.section-angle-bottom svg { width: 100%; height: 100%; display: block; }

/* --- アニメーション --- */
[data-animate] { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 0.8s ease; }
[data-animate].animated { opacity: 1; transform: translateY(0); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 5px var(--accent-crystal); } 50% { box-shadow: 0 0 20px var(--accent-crystal), 0 0 40px rgba(124,92,191,0.3); } }
@keyframes scrollLine { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 50.01% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes loadFill { from { width: 0; } to { width: 100%; } }
@keyframes borderGlow {
  0%, 100% { border-color: rgba(124,92,191,0.15); }
  50% { border-color: rgba(124,92,191,0.4); }
}
@keyframes hexRotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes slideInUp { from { opacity: 0; transform: translateY(60px); } to { opacity: 1; transform: translateY(0); } }

/* --- ローディング画面 --- */
#loading {
  position: fixed; inset: 0;
  background: var(--bg-darkest);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000;
  transition: opacity 0.8s ease;
}
#loading.hidden { opacity: 0; pointer-events: none; }
.loading-content { text-align: center; }
.loading-hex {
  width: 120px; height: 120px;
  background: url('assets/generated/ui_loading_emblem.png') center/contain no-repeat;
  animation: pulse 1.5s ease infinite, hexRotate 8s linear infinite;
  margin: 0 auto 20px;
}
.loading-title { font-family: var(--font-display); font-size: 28px; letter-spacing: 10px; margin-bottom: 32px; }
.loading-bar { width: 240px; height: 2px; background: rgba(124,92,191,0.15); border-radius: 1px; overflow: hidden; margin: 0 auto; }
.loading-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent-crystal), var(--accent-cyan)); animation: loadFill 1.8s ease forwards; }

/* --- ナビゲーション --- */
#navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-height); z-index: 1000;
  transition: background 0.3s, box-shadow 0.3s;
}
#navbar.scrolled { background: rgba(5,8,15,0.92); backdrop-filter: blur(16px); box-shadow: 0 1px 0 rgba(124,92,191,0.15); }
.nav-inner { max-width: var(--container-width); margin: 0 auto; padding: 0 24px; height: 100%; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; gap: 10px; }
.nav-logo-icon { font-size: 20px; color: var(--accent-crystal); }
.nav-logo-text { font-family: var(--font-display); font-size: 15px; letter-spacing: 4px; font-weight: 700; }
.nav-links { display: flex; gap: 28px; }
.nav-links a { font-family: var(--font-display); font-size: 11px; letter-spacing: 2px; color: var(--text-secondary); transition: color 0.3s; position: relative; }
.nav-links a::after { content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 1px; background: var(--accent-crystal); transition: width 0.3s; }
.nav-links a:hover, .nav-links a.active { color: var(--text-primary); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.hamburger { display: none; flex-direction: column; gap: 5px; padding: 4px; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--text-primary); transition: all 0.3s; }
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* --- ヒーロー --- */
#hero { position: relative; height: 100vh; min-height: 700px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#particleCanvas { position: absolute; inset: 0; z-index: 2; }
.hero-overlay { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(5,8,15,0.3) 0%, rgba(5,8,15,0.85) 70%); z-index: 3; }
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg-image {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.5) saturate(1.2);
}
.hero-bg-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #0a0e1a 0%, #0f1a30 30%, #1a1040 60%, #0a0e1a 100%);
}
.hero-mouse-glow {
  position: fixed; width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(124,92,191,0.08) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 4; opacity: 0; transition: opacity 0.3s;
}
.hero-scanline {
  position: absolute; inset: 0; z-index: 5; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(124,92,191,0.015) 3px, rgba(124,92,191,0.015) 6px);
}
.hero-content { position: relative; z-index: 6; text-align: center; padding: 0 24px; animation: fadeIn 1s ease 0.8s both; }
.hero-emblem { font-size: 64px; color: var(--accent-crystal); margin-bottom: 16px; animation: float 4s ease-in-out infinite; text-shadow: 0 0 40px rgba(124,92,191,0.6), 0 0 80px rgba(124,92,191,0.3); }
.hero-label { font-family: var(--font-display); font-size: 11px; letter-spacing: 8px; color: var(--accent-crystal-light); margin-bottom: 16px; }
.hero-title {
  font-family: var(--font-display); font-size: 76px; font-weight: 900;
  letter-spacing: 14px; line-height: 1.1;
  background: linear-gradient(135deg, #e8e6e3 0%, #a78bfa 40%, #4ecdc4 80%, #e8e6e3 100%);
  background-size: 200% 200%;
  animation: gradientShift 6s ease infinite;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 24px;
}
@keyframes gradientShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.hero-divider { width: 80px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-crystal), transparent); margin: 0 auto 20px; }
.hero-subtitle { font-family: var(--font-serif); font-size: 22px; color: var(--text-primary); margin-bottom: 8px; letter-spacing: 4px; }
.hero-subtitle-typing { font-family: var(--font-serif); font-size: 16px; color: var(--accent-crystal-light); min-height: 1.5em; margin-bottom: 24px; letter-spacing: 2px; }
.hero-desc { font-size: 14px; color: var(--text-secondary); line-height: 2; margin-bottom: 40px; }
.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block; font-family: var(--font-display);
  font-size: 12px; letter-spacing: 3px;
  padding: 14px 40px; border-radius: 2px;
  transition: all 0.3s; position: relative; overflow: hidden;
}
.btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.6s;
}
.btn:hover::before { transform: translateX(100%); }
.btn-primary { background: var(--accent-crystal); color: #fff; }
.btn-primary:hover { background: var(--accent-crystal-light); box-shadow: 0 0 30px rgba(124,92,191,0.5); transform: translateY(-2px); }
.btn-outline { border: 1px solid rgba(124,92,191,0.5); color: var(--accent-crystal-light); }
.btn-outline:hover { border-color: var(--accent-crystal); background: rgba(124,92,191,0.1); transform: translateY(-2px); }

.scroll-indicator { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.scroll-indicator span { font-family: var(--font-display); font-size: 10px; letter-spacing: 4px; color: var(--text-muted); }
.scroll-line { width: 1px; height: 40px; background: var(--accent-crystal); animation: scrollLine 2s ease infinite; }

/* --- イントロ --- */
.intro-content { text-align: center; max-width: 800px; margin: 0 auto; }
.intro-heading { font-family: var(--font-serif); font-size: 30px; font-weight: 700; line-height: 1.6; margin-bottom: 32px; }
.intro-text { font-size: 15px; color: var(--text-secondary); line-height: 2.2; }

/* --- ストーリー --- */
#story { padding: 120px 0; }
.story-bg-parallax { position: absolute; inset: -20% 0; z-index: 0; }
.story-bg-image { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.3) saturate(1.3); }
.story-bg-placeholder { width: 100%; height: 100%; background: linear-gradient(180deg, #0d1525 0%, #1a1040 50%, #0d1525 100%); }
.story-overlay { position: absolute; inset: 0; background: rgba(13,21,37,0.7); z-index: 1; }
#story .container { position: relative; z-index: 2; }
.story-grid { display: grid; grid-template-columns: 1fr 380px; gap: 60px; margin-top: 48px; }
.story-chapter { margin-bottom: 36px; padding-left: 20px; border-left: 2px solid rgba(124,92,191,0.2); }
.story-chapter h3 { font-family: var(--font-serif); font-size: 18px; color: var(--accent-crystal-light); margin-bottom: 12px; }
.story-chapter p { font-size: 14px; color: var(--text-secondary); line-height: 2; }
.story-visual { position: sticky; top: 100px; }
.story-image-placeholder { width: 100%; aspect-ratio: 3/4; background: var(--bg-card); border: 1px solid rgba(124,92,191,0.2); border-radius: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; margin-bottom: 32px; overflow: hidden; }
.story-image-placeholder img { width: 100%; height: 100%; object-fit: cover; }
.placeholder-icon { font-size: 48px; color: var(--accent-crystal); opacity: 0.3; margin-bottom: 8px; }
.placeholder-icon.large { font-size: 72px; }
.story-image-placeholder p, .mech-placeholder p { font-family: var(--font-display); font-size: 11px; letter-spacing: 3px; color: var(--text-muted); }

.story-timeline-mini { padding-left: 20px; border-left: 1px solid rgba(124,92,191,0.3); }
.timeline-item { padding: 8px 0 8px 16px; position: relative; display: flex; gap: 16px; align-items: baseline; }
.timeline-item::before { content: ''; position: absolute; left: -24px; top: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); border: 1px solid var(--bg-section); }
.timeline-item.active::before { background: var(--accent-crystal); box-shadow: 0 0 10px var(--accent-crystal); }
.timeline-year { font-family: var(--font-display); font-size: 13px; color: var(--accent-crystal-light); min-width: 48px; }
.timeline-event { font-size: 13px; color: var(--text-secondary); }

/* --- 世界観カード --- */
.world-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.world-card {
  background: var(--bg-card);
  background-image: url('assets/generated/tex_metal_brushed.png');
  background-size: cover;
  border: 1px solid rgba(124,92,191,0.12);
  border-radius: 4px; padding: 40px 32px; text-align: center;
  transition: all 0.4s; position: relative; overflow: hidden;
}
.world-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(124,92,191,0.06) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.4s;
}
.world-card:hover { border-color: var(--accent-crystal); transform: translateY(-6px); box-shadow: 0 12px 40px rgba(124,92,191,0.15); }
.world-card:hover::before { opacity: 1; }
.world-card-icon { font-size: 40px; margin-bottom: 20px; display: inline-block; }
.world-card-icon.crystal { color: var(--accent-crystal-light); text-shadow: 0 0 20px rgba(167,139,250,0.4); }
.world-card-icon.aegis { color: var(--accent-cyan); text-shadow: 0 0 20px rgba(78,205,196,0.4); }
.world-card-icon.phantom { color: var(--crimson); text-shadow: 0 0 20px rgba(192,57,43,0.4); }
.world-card h3 { font-family: var(--font-serif); font-size: 20px; margin-bottom: 16px; position: relative; }
.world-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.9; position: relative; }

/* --- キャラクター --- */
.char-tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 48px; }
.char-tab {
  font-family: var(--font-display); font-size: 11px; letter-spacing: 1px;
  padding: 10px 20px; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 2px; transition: all 0.3s; display: flex; align-items: center; gap: 8px;
}
.tab-color { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--squad-color); box-shadow: 0 0 6px var(--squad-color); }
.char-tab:hover { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.03); }
.char-tab.active { border-color: var(--accent-crystal); background: rgba(124,92,191,0.12); }
.char-panel { display: none; }
.char-panel.active { display: block; animation: fadeIn 0.4s ease; }
.char-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }

.char-card {
  background: var(--bg-card); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px; overflow: hidden; cursor: pointer;
  transition: border-color 0.4s, box-shadow 0.4s;
  transform-style: preserve-3d; will-change: transform;
}
.char-card:hover {
  border-color: var(--squad-color);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 20px color-mix(in srgb, var(--squad-color) 15%, transparent);
}
.char-card-img { width: 100%; aspect-ratio: 3/4; overflow: hidden; position: relative; }
.char-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--squad-color) 6%, var(--bg-dark)) 0%, var(--bg-card) 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.char-placeholder span { font-family: var(--font-display); font-size: 28px; color: var(--squad-color); opacity: 0.25; }

/* カードホバー時のクォート */
.char-card-quote {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  font-size: 11px; color: var(--accent-crystal-light);
  font-style: italic; line-height: 1.5;
  opacity: 0; transform: translateY(8px);
  transition: all 0.3s;
}
.char-card:hover .char-card-quote { opacity: 1; transform: translateY(0); }
.char-card-info { padding: 16px; }
.char-card-role {
  font-family: var(--font-display); font-size: 9px; letter-spacing: 2px; color: var(--squad-color);
  display: inline-block; padding: 2px 8px;
  border: 1px solid color-mix(in srgb, var(--squad-color) 30%, transparent);
  border-radius: 1px; margin-bottom: 8px;
}
.char-card-name { font-family: var(--font-serif); font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.char-card-name-en { font-family: var(--font-display); font-size: 10px; color: var(--text-muted); letter-spacing: 1px; margin-bottom: 10px; }
.char-card-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.7; }
.char-card-click-hint {
  font-family: var(--font-display); font-size: 9px; letter-spacing: 1px; color: var(--text-muted);
  margin-top: 8px; opacity: 0; transition: opacity 0.3s;
}
.char-card:hover .char-card-click-hint { opacity: 1; }

/* --- キャラクター詳細モーダル --- */
.char-modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.4s; }
.char-modal.active { opacity: 1; pointer-events: auto; }
.modal-overlay-bg { position: absolute; inset: 0; background: rgba(5,8,15,0.92); backdrop-filter: blur(8px); }
.modal-container {
  position: relative; z-index: 1;
  width: 90vw; max-width: 900px; max-height: 85vh;
  background: var(--bg-dark);
  background-image: url('assets/generated/tex_circuit_grid.png');
  background-size: 400px 400px;
  border: 1px solid rgba(124,92,191,0.2);
  border-radius: 6px; overflow: hidden;
  display: grid; grid-template-columns: 320px 1fr;
  animation: slideInUp 0.4s ease;
}
.modal-accent-line { position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.modal-close { position: absolute; top: 12px; right: 16px; font-size: 28px; color: var(--text-secondary); z-index: 3; transition: color 0.3s; }
.modal-close:hover { color: var(--text-primary); }
.modal-prev, .modal-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-size: 20px; color: var(--text-muted); z-index: 3;
  padding: 12px; transition: color 0.3s;
}
.modal-prev { left: -52px; }
.modal-next { right: -52px; }
.modal-prev:hover, .modal-next:hover { color: var(--text-primary); }

/* モーダル左: キャラ画像 */
.modal-left {
  background: var(--bg-section);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px; position: relative; overflow: hidden;
}
.modal-char-placeholder {
  width: 240px; height: 320px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--sq-color, var(--accent-crystal)) 8%, var(--bg-dark)) 0%, var(--bg-section) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.modal-char-placeholder .placeholder-icon { font-size: 56px; }
.modal-char-num { font-family: var(--font-display); font-size: 48px; font-weight: 900; opacity: 0.15; position: absolute; top: 16px; left: 20px; }

/* モーダル右: 情報 */
.modal-right { padding: 32px; overflow-y: auto; max-height: 85vh; }
.modal-char-squad { font-family: var(--font-display); font-size: 10px; letter-spacing: 2px; margin-bottom: 4px; }
.modal-char-name-jp { font-family: var(--font-serif); font-size: 28px; font-weight: 700; margin-bottom: 2px; }
.modal-char-name-en { font-family: var(--font-display); font-size: 11px; color: var(--text-muted); letter-spacing: 2px; margin-bottom: 4px; }
.modal-char-role { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }

/* モーダルタブ */
.modal-tabs { display: flex; gap: 4px; margin-bottom: 24px; }
.modal-tab {
  font-family: var(--font-display); font-size: 10px; letter-spacing: 1px;
  padding: 8px 16px; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 2px; transition: all 0.3s;
}
.modal-tab:hover { border-color: rgba(255,255,255,0.2); }
.modal-tab.active { border-color: var(--accent-crystal); background: rgba(124,92,191,0.12); color: var(--accent-crystal-light); }
.modal-tab-panel { display: none; }
.modal-tab-panel.active { display: block; animation: fadeIn 0.3s; }

/* PROFILE タブ */
.modal-char-quote { font-family: var(--font-serif); font-size: 15px; color: var(--accent-crystal-light); font-style: italic; line-height: 1.7; margin-bottom: 20px; padding-left: 16px; border-left: 2px solid var(--accent-crystal); }
.modal-char-desc { font-size: 14px; color: var(--text-secondary); line-height: 2; }

/* MUSIC タブ */
.modal-music-item {
  background: var(--bg-card); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px; padding: 20px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 16px;
}
.modal-music-icon { font-size: 32px; color: var(--accent-crystal); opacity: 0.5; flex-shrink: 0; width: 48px; text-align: center; }
.modal-music-info h4 { font-size: 14px; margin-bottom: 4px; }
.modal-music-info p { font-size: 12px; color: var(--text-muted); }

/* MECHANIC タブ */
.modal-mech-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.modal-mech-name { font-family: var(--font-display); font-size: 22px; letter-spacing: 2px; }
.modal-mech-frame { font-size: 12px; color: var(--accent-cyan); }
.modal-mech-specs { margin-bottom: 20px; }
.modal-mech-spec-row { display: flex; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.modal-mech-spec-row dt { font-size: 12px; color: var(--text-muted); min-width: 80px; }
.modal-mech-spec-row dd { font-size: 13px; color: var(--text-secondary); }
.modal-mech-weapon { font-size: 14px; color: var(--accent-gold); margin-bottom: 8px; }
.modal-mech-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.8; }

/* --- 小隊 --- */
.squad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 48px; }
.squad-card {
  background: var(--bg-card);
  background-image: url('assets/generated/tex_circuit_grid.png');
  background-size: 400px 400px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px; padding: 36px 28px;
  transition: all 0.4s; position: relative; overflow: hidden;
}
.squad-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--squad-color); opacity: 0.7; }
.squad-card::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--squad-color) 5%, transparent) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.4s;
}
.squad-card:hover { border-color: var(--squad-color); transform: translateY(-4px); box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.squad-card:hover::after { opacity: 1; }
.squad-card > * { position: relative; z-index: 1; }
.squad-emblem {
  width: 64px; height: 64px; margin-bottom: 20px;
  border-radius: 4px; overflow: hidden;
}
.squad-emblem img { width: 100%; height: 100%; object-fit: contain; }
.squad-emblem-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--squad-color);
  border: 1px solid color-mix(in srgb, var(--squad-color) 25%, transparent);
  border-radius: 4px;
}
.squad-card h3 { font-family: var(--font-display); font-size: 18px; letter-spacing: 2px; color: var(--squad-color); margin-bottom: 4px; }
.squad-role { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.squad-motto { font-family: var(--font-serif); font-size: 13px; color: var(--accent-crystal-light); font-style: italic; margin-bottom: 16px; }
.squad-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.8; margin-bottom: 16px; }
.squad-base { font-size: 11px; color: var(--text-muted); margin-bottom: 12px; }
.squad-members { font-size: 12px; color: var(--text-secondary); padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.06); }

/* --- メカニック --- */
.mech-overview { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; margin-bottom: 80px; }
.mech-overview-text h3 { font-family: var(--font-serif); font-size: 22px; margin-bottom: 16px; }
.mech-overview-text p { font-size: 14px; color: var(--text-secondary); line-height: 2; margin-bottom: 32px; }
.mech-placeholder { width: 100%; height: 400px; background: var(--bg-card); border: 1px solid rgba(124,92,191,0.2); border-radius: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.mech-placeholder img { width: 100%; height: 100%; object-fit: cover; }
.sync-rates { display: flex; flex-direction: column; gap: 16px; }
.sync-bar { position: relative; }
.sync-label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.sync-fill { height: 4px; background: var(--sync-color); width: var(--sync-width); border-radius: 2px; box-shadow: 0 0 10px color-mix(in srgb, var(--sync-color) 40%, transparent); transition: width 1.5s ease; }
.sync-value { font-family: var(--font-display); font-size: 11px; color: var(--text-muted); position: absolute; right: 0; top: 0; }
.mech-section-title { font-family: var(--font-display); font-size: 14px; letter-spacing: 3px; text-align: center; color: var(--accent-crystal-light); margin-bottom: 32px; }
.mech-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.mech-card {
  background: var(--bg-card);
  background-image: url('assets/generated/tex_metal_brushed.png');
  background-size: cover;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px; padding: 28px 24px; transition: all 0.3s;
}
.mech-card:hover { border-color: rgba(124,92,191,0.3); transform: translateY(-3px); }
.mech-card.special { border-color: rgba(124,92,191,0.3); background: linear-gradient(135deg, var(--bg-card) 0%, rgba(124,92,191,0.08) 100%); animation: borderGlow 3s ease infinite; }
.mech-card-header { font-family: var(--font-display); font-size: 11px; letter-spacing: 2px; color: var(--accent-crystal-light); margin-bottom: 8px; }
.mech-card h4 { font-family: var(--font-serif); font-size: 18px; margin-bottom: 4px; }
.mech-type { font-size: 12px; color: var(--accent-cyan); margin-bottom: 12px; }
.mech-card p:last-child { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }

/* --- 相関図 --- */
.relation-chart { margin-top: 48px; }
.relation-placeholder {
  background: var(--bg-card);
  background-image: url('assets/generated/tex_crystal_energy.png');
  background-size: 512px 512px;
  border: 1px solid rgba(124,92,191,0.15); border-radius: 4px; padding: 48px;
}
.relation-nodes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.relation-group { background: rgba(0,0,0,0.2); border: 1px solid color-mix(in srgb, var(--group-color) 25%, transparent); border-radius: 4px; padding: 20px; transition: all 0.3s; }
.relation-group:hover { border-color: var(--group-color); box-shadow: 0 0 16px color-mix(in srgb, var(--group-color) 10%, transparent); }
.relation-group-label { font-family: var(--font-display); font-size: 11px; letter-spacing: 1px; color: var(--group-color); margin-bottom: 12px; }
.relation-node { display: inline-block; padding: 4px 12px; margin: 4px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 2px; font-size: 13px; color: var(--text-secondary); transition: all 0.3s; cursor: pointer; }
.relation-node:hover { border-color: var(--group-color); color: var(--text-primary); background: rgba(255,255,255,0.08); }
.relation-note { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 32px; }

/* --- サブキャラ --- */
.subchar-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; margin-top: 48px; }
.subchar-category h3 { font-family: var(--font-display); font-size: 14px; letter-spacing: 2px; color: var(--accent-crystal-light); margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid rgba(124,92,191,0.2); }
.subchar-item { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.subchar-name { font-size: 14px; }
.subchar-title { font-size: 12px; color: var(--text-muted); }

/* --- ギャラリー --- */
.gallery-tabs { display: flex; justify-content: center; gap: 8px; margin-bottom: 32px; }
.gallery-tab { font-family: var(--font-display); font-size: 11px; letter-spacing: 2px; padding: 8px 20px; border: 1px solid rgba(255,255,255,0.1); border-radius: 2px; transition: all 0.3s; }
.gallery-tab:hover { border-color: rgba(255,255,255,0.3); }
.gallery-tab.active { border-color: var(--accent-crystal); background: rgba(124,92,191,0.15); }
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.gallery-item { aspect-ratio: 16/9; border-radius: 4px; overflow: hidden; cursor: pointer; transition: all 0.4s; }
.gallery-item:hover { transform: scale(1.03); box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.gallery-placeholder { width: 100%; height: 100%; background: var(--bg-card); border: 1px solid rgba(255,255,255,0.06); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 10px; letter-spacing: 1px; color: var(--text-muted); text-align: center; line-height: 1.8; }

/* --- メディア --- */
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 48px; }
.media-card { background: var(--bg-card); border: 1px solid rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; transition: all 0.3s; }
.media-card:hover { transform: translateY(-4px); border-color: rgba(124,92,191,0.3); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.media-thumbnail { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--bg-dark) 0%, rgba(124,92,191,0.08) 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; position: relative; overflow: hidden; }
.media-thumbnail::before { content: ''; position: absolute; inset: 0; border: 1px solid rgba(124,92,191,0.1); }
.media-play-icon { font-size: 40px; color: var(--accent-crystal); opacity: 0.4; transition: opacity 0.3s; }
.media-card:hover .media-play-icon { opacity: 0.8; }
.media-thumbnail p { font-family: var(--font-display); font-size: 10px; letter-spacing: 2px; color: var(--text-muted); }
.media-card h4 { padding: 16px 16px 4px; font-size: 15px; }
.media-card > p { padding: 0 16px 16px; font-size: 13px; color: var(--text-muted); }

/* --- 用語集 --- */
.glossary-list { max-width: 800px; margin: 48px auto 0; }
.glossary-item { border-bottom: 1px solid rgba(255,255,255,0.06); }
.glossary-header { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 18px 0; text-align: left; transition: color 0.3s; }
.glossary-header:hover { color: var(--accent-crystal-light); }
.glossary-term { font-size: 15px; font-weight: 500; }
.glossary-toggle { font-family: var(--font-display); font-size: 18px; color: var(--accent-crystal); transition: transform 0.3s; width: 24px; text-align: center; }
.glossary-item.open .glossary-toggle { transform: rotate(45deg); }
.glossary-body { max-height: 0; overflow: hidden; transition: max-height 0.4s ease, padding 0.4s ease; }
.glossary-item.open .glossary-body { max-height: 300px; padding-bottom: 18px; }
.glossary-body p { font-size: 14px; color: var(--text-secondary); line-height: 2; padding-left: 16px; border-left: 2px solid var(--accent-crystal); }

/* --- フッター --- */
.site-footer { background: var(--bg-darkest); padding: 64px 0 32px; border-top: 1px solid rgba(124,92,191,0.15); }
.footer-top { display: flex; justify-content: space-between; align-items: flex-start; }
.footer-logo { display: flex; flex-direction: column; gap: 4px; }
.footer-icon { font-size: 28px; color: var(--accent-crystal); margin-bottom: 4px; }
.footer-logo h3 { font-family: var(--font-display); font-size: 16px; letter-spacing: 4px; }
.footer-logo p { font-size: 12px; color: var(--text-muted); }
.footer-nav { display: flex; gap: 24px; }
.footer-nav a { font-family: var(--font-display); font-size: 10px; letter-spacing: 2px; color: var(--text-muted); transition: color 0.3s; }
.footer-nav a:hover { color: var(--text-primary); }
.footer-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 40px 0 24px; }
.footer-copy { font-size: 12px; color: var(--text-muted); text-align: center; }

/* --- レスポンシブ --- */
@media (max-width: 1024px) {
  .char-grid { grid-template-columns: repeat(3, 1fr); }
  .squad-grid, .mech-grid { grid-template-columns: repeat(2, 1fr); }
  .story-grid { grid-template-columns: 1fr; }
  .story-visual { position: static; }
  .mech-overview { grid-template-columns: 1fr; }
  .relation-nodes { grid-template-columns: repeat(2, 1fr); }
  .modal-container { grid-template-columns: 1fr; max-width: 560px; }
  .modal-left { padding: 24px; flex-direction: row; gap: 16px; }
  .modal-char-placeholder { width: 120px; height: 160px; margin: 0; }
  .modal-prev { left: 8px; }
  .modal-next { right: 8px; }
}
@media (max-width: 768px) {
  .section { padding: 80px 0; }
  .hamburger { display: flex; }
  .nav-links { position: fixed; top: var(--nav-height); right: -280px; width: 280px; height: calc(100vh - var(--nav-height)); background: rgba(5,8,15,0.98); flex-direction: column; padding: 32px; gap: 0; transition: right 0.3s; backdrop-filter: blur(12px); }
  .nav-links.open { right: 0; }
  .nav-links li a { display: block; padding: 12px 0; }
  .hero-title { font-size: 40px; letter-spacing: 6px; }
  .hero-subtitle { font-size: 16px; letter-spacing: 2px; }
  .section-title { font-size: 28px; }
  .char-grid { grid-template-columns: repeat(2, 1fr); }
  .char-tabs { gap: 4px; }
  .char-tab { font-size: 9px; padding: 8px 10px; }
  .squad-grid, .mech-grid, .world-cards, .media-grid, .subchar-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .relation-nodes { grid-template-columns: 1fr; }
  .footer-top { flex-direction: column; gap: 24px; }
  .footer-nav { flex-wrap: wrap; gap: 16px; }
  .modal-container { width: 95vw; grid-template-columns: 1fr; }
  .modal-left { display: none; }
}
@media (max-width: 480px) {
  .hero-title { font-size: 30px; letter-spacing: 4px; }
  .char-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .char-card-desc { display: none; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
}

/* ========================================
   追加スタイル: 開発中バッジ
   ======================================== */
.dev-badge-container {
  display: flex; justify-content: center; margin-bottom: 20px;
}
.dev-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 24px;
  background: rgba(255, 165, 2, 0.1);
  border: 1px solid rgba(255, 165, 2, 0.4);
  border-radius: 2px;
  font-family: var(--font-display);
  font-size: 11px; letter-spacing: 3px;
  color: #ffa502;
  animation: borderGlow 3s ease infinite;
  text-shadow: 0 0 10px rgba(255, 165, 2, 0.3);
}
.dev-badge-icon { font-size: 16px; }

/* ========================================
   追加スタイル: キャラ実画像
   ======================================== */
.char-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.char-card:hover .char-img {
  transform: scale(1.05);
}
.modal-char-img {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.3s;
}

/* ========================================
   追加スタイル: ライトボックス
   ======================================== */
.lightbox {
  position: fixed; inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.95);
  display: none; align-items: center; justify-content: center;
  cursor: pointer;
}
.lightbox.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}
.lightbox img {
  max-width: 90vw; max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 0 60px rgba(124, 92, 191, 0.3);
  cursor: default;
}
.lightbox-close {
  position: absolute; top: 24px; right: 32px;
  font-size: 36px; color: rgba(255,255,255,0.7);
  background: none; border: none; cursor: pointer;
  transition: color 0.3s;
  z-index: 10001;
}
.lightbox-close:hover { color: #fff; }

/* ========================================
   追加スタイル: ナビ戻りリンク
   ======================================== */
.nav-back-link {
  color: var(--accent-gold) !important;
  font-size: 10px !important;
}
.nav-back-link:hover {
  color: #fff !important;
}

/* ========================================
   追加スタイル: ナビドロップダウン
   ======================================== */
.nav-dropdown {
  position: relative;
}
.nav-more-link {
  color: var(--accent-cyan) !important;
}
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 180px;
  background: rgba(10, 16, 32, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(124, 92, 191, 0.3);
  border-radius: 4px;
  padding: 8px 0;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
}
.nav-dropdown-menu li {
  list-style: none;
}
.nav-dropdown-menu li a {
  display: block;
  padding: 10px 16px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.2s;
  letter-spacing: 0;
}
.nav-dropdown-menu li a:hover {
  background: rgba(124, 92, 191, 0.15);
  color: var(--text-primary);
}

/* ========================================
   追加スタイル: 関連ページカード
   ======================================== */
.pages-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}
.page-link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 20px;
  background: var(--bg-card);
  border: 1px solid rgba(124, 92, 191, 0.15);
  border-radius: 6px;
  transition: all 0.4s ease;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.page-link-card:hover {
  border-color: var(--accent-crystal);
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(124, 92, 191, 0.2);
  background: var(--bg-card-hover);
}
.page-link-icon {
  font-size: 36px;
  margin-bottom: 16px;
}
.page-link-card h3 {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--accent-crystal-light);
  margin-bottom: 10px;
}
.page-link-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* レスポンシブ: 関連ページ */
@media (max-width: 1024px) {
  .pages-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .pages-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .pages-grid { grid-template-columns: 1fr; }
}

