/* ========== CSS VARIABLES ========== */
:root {
  /* Ghostly ectoplasm greens */
  --primary: #6B9E6D;
  --primary-dark: #4A7C4C;
  --primary-light: #A3CFA5;
  --ghost-glow: #C8E6C9;
  --ectoplasm: #8FBC8F;

  /* Apartment-living beiges */
  --beige: #D4C5B9;
  --beige-light: #EDE4DB;
  --beige-dark: #B8A898;
  --warm-bg: #FBF8F4;
  --warm-bg-alt: #F5F0EB;

  /* Neutral */
  --white: #FFFFFF;
  --cream: #FDFAF6;
  --text-primary: #3D3227;
  --text-secondary: #6B5E52;
  --text-muted: #9B8E82;
  --border: #E0D5CA;

  /* Accent */
  --accent-purple: #7B6888;
  --accent-purple-light: #A895B5;
  --shadow: rgba(61, 50, 39, 0.08);
  --shadow-md: rgba(61, 50, 39, 0.12);
  --shadow-lg: rgba(61, 50, 39, 0.18);

  /* Typography */
  --font-sans: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --font-serif: 'Georgia', 'Noto Serif SC', 'SimSun', serif;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s ease;
}

/* ========== RESET ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--warm-bg);
  -webkit-font-smoothing: antialiased;
}

/* ========== HAUNTED BACKGROUND PATTERN ========== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(107, 158, 109, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(123, 104, 136, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(212, 197, 185, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

/* Ouija planchette decorative pattern */
main::after {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background:
    radial-gradient(circle at center, transparent 98px, rgba(107, 158, 109, 0.03) 99px, transparent 100px),
    linear-gradient(0deg, transparent calc(50% - 1px), rgba(107, 158, 109, 0.04) calc(50% - 0.5px), rgba(107, 158, 109, 0.04) calc(50% + 0.5px), transparent calc(50% + 1px)),
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(107, 158, 109, 0.04) calc(50% - 0.5px), rgba(107, 158, 109, 0.04) calc(50% + 0.5px), transparent calc(50% + 1px));
  pointer-events: none;
  z-index: -1;
  opacity: 0.7;
}

/* ========== HEADER & NAVIGATION ========== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 248, 244, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px var(--shadow);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-dark);
  text-decoration: none;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.logo:hover { color: var(--primary); }

nav { display: flex; align-items: center; gap: 4px; }
nav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: var(--transition);
  position: relative;
}
nav a:hover, nav a.active {
  color: var(--primary-dark);
  background: rgba(107, 158, 109, 0.08);
}
nav a.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  text-decoration: none;
  border-radius: 24px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(107, 158, 109, 0.3);
}
.header-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(107, 158, 109, 0.4);
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-dark));
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: var(--transition);
}
.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 SECTION ========== */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.55);
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(75, 50, 40, 0.5) 0%,
    rgba(251, 248, 244, 0.9) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 60px 24px;
  max-width: 800px;
}

.hero-tag {
  display: inline-block;
  padding: 4px 16px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  color: var(--white);
  font-size: 0.85rem;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--white);
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
  margin-bottom: 12px;
  line-height: 1.3;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 6px rgba(0,0,0,0.3);
  margin-bottom: 24px;
}

/* Page-specific hero backgrounds */
.hero-home .hero-bg { background-image: url('../img/header.jpg'); }
.hero-story .hero-bg { background-image: url('../img/screenshot-02.jpg'); }
.hero-characters .hero-bg { background-image: url('../img/screenshot-03.jpg'); }
.hero-guide .hero-bg { background-image: url('../img/screenshot-04.jpg'); }
.hero-faq .hero-bg { background-image: url('../img/header.jpg'); }

/* ========== CONTENT SECTIONS ========== */
.content-section {
  padding: 60px 24px;
  max-width: 1000px;
  margin: 0 auto;
}

.content-section h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  position: relative;
  padding-bottom: 16px;
}

.content-section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 2px;
}

.content-section h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 32px 0 12px;
}

.content-section p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.8;
}

.content-section .lead {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 24px;
}

/* ========== SECTION ALTERNATING ========== */
.section-alt {
  background: var(--warm-bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-alt .content-section { padding-top: 60px; padding-bottom: 60px; }

/* ========== INTRO SECTION (Home) ========== */
.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.intro-text p {
  font-size: 1.05rem;
  line-height: 1.9;
}

.intro-image img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 8px 30px var(--shadow-md);
}

/* ========== FEATURE CARDS ========== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  opacity: 0;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--shadow-md);
}

.feature-card:hover::before { opacity: 1; }

.feature-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  display: block;
}

.feature-card h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

/* ========== SCREENSHOT GALLERY ========== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.gallery-grid img {
  width: 100%;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px var(--shadow);
}

.gallery-grid img:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 30px var(--shadow-md);
}

/* ========== PLAYER REVIEWS ========== */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 24px;
}

.review-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
}

.review-card::before {
  content: '"';
  position: absolute;
  top: 8px;
  left: 16px;
  font-family: var(--font-serif);
  font-size: 3rem;
  color: var(--primary-light);
  line-height: 1;
  opacity: 0.3;
}

.review-stars {
  color: #D4A853;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.review-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 12px;
}

.review-author {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ========== CTA BANNER ========== */
.cta-banner {
  background: linear-gradient(135deg, var(--primary-dark), var(--accent-purple));
  padding: 48px 24px;
  text-align: center;
}

.cta-banner h2 {
  color: var(--white);
  font-family: var(--font-serif);
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.cta-banner p {
  color: rgba(255,255,255,0.85);
  margin-bottom: 24px;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 36px;
  background: var(--white);
  color: var(--primary-dark);
  text-decoration: none;
  border-radius: 28px;
  font-weight: 700;
  font-size: 1.05rem;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.3);
}

/* ========== STORY PAGE ========== */
.story-timeline {
  position: relative;
  padding-left: 32px;
  margin: 24px 0;
}

.story-timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), var(--primary-light), var(--primary));
}

.story-event {
  position: relative;
  margin-bottom: 28px;
  padding-left: 20px;
}

.story-event::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--warm-bg);
  box-shadow: 0 0 0 1px var(--primary-light);
}

.story-event h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--primary-dark);
  margin: 0 0 4px;
}

.story-event p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0;
}

/* ========== CHARACTER PAGE ========== */
.char-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.char-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  gap: 20px;
  transition: var(--transition);
}

.char-card:hover {
  box-shadow: 0 8px 30px var(--shadow-md);
  transform: translateY(-2px);
}

.char-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--beige-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--primary-dark);
  flex-shrink: 0;
}

.char-info h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.char-actor {
  font-size: 0.8rem;
  color: var(--accent-purple);
  margin-bottom: 8px;
}

.char-info p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

.char-trait {
  display: inline-block;
  padding: 2px 10px;
  background: var(--ghost-glow);
  color: var(--primary-dark);
  border-radius: 12px;
  font-size: 0.78rem;
  margin: 4px 4px 0 0;
}

/* ========== GUIDE PAGE ========== */
.guide-block {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.guide-block h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--primary-dark);
}

.guide-step {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.guide-step:last-child { border-bottom: none; }

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.step-content h4 {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.step-content p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
}

/* ========== FAQ PAGE ========== */
.faq-list {
  margin-top: 24px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--white);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: left;
  transition: var(--transition);
}

.faq-question:hover { background: var(--warm-bg-alt); }

.faq-arrow {
  font-size: 1.2rem;
  color: var(--primary);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 16px;
}

.faq-item.open .faq-arrow { transform: rotate(180deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.faq-item.open .faq-answer { max-height: 600px; }

.faq-answer-inner {
  padding: 0 24px 20px;
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 0.95rem;
}

/* ========== LIGHTBOX ========== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 200;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  color: var(--white);
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 201;
}

/* ========== FOOTER ========== */
footer {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  background: var(--warm-bg-alt);
}

footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ========== UTILITY CLASSES ========== */
.prose {
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 1rem;
}

.prose p { margin-bottom: 16px; }

.text-center { text-align: center; }
.gallery-note { text-align: center; margin-top: 16px; color: var(--text-muted); font-size: 0.9rem; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .header-inner { padding: 0 16px; }

  .hamburger { display: flex; }

  nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(251, 248, 244, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
    box-shadow: 0 8px 24px var(--shadow);
  }

  nav.open { display: flex; }

  nav a {
    padding: 12px 24px;
    border-radius: 0;
    width: 100%;
  }

  nav a.active::after { display: none; }

  .hero-title { font-size: 2rem; }
  .hero { min-height: 320px; }

  .intro-grid { grid-template-columns: 1fr; gap: 24px; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .reviews-grid { grid-template-columns: 1fr; }
  .char-grid { grid-template-columns: 1fr; }

  .content-section h2 { font-size: 1.6rem; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.6rem; }
  .hero { min-height: 260px; }

  .features-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .char-card { flex-direction: column; align-items: center; text-align: center; }

  .header-cta {
    padding: 8px 16px;
    font-size: 0.82rem;
  }

  .content-section { padding: 40px 16px; }
  .content-section h2 { font-size: 1.4rem; }
}
