/* ========================================
   共通スタイル - 雲の王国
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Noto+Serif+JP:wght@300;400;500;700&display=swap');

/* --- CSS 変数 --- */
:root {
  --bg-dark:       #07091a;
  --bg-surface:    #0d1226;
  --bg-card:       #121830;
  --color-primary: #4a9ede;
  --color-accent:  #c8a84b;
  --color-accent-l:#e8c870;
  --color-text:    #dde4f0;
  --color-muted:   #dde4f0;
  --color-border:  #1e2a45;

  --font-en: 'Cinzel', serif;
  --font-ja: 'Noto Serif JP', serif;

  --header-h:   70px;
  --section-gap: 80px;
  --max-w:      1100px;
  --radius:     4px;
  --transition: 0.3s ease;
}

/* --- リセット / ベース --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(ellipse 90% 70% at 50% 30%, rgba(20, 60, 140, 0.55) 0%, transparent 70%),
    radial-gradient(ellipse at 50% -10%, rgba(80, 140, 255, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 90%,  rgba(200, 168, 75, 0.07) 0%, transparent 45%),
    linear-gradient(to bottom, #0e2244 0%, #0a1632 30%, #08111f 60%, #07091a 100%);
  background-attachment: fixed;
  color: var(--color-text);
  font-family: var(--font-ja);
  font-weight: 400;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

/* グローバル星空背景 */
#global-bg-stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* --- メインサイト wrapper（オープニング後に visible クラスで表示）--- */
.main-site {
  position: relative;
  z-index: 1;
  opacity: 0;
  transition: opacity 1s ease;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-site.visible {
  opacity: 1;
}

/* ========================================
   Header / Navigation
   ======================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-h);
  z-index: 100;
  background: linear-gradient(to bottom,
    rgba(7, 9, 26, 0.97) 0%,
    rgba(7, 9, 26, 0.80) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 24px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.site-logo a {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.logo-text-en {
  font-family: var(--font-ja);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  color: var(--color-accent);
  opacity: 0.85;
}

.logo-text-ja {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--color-text);
}

.header-logo-img {
  height: 38px;
  width: auto;
  display: block;
}

.site-nav {
  margin-left: auto;
  --nav-link-color: var(--color-muted);
}

.site-nav ul {
  display: flex;
  gap: 2rem;
}

.site-nav a {
  font-family: var(--font-en);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--nav-link-color);
  transition: color var(--transition);
  position: relative;
  padding-bottom: 4px;
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-accent);
  transition: width var(--transition);
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--color-accent-l);
}

.site-nav a:hover::after,
.site-nav a.active::after {
  width: 100%;
}

.site-nav a.coming-soon {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.lang-toggle {
  background: none;
  border: 1px solid var(--color-muted);
  color: var(--color-text);
  font-family: var(--font-en);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  padding: 6px 14px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: color var(--transition), border-color var(--transition);
}

.lang-toggle:hover {
  color: var(--color-accent-l);
  border-color: var(--color-accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 1.2rem;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: var(--radius);
  margin-left: auto;
}

/* ========================================
   ページ内部用ヒーロー (inner pages)
   ======================================== */
.page-hero {
  padding-top: var(--header-h);
  min-height: 200px;
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(74, 158, 222, 0.07) 0%, transparent 60%);
}

.page-hero-inner {
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px;
}

.page-hero-en {
  font-family: var(--font-en);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--color-text);
  line-height: 1;
}

.page-hero-ja {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  color: var(--color-muted);
  margin-top: 8px;
}

/* 星 - 全ページ共通（top.css の hero-stars / common.js の global-bg-stars 両方で使用） */
.star {
  position: absolute;
  border-radius: 50%;
  opacity: var(--min-op, 0.2);
  animation: starTwinkle var(--dur, 5s) ease-in-out var(--delay, 0s) infinite alternate;
}

@keyframes starTwinkle {
  from { opacity: var(--min-op, 0.15); }
  to   { opacity: var(--max-op, 0.8); }
}

/* ========================================
   Section 共通
   ======================================== */
.section {
  padding: var(--section-gap) 0;
}

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.section-title {
  display: flex;
  flex-direction: column;
  margin-bottom: 40px;
  position: relative;
  padding-bottom: 16px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 44px;
  height: 2px;
  background: linear-gradient(to right, var(--color-accent), transparent);
}

.section-title .en {
  font-family: var(--font-en);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-text);
}

.section-title .ja {
  font-size: 0.72rem;
  color: var(--color-muted);
  letter-spacing: 0.22em;
  margin-top: 4px;
}

/* ========================================
   ボタン
   ======================================== */
.btn-outline {
  display: inline-block;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  font-family: var(--font-en);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  padding: 10px 28px;
  transition: background var(--transition), color var(--transition);
}

.btn-outline:hover {
  background: var(--color-accent);
  color: var(--bg-dark);
}

.text-center {
  text-align: center;
  margin-top: 40px;
}

/* プレースホルダー表示 */
.page-placeholder {
  color: var(--color-muted);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-align: center;
  padding: 60px 0;
  border: 1px dashed var(--color-border);
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
  background: rgba(7, 9, 26, 0.97);
  border-top: 1px solid var(--color-border);
  padding: 40px 0 24px;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}

.footer-logo {
  height: 32px;
  width: auto;
  margin: 0 auto 16px;
  opacity: 0.75;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 24px;
}

.footer-nav a {
  font-family: var(--font-en);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  color: var(--color-muted);
  transition: color var(--transition);
}

.footer-nav a:hover {
  color: var(--color-text);
}

.footer-copy {
  font-size: 0.68rem;
  color: var(--color-muted);
  letter-spacing: 0.05em;
}

/* ========================================
   モバイルナビ オーバーレイ
   ======================================== */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.50);
  z-index: 98;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.38s ease;
}

.nav-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

@keyframes spNavItemIn {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ========================================
   レスポンシブ (768px 以下)
   ======================================== */
@media (max-width: 768px) {
  :root {
    --header-h:    60px;
    --section-gap: 60px;
  }

  .site-nav {
    --nav-link-color: #ffffff;
    display: block;
    position: fixed;
    top: var(--header-h);
    right: 0;
    left: auto;
    width: 72vw;
    max-width: 280px;
    height: calc(100vh - var(--header-h));
    background: rgba(7, 9, 26, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 36px 28px;
    border-left: 1px solid var(--color-border);
    border-bottom: none;
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0.38s;
    z-index: 101;
  }

  .site-nav.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0s;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .site-nav a {
    display: block;
    font-size: 0.95rem;
    padding: 16px 0;
    border-bottom: 1px solid rgba(30, 42, 69, 0.6);
  }

  .site-nav li {
    opacity: 0;
    transform: translateX(28px);
  }

  .site-nav.open li {
    animation: spNavItemIn 0.4s cubic-bezier(0.2, 0, 0.1, 1) forwards;
  }

  .site-nav.open li:nth-child(1) { animation-delay: 0.10s; }
  .site-nav.open li:nth-child(2) { animation-delay: 0.18s; }
  .site-nav.open li:nth-child(3) { animation-delay: 0.26s; }
  .site-nav.open li:nth-child(4) { animation-delay: 0.34s; }
  .site-nav.open li:nth-child(5) { animation-delay: 0.42s; }

  .nav-toggle {
    display: block;
  }

  .section-title .en {
    font-size: 1.4rem;
  }

  .page-hero-en {
    font-size: 1.6rem;
  }

  .footer-nav {
    display: none;
  }
}
