/* ========== CSS VARIABLES - Principal Office Theme ========== */
:root {
  /* Chalkboard greens */
  --chalk-green: #2d5a27;
  --chalk-mid: #3a7a44;
  --chalk-light: #4a9b4e;
  --chalk-pale: #c8e6c9;
  --chalk-wash: #e8f5e9;

  /* Desk-blotter browns */
  --blotter-dark: #4e342e;
  --blotter-mid: #6d4c41;
  --blotter-base: #795548;
  --blotter-light: #a1887f;
  --blotter-pale: #d7ccc8;
  --blotter-wash: #efebe9;

  /* Light campus background */
  --bg: #faf8f3;
  --bg-warm: #f5f0ea;
  --bg-card: #ffffff;
  --bg-header: #1b3a18;

  /* Text */
  --text: #3e2723;
  --text-soft: #6d4c41;
  --text-light: #8d6e63;
  --text-on-dark: #f5f0ea;

  /* Accent */
  --accent: #c8a96e;
  --accent-light: #e8d5b7;
  --accent-dark: #8d6e3f;

  /* Functional */
  --border: #d7ccc8;
  --shadow: rgba(78, 52, 46, 0.08);
  --shadow-md: rgba(78, 52, 46, 0.15);

  /* Fonts */
  --font-sans: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', 'Noto Sans SC', sans-serif;
  --font-serif: 'Noto Serif SC', 'STSong', 'SimSun', 'Songti SC', serif;
}

/* ========== RESET ========== */
*, *::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);
  color: var(--text);
  line-height: 1.75;
  min-height: 100vh;
  position: relative;
}

/* Light campus bg with subtle crest pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 15% 20%, var(--blotter-mid) 1px, transparent 1px),
    radial-gradient(circle at 85% 40%, var(--blotter-mid) 1px, transparent 1px),
    radial-gradient(circle at 50% 75%, var(--blotter-mid) 1px, transparent 1px);
  background-size: 200px 200px, 250px 250px, 180px 180px;
}

/* ========== UTILITY CLASSES ========== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.prose { max-width: 800px; margin: 0 auto; }
.section-alt { background: var(--bg-warm); padding-top: 0; }
.table-scroll { overflow-x: auto; }
.hero-tagline {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: #fff;
  font-weight: 600;
}
.guide-intro { color: var(--text-soft); margin-bottom: 24px; }
.route-desc { color: var(--text-soft); margin-bottom: 16px; }
.route-heading {
  font-family: var(--font-serif);
  color: var(--chalk-green);
  margin: 24px 0 10px;
}
.chapter-title {
  font-size: 1.1rem;
  margin-top: 16px;
}
.card-grid { display: grid; gap: 24px; }

/* ========== HEADER ========== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  border-bottom: 3px solid var(--accent-dark);
}
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 {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-on-dark);
}
header .logo img { height: 36px; width: auto; }
header .logo span {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
header .logo::after {
  content: '';
  display: inline-block;
  width: 24px;
  height: 24px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.3;
  margin-left: 4px;
}

/* Nav */
nav { display: flex; align-items: center; gap: 8px; }
nav a {
  color: var(--text-on-dark);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: background 0.2s, color 0.2s;
  position: relative;
}
nav a:hover { background: rgba(255,255,255,0.1); }
nav a.active {
  background: var(--chalk-green);
  color: #fff;
}
nav a.active::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--accent-dark);
}

/* Header CTA */
.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: var(--bg-header);
  text-decoration: none;
  padding: 8px 20px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}
.btn-cta:hover { background: var(--accent-light); transform: translateY(-1px); }
.btn-cta::before {
  content: '↓';
  font-size: 1.1rem;
}
.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-on-dark);
  border-radius: 1px;
}

/* ========== HERO ========== */
.hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(27,58,24,0.85) 0%, rgba(27,58,24,0.6) 50%, rgba(27,58,24,0.4) 100%);
}
.hero .hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #fff;
  padding: 60px 24px;
  max-width: 700px;
}
.hero .hero-crest {
  display: inline-block;
  width: 80px;
  height: 80px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  margin-bottom: 20px;
  position: relative;
  background: rgba(255,255,255,0.08);
}
.hero .hero-crest::before {
  content: '⚜';
  font-size: 2rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--accent);
}
.hero h2 {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.hero .hero-subtitle {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 8px;
}

/* Per-page hero backgrounds */
.hero-home .hero-bg { background-image: url('../img/screenshot-02.webp'); }
.hero-guide .hero-bg { background-image: url('../img/screenshot-03.webp'); }
.hero-story .hero-bg { background-image: url('../img/screenshot-02.webp'); }
.hero-characters .hero-bg { background-image: url('../img/screenshot-04.webp'); }
.hero-faq .hero-bg { background-image: url('../img/screenshot-03.webp'); }

/* ========== MAIN CONTENT ========== */
main { position: relative; z-index: 1; }
section { padding: 60px 24px; }
section:nth-child(even) { background: var(--bg-warm); }

.container {
  max-width: 1100px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}
.section-header h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--chalk-green);
  margin-bottom: 8px;
  position: relative;
  display: inline-block;
}
.section-header h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 12px auto 0;
}
.section-header .section-subtitle {
  color: var(--text-soft);
  font-size: 1rem;
  margin-top: 8px;
}

/* ========== GAME INFO CARDS (index) ========== */
.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}
.info-card {
  background: var(--bg-card);
  border-left: 4px solid var(--chalk-mid);
  padding: 20px;
  border-radius: 0 8px 8px 0;
  box-shadow: 0 2px 8px var(--shadow);
}
.info-card dt {
  font-size: 0.85rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.info-card dd {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 600;
}

/* ========== FEATURE CARDS (index) ========== */
.feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 24px;
  box-shadow: 0 2px 12px var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px var(--shadow-md);
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--chalk-mid);
  border-radius: 10px 10px 0 0;
}
.feature-card .fc-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}
.feature-card h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--chalk-green);
  margin-bottom: 8px;
}
.feature-card p { color: var(--text-soft); font-size: 0.95rem; }

/* ========== SCREENSHOT GALLERY ========== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.gallery-grid a {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow);
  transition: transform 0.2s;
  cursor: pointer;
}
.gallery-grid a:hover { transform: scale(1.03); }
.gallery-grid img {
  width: 100%;
  height: auto;
  display: block;
}

/* ========== REVIEWS / QUOTES ========== */
.reviews {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.review-card {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 24px;
  border: 1px solid var(--border);
  position: relative;
}
.review-card::before {
  content: '"';
  position: absolute;
  top: 8px;
  left: 16px;
  font-family: var(--font-serif);
  font-size: 4rem;
  color: var(--chalk-pale);
  line-height: 1;
}
.review-card p { color: var(--text-soft); margin-bottom: 12px; padding-top: 20px; }
.review-card cite {
  font-style: normal;
  color: var(--text-light);
  font-size: 0.9rem;
}

/* ========== CTA BANNER (index only) ========== */
.cta-banner {
  background: linear-gradient(135deg, var(--bg-header), var(--chalk-green));
  text-align: center;
  padding: 56px 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(200,169,110,0.2) 0%, transparent 60%);
}
.cta-banner h2 {
  position: relative;
  font-family: var(--font-serif);
  font-size: 2rem;
  margin-bottom: 12px;
}
.cta-banner p {
  position: relative;
  color: rgba(255,255,255,0.8);
  margin-bottom: 24px;
  font-size: 1.05rem;
}
.btn-banner-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--bg-header);
  text-decoration: none;
  padding: 14px 40px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  transition: background 0.2s, transform 0.2s;
}
.btn-banner-cta:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
}

/* ========== GUIDE PAGE ========== */
.guide-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 40px;
}
.guide-nav a {
  display: inline-block;
  padding: 8px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.2s;
}
.guide-nav a:hover {
  background: var(--chalk-green);
  color: #fff;
  border-color: var(--chalk-green);
}
.tip-box {
  background: linear-gradient(135deg, var(--chalk-wash), var(--bg-card));
  border-left: 4px solid var(--chalk-mid);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 0 8px 8px 0;
  font-size: 0.95rem;
}
.tip-box strong { color: var(--chalk-green); }
.route-steps { counter-reset: step; }
.route-steps li {
  list-style: none;
  counter-increment: step;
  padding: 12px 0 12px 48px;
  position: relative;
  border-bottom: 1px dashed var(--border);
}
.route-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 10px;
  width: 32px;
  height: 32px;
  background: var(--chalk-green);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

/* ========== STORY PAGE ========== */
.story-chapter {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px var(--shadow);
}
.story-chapter h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--chalk-green);
  margin-bottom: 12px;
}
.story-chapter p { color: var(--text-soft); }
.chapter-meta {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ========== CHARACTERS PAGE ========== */
.char-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.char-card {
  background: var(--bg-card);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 12px var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.2s;
}
.char-card:hover { transform: translateY(-4px); }
.char-card .char-visual {
  height: 200px;
  background: linear-gradient(135deg, var(--chalk-wash), var(--blotter-pale));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}
.char-card .char-info {
  padding: 20px;
}
.char-card .char-info h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--chalk-green);
  margin-bottom: 6px;
}
.char-card .char-info .char-role {
  font-size: 0.85rem;
  color: var(--accent-dark);
  font-weight: 600;
  margin-bottom: 12px;
}
.char-card .char-info p { color: var(--text-soft); }
.char-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.char-traits span {
  background: var(--chalk-wash);
  color: var(--chalk-green);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
}

/* ========== FAQ PAGE ========== */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--bg-card);
}
.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 16px 48px 16px 20px;
  text-align: left;
  font-size: 1.05rem;
  font-family: var(--font-sans);
  color: var(--text);
  cursor: pointer;
  position: relative;
  font-weight: 600;
}
.faq-question::after {
  content: '+';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  color: var(--chalk-green);
  transition: transform 0.3s;
}
.faq-item.active .faq-question::after {
  content: '−';
  transform: translateY(-50%) rotate(180deg);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.faq-item.active .faq-answer { max-height: 500px; }
.faq-answer .faq-answer-inner {
  padding: 0 20px 20px;
  color: var(--text-soft);
}

/* System requirements table */
.sysreq-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}
.sysreq-table th, .sysreq-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.sysreq-table th {
  background: var(--bg-warm);
  font-weight: 600;
  color: var(--chalk-green);
  font-family: var(--font-serif);
}
.sysreq-table tr:last-child td { border-bottom: none; }

/* ========== FOOTER ========== */
footer {
  background: var(--bg-header);
  text-align: center;
  padding: 24px;
  color: rgba(245,240,234,0.6);
  font-size: 0.9rem;
  border-top: 3px solid var(--accent-dark);
}
footer p { color: rgba(245,240,234,0.6); }

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

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  header .header-inner { padding: 0 16px; height: 56px; }
  nav { display: none; }
  nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg-header);
    padding: 12px;
    gap: 4px;
    border-bottom: 3px solid var(--accent-dark);
  }
  nav.open a { width: 100%; padding: 12px 16px; }
  .hamburger { display: flex; }
  .hero h2 { font-size: 1.8rem; }
  .hero { min-height: 300px; }
  .hero .hero-content { padding: 40px 16px; }
  section { padding: 40px 16px; }
  .section-header h2 { font-size: 1.5rem; }
  .info-cards { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: 1fr; }
  .char-cards { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .info-cards { grid-template-columns: 1fr; }
  .feature-cards { grid-template-columns: 1fr; }
  .hero h2 { font-size: 1.5rem; }
  .hero .hero-subtitle { font-size: 0.95rem; }
  .btn-banner-cta { padding: 12px 28px; font-size: 1rem; }
}

/* ========== PAGE HEADER DECORATION ========== */
.page-header {
  text-align: center;
  padding: 40px 24px 20px;
}
.page-header h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--chalk-green);
}
.page-header p {
  color: var(--text-soft);
  margin-top: 8px;
}
