/* ============================================================
   index.css — 首頁專用樣式
   「沉默是金。」
   ============================================================ */


/* ============================================================
   0 — 首頁 body 背景覆蓋（防止側邊洩出全站預設暗灰）
   ============================================================ */

body {
  background-color: var(--landing-bg);
}


/* ============================================================
   A — Loading 覆蓋層
   ============================================================ */

#loading-screen {
  position: fixed;
  inset: 0;
  z-index: var(--z-loading);
  background-color: var(--landing-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#loading-logo {
  position: relative;
  z-index: 2;
  width: min(480px, 80vw);
  height: auto;
  object-fit: contain;
  filter: blur(20px);
  opacity: 0;
  transform: scale(var(--logo-scale, 1));
  transform-origin: center center;
  /* JS 動畫從 opacity:0→1, blur(20px)→blur(0px) */
}

/* 碎裂片段：初始隱藏，飛散時由 GSAP 控制（opacity 0→1→0）*/
.loading-fragment {
  position: absolute;
  inset: 0;
  background-color: var(--landing-bg);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.45) inset;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
}

#frag-1 { clip-path: polygon(0 0, 42% 0, 35% 38%, 0 25%); }
#frag-2 { clip-path: polygon(42% 0, 100% 0, 100% 20%, 60% 32%, 35% 38%); }
#frag-3 { clip-path: polygon(0 25%, 35% 38%, 28% 65%, 0 55%); }
#frag-4 { clip-path: polygon(35% 38%, 60% 32%, 100% 20%, 100% 70%, 65% 62%, 28% 65%); }
#frag-5 { clip-path: polygon(0 55%, 28% 65%, 20% 100%, 0 100%); }
#frag-6 { clip-path: polygon(28% 65%, 65% 62%, 100% 70%, 100% 100%, 20% 100%); }


/* ============================================================
   B — Hero 區塊
   ============================================================ */

#hero {
  min-height: 100vh;
  background-color: var(--landing-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  /* Hero 需要真正全高，抵消 page-wrapper 的 padding-top */
  margin-top: -4rem;
  padding-top: 4rem;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  opacity: 0;
  /* 由 JS GSAP 控制淡入 */
}

#hero-logo {
  width: min(480px, 80vw);
  height: auto;
  object-fit: contain;
  filter: none;
  /* CMS 可調整大小：transform 不影響 layout flow，subtitle 間距始終固定 */
  transform: scale(var(--logo-scale, 1));
  transform-origin: center bottom;
}

.hero-subtitle {
  margin-top: 1.5rem;
  color: var(--landing-accent);
  letter-spacing: 0.3em;
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  font-family: var(--font-scripture);
  font-style: italic;
  text-transform: uppercase;
}

/* 掃描線定位（樣式本體已在 global.css） */
#hero .scanline-full {
  top: 40%;
}


/* ============================================================
   B2 — 世界觀簡介區
   ============================================================ */

#intro {
  background-color: var(--landing-bg);
  padding: 4rem 2rem 2rem;
}

.intro-content {
  max-width: 700px;
  margin: 0 auto;
  border-left: 2px solid rgba(184, 168, 138, 0.25);
  padding-left: 2rem;
}

.intro-para {
  font-family: var(--font-sacred);
  font-size: clamp(0.92rem, 1.8vw, 1.05rem);
  line-height: 2.1;
  letter-spacing: 0.05em;
  color: var(--landing-accent);
  margin: 0 0 1.5rem;
  opacity: 0;
}

.intro-para:first-child {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
}

@media (max-width: 767px) {
  #intro { padding: 3rem 1.2rem 1.5rem; }
  .intro-content { padding-left: 1.2rem; }
}


/* ============================================================
   C — 三入口導航區
   ============================================================ */

#nav-entries {
  background-color: var(--landing-bg);
  padding: 2rem 4rem 6rem;
  max-width: 900px;
  margin: 0 auto;
}

.nav-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.8rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--sodo-text-primary);
  transition: color var(--transition-smooth);
  overflow: hidden;
}

.nav-entry:first-child {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-entry:hover {
  color: #fff;
}

.nav-entry__label {
  font-family: var(--font-sacred);
  font-weight: 400;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  line-height: 1.1;
  flex-shrink: 0;
  color: var(--landing-accent);
}

.nav-entry__label em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.35em;
  letter-spacing: 0.2em;
  color: var(--sodo-text-secondary);
  vertical-align: middle;
  margin-left: 0.6em;
  transition: color var(--transition-smooth);
  display: inline-block;
}

.nav-entry:hover .nav-entry__label em {
  color: var(--sodo-accent-bright);
}

/* 預覽圖容器：初始 width 0，由 JS GSAP 展開 */
.nav-entry__preview {
  width: 0;
  opacity: 0;
  overflow: hidden;
  flex-shrink: 0;
  margin-left: 2rem;
}

.nav-entry__preview img {
  width: 200px;
  height: 130px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

/* 角色縮圖橫排 */
.nav-entry__preview--chars {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-entry__preview--chars img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}


/* ============================================================
   D — 底部打字機標語
   ============================================================ */

#typewriter-tagline {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.28);
  pointer-events: none;
  z-index: 50;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.6s ease;
}

#typewriter-tagline.visible {
  opacity: 1;
}


/* ============================================================
   E — 響應式
   ============================================================ */

@media (max-width: 767px) {
  #nav-entries {
    padding: 1.5rem 1.5rem 4rem;
  }

  .nav-entry {
    padding: 1.4rem 0;
  }

  /* Mobile 不顯示 hover 預覽圖 */
  .nav-entry__preview {
    display: none;
  }

  .nav-entry__label {
    font-size: clamp(1.4rem, 6vw, 2rem);
  }

  .hero-subtitle {
    letter-spacing: 0.15em;
    font-size: 0.8rem;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  #nav-entries {
    padding: 2rem 3rem 5rem;
  }

  .nav-entry__preview img {
    width: 160px;
    height: 105px;
  }

  .nav-entry__preview--chars img {
    width: 50px;
    height: 50px;
  }
}
