/* ============================================================
   INKANTATION STUDIOS — SHARED STYLESHEET
   Heroes of Divinity | Dark Fantasy RPG
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700;900&family=Cinzel+Decorative:wght@400;700&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Lato:ital,wght@0,300;0,400;0,700;1,400&display=swap');

/* ── CSS Variables ───────────────────────────────────────── */
:root {
  --bg-dark:      #07080f;
  --bg-mid:       #0e1020;
  --bg-card:      #12172a;
  --bg-card-alt:  #161c30;
  --bg-raised:    #1a2040;
  --border:       #2c3558;
  --border-glow:  #4a5a9a;
  --gold:         #c9a84c;
  --gold-light:   #e8d08a;
  --gold-dark:    #8a6a1a;
  --gold-glow:    rgba(201,168,76,0.25);
  --crimson:      #8b1a2a;
  --crimson-glow: rgba(139,26,42,0.4);
  --text-primary: #e8e0d0;
  --text-muted:   #8a8faa;
  --text-gold:    #c9a84c;
  --text-dim:     #5a6080;
  --accent-blue:  #3a5a9a;
  --accent-purple:#6a3a9a;
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.4);
  --shadow-card:  0 4px 16px rgba(0,0,0,0.5);
  --glow-gold:    0 0 20px rgba(201,168,76,0.3);
  --glow-gold-sm: 0 0 10px rgba(201,168,76,0.2);
  --radius:       8px;
  --radius-lg:    16px;
  --nav-height:   70px;
  --transition:   0.3s ease;
}

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.7;
  min-height: 100vh;
}

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Cinzel', serif;
  letter-spacing: 0.05em;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.4rem); font-weight: 600; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.7rem); font-weight: 500; }
h4 { font-size: 1.2rem; font-weight: 500; }
h5 { font-size: 1rem; font-weight: 500; }

p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--gold);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--gold-light); }

strong { color: var(--gold-light); font-weight: 600; }
em { color: var(--text-muted); font-style: italic; }

ul, ol { padding-left: 1.5em; margin-bottom: 1em; }
li { margin-bottom: 0.25em; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--border-glow); }

/* ── Navigation ──────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(7, 8, 15, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 2rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.1rem;
  color: var(--gold);
  text-shadow: var(--glow-gold-sm);
  letter-spacing: 0.1em;
  flex-shrink: 0;
  text-decoration: none;
}

.nav-logo:hover { color: var(--gold-light); text-shadow: var(--glow-gold); }

.nav-logo-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  box-shadow: var(--glow-gold-sm);
  background: var(--gold-dark);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  padding: 0; margin: 0;
  flex: 1;
}

.nav-links a {
  display: block;
  padding: 0.4rem 1rem;
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
  background: rgba(201, 168, 76, 0.1);
  text-shadow: var(--glow-gold-sm);
}

.nav-cta {
  margin-left: auto;
}

.nav-cta a {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--bg-dark) !important;
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: all var(--transition);
  box-shadow: var(--glow-gold-sm);
  text-shadow: none !important;
}

.nav-cta a:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  box-shadow: var(--glow-gold);
  transform: translateY(-1px);
  color: var(--bg-dark) !important;
}

.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--gold);
  font-size: 1.5rem;
  cursor: pointer;
  margin-left: auto;
}

/* ── Layout Utilities ────────────────────────────────────── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-header h2 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.section-label {
  display: inline-block;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
  padding: 0.25rem 1rem;
  border: 1px solid var(--gold-dark);
  border-radius: 20px;
  background: rgba(201,168,76,0.05);
}

.section-desc {
  max-width: 600px;
  margin: 1rem auto 0;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.gold-line {
  width: 60px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 1rem auto;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
}

.card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-lg), var(--glow-gold-sm);
  transform: translateY(-3px);
}

.card-header {
  padding: 1.5rem 1.75rem 0;
}

.card-body {
  padding: 1.25rem 1.75rem 1.75rem;
}

.card-footer {
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}

/* ── Ornamental Dividers ─────────────────────────────────── */
.ornament {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0;
}

.ornament::before,
.ornament::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-glow));
}

.ornament::after {
  background: linear-gradient(90deg, var(--border-glow), transparent);
}

.ornament-icon {
  color: var(--gold);
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--bg-dark);
  box-shadow: var(--glow-gold-sm);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  box-shadow: var(--glow-gold);
  transform: translateY(-2px);
  color: var(--bg-dark);
}

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-dark);
}

.btn-outline:hover {
  background: rgba(201,168,76,0.1);
  border-color: var(--gold);
  box-shadow: var(--glow-gold-sm);
  transform: translateY(-2px);
  color: var(--gold-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-glow);
  background: rgba(255,255,255,0.04);
}

.btn-danger {
  background: linear-gradient(135deg, var(--crimson), #c0392b);
  color: #fff;
  box-shadow: 0 0 12px var(--crimson-glow);
}

.btn-danger:hover {
  box-shadow: 0 0 20px var(--crimson-glow);
  transform: translateY(-2px);
  color: #fff;
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 0.95rem;
}

/* ── Badges / Tags ───────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 20px;
}

.badge-gold {
  background: rgba(201,168,76,0.15);
  color: var(--gold);
  border: 1px solid var(--gold-dark);
}

.badge-blue {
  background: rgba(58,90,154,0.2);
  color: #7a9ade;
  border: 1px solid #3a5a9a;
}

.badge-purple {
  background: rgba(106,58,154,0.2);
  color: #aa7ade;
  border: 1px solid #6a3a9a;
}

.badge-crimson {
  background: rgba(139,26,42,0.2);
  color: #d44a5a;
  border: 1px solid var(--crimson);
}

.badge-green {
  background: rgba(38,120,70,0.2);
  color: #5abe8a;
  border: 1px solid #26783a;
}

/* ── Hero Section ────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding-top: var(--nav-height);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(58,90,154,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(106,58,154,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(139,26,42,0.08) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-dark) 0%, #0a0c1a 100%);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(42,50,90,0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42,50,90,0.15) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.hero-content {
  position: relative;
  text-align: center;
  max-width: 900px;
  padding: 2rem;
}

.hero-eyebrow {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

.hero-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--text-primary), var(--gold-light), var(--text-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  text-shadow: none;
}

.hero-subtitle {
  font-family: 'Cinzel', serif;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--gold);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  font-weight: 400;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.8;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dim);
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  animation: bounce 2s infinite;
}

.hero-scroll::after {
  content: '';
  display: block;
  width: 1px;
  height: 30px;
  background: linear-gradient(180deg, var(--border-glow), transparent);
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(5px); }
}

/* ── Stat/Info Boxes ─────────────────────────────────────── */
.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  text-align: center;
}

.stat-box-value {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-box-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Grid Utilities ──────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ── Accordion / Details ─────────────────────────────────── */
details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0.75rem;
  transition: border-color var(--transition);
}

details:hover { border-color: var(--border-glow); }

details[open] {
  border-color: var(--gold-dark);
  box-shadow: var(--glow-gold-sm);
}

summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  list-style: none;
  user-select: none;
  background: var(--bg-card-alt);
  transition: background var(--transition);
}

summary:hover { background: var(--bg-raised); }

summary::-webkit-details-marker { display: none; }

summary::before {
  content: '▶';
  font-size: 0.65rem;
  color: var(--gold);
  transition: transform var(--transition);
  flex-shrink: 0;
}

details[open] > summary::before { transform: rotate(90deg); }

.details-content {
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

/* ── Tables ──────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 1.25rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead tr { background: var(--bg-raised); }

thead th {
  padding: 0.75rem 1rem;
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid rgba(44,53,88,0.5);
  transition: background var(--transition);
}

tbody tr:hover { background: rgba(255,255,255,0.02); }
tbody tr:last-child { border-bottom: none; }

tbody td {
  padding: 0.65rem 1rem;
  color: var(--text-primary);
  vertical-align: top;
}

tbody td:first-child {
  font-family: 'Cinzel', serif;
  font-weight: 500;
  color: var(--gold-light);
}

/* ── Callout Boxes ───────────────────────────────────────── */
.callout {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  border-left: 4px solid;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.callout-gold {
  background: rgba(201,168,76,0.06);
  border-color: var(--gold);
  color: var(--text-primary);
}

.callout-blue {
  background: rgba(58,90,154,0.1);
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

.callout-purple {
  background: rgba(106,58,154,0.1);
  border-color: var(--accent-purple);
  color: var(--text-primary);
}

.callout-danger {
  background: rgba(139,26,42,0.1);
  border-color: var(--crimson);
  color: var(--text-primary);
}

/* ── Forms ───────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

input[type=text],
input[type=email],
input[type=number],
input[type=password],
textarea,
select {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: 'EB Garamond', serif;
  font-size: 0.95rem;
  padding: 0.6rem 0.85rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.1);
}

input[readonly] {
  background: var(--bg-card-alt);
  color: var(--text-muted);
  cursor: default;
}

textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}

select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c9a84c' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

select option {
  background: var(--bg-mid);
  color: var(--text-primary);
}

/* ── Page Header (inner pages) ───────────────────────────── */
.page-header {
  padding: calc(var(--nav-height) + 4rem) 0 4rem;
  background:
    radial-gradient(ellipse at center top, rgba(58,90,154,0.15) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-mid) 0%, var(--bg-dark) 100%);
  border-bottom: 1px solid var(--border);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(42,50,90,0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42,50,90,0.12) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.page-header-content {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  padding: 0 2rem;
}

.page-header h1 { margin-bottom: 0.75rem; }
.page-header p { color: var(--text-muted); font-size: 1.1rem; max-width: 550px; margin: 0 auto; }

/* ── Sidebar Layout (Codex) ──────────────────────────────── */
.sidebar-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  min-height: calc(100vh - var(--nav-height));
}

.sidebar {
  background: var(--bg-mid);
  border-right: 1px solid var(--border);
  padding: 2rem 0;
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
}

.sidebar-title {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 1.5rem;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}

.sidebar-title:first-child { margin-top: 0; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1.5rem;
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  transition: all var(--transition);
}

.sidebar-nav a:hover {
  color: var(--text-primary);
  border-left-color: var(--border-glow);
  background: rgba(255,255,255,0.03);
}

.sidebar-nav a.active {
  color: var(--gold);
  border-left-color: var(--gold);
  background: rgba(201,168,76,0.08);
}

.sidebar-nav a .icon { font-size: 0.8rem; width: 1rem; text-align: center; }

.codex-content {
  padding: 3rem;
  max-width: 900px;
}

/* ── Codex Entry Styles ──────────────────────────────────── */
.codex-section {
  margin-bottom: 4rem;
  scroll-margin-top: calc(var(--nav-height) + 1rem);
}

.codex-section-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 2rem;
  color: var(--gold-light);
  margin-bottom: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.codex-subsection {
  margin-top: 2.5rem;
  scroll-margin-top: calc(var(--nav-height) + 1rem);
}

.codex-subsection-title {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.codex-entry {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  transition: border-color var(--transition);
}

.codex-entry:hover { border-color: var(--border-glow); }

.codex-entry h4 {
  color: var(--gold);
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
}

.codex-entry p { color: var(--text-muted); margin-bottom: 0.6em; font-size: 0.95rem; }
.codex-entry ul { color: var(--text-muted); font-size: 0.95rem; }

.stat-block {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.stat-block-title {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}

.stat-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}

.stat-label {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold-light);
  min-width: 140px;
  flex-shrink: 0;
}

.stat-value {
  color: var(--text-primary);
  font-size: 0.85rem;
}

.ability-block {
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius);
  border-left: 3px solid var(--gold-dark);
}

.ability-name {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 0.3rem;
}

.ability-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Footer ──────────────────────────────────────────────── */
footer {
  background: var(--bg-mid);
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.footer-heading {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li { margin-bottom: 0.5rem; }

.footer-links a {
  color: var(--text-muted);
  font-size: 0.88rem;
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--gold); }

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom p {
  color: var(--text-dim);
  font-size: 0.82rem;
  margin: 0;
}

.social-links {
  display: flex;
  gap: 0.75rem;
}

.social-link {
  width: 36px; height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: all var(--transition);
}

.social-link:hover {
  color: var(--gold);
  border-color: var(--gold-dark);
  background: rgba(201,168,76,0.08);
}

/* ── Responsive Nav ──────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-mobile-toggle { display: block; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .sidebar-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .codex-content { padding: 2rem 1rem; }
  .container { padding: 0 1rem; }
}

@media (max-width: 500px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero-buttons { flex-direction: column; align-items: center; }
}

/* ── Utility Classes ─────────────────────────────────────── */
.text-gold { color: var(--gold) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }

/* ── Print Styles ────────────────────────────────────────── */
@media print {
  .nav, footer, .btn, .no-print { display: none !important; }
  body { background: white; color: black; }
  .page-header { background: none; padding: 1rem 0; }
  .card { border: 1px solid #ccc; box-shadow: none; }
  a { color: black; text-decoration: underline; }
  h1, h2, h3, h4, h5, h6 { color: black; }
  strong { color: black; }
}
