/* ==========================================================================
   The Herald of Chaos | Chronicles of Rutendo
   Cinematic Fantasy & Sci-Fi World Portal (House of the Dragon / Witcher / GOT)
   ========================================================================== */

:root {
  --bg-obsidian: #07060b;
  --bg-surface: #110e18;
  --bg-card: rgba(15, 12, 22, 0.84);
  --gold: #d6a449;
  --gold-bright: #f4d690;
  --gold-deep: #8b601e;
  --gold-dim: rgba(214, 164, 73, 0.3);
  --gold-border: rgba(214, 164, 73, 0.45);
  --ember: #d4522a;
  --violet: #8c52e0;
  --text-ivory: #f6efe2;
  --text-parchment: #d9cfb9;
  --text-muted: #a49986;
  --font-ornate: 'Cinzel Decorative', 'Cinzel', Georgia, serif;
  --font-display: 'Cinzel', Georgia, serif;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm: 5px;
  --radius-md: 10px;
  --shadow-relic: 0 24px 60px rgba(0, 0, 0, 0.78), 0 0 32px rgba(214, 164, 73, 0.14);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-obsidian);
}

body {
  margin: 0;
  color: var(--text-parchment);
  background-color: var(--bg-obsidian);
  font-family: var(--font-sans);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Live Floating Ember Particle Canvas */
.ember-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  opacity: 0.72;
}

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

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: min(1200px, 92%);
  margin: 0 auto;
}

.relative-z {
  position: relative;
  z-index: 2;
}

/* Header & Single-Line Navbar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(7, 6, 11, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--gold-dim);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.55);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--gold-bright);
  white-space: nowrap;
}

.brand-sigil {
  color: var(--gold);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-parchment);
  white-space: nowrap;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.nav-links a:hover {
  color: var(--gold-bright);
  text-shadow: 0 0 12px rgba(244, 214, 144, 0.45);
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-sm);
  padding: 8px 9px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--gold-bright);
}

.mobile-drawer {
  display: none;
  flex-direction: column;
  gap: 14px;
  padding: 20px 6%;
  background: #0e0b15;
  border-bottom: 1px solid var(--gold-dim);
}

.mobile-drawer.open {
  display: flex;
}

.mobile-drawer a {
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-ivory);
}

/* Forged Metallic Fantasy Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  white-space: nowrap;
}

.btn-sm {
  padding: 10px 18px;
  font-size: 0.74rem;
}

.btn-full {
  width: 100%;
}

.btn-forged {
  background: linear-gradient(180deg, #f3d285 0%, #c99133 48%, #9b6a1e 100%);
  color: #161007;
  border: 1px solid #fae2a5;
  box-shadow:
    inset 0 1px 0 rgba(255, 250, 232, 0.7),
    0 10px 28px rgba(201, 145, 51, 0.34),
    0 0 18px rgba(212, 82, 42, 0.2);
}

.btn-forged:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 250, 232, 0.85),
    0 14px 36px rgba(214, 164, 73, 0.48),
    0 0 24px rgba(212, 82, 42, 0.3);
}

.btn-outline-gold {
  background: rgba(15, 12, 22, 0.72);
  color: var(--gold-bright);
  border: 1px solid var(--gold-border);
  box-shadow: inset 0 0 14px rgba(214, 164, 73, 0.1);
}

.btn-outline-gold:hover {
  background: rgba(214, 164, 73, 0.18);
  border-color: var(--gold-bright);
  transform: translateY(-2px);
}

/* ==========================================================================
   FULL-BLEED CINEMATIC HERO
   ========================================================================== */
.hero {
  position: relative;
  padding: 64px 0 78px;
  overflow: hidden;
  min-height: 760px;
  display: flex;
  align-items: center;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background: url('assets/bg_hero_realm.jpg') center top / cover no-repeat;
  transform: scale(1.02);
  z-index: 0;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(7, 6, 11, 0.92) 0%, rgba(7, 6, 11, 0.72) 48%, rgba(7, 6, 11, 0.42) 100%),
    linear-gradient(180deg, rgba(7, 6, 11, 0.55) 0%, transparent 25%, rgba(7, 6, 11, 0.85) 90%, #07060b 100%);
}

.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 54px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 15px;
  border-radius: 3px;
  background: rgba(14, 11, 20, 0.8);
  border: 1px solid var(--gold-border);
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 18px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}

.hero-title {
  margin: 0 0 18px;
  font-family: var(--font-ornate);
  font-weight: 900;
  font-size: clamp(2.55rem, 5.1vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fff9ec 0%, #f1d187 48%, #b97f26 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.85));
}

.hero-subtitle {
  margin: 0 0 28px;
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 1.85vw, 1.5rem);
  line-height: 1.48;
  color: var(--text-ivory);
  max-width: 56ch;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9);
}

/* Engraved Summoning Vault */
.lead-vault {
  position: relative;
  background: linear-gradient(155deg, rgba(19, 15, 29, 0.92) 0%, rgba(10, 8, 16, 0.95) 100%);
  border: 1px solid var(--gold-border);
  border-radius: 6px;
  padding: 28px 28px 22px;
  box-shadow: var(--shadow-relic), inset 0 0 36px rgba(140, 82, 224, 0.12);
  backdrop-filter: blur(10px);
}

.vault-rivet {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid var(--gold-bright);
  pointer-events: none;
}

.vault-rivet.tl { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.vault-rivet.tr { top: 8px; right: 8px; border-left: 0; border-bottom: 0; }
.vault-rivet.bl { bottom: 8px; left: 8px; border-right: 0; border-top: 0; }
.vault-rivet.br { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }

.vault-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

.lead-vault-head h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.24rem;
  font-weight: 700;
  color: var(--text-ivory);
  letter-spacing: 0.04em;
}

.lead-vault-head p {
  margin: 0 0 18px;
  font-size: 0.93rem;
  color: var(--text-parchment);
}

.lead-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 12px;
  margin-bottom: 12px;
}

.lead-form input {
  width: 100%;
  padding: 13px 15px;
  border-radius: 4px;
  border: 1px solid rgba(214, 164, 73, 0.36);
  background: rgba(6, 5, 10, 0.88);
  color: var(--text-ivory);
  font-family: var(--font-sans);
  font-size: 0.94rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lead-form input::placeholder {
  color: #938878;
}

.lead-form input:focus {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(214, 164, 73, 0.2);
}

.form-note {
  margin: 11px 0 0;
  font-size: 0.76rem;
  color: var(--text-muted);
  text-align: center;
}

.lead-success {
  padding: 10px 4px;
  text-align: center;
}

.success-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 8px;
}

.lead-success h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  color: var(--text-ivory);
  font-size: 1.25rem;
}

.lead-success p {
  margin: 0 0 16px;
  font-size: 0.94rem;
  color: var(--text-parchment);
}

.hero-secondary-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 26px;
  margin-top: 20px;
}

.text-link {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--gold-bright);
  border-bottom: 1px solid rgba(244, 214, 144, 0.4);
  padding-bottom: 2px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.text-link:hover {
  color: #fff8e6;
  border-color: #fff8e6;
}

/* Book II Cover Pedestal + Rotating Arcane Sigil */
.hero-visual {
  display: flex;
  justify-content: center;
}

.book-altar {
  position: relative;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.arcane-ring {
  position: absolute;
  top: -36px;
  width: 460px;
  height: 460px;
  pointer-events: none;
  z-index: 0;
  animation: rotateSlow 60s linear infinite;
  opacity: 0.85;
}

@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.altar-aura {
  position: absolute;
  inset: 4% -10% 14%;
  background:
    radial-gradient(circle at 46% 35%, rgba(140, 82, 224, 0.48), transparent 58%),
    radial-gradient(circle at 55% 75%, rgba(212, 82, 42, 0.3), transparent 58%);
  filter: blur(30px);
  z-index: 0;
  pointer-events: none;
}

.cover-stage {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 356px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid rgba(244, 214, 144, 0.55);
  box-shadow:
    -12px 24px 56px rgba(0, 0, 0, 0.88),
    0 0 42px rgba(140, 82, 224, 0.36);
  background: #0b0912;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.cover-stage:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow:
    -14px 30px 68px rgba(0, 0, 0, 0.92),
    0 0 54px rgba(214, 164, 73, 0.35);
}

.cover-stage .cover-img {
  width: 100%;
  height: auto;
  aspect-ratio: 494 / 737;
  object-fit: cover;
}

/* Strictly scoped Front/Back toggle so covers never stack */
.cover-stage .cover-back {
  display: none;
}

.cover-stage.show-back .cover-front {
  display: none;
}

.cover-stage.show-back .cover-back {
  display: block;
}

.cover-toggle-bar {
  position: relative;
  z-index: 3;
  display: inline-flex;
  gap: 6px;
  margin-top: 20px;
  padding: 5px;
  background: rgba(12, 9, 18, 0.92);
  border: 1px solid var(--gold-border);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
}

.toggle-btn {
  border: none;
  background: transparent;
  color: var(--text-parchment);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.toggle-btn.active {
  background: linear-gradient(180deg, #f3d285, #b47d24);
  color: #161007;
}

.book-meta-strip {
  position: relative;
  z-index: 3;
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-parchment);
  letter-spacing: 0.05em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

/* Continuous Moving Chronicle Marquee */
.marquee-band {
  position: relative;
  z-index: 10;
  border-top: 1px solid var(--gold-border);
  border-bottom: 1px solid var(--gold-border);
  background: linear-gradient(90deg, #0d0914 0%, #1d1428 50%, #0d0914 100%);
  padding: 15px 0;
  overflow: hidden;
  user-select: none;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marqueeScroll 34s linear infinite;
}

.marquee-band:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-group {
  display: flex;
  align-items: center;
  gap: 38px;
  padding-right: 38px;
}

.marquee-group span {
  font-family: var(--font-display);
  font-size: 0.79rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--gold-bright);
  white-space: nowrap;
}

@keyframes marqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Shared Section & Full-Bleed Backdrops */
.section {
  padding: 96px 0;
  position: relative;
  overflow: hidden;
}

.section-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.ruins-bg {
  background-image: url('assets/bg_ruins_prophecy.jpg');
}

.codex-bg {
  background-image: url('assets/bg_codex_map.jpg');
}

.section-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, #07060b 0%, rgba(8, 6, 13, 0.72) 22%, rgba(8, 6, 13, 0.78) 78%, #07060b 100%);
}

.codex-scrim {
  background:
    linear-gradient(180deg, #07060b 0%, rgba(10, 8, 15, 0.78) 18%, rgba(10, 8, 15, 0.82) 82%, #07060b 100%);
}

/* Ornate Filigree Divider */
.ornate-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 0 auto 42px;
  max-width: 480px;
}

.div-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.div-crest {
  color: var(--gold-bright);
  font-size: 1.15rem;
  text-shadow: 0 0 12px rgba(214, 164, 73, 0.5);
}

.section-head {
  margin-bottom: 46px;
}

.section-head.centered {
  text-align: center;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}

.compact-head {
  margin-bottom: 26px;
}

.section-kicker {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.section-title {
  margin: 0 0 14px;
  font-family: var(--font-ornate);
  font-weight: 700;
  font-size: clamp(1.9rem, 3.4vw, 2.85rem);
  line-height: 1.16;
  color: var(--text-ivory);
  letter-spacing: 0.04em;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.sub-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  color: var(--text-ivory);
  letter-spacing: 0.05em;
}

.section-lead {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.32rem;
  line-height: 1.54;
  color: var(--text-ivory);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
}

/* Prophecy Plaque */
.prophecy-plaque {
  position: relative;
  max-width: 820px;
  margin: 0 auto 54px;
  padding: 44px 38px;
  text-align: center;
  background: radial-gradient(circle at 50% 0%, rgba(212, 82, 42, 0.16), rgba(11, 9, 17, 0.88) 70%);
  border: 1px solid var(--gold-border);
  border-radius: 6px;
  box-shadow: var(--shadow-relic);
  backdrop-filter: blur(8px);
}

.plaque-corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: var(--gold-bright);
  border-style: solid;
}

.plaque-corner.tl { top: 10px; left: 10px; border-width: 2px 0 0 2px; }
.plaque-corner.tr { top: 10px; right: 10px; border-width: 2px 2px 0 0; }
.plaque-corner.bl { bottom: 10px; left: 10px; border-width: 0 0 2px 2px; }
.plaque-corner.br { bottom: 10px; right: 10px; border-width: 0 2px 2px 0; }

.plaque-label {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.prophecy-verse {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.5rem, 2.7vw, 2.15rem);
  line-height: 1.48;
  color: #fff8ea;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.85);
}

/* Stakes 3-Column Grid */
.stakes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.lore-card {
  background: rgba(13, 10, 20, 0.86);
  border: 1px solid var(--gold-border);
  border-top: 3px solid var(--gold);
  border-radius: 6px;
  padding: 30px 26px;
  backdrop-filter: blur(8px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.lore-card:hover {
  transform: translateY(-5px);
  border-color: var(--gold-bright);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.78), 0 0 22px rgba(212, 82, 42, 0.2);
}

.card-numeral {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--gold-bright);
  background: radial-gradient(circle, rgba(214, 164, 73, 0.22), rgba(14, 10, 22, 0.8));
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--gold-bright);
  margin-bottom: 16px;
}

.lore-card h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.12rem;
  color: var(--text-ivory);
  letter-spacing: 0.04em;
}

.lore-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-parchment);
}

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

/* Codex Tabs & Glass Grimoire Cards */
.codex-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}

.codex-tab {
  background: rgba(12, 10, 18, 0.82);
  border: 1px solid var(--gold-border);
  border-radius: 4px;
  color: var(--text-ivory);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  padding: 11px 22px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.codex-tab:hover {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}

.codex-tab.active {
  background: linear-gradient(180deg, #f3d285, #b47d24);
  color: #161007;
  border-color: #fae2a5;
}

.codex-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.codex-entry {
  background: rgba(11, 9, 17, 0.88);
  border: 1px solid rgba(214, 164, 73, 0.34);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 24px;
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.codex-entry h4 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.06rem;
  color: var(--gold-bright);
  letter-spacing: 0.04em;
}

.codex-entry p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--text-parchment);
}

.inline-gold {
  color: var(--gold-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Interactive Faction Banners */
.factions-block {
  margin-top: 64px;
}

.faction-banners {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.faction-banner {
  background: linear-gradient(180deg, rgba(22, 17, 32, 0.92), rgba(10, 8, 16, 0.94));
  border: 1px solid rgba(214, 164, 73, 0.32);
  border-radius: 6px;
  padding: 18px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  color: var(--text-parchment);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.faction-banner:hover {
  transform: translateY(-3px);
  border-color: var(--gold-bright);
}

.faction-banner.active {
  border-color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(214, 164, 73, 0.2), rgba(14, 11, 22, 0.96));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65), 0 0 18px rgba(214, 164, 73, 0.22);
}

.faction-emblem {
  font-size: 1.5rem;
  line-height: 1;
}

.faction-name {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-ivory);
}

.faction-motto {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--gold-bright);
}

.faction-detail-box {
  background: rgba(11, 9, 17, 0.92);
  border: 1px solid var(--gold-border);
  border-radius: 6px;
  padding: 24px 28px;
  text-align: center;
  max-width: 880px;
  margin: 0 auto;
  backdrop-filter: blur(8px);
}

.faction-detail-box h4 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--gold-bright);
  letter-spacing: 0.06em;
}

.faction-detail-box p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--text-ivory);
}

/* Character Gallery (11 Official Cards) */
.characters-section {
  background:
    radial-gradient(circle at 50% 10%, rgba(140, 82, 224, 0.14), transparent 46%),
    radial-gradient(circle at 80% 80%, rgba(212, 82, 42, 0.1), transparent 44%),
    #08070d;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 36px;
}

.filter-pill {
  background: rgba(19, 16, 28, 0.85);
  border: 1px solid var(--gold-dim);
  color: var(--text-parchment);
  font-family: var(--font-display);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 9px 18px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-pill:hover {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}

.filter-pill.active {
  background: rgba(214, 164, 73, 0.2);
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.char-card {
  background: linear-gradient(180deg, rgba(24, 19, 34, 0.92) 0%, rgba(10, 8, 15, 0.96) 100%);
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  padding: 14px 14px 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-align: left;
  color: inherit;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.char-card:hover {
  transform: translateY(-6px);
  border-color: var(--gold-bright);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.78), 0 0 24px rgba(214, 164, 73, 0.24);
}

.char-card-img-wrap {
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  background: #0b0911;
  margin-bottom: 13px;
}

.char-card-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

.char-card-role {
  font-size: 0.71rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}

.char-card-name {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.02rem;
  color: var(--text-ivory);
}

.char-card-blurb {
  margin: 0 0 10px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
  flex-grow: 1;
}

.char-card-cta {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

/* Wiki Banner */
.wiki-banner {
  margin-top: 46px;
  padding: 28px 32px;
  border-radius: 6px;
  background: linear-gradient(120deg, rgba(140, 82, 224, 0.18), rgba(16, 13, 24, 0.94));
  border: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wiki-banner h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.18rem;
  color: var(--text-ivory);
}

.wiki-banner p {
  margin: 0;
  font-size: 0.93rem;
  color: var(--text-parchment);
}

.wiki-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  flex-shrink: 0;
}

/* Book I Section */
.book-one-section {
  background:
    radial-gradient(circle at 22% 35%, rgba(212, 82, 42, 0.16), transparent 48%),
    radial-gradient(circle at 80% 25%, rgba(214, 164, 73, 0.1), transparent 46%),
    #0b0912;
  border-top: 1px solid var(--gold-dim);
  border-bottom: 1px solid var(--gold-dim);
}

.book-one-grid {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 54px;
  align-items: center;
}

.book-one-frame {
  position: relative;
  max-width: 340px;
  margin: 0 auto;
}

.book-one-glow {
  position: absolute;
  inset: 8% -10%;
  background: radial-gradient(circle, rgba(214, 164, 73, 0.34), rgba(212, 82, 42, 0.2), transparent 68%);
  filter: blur(28px);
  z-index: 0;
}

.book-one-frame img {
  position: relative;
  z-index: 1;
  width: 100%;
  border-radius: 6px;
  border: 2px solid rgba(244, 214, 144, 0.5);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.85);
}

.published-ribbon {
  position: relative;
  z-index: 2;
  margin: 14px auto 0;
  width: fit-content;
  padding: 6px 16px;
  border-radius: 4px;
  background: rgba(214, 164, 73, 0.16);
  border: 1px solid var(--gold-border);
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.book-one-tagline {
  margin: 0 0 18px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.28rem;
  color: var(--gold-bright);
}

.book-one-desc {
  margin: 0 0 16px;
  font-size: 0.98rem;
  color: var(--text-parchment);
}

.buy-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

/* Verified Praise */
.praise-block {
  margin-top: 64px;
  padding-top: 46px;
  border-top: 1px solid var(--gold-dim);
}

.praise-heading {
  margin: 0 0 24px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.84rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.praise-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.praise-card {
  margin: 0;
  padding: 26px 24px;
  border-radius: 6px;
  background: rgba(16, 13, 24, 0.88);
  border: 1px solid rgba(214, 164, 73, 0.28);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.praise-card p {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--text-ivory);
}

.praise-card footer {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Author Section */
.author-grid {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 44px;
  align-items: center;
}

.author-crest-card {
  padding: 36px 28px;
  border-radius: 6px;
  background: linear-gradient(155deg, rgba(25, 20, 38, 0.94), rgba(11, 9, 17, 0.96));
  border: 1px solid var(--gold-border);
  text-align: center;
}

.author-monogram {
  width: 92px;
  height: 92px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: radial-gradient(circle, rgba(214, 164, 73, 0.22), rgba(140, 82, 224, 0.14));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ornate);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold-bright);
  letter-spacing: 0.08em;
}

.author-location {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-parchment);
}

.author-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.author-links a {
  font-size: 0.86rem;
  color: var(--gold-bright);
  padding: 7px 10px;
  border-radius: 4px;
  background: rgba(214, 164, 73, 0.09);
  border: 1px solid rgba(214, 164, 73, 0.22);
  transition: background 0.2s ease;
}

.author-links a:hover {
  background: rgba(214, 164, 73, 0.2);
}

.author-bio p {
  margin: 0 0 16px;
  font-size: 1rem;
  color: var(--text-parchment);
}

/* Final CTA Vault */
.final-cta-section {
  padding-top: 24px;
  padding-bottom: 92px;
}

.final-vault {
  text-align: center;
  padding: 52px 36px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(214, 164, 73, 0.18), transparent 60%),
    linear-gradient(160deg, #171224 0%, #0b0912 100%);
  border: 1px solid var(--gold-border);
  box-shadow: var(--shadow-relic);
}

.final-vault h2 {
  margin: 0 0 12px;
  font-family: var(--font-ornate);
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  color: var(--text-ivory);
}

.final-vault > p {
  margin: 0 auto 26px;
  max-width: 60ch;
  color: var(--text-parchment);
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr 1.35fr auto;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--gold-dim);
  background: #050408;
  padding: 34px 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.88rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--text-parchment);
}

.footer-links a:hover {
  color: var(--gold-bright);
}

.footer-copy {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 4, 8, 0.86);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  width: min(820px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(160deg, #191426 0%, #0d0b14 100%);
  border: 1px solid var(--gold-border);
  border-radius: 8px;
  padding: 34px 32px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.88);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--gold-dim);
  background: rgba(9, 8, 13, 0.75);
  color: var(--gold-bright);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal-kicker {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.74rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

.char-modal-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  align-items: center;
}

.char-modal-portrait img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--gold-border);
}

.char-modal-body h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--text-ivory);
}

.modal-faction {
  margin: 0 0 14px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--gold-bright);
}

.modal-desc {
  margin: 0 0 22px;
  font-size: 0.98rem;
  color: var(--text-parchment);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Chapter Reader Modal */
.chapter-header {
  text-align: center;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--gold-dim);
}

.chapter-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.65rem;
  color: var(--text-ivory);
}

.chapter-gate p {
  margin: 0 0 18px;
  text-align: center;
  color: var(--text-parchment);
}

.chapter-scroll {
  font-family: var(--font-serif);
  font-size: 1.24rem;
  line-height: 1.72;
  color: var(--text-ivory);
}

.chapter-scroll p {
  margin: 0 0 16px;
}

.chapter-scroll .dropcap::first-letter {
  float: left;
  font-family: var(--font-ornate);
  font-size: 3.3rem;
  line-height: 0.85;
  padding-right: 10px;
  padding-top: 4px;
  color: var(--gold-bright);
}

.chapter-end-cta {
  margin-top: 28px;
  padding: 22px;
  border-radius: 6px;
  background: rgba(214, 164, 73, 0.1);
  border: 1px solid var(--gold-dim);
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.92rem;
}

.chapter-end-cta p {
  margin: 0 0 10px;
}

/* Responsive */
@media (max-width: 1060px) {
  .hero-grid,
  .book-one-grid,
  .author-grid {
    grid-template-columns: 1fr;
    gap: 42px;
  }
  .faction-banners {
    grid-template-columns: repeat(3, 1fr);
  }
  .character-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .stakes-grid,
  .praise-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .nav-links,
  .nav-cta {
    display: none;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .codex-grid {
    grid-template-columns: 1fr;
  }
  .faction-banners {
    grid-template-columns: repeat(2, 1fr);
  }
  .character-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .wiki-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .inline-form,
  .lead-form .form-row {
    grid-template-columns: 1fr;
  }
  .char-modal-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .char-modal-portrait {
    max-width: 220px;
    margin: 0 auto;
  }
  .modal-actions {
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .character-grid,
  .faction-banners {
    grid-template-columns: 1fr;
  }
  .arcane-ring {
    width: 340px;
    height: 340px;
  }
}
