/* ========== CSS VARIABLES ========== */
:root {
  /* Eden Genesis Color Palette */
  --bg: #faf7f0;
  --bg-warm: #f5f0e6;
  --bg-cream: #fdfaf3;
  --bg-card: #ffffff;
  --text: #2c2416;
  --text-soft: #5c4e3a;
  --text-muted: #8a7b66;

  /* Apple Reds — Genesis forbidden fruit */
  --apple-red: #C0392B;
  --apple-red-light: #E74C3C;
  --apple-red-dark: #8B1A1A;
  --apple-crimson: #A93226;

  /* Eden Greens — Garden paradise */
  --eden-green: #27AE60;
  --eden-green-light: #2ECC71;
  --eden-green-dark: #1E8449;
  --eden-leaf: #229954;

  /* Serpent Gold — Snake-coil accents */
  --serpent-gold: #D4A017;
  --serpent-gold-light: #E8C547;

  /* Neutral + Header */
  --header-bg: #1a1a2e;
  --header-text: #e8e0d4;
  --header-border: #C0392B;
  --border: #e0d8c8;

  /* Fonts */
  --font-serif: 'Noto Serif SC', 'SimSun', 'STSong', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
}

/* ========== RESET & BASE ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  /* Serpent-coil subtle body pattern */
  background-image:
    radial-gradient(circle at 50% 50%, transparent 0%, var(--bg) 100%),
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 40px,
      rgba(192,57,43,0.02) 40px,
      rgba(192,57,43,0.02) 41px
    );
}

/* ========== ACCESSIBILITY ========== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ========== HEADER & NAV ========== */
header {
  background: var(--header-bg);
  border-bottom: 3px solid var(--header-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
header .header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
}
header .logo {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--header-text);
  text-decoration: none;
  letter-spacing: 0.05em;
}
header .logo::before {
  content: '🍎 ';
  font-size: 1.1rem;
}
nav { display: flex; align-items: center; gap: 28px; }
nav a {
  color: var(--header-text);
  text-decoration: none;
  font-size: 0.95rem;
  position: relative;
  padding: 4px 0;
  transition: color 0.2s;
}
nav a:hover { color: var(--serpent-gold-light); }
nav a.active { color: var(--apple-red-light); }
nav a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--apple-red-light);
  border-radius: 2px;
}

/* Header CTA Button */
.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--apple-red), var(--apple-red-dark));
  color: #fff;
  padding: 8px 20px;
  border-radius: 24px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.25s;
  box-shadow: 0 2px 8px rgba(192,57,43,0.3);
  white-space: nowrap;
}
.btn-cta:hover {
  background: linear-gradient(135deg, var(--apple-red-light), var(--apple-red));
  box-shadow: 0 4px 16px rgba(192,57,43,0.45);
  transform: translateY(-1px);
}
.btn-cta::after { content: ' 🍃'; font-size: 0.85rem; }

/* 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(--header-text);
  border-radius: 2px;
  transition: all 0.3s;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* ========== HERO SECTION ========== */
.hero {
  position: relative;
  text-align: center;
  padding: 60px 24px 80px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #1a1a2e 0%, #2d1f1f 40%, #3d2a1a 100%);
}
/* Serpent-coil decorative overlay */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 80% 20%, rgba(212,160,23,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 80%, rgba(192,57,43,0.1) 0%, transparent 50%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--apple-red), var(--serpent-gold), var(--eden-green), var(--serpent-gold), var(--apple-red));
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.35;
}
.hero.hero-home .hero-bg { background-image: url('../img/header.jpg'); }
.hero.hero-guide .hero-bg { background-image: url('../img/screenshot-03.jpg'); }
.hero.hero-story .hero-bg { background-image: url('../img/screenshot-05.jpg'); }
.hero.hero-characters .hero-bg { background-image: url('../img/screenshot-01.jpg'); }
.hero.hero-faq .hero-bg { background-image: url('../img/screenshot-04.jpg'); }

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}
.hero-title {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.hero-tagline {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.8);
  font-weight: 300;
  margin-bottom: 8px;
}
.hero-sub {
  font-size: 1.05rem;
  color: var(--serpent-gold-light);
  font-weight: 400;
}
.hero-meta {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.hero-meta span {
  background: rgba(255,255,255,0.1);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
}

/* Sub-page hero variants */
.hero-subpage { padding: 40px 24px 48px; }
.hero-subpage-title { font-size: 2rem; font-weight: 700; }

/* ========== MAIN CONTENT ========== */
main { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* Sections */
.section {
  padding: 60px 0;
}
.section-no-padding {
  padding: 0;
}
.section-alt {
  background: var(--bg-warm);
  padding: 60px 0;
}
.section-title-group {
  text-align: center;
  margin-bottom: 40px;
}
.section-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-soft);
}
.section-title-group-spaced { margin-top: 48px; }

/* ========== GAME INFO CARDS (index) ========== */
.game-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.info-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--eden-green);
  transition: transform 0.2s, box-shadow 0.2s;
}
.info-card:nth-child(2) { border-left-color: var(--apple-red); }
.info-card:nth-child(3) { border-left-color: var(--serpent-gold); }
.info-card:nth-child(4) { border-left-color: var(--eden-green-dark); }
.info-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.info-card h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 6px;
}
.info-card p {
  font-size: 0.9rem;
  color: var(--text-soft);
}

/* ========== FEATURE CARDS (index) ========== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.feature-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--apple-red);
  transition: all 0.25s;
}
.feature-card:nth-child(2) { border-top-color: var(--eden-green); }
.feature-card:nth-child(3) { border-top-color: var(--serpent-gold); }
.feature-card:nth-child(4) { border-top-color: var(--apple-red-dark); }
.feature-card:nth-child(5) { border-top-color: var(--eden-green-dark); }
.feature-card:nth-child(6) { border-top-color: var(--serpent-gold); }
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.feature-card .feature-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}
.feature-card h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text);
}
.feature-card p {
  font-size: 0.93rem;
  color: var(--text-soft);
}

/* ========== SCREENSHOT GALLERY (index) ========== */
.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.screenshot-grid img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s;
}
.screenshot-grid img:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-lg);
}

/* ========== REVIEWS (index) ========== */
.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.review-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.review-card::before {
  content: '"';
  font-family: var(--font-serif);
  font-size: 4rem;
  color: var(--apple-red);
  opacity: 0.2;
  position: absolute;
  top: 8px;
  left: 16px;
  line-height: 1;
}
.review-card p {
  font-size: 0.95rem;
  color: var(--text-soft);
  font-style: italic;
  padding-left: 28px;
}
.review-card .review-author {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: normal;
}

/* ========== CTA BANNER (index) ========== */
.cta-banner {
  background: linear-gradient(135deg, var(--apple-red-dark), var(--apple-crimson));
  color: #fff;
  text-align: center;
  padding: 50px 24px;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute;
  inset: -20px;
  background:
    radial-gradient(circle at 30% 50%, rgba(212,160,23,0.2) 0%, transparent 40%),
    radial-gradient(circle at 70% 50%, rgba(39,174,96,0.15) 0%, transparent 40%);
  pointer-events: none;
}
.cta-banner h2 {
  position: relative;
  font-family: var(--font-serif);
  font-size: 1.8rem;
  margin-bottom: 10px;
}
.cta-banner p {
  position: relative;
  font-size: 1.05rem;
  opacity: 0.9;
  margin-bottom: 20px;
}
.cta-banner .btn-cta {
  position: relative;
  font-size: 1.05rem;
  padding: 12px 36px;
  background: linear-gradient(135deg, var(--serpent-gold), var(--serpent-gold-light));
  color: var(--text);
  box-shadow: 0 4px 16px rgba(212,160,23,0.4);
}
.cta-banner .btn-cta:hover {
  box-shadow: 0 6px 24px rgba(212,160,23,0.55);
}

/* ========== CONTENT SECTIONS (guide, story, characters, faq) ========== */
.content-section {
  max-width: 850px;
  margin: 0 auto;
  padding: 40px 0;
}
.content-section h2 {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}
.content-section h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--apple-red-dark);
  margin: 28px 0 12px;
  padding-left: 12px;
  border-left: 4px solid var(--apple-red);
}
.content-section p {
  font-size: 1rem;
  color: var(--text-soft);
  margin-bottom: 16px;
}

/* ========== GUIDE PAGE ========== */
.guide-step {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--eden-green);
  position: relative;
}
.guide-step:nth-child(odd) { border-left-color: var(--apple-red); }
.guide-step h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--text);
  margin: 0 0 8px;
  border: none;
  padding: 0;
}
.guide-tip {
  background: linear-gradient(135deg, #fef9e7, #fdf2e9);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
  border-left: 4px solid var(--serpent-gold);
  font-size: 0.93rem;
  color: var(--text-soft);
}
.guide-tip strong { color: var(--apple-red-dark); }
.guide-intro {
  font-size: 1.05rem;
  color: var(--text-soft);
  margin-bottom: 24px;
  line-height: 1.9;
}
.route-desc {
  font-size: 0.95rem;
  color: var(--text-soft);
  margin-bottom: 16px;
}
.route-heading {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--eden-green-dark);
  margin: 32px 0 12px;
  border: none;
  padding: 0 0 0 12px;
  border-left: 4px solid var(--eden-green);
}
.guide-steps-wrapper { counter-reset: guide-step-counter; }

/* ========== STORY PAGE ========== */
.story-intro {
  font-size: 1.08rem;
  color: var(--text-soft);
  margin-bottom: 24px;
  line-height: 2;
}
.chapter-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--serpent-gold);
}
.chapter-card:nth-child(2n) { border-left-color: var(--apple-red); }
.chapter-card:nth-child(3n) { border-left-color: var(--eden-green); }
.chapter-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

/* ========== CHARACTERS PAGE ========== */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.char-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s, box-shadow 0.25s;
}
.char-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.char-card-header {
  background: linear-gradient(135deg, var(--header-bg), #2d1f1f);
  color: #fff;
  padding: 20px;
  text-align: center;
}
.char-card-header h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin: 0 0 4px;
  color: #fff;
  border: none;
  padding: 0;
}
.char-card-header .char-role {
  font-size: 0.8rem;
  color: var(--serpent-gold-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.char-card-body {
  padding: 20px;
}
.char-card-body p {
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-bottom: 12px;
}
.char-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.char-tag {
  background: var(--bg-warm);
  color: var(--text-soft);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
}

/* ========== FAQ PAGE ========== */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--bg-card);
}
.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 18px 24px;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
  font-family: var(--font-sans);
  transition: background 0.2s;
}
.faq-question:hover { background: var(--bg-warm); }
.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  color: var(--apple-red);
  font-weight: 300;
  transition: transform 0.3s;
}
.faq-item.active .faq-question::after { content: '−'; transform: rotate(180deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  padding: 0 24px;
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.8;
}
.faq-item.active .faq-answer {
  max-height: 500px;
  padding: 0 24px 20px;
}
.faq-note {
  margin-top: 16px;
}

/* System Requirements Table */
.table-scroll {
  overflow-x: auto;
  margin: 16px 0;
}
.sys-reqs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.sys-reqs-table th {
  background: var(--apple-red-dark);
  color: #fff;
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
}
.sys-reqs-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.sys-reqs-table tr:nth-child(even) td { background: var(--bg-warm); }
.sys-reqs-h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--apple-red-dark);
  margin-top: 24px;
  margin-bottom: 12px;
}
.sys-reqs-h3:first-of-type { margin-top: 8px; }
.td-highlight {
  color: var(--apple-red);
  font-weight: 700;
}

/* ========== CONTENT LIST CLASSES ========== */
.content-list {
  list-style: disc;
  padding-left: 20px;
}
.content-list-num {
  list-style: decimal;
  padding-left: 24px;
}
.content-li {
  margin-bottom: 5px;
  color: var(--text-soft);
}
.content-li-sm {
  margin-bottom: 4px;
  color: var(--text-soft);
}
.content-li-md {
  margin-bottom: 8px;
  color: var(--text-soft);
}
.content-li-lg {
  margin-bottom: 10px;
  color: var(--text-soft);
}

/* ========== COLORED STRONG TAGS ========== */
.strong-red { color: var(--apple-red); }
.strong-gold { color: var(--serpent-gold); }
.strong-muted { color: var(--text-muted); }
.strong-green { color: var(--eden-green-dark); }

/* ========== LIGHTBOX ========== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 4px;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 32px;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  z-index: 2001;
}

/* ========== FOOTER ========== */
footer {
  text-align: center;
  padding: 24px;
  margin-top: 60px;
  border-top: 1px solid var(--border);
  background: var(--bg-warm);
}
footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .hero-title { font-size: 2rem; }
  .hero-tagline { font-size: 1rem; }
  .hero-meta { gap: 12px; }
  .hero { padding: 40px 16px 50px; }
  .hero-subpage { padding: 32px 16px 40px; }
  .hero-subpage-title { font-size: 1.6rem; }

  .section { padding: 40px 0; }
  .section-title { font-size: 1.8rem; }

  nav { display: none; }
  nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--header-bg);
    padding: 16px 24px;
    gap: 12px;
    border-bottom: 2px solid var(--header-border);
  }
  .hamburger { display: flex; }
  .header-inner { padding: 0 16px; }

  .feature-grid { grid-template-columns: 1fr; }
  .game-info-grid { grid-template-columns: 1fr; }
  .screenshot-grid { grid-template-columns: 1fr 1fr; }
  .char-grid { grid-template-columns: 1fr; }

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

@media (max-width: 480px) {
  .hero-title { font-size: 1.6rem; }
  .screenshot-grid { grid-template-columns: 1fr; }
  .btn-cta { font-size: 0.82rem; padding: 6px 14px; }
  .hero-meta span { font-size: 0.75rem; padding: 4px 10px; }
}
