:root {
  --rh-ink: #1a120c;
  --rh-parchment: #f3ebe0;
  --rh-sand: #e8dcc8;
  --rh-gold: #b8862b;
  --rh-gold-deep: #8a6420;
  --rh-saffron: #c45c1a;
  --rh-crimson: #6e2418;
  --rh-forest: #2f4a38;
  --rh-muted: #6e5f52;
  --rh-panel: #221912;
  --rh-line: rgba(184, 134, 43, 0.35);
}

.rmy-hub-body {
  margin: 0;
  background: var(--rh-parchment);
  color: #1a120c;
  font-family: "Outfit", "Noto Sans Devanagari", system-ui, sans-serif;
}

/* Light surfaces: always near-black type (never inherit white from global/dark chrome). */
.rh-main,
.rh-main p,
.rh-main li,
.rh-main td,
.rh-main th,
.rh-main dd,
.rh-main h1,
.rh-main h2,
.rh-main h3,
.rh-page-hero,
.rh-page-hero h1,
.rh-section,
.rh-article,
.rh-gate,
.rh-gate h3,
.rh-gate p,
.rh-item,
.rh-item h3,
.rh-item p,
.rh-weapon,
.rh-weapon h3,
.rh-weapon dd,
.rh-trad-col,
.rh-trad-col h3,
.rh-trad-col dd,
.rh-place-card,
.rh-place-card h2,
.rh-place-card p,
.rh-faq,
.rh-faq summary,
.rh-faq p {
  color: #1a120c;
}

.rh-hero {
  position: relative;
  min-height: min(72vh, 640px);
  display: flex;
  align-items: flex-end;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(196, 92, 26, 0.35), transparent 55%),
    linear-gradient(160deg, #2a1a12 0%, #14100c 45%, #1c140f 100%);
  color: #f6eedf;
  overflow: hidden;
}

.rh-hero-veil {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      -18deg,
      transparent,
      transparent 12px,
      rgba(243, 235, 224, 0.03) 12px,
      rgba(243, 235, 224, 0.03) 13px
    );
  pointer-events: none;
}

.rh-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 3rem;
  width: 100%;
}

.rh-brand {
  margin: 0 0 0.4rem;
  font-family: "Fraunces", "Noto Serif Devanagari", serif;
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--rh-gold);
}

.rh-hero h1 {
  margin: 0 0 0.75rem;
  font-family: "Fraunces", "Noto Serif Devanagari", serif;
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 600;
  color: #f8f1e4;
  max-width: 18ch;
}

.rh-lede {
  margin: 0 0 1.5rem;
  max-width: 42ch;
  font-size: 1.05rem;
  line-height: 1.55;
  color: rgba(246, 238, 223, 0.82);
}

.rh-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
}

.rh-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.7rem 1.25rem;
  border-radius: 2px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.rh-btn:hover { transform: translateY(-2px); }

.rh-btn-gold {
  background: var(--rh-gold);
  color: #1a120c;
}

.rh-btn-gold:hover { background: #d4a03a; color: #1a120c; }

.rh-btn-ghost {
  border: 1px solid rgba(246, 238, 223, 0.45);
  color: #f6eedf;
  background: transparent;
}

.rh-lang {
  margin-left: 0.25rem;
  color: var(--rh-gold);
  text-decoration: none;
  font-size: 0.9rem;
}

.rh-rail {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.65rem 1rem;
  background: rgba(243, 235, 224, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rh-line);
  scrollbar-width: none;
}

.rh-rail::-webkit-scrollbar { display: none; }

.rh-rail a {
  flex: 0 0 auto;
  padding: 0.4rem 0.85rem;
  text-decoration: none;
  color: var(--rh-muted);
  font-size: 0.85rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}

.rh-rail a:hover,
.rh-rail a.is-active {
  color: var(--rh-saffron);
  border-bottom-color: var(--rh-saffron);
}

.rh-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.rh-section {
  padding: 2.5rem 0 1rem;
  border-top: 1px solid var(--rh-line);
  scroll-margin-top: 3.5rem;
}

.rh-section:first-of-type { border-top: 0; padding-top: 1rem; }

.rh-section h2 {
  margin: 0 0 0.4rem;
  font-family: "Fraunces", "Noto Serif Devanagari", serif;
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  color: #1a120c;
}

.rh-section-lede {
  margin: 0 0 1.5rem;
  max-width: 58ch;
  color: #3d2a1c;
  line-height: 1.5;
}
.rh-section-lede a {
  color: #8a3d12;
  font-weight: 600;
}

.rh-gates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.rh-gate {
  display: block;
  padding: 1.15rem 1.2rem 1.25rem;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(165deg, #fffaf3, var(--rh-sand));
  border-left: 3px solid var(--rh-gold);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.rh-gate:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(26, 18, 12, 0.08);
}

.rh-gate[data-accent="saffron"] { border-left-color: var(--rh-saffron); }
.rh-gate[data-accent="crimson"] { border-left-color: var(--rh-crimson); }
.rh-gate[data-accent="forest"] { border-left-color: var(--rh-forest); }
.rh-gate[data-accent="ink"] { border-left-color: var(--rh-ink); }
.rh-gate[data-accent="ash"] { border-left-color: #5c534a; }
.rh-gate[data-accent="bronze"] { border-left-color: #8b6914; }

.rh-gate h3 {
  margin: 0 0 0.4rem;
  font-family: "Fraunces", "Noto Serif Devanagari", serif;
  font-size: 1.1rem;
}

.rh-gate p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--rh-muted);
}

.rh-trad-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 720px) {
  .rh-trad-cols { grid-template-columns: 1fr; }
}

.rh-trad-col {
  padding: 1.25rem;
  background: #fffaf3;
  border-top: 3px solid var(--rh-gold);
}

.rh-trad-col h3 {
  margin: 0 0 0.25rem;
  font-family: "Fraunces", "Noto Serif Devanagari", serif;
  font-size: 1.15rem;
}

.rh-trad-col .rh-work {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--rh-saffron);
  font-weight: 600;
}

.rh-trad-col dl {
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.rh-trad-col dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rh-muted);
}

.rh-trad-col dd {
  margin: 0.15rem 0 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.rh-trad-table-wrap,
.rh-evidence-wrap {
  overflow-x: auto;
  border: 1px solid var(--rh-line);
  background: #fffaf3;
}

.rh-trad-table,
.rh-evidence-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.rh-trad-table th,
.rh-evidence-table th {
  text-align: left;
  padding: 0.85rem 1rem;
  background: #ebe1d2;
  font-family: "Fraunces", "Noto Serif Devanagari", serif;
  font-weight: 600;
  border-bottom: 1px solid var(--rh-line);
}

.rh-trad-table td,
.rh-evidence-table td {
  padding: 0.9rem 1rem;
  vertical-align: top;
  border-bottom: 1px solid rgba(26, 18, 12, 0.08);
  line-height: 1.45;
}

.rh-trad-table tr:last-child td,
.rh-evidence-table tr:last-child td { border-bottom: 0; }

.rh-trad-table td:first-child {
  font-weight: 600;
  color: #6b2f0e;
  white-space: nowrap;
}
.rh-trad-table td,
.rh-evidence-table td {
  color: #1a120c;
}

.rh-clan-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.rh-clan-btn {
  border: 1px solid var(--rh-line);
  background: #fffaf3;
  color: var(--rh-ink);
  padding: 0.45rem 0.9rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.rh-clan-btn:hover,
.rh-clan-btn.is-active {
  background: var(--rh-panel);
  color: var(--rh-parchment);
  border-color: var(--rh-panel);
}

.rh-graph-stage {
  position: relative;
  display: grid;
  /* Single column until a folio opens — avoids Cytoscape measuring a half-empty grid. */
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(420px, 52vh);
  gap: 0;
  min-height: 460px;
  background: linear-gradient(180deg, #1f1712, #15100c);
  border: 1px solid #3a2c22;
}

.rh-graph-stage.has-folio {
  grid-template-columns: 1fr minmax(200px, 280px);
}

.rh-graph-toolbar {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid #3a2c22;
  background: rgba(15, 11, 8, 0.55);
}

.rh-graph-fs {
  border: 1px solid rgba(201, 150, 46, 0.45);
  background: transparent;
  color: #f3ebe0;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.75rem;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.rh-graph-fs:hover {
  background: rgba(201, 150, 46, 0.18);
  border-color: rgba(201, 150, 46, 0.7);
}

@media (max-width: 800px) {
  .rh-graph-stage,
  .rh-graph-stage.has-folio {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(420px, 52vh) auto;
    min-height: 480px;
  }
  .rh-graph-stage.has-folio .rh-folio {
    grid-column: 1;
    grid-row: 3;
    border-left: 0;
    border-top: 1px solid #3a2c22;
    max-height: 280px;
  }
}

.rh-graph {
  grid-column: 1;
  grid-row: 2;
  /* Explicit height — % height with only min-height parents yields 0 for Cytoscape. */
  width: 100%;
  height: 100%;
  min-height: 420px;
  position: relative;
}

.rh-folio {
  grid-column: 1;
  grid-row: 3;
  padding: 1.25rem 1.15rem;
  background: #2a211a;
  color: #f1ebd9;
  border-left: 0;
  border-top: 1px solid #3a2c22;
  overflow: auto;
  max-height: 320px;
}

.rh-graph-stage.has-folio .rh-folio {
  grid-column: 2;
  grid-row: 2;
  border-left: 1px solid #3a2c22;
  border-top: 0;
  max-height: none;
}

@media (max-width: 800px) {
  .rh-graph {
    grid-column: 1;
    grid-row: 2;
  }
  .rh-folio {
    grid-column: 1;
    grid-row: 3;
  }
}

.rh-graph-stage:fullscreen,
.rh-graph-stage:-webkit-full-screen {
  width: 100%;
  height: 100%;
  min-height: 100%;
  box-sizing: border-box;
  background: linear-gradient(180deg, #1f1712, #0f0b08);
}

.rh-graph-stage:fullscreen .rh-graph,
.rh-graph-stage:-webkit-full-screen .rh-graph {
  min-height: 0;
  height: 100%;
}

.rh-graph-stage:fullscreen .rh-folio,
.rh-graph-stage:-webkit-full-screen .rh-folio {
  max-height: none;
}

.rh-folio[hidden] { display: none !important; }

@media (max-width: 800px) {
  .rh-folio {
    border-left: 0;
    border-top: 1px solid #3a2c22;
  }
}

.rh-folio-close {
  float: right;
  border: 0;
  background: transparent;
  color: #cbbba8;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.rh-folio-role {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rh-gold);
}

.rh-folio h3 {
  margin: 0 0 0.5rem;
  font-family: "Fraunces", "Noto Serif Devanagari", serif;
  font-size: 1.2rem;
  color: var(--rh-gold);
}

.rh-folio p:last-child {
  margin: 0;
  line-height: 1.5;
  color: rgba(241, 235, 217, 0.85);
  font-size: 0.92rem;
}

.rh-list {
  display: grid;
  gap: 0.85rem;
}

.rh-item {
  padding: 1rem 1.15rem;
  background: #fffaf3;
  border-left: 3px solid var(--rh-forest);
  cursor: pointer;
  transition: background 0.2s ease;
}

.rh-item:hover { background: #fff5ea; }

.rh-item h3 {
  margin: 0 0 0.35rem;
  font-family: "Fraunces", "Noto Serif Devanagari", serif;
  font-size: 1.05rem;
}

.rh-item .rh-kandas {
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  color: var(--rh-gold-deep);
  font-weight: 600;
}

.rh-item p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #2a1c14;
}

.rh-item.is-open p.rh-more {
  margin-top: 0.55rem;
  color: #1a120c;
}

.rh-weapons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.rh-weapon {
  padding: 1.15rem;
  background: linear-gradient(165deg, #fffaf3, #efe4d4);
  border-top: 3px solid #8b6914;
}

.rh-weapon h3 {
  margin: 0 0 0.75rem;
  font-family: "Fraunces", "Noto Serif Devanagari", serif;
  font-size: 1.05rem;
}

.rh-weapon dl {
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.rh-weapon dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rh-muted);
}

.rh-weapon dd {
  margin: 0.1rem 0 0;
  font-size: 0.88rem;
  line-height: 1.4;
}

.rh-related {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rh-line);
}

.rh-related h3 {
  margin: 0 0 0.75rem;
  font-family: "Fraunces", serif;
}

.rh-related ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.rh-related a {
  color: var(--rh-saffron);
  text-decoration: none;
  font-weight: 500;
}

.rh-related a:hover { text-decoration: underline; }

.rh-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--rh-muted);
  margin-bottom: 1.25rem;
}
.rh-crumb a { color: var(--rh-saffron); text-decoration: none; }

.rh-page-hero {
  padding: 0.5rem 0 1.75rem;
  color: #1a120c;
}
.rh-page-hero .rh-brand {
  color: #1a120c;
  font-size: clamp(1.4rem, 3vw, 2rem);
}
.rh-page-hero h1 {
  margin: 0.2rem 0 0.5rem;
  font-family: "Fraunces", "Noto Serif Devanagari", serif;
  font-size: clamp(1.6rem, 3.5vw, 2.35rem);
  color: #1a120c;
}
.rh-page-hero .rh-lede {
  color: #2a1c14;
}
.rh-subtitle {
  margin: 0 0 0.75rem;
  color: #6b2f0e;
  font-weight: 600;
  max-width: 48ch;
}
.rh-modern {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: #3d2a1c;
}

.rh-place-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.rh-place-card {
  display: block;
  padding: 1.15rem 1.2rem;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(165deg, #fffaf3, var(--rh-sand));
  border-left: 3px solid var(--rh-forest);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.rh-place-card.is-featured { border-left-color: var(--rh-gold); }
.rh-place-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(26, 18, 12, 0.08);
}
.rh-place-region {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rh-gold-deep);
  font-weight: 600;
}
.rh-place-card h2 {
  margin: 0 0 0.4rem;
  font-family: "Fraunces", "Noto Serif Devanagari", serif;
  font-size: 1.15rem;
}
.rh-place-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--rh-muted);
  line-height: 1.45;
}

.rh-article {
  max-width: 720px;
}
.rh-article-section {
  padding: 1.25rem 0;
  border-top: 1px solid var(--rh-line);
}
.rh-article-section h2 {
  margin: 0 0 0.65rem;
  font-family: "Fraunces", "Noto Serif Devanagari", serif;
  font-size: 1.25rem;
}
.rh-article-section p {
  margin: 0;
  line-height: 1.65;
  font-size: 1.02rem;
}

.rh-evidence-list,
.rh-ref-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.75rem;
}
.rh-evidence-list li {
  padding: 0.85rem 1rem;
  background: #fffaf3;
  border-left: 3px solid var(--rh-forest);
  line-height: 1.45;
}
.rh-evidence-list li.is-open { border-left-color: var(--rh-saffron); }
.rh-ev-tag {
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rh-gold-deep);
}
.rh-ref-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(26, 18, 12, 0.08);
  line-height: 1.45;
}
.rh-ref-list li strong { display: block; margin-bottom: 0.2rem; }
.rh-ref-list li span { color: var(--rh-muted); font-size: 0.92rem; }

.rh-faq-list {
  display: grid;
  gap: 0.65rem;
}
.rh-faq {
  background: #fffaf3;
  border-left: 3px solid var(--rh-gold);
  padding: 0.85rem 1rem;
}
.rh-faq summary {
  cursor: pointer;
  font-weight: 600;
  font-family: "Fraunces", "Noto Serif Devanagari", serif;
  color: #1a120c;
}
.rh-faq p {
  margin: 0.65rem 0 0;
  line-height: 1.55;
  color: #2a1c14;
  font-size: 0.95rem;
}

.rh-item a.rh-place-link {
  display: inline-block;
  margin-top: 0.55rem;
  color: var(--rh-saffron);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.88rem;
}
.rh-item a.rh-place-link:hover { text-decoration: underline; }

.rh-graph-stage {
  min-height: 360px;
}
.rh-graph {
  min-height: 360px;
}
.rh-clan-note {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--rh-muted);
}

@media (prefers-reduced-motion: reduce) {
  .rh-btn,
  .rh-gate,
  .rh-place-card { transition: none; }
}
