/* ═══════════════════════════════════════════════════════
   WORLD CODEX — styles.css
   Dark mystical wiki — Bootstrap 5 framework
═══════════════════════════════════════════════════════ */

/* ─── Custom Properties ─── */
:root {
  --gold:        #c9a84c;
  --gold-light:  #e8c87a;
  --gold-dim:    #8a6c2e;
  --ink:         #0d0c0a;
  --ink-2:       #131210;
  --ink-3:       #1c1a16;
  --ink-4:       #252218;
  --ink-5:       #2e2b1f;
  --parchment:   #e8dfc8;
  --parchment-dim: #a89c7e;
  --text-body:   #ccc4aa;
  --text-muted:  #7a7060;
  --hell-red:    #c43a2b;
  --hell-orange: #d4622a;
  --heaven-blue: #4a7fa5;
  --heaven-light:#8ab8d4;
  --border:      rgba(201,168,76,0.15);
  --border-mid:  rgba(201,168,76,0.3);
  --glow:        rgba(201,168,76,0.12);

  --font-display: 'Cinzel Decorative', serif;
  --font-heading: 'Cinzel', serif;
  --font-body:    'EB Garamond', serif;

  --radius:     8px;
  --radius-lg:  14px;
  --transition: 0.3s ease;
}

/* ─── Base Reset ─── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--ink);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.75;
  overflow-x: hidden;
}

/* ─── Particle Canvas ─── */
#particleCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--ink-2); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ─── Selection ─── */
::selection { background: rgba(201,168,76,0.3); color: var(--gold-light); }

/* ═══════════════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════════════ */
.codex-hero {
  position: relative;
  min-height: 100vh;
  padding: 2rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(201,168,76,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 60% 80% at 20% 80%, rgba(196,58,43,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 20%, rgba(74,127,165,0.04) 0%, transparent 60%),
    var(--ink);
  z-index: 1;
}

.hero-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,0.08) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: glow-pulse 6s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  50%       { opacity: 1;   transform: translate(-50%, -50%) scale(1.15); }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 860px;
}

.hero-eyebrow {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 0.75rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 5.5rem);
  color: var(--gold-light);
  text-shadow:
    0 0 40px rgba(201,168,76,0.4),
    0 0 80px rgba(201,168,76,0.15);
  line-height: 1.1;
  margin-bottom: 1.2rem;
  letter-spacing: 0.03em;
}

.hero-sub {
  font-family: var(--font-body);
  font-size: 1.15rem;
  color: var(--parchment-dim);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.8;
  font-style: italic;
}

.hero-scroll-hint {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  animation: scroll-hint 2.5s ease-in-out infinite;
}

@keyframes scroll-hint {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50%       { opacity: 0.9; transform: translateY(6px); }
}

/* Pill Buttons */
.pill-btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--border-mid);
  border-radius: 50px;
  padding: 0.42rem 1.1rem;
  text-decoration: none;
  background: rgba(201,168,76,0.05);
  transition: all var(--transition);
  white-space: nowrap;
}

.pill-btn:hover {
  background: rgba(201,168,76,0.12);
  border-color: var(--gold);
  color: var(--gold-light);
  box-shadow: 0 0 16px rgba(201,168,76,0.2);
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════
   STICKY NAV
═══════════════════════════════════════════════════════ */
.codex-sticky-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,12,10,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transform: translateY(-100%);
  transition: transform 0.4s ease;
  overflow-x: auto;
  scrollbar-width: none;
}

.codex-sticky-nav::-webkit-scrollbar { display: none; }

.codex-sticky-nav.visible { transform: translateY(0); }

.nav-brand {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--gold);
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-divider {
  width: 1px;
  height: 22px;
  background: var(--border-mid);
  flex-shrink: 0;
}

.snav-link {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.6rem 0.5rem;
  white-space: nowrap;
  transition: color var(--transition);
  flex-shrink: 0;
}

.snav-link:hover,
.snav-link.active { color: var(--gold); }

/* ═══════════════════════════════════════════════════════
   MAIN LAYOUT
═══════════════════════════════════════════════════════ */
.codex-main {
  position: relative;
  z-index: 1;
  padding-top: 2rem;
  padding-bottom: 5rem;
}

/* ═══════════════════════════════════════════════════════
   SECTIONS
═══════════════════════════════════════════════════════ */
.codex-section {
  margin-bottom: 5rem;
  padding-top: 3rem;
}

.section-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.section-number {
  font-family: var(--font-display);
  font-size: 2.8rem;
  color: var(--gold-dim);
  opacity: 0.5;
  line-height: 1;
  flex-shrink: 0;
  padding-top: 0.2rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  color: var(--gold-light);
  margin-bottom: 0.3rem;
  line-height: 1.2;
}

.section-subtitle {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 0;
  font-size: 1rem;
}

/* ═══════════════════════════════════════════════════════
   CODEX CARDS
═══════════════════════════════════════════════════════ */
.codex-card {
  background: var(--ink-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem 2rem;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.codex-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(201,168,76,0.03) 0%, transparent 60%);
  pointer-events: none;
}

.codex-card:hover {
  border-color: var(--border-mid);
  box-shadow: 0 4px 30px rgba(0,0,0,0.4), 0 0 20px rgba(201,168,76,0.05);
}

.card-heading {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--gold);
  margin-bottom: 1rem;
  letter-spacing: 0.03em;
}

.lead-text {
  font-size: 1.15rem;
  color: var(--parchment-dim);
  font-style: italic;
  margin-bottom: 0;
  line-height: 1.85;
}

.sub-heading {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--gold-dim);
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

/* ─── Callout Blocks ─── */
.codex-callout {
  background: rgba(201,168,76,0.05);
  border-left: 3px solid var(--gold-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.9rem 1.2rem;
  color: var(--parchment-dim);
  font-style: italic;
  font-size: 1.05rem;
}

.war-callout { border-left-color: var(--hell-red); background: rgba(196,58,43,0.05); }
.crossroads-callout { border-left-color: var(--gold-dim); font-style: normal; }

/* ─── Inset Blocks ─── */
.inset-block {
  background: var(--ink-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  height: 100%;
}

.inset-block h6 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 0.5rem;
}

/* ─── Divider ─── */
hr.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* ═══════════════════════════════════════════════════════
   REALM CARDS
═══════════════════════════════════════════════════════ */
.realm-card { position: relative; }

.realm-icon {
  font-size: 2.2rem;
  margin-bottom: 1rem;
}

.realm-life .realm-icon { color: #5a9e6f; }
.realm-death .realm-icon { color: var(--gold-dim); }

.realm-life {
  border-color: rgba(90,158,111,0.2);
  background: linear-gradient(135deg, rgba(90,158,111,0.04) 0%, var(--ink-2) 60%);
}

.realm-death {
  border-color: rgba(201,168,76,0.2);
  background: linear-gradient(135deg, rgba(201,168,76,0.04) 0%, var(--ink-2) 60%);
}

/* ═══════════════════════════════════════════════════════
   PURGATORY WATER CARD
═══════════════════════════════════════════════════════ */
.purgatory-water-card {
  border-color: rgba(74,127,165,0.25);
  background: linear-gradient(135deg, rgba(74,127,165,0.04) 0%, var(--ink-2) 60%);
}

.water-orb {
  font-size: 2.5rem;
  color: var(--heaven-blue);
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(74,127,165,0.1);
  border-radius: 50%;
  border: 1px solid rgba(74,127,165,0.2);
}

/* ═══════════════════════════════════════════════════════
   MINI CARDS
═══════════════════════════════════════════════════════ */
.mini-card {
  background: var(--ink-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  height: 100%;
}

.mini-card h5 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  color: var(--gold-dim);
  margin-bottom: 0.5rem;
}

.mini-card h6 {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--gold-dim);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

.mini-icon {
  font-size: 1.5rem;
  color: var(--gold-dim);
  display: block;
  margin-bottom: 0.6rem;
}

/* ═══════════════════════════════════════════════════════
   SOUL SPECTRUM
═══════════════════════════════════════════════════════ */
.soul-spectrum {
  background: var(--ink-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.spectrum-track {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.spectrum-item {
  display: flex;
  gap: 1.2rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--border);
  position: relative;
  transition: background var(--transition);
  border-radius: var(--radius);
  padding-left: 0.5rem;
}

.spectrum-item:last-child { border-bottom: none; }

.spectrum-item:hover { background: rgba(201,168,76,0.03); }

.spec-dot {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 1rem;
  background: var(--ink-3);
  margin-top: 0.15rem;
}

[data-type="pure"]      .spec-dot { border-color: rgba(90,158,111,0.5); color: #5a9e6f; }
[data-type="new"]       .spec-dot { border-color: rgba(201,168,76,0.5); color: var(--gold); }
[data-type="unfinished"].spec-dot { border-color: rgba(180,140,80,0.5); color: #b48c50; }
[data-type="altered"]   .spec-dot { border-color: rgba(74,127,165,0.5); color: var(--heaven-blue); }
[data-type="broken"]    .spec-dot { border-color: rgba(196,58,43,0.5);  color: var(--hell-red); }

.spec-body h5 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--gold-light);
  margin-bottom: 0.35rem;
}

/* ═══════════════════════════════════════════════════════
   SOUL STRENGTH CARDS
═══════════════════════════════════════════════════════ */
.strength-card { padding-bottom: 1.5rem; }

.strength-meter {
  height: 4px;
  background: var(--ink-5);
  border-radius: 2px;
  margin-top: 1rem;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  transition: width 1.5s ease;
}

.fragile-fill { background: linear-gradient(90deg, #7a6040, #c9a84c); }
.weak-fill    { background: linear-gradient(90deg, #5a3a2a, #8a5a40); }

/* ═══════════════════════════════════════════════════════
   ORIGINAL SOULS
═══════════════════════════════════════════════════════ */
.original-souls-card {
  background: linear-gradient(135deg, rgba(201,168,76,0.05) 0%, var(--ink-2) 50%);
  border-color: var(--border-mid);
}

.originals-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1rem;
}

@media (max-width: 576px) {
  .originals-grid { grid-template-columns: 1fr; }
}

.original-item {
  background: var(--ink-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
}

.original-item.grieve { border-color: rgba(196,58,43,0.3); }
.original-item.firelords { border-color: rgba(201,168,76,0.3); }

.orig-name {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--gold);
  margin-bottom: 0.2rem;
}

.orig-role {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.orig-desc { font-size: 0.95rem; margin-bottom: 0; }

/* ═══════════════════════════════════════════════════════
   DEATH MEMORY CARD
═══════════════════════════════════════════════════════ */
.death-memory-card {
  border-color: rgba(196,58,43,0.2);
  background: linear-gradient(135deg, rgba(196,58,43,0.04) 0%, var(--ink-2) 60%);
}

/* ═══════════════════════════════════════════════════════
   MAGIC CARDS
═══════════════════════════════════════════════════════ */
.magic-card {
  background: var(--ink-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  height: 100%;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.magic-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.magic-card:hover {
  border-color: var(--border-mid);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.magic-card:hover::after { opacity: 1; }

.magic-icon {
  font-size: 2rem;
  color: var(--gold-dim);
  margin-bottom: 0.8rem;
  display: block;
}

.magic-card h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 0.6rem;
  letter-spacing: 0.04em;
}

/* ═══════════════════════════════════════════════════════
   ENCHANTMENT BLOCKS
═══════════════════════════════════════════════════════ */
.enchant-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  height: 100%;
}

.enchant-block.willful  { border-color: rgba(90,158,111,0.25); background: rgba(90,158,111,0.04); }
.enchant-block.unwillful{ border-color: rgba(196,58,43,0.25);  background: rgba(196,58,43,0.04); }

.enchant-block h5 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.8rem;
}

.enchant-block.willful h5   { color: #5a9e6f; }
.enchant-block.unwillful h5 { color: var(--hell-orange); }

.enchant-block ul { padding-left: 1.2rem; margin-bottom: 0; }
.enchant-block li { margin-bottom: 0.3rem; font-size: 0.98rem; }

/* ═══════════════════════════════════════════════════════
   ACCORDION
═══════════════════════════════════════════════════════ */
.codex-accordion .accordion-item {
  background: var(--ink-3);
  border: 1px solid var(--border);
  border-radius: var(--radius) !important;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.codex-accordion .accordion-button {
  background: var(--ink-3);
  color: var(--text-body);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  box-shadow: none;
  padding: 1rem 1.2rem;
}

.codex-accordion .accordion-button:not(.collapsed) {
  background: rgba(201,168,76,0.06);
  color: var(--gold-light);
  box-shadow: none;
}

.codex-accordion .accordion-button::after {
  filter: invert(0.7) sepia(1) saturate(2) hue-rotate(5deg);
}

.codex-accordion .accordion-body {
  background: var(--ink-3);
  padding: 0.8rem 1.2rem 1.2rem;
  border-top: 1px solid var(--border);
}

.acc-icon { color: var(--gold-dim); }

.badge-rare {
  background: rgba(196,58,43,0.15);
  color: var(--hell-red);
  border: 1px solid rgba(196,58,43,0.3);
  border-radius: 50px;
  padding: 0.15rem 0.6rem;
  font-size: 0.7rem;
  font-family: var(--font-heading);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════
   REALM COMPARISON
═══════════════════════════════════════════════════════ */
.realm-comparison {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  align-items: center;
  background: var(--ink-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

@media (max-width: 768px) {
  .realm-comparison {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .realm-divider { order: 2; }
  .heaven-side   { order: 3; }
}

.realm-label {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
}

.hell-label   { color: var(--hell-orange); border-bottom-color: rgba(212,98,42,0.3); }
.heaven-label { color: var(--heaven-light); border-bottom-color: rgba(74,127,165,0.3); }

.realm-facts { display: flex; flex-direction: column; gap: 0.5rem; }

.fact-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.95rem;
}

.fact-key { color: var(--text-muted); font-family: var(--font-heading); font-size: 0.8rem; letter-spacing: 0.04em; }
.fact-val { color: var(--text-body); text-align: right; font-size: 0.9rem; }

.realm-divider {
  font-size: 2.5rem;
  color: var(--gold-dim);
  opacity: 0.4;
  text-align: center;
}

.hell-side  { border-right: 1px solid rgba(212,98,42,0.15); padding-right: 1.5rem; }
.heaven-side{ border-left: 1px solid rgba(74,127,165,0.15); padding-left: 1.5rem; }

@media (max-width: 768px) {
  .hell-side  { border-right: none; border-bottom: 1px solid var(--border); padding-right: 0; padding-bottom: 1rem; }
  .heaven-side{ border-left: none; padding-left: 0; }
}

.hell-accent   { color: var(--hell-orange) !important; }
.heaven-accent { color: var(--heaven-light) !important; }

/* ═══════════════════════════════════════════════════════
   RED DRAUGHT
═══════════════════════════════════════════════════════ */
.red-draught-card {
  border-color: rgba(196,58,43,0.2);
  background: linear-gradient(135deg, rgba(196,58,43,0.04) 0%, var(--ink-2) 60%);
}

/* ═══════════════════════════════════════════════════════
   LOCATION CARDS
═══════════════════════════════════════════════════════ */
.location-card {
  background: var(--ink-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  height: 100%;
  transition: all var(--transition);
}

.location-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-mid);
}

.location-card h5 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}

.fade-card    h5 { color: rgba(200,200,220,0.7); }
.zathura-card h5 { color: var(--hell-red); }
.wastes-card  h5 { color: var(--hell-orange); }
.backroads-card h5{ color: var(--gold-dim); }

/* ═══════════════════════════════════════════════════════
   HIERARCHY BLOCKS
═══════════════════════════════════════════════════════ */
.hierarchy-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 100%;
}

.hierarchy-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  padding: 1.2rem 1.5rem;
  margin: 0;
}

.hell-hierarchy .hierarchy-title   { background: rgba(212,98,42,0.08); color: var(--hell-orange); border-bottom: 1px solid rgba(212,98,42,0.2); }
.heaven-hierarchy .hierarchy-title { background: rgba(74,127,165,0.08); color: var(--heaven-light); border-bottom: 1px solid rgba(74,127,165,0.2); }

.hierarchy-steps { padding: 0.5rem 0; }

.h-step {
  padding: 0.8rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1rem;
  align-items: start;
  transition: background var(--transition);
}

.h-step:last-child { border-bottom: none; }
.h-step:hover { background: rgba(201,168,76,0.02); }

.h-rank {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-top: 0.15rem;
}

.h-desc { font-size: 0.9rem; color: var(--text-muted); }

/* Hell step colors */
.newling .h-rank  { color: var(--text-muted); }
.denizen .h-rank  { color: var(--parchment-dim); }
.mogul .h-rank    { color: var(--gold-dim); }
.czar .h-rank     { color: var(--hell-orange); }
/* Heaven step colors */
.essence .h-rank   { color: var(--text-muted); }
.illume .h-rank    { color: var(--parchment-dim); }
.guardians .h-rank { color: var(--gold-dim); }
.seekers .h-rank   { color: var(--gold); }
.purifiers .h-rank { color: var(--heaven-light); }
.governors .h-rank { color: var(--heaven-blue); }

@media (max-width: 576px) {
  .h-step { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════
   FIRE LORDS GRID
═══════════════════════════════════════════════════════ */
.firelords-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.fl-card {
  background: var(--ink-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  transition: all var(--transition);
}

.fl-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-mid);
}

.fl-fire { font-size: 1.8rem; margin-bottom: 0.4rem; }

.fl-card h5 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.fl-domain {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.fl-card p { font-size: 0.92rem; margin-bottom: 0; }

.garanzo { border-color: rgba(212,98,42,0.25); }
.garanzo h5 { color: var(--hell-orange); }
.zazoro  { border-color: rgba(74,127,165,0.25); }
.zazoro h5  { color: var(--heaven-blue); }
.phayne  { border-color: rgba(130,80,160,0.25); }
.phayne h5  { color: #a060c0; }
.zathura { border-color: rgba(196,58,43,0.25); }
.zathura h5 { color: var(--hell-red); }

/* ═══════════════════════════════════════════════════════
   GRIEVE CARD
═══════════════════════════════════════════════════════ */
.grieve-card {
  border-color: rgba(196,58,43,0.2);
  background: linear-gradient(135deg, rgba(80,20,20,0.15) 0%, var(--ink-2) 60%);
}

/* ═══════════════════════════════════════════════════════
   LOVE CARDS
═══════════════════════════════════════════════════════ */
.love-card { text-align: center; padding: 2rem; }

.demon-love {
  border-color: rgba(212,98,42,0.2);
  background: linear-gradient(135deg, rgba(212,98,42,0.05) 0%, var(--ink-2) 60%);
}

.angel-love {
  border-color: rgba(74,127,165,0.2);
  background: linear-gradient(135deg, rgba(74,127,165,0.05) 0%, var(--ink-2) 60%);
}

/* ═══════════════════════════════════════════════════════
   KINGDOM CARDS
═══════════════════════════════════════════════════════ */
.kingdom-card {
  background: var(--ink-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  height: 100%;
  transition: all var(--transition);
}

.kingdom-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-mid);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.kingdom-badge {
  position: absolute;
  top: 1rem; right: 1rem;
  font-family: var(--font-heading);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.15rem 0.6rem;
}

.kingdom-card h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
  padding-right: 3rem;
}

.kingdom-type {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}

.kingdom-stat {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border);
}

.ashra   { border-top: 3px solid rgba(200,90,60,0.5); }
.wulfe   { border-top: 3px solid rgba(90,130,100,0.5); }
.naytron { border-top: 3px solid rgba(201,168,76,0.5); }
.heftle  { border-top: 3px solid rgba(74,127,165,0.5); }
.rundaur { border-top: 3px solid rgba(196,58,43,0.5); }

/* ─── Age Range ─── */
.age-range {
  background: var(--ink-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 0.75rem;
}

.age-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.age-item:last-child { border-bottom: none; }
.age-item span { font-family: var(--font-heading); color: var(--gold-dim); font-size: 0.82rem; }
.age-item em   { color: var(--text-muted); font-size: 0.88rem; }

/* ═══════════════════════════════════════════════════════
   SOUL DESTRUCTION LIST
═══════════════════════════════════════════════════════ */
.destruction-list { display: flex; flex-direction: column; gap: 1rem; }

.dest-item {
  display: flex;
  gap: 1.2rem;
  padding: 1rem;
  background: var(--ink-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}

.dest-item:hover { border-color: var(--border-mid); }

.dest-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--gold-dim);
  opacity: 0.4;
  line-height: 1;
  flex-shrink: 0;
  min-width: 2.5rem;
  padding-top: 0.2rem;
}

.dest-body h5 {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 0.4rem;
}

.dest-body p { margin-bottom: 0; font-size: 0.97rem; }

/* ═══════════════════════════════════════════════════════
   DRAK CARD
═══════════════════════════════════════════════════════ */
.drak-card {
  background: linear-gradient(135deg, rgba(20,10,30,0.6) 0%, var(--ink-2) 70%);
  border-color: rgba(130,80,180,0.2);
}

/* ═══════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════ */
.codex-footer {
  background: var(--ink-2);
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  position: relative;
  z-index: 1;
}

.footer-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 0.4rem;
}

.footer-sub {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.footer-divider {
  width: 80px;
  height: 1px;
  background: var(--border-mid);
  margin: 1rem auto;
}

.footer-credit {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════
   BACK TO TOP
═══════════════════════════════════════════════════════ */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ink-3);
  border: 1px solid var(--border-mid);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: all var(--transition);
  font-size: 1.1rem;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  background: rgba(201,168,76,0.1);
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(201,168,76,0.2);
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════
   REVEAL ANIMATIONS
═══════════════════════════════════════════════════════ */
.reveal-up {
  opacity: 0;
  transform: translateY(30px);
  animation: reveal-up 1.2s ease forwards;
  animation-delay: 0.3s;
}

@keyframes reveal-up {
  to { opacity: 1; transform: translateY(0); }
}

.reveal-card {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-card.in-view {
  opacity: 1;
  transform: translateY(0);
}

.reveal-section > * { }

/* Staggered card delays */
.reveal-card:nth-child(1) { transition-delay: 0.05s; }
.reveal-card:nth-child(2) { transition-delay: 0.1s;  }
.reveal-card:nth-child(3) { transition-delay: 0.15s; }
.reveal-card:nth-child(4) { transition-delay: 0.2s;  }
.reveal-card:nth-child(5) { transition-delay: 0.25s; }
.reveal-card:nth-child(6) { transition-delay: 0.3s;  }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .section-header { flex-direction: column; gap: 0.5rem; }
  .section-number { font-size: 2rem; }
  .codex-card     { padding: 1.2rem 1.3rem; }
  .h-step { padding: 0.7rem 1rem; }
}

@media (max-width: 576px) {
  .hero-nav-pills .pill-btn { font-size: 0.7rem; padding: 0.35rem 0.9rem; }
  .firelords-grid { grid-template-columns: 1fr 1fr; }
  .destruction-list .dest-item { flex-direction: column; }
}

/* ═══════════════════════════════════════════════════════
   UTILITY OVERRIDES
═══════════════════════════════════════════════════════ */
p { color: var(--text-body); }
strong { color: var(--parchment-dim); }
em { color: var(--parchment-dim); }
a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--gold-light); }

ul li { margin-bottom: 0.3rem; }

/* Bootstrap accordion dark override */
[data-bs-theme="dark"] .accordion-button:not(.collapsed) { color: var(--gold-light); }

/* Container max-width tweak */
.container-xl { max-width: 1200px; }
