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

:root {
  --parch: #F4E9D2;
  --parch-dark: #E8D8B8;
  --ink: #3A2A14;
  --sepia: #8B6428;
  --sepia-light: #BFA068;
  --rose: #B85850;
  --blue-slate: #4E6A8C;
  --green-ok: #3D7A4A;
  --amber: #B8860B;
  --nav-h: 56px;
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--parch);
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 28px,
      rgba(139,100,40,0.04) 28px, rgba(139,100,40,0.04) 29px),
    repeating-linear-gradient(90deg, transparent, transparent 28px,
      rgba(139,100,40,0.025) 28px, rgba(139,100,40,0.025) 29px);
  color: var(--ink);
  font-family: 'Lato', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ── NAVIGATION ─────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(244,233,210,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--parch-dark);
  height: var(--nav-h);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 24px;
}

.nav-brand {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: 6px;
}

.nav-links a {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--sepia);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 3px;
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover { color: var(--ink); background: rgba(139,100,40,0.08); }
.nav-links a.active { color: var(--ink); background: rgba(139,100,40,0.12); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ── PAGE HEADER ─────────────────────────────────────── */
.page-header {
  text-align: center;
  padding: 80px 24px 48px;
  border-bottom: 1px solid var(--parch-dark);
}

.page-header h1 {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.page-header p {
  font-size: 0.9rem;
  color: var(--sepia);
  font-style: italic;
}

/* ── SECTIONS ────────────────────────────────────────── */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.section-subtitle {
  font-size: 0.88rem;
  color: var(--sepia);
  font-style: italic;
}

/* ── CARDS GRID ─────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}

.card {
  background: rgba(255,255,255,0.35);
  border: 1px solid var(--parch-dark);
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(80,50,10,0.12);
}

.card-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-gradient {
  width: 100%;
  height: 100%;
}

.card-year {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-family: 'Libre Baskerville', serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: rgba(58,42,20,0.7);
  padding: 3px 10px;
  border-radius: 3px;
  letter-spacing: 0.1em;
}

.card-body {
  padding: 18px 20px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-body .type-badge {
  margin-bottom: 10px;
  align-self: flex-start;
}

.card-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 4px;
}

.card:hover .card-title { color: var(--sepia); }

.card-location {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--sepia-light);
  margin-bottom: 12px;
}

.card-excerpt {
  font-size: 0.84rem;
  color: #4A3820;
  line-height: 1.7;
  flex: 1;
}

/* ── EXPLORE SECTION ─────────────────────────────────── */
.explore-section {
  border-top: 1px solid var(--parch-dark);
}

.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.explore-card {
  background: rgba(255,255,255,0.3);
  border: 1px solid var(--parch-dark);
  border-radius: 6px;
  padding: 28px 24px;
  text-decoration: none;
  color: inherit;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
}

.explore-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(80,50,10,0.1);
  background: rgba(255,255,255,0.5);
}

.explore-icon {
  color: var(--sepia);
  margin-bottom: 14px;
}

.explore-card h3 {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.explore-card:hover h3 { color: var(--sepia); }

.explore-card p {
  font-size: 0.8rem;
  color: var(--sepia);
  line-height: 1.6;
}

/* ── TRACKER BALL ─────────────────────────────────────── */
#tracker {
  position: fixed;
  left: 50px;
  top: 50vh;
  transform: translateY(-50%);
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--parch-dark);
  border: 2px solid var(--sepia);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  box-shadow: 0 2px 14px rgba(80,50,10,0.22);
  pointer-events: none;
}

@media (min-width: 681px) {
  #tracker {
    opacity: 0;
    transition: opacity 0.4s, border-color 0.5s;
  }
}

#tracker.status-canonical  { border-color: var(--blue-slate); }
#tracker.status-tradition  { border-color: var(--green-ok); }
#tracker.status-study      { border-color: var(--rose); }
#tracker.status-caution    { border-color: var(--amber); }

.tracker-symbol {
  font-size: 0.62rem;
  color: var(--sepia-light);
  line-height: 1;
  margin-bottom: 2px;
}
.tracker-year {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.56rem;
  font-weight: 700;
  color: var(--sepia);
  line-height: 1;
}

/* ── HERO ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 40px 100px;
  border-bottom: 1px solid var(--parch-dark);
}

.hero-short {
  min-height: 70vh;
  padding: 100px 40px 80px;
}

.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 55% at 50% 40%,
    rgba(184,88,80,0.04) 0%, transparent 70%);
  pointer-events: none;
}

.hero-flourish { margin-bottom: 24px; opacity: 0.5; }

.hero-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.6em;
  text-transform: uppercase;
  color: var(--sepia);
  margin-bottom: 18px;
}

.hero-title {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(2.4rem, 8vw, 5.5rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.0;
}

.hero-title em {
  display: block;
  font-size: 38%;
  font-style: italic;
  font-weight: 400;
  color: var(--sepia);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.hero-ornament {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 26px auto;
  color: var(--sepia-light);
}

.hero-ornament-line { width: 55px; height: 1px; background: var(--sepia-light); }

.hero-desc {
  font-family: 'Libre Baskerville', serif;
  font-size: 1rem;
  font-style: italic;
  color: var(--sepia);
  max-width: 400px;
  line-height: 1.9;
}

.scroll-cue {
  position: absolute;
  bottom: 30px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--sepia);
  font-size: 0.64rem;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  animation: bounce 2.5s ease-in-out infinite;
}

@keyframes bounce {
  0%,100% { transform: translateX(-50%) translateY(0);    opacity: 0.4; }
  50%      { transform: translateX(-50%) translateY(10px); opacity: 0.8; }
}

/* ── TIMELINE WRAPPER ── */
.tl-wrap {
  position: relative;
  margin-left: 80px;
  max-width: 780px;
  padding: 80px 40px 120px 32px;
}

.tl-thread {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 1px;
  background: var(--sepia-light);
  opacity: 0.45;
  pointer-events: none;
}

/* ── ENTRY ── */
.entry {
  position: relative;
  display: grid;
  grid-template-areas:
    "img  badge"
    "img  header"
    "img  desc";
  grid-template-columns: 140px 1fr;
  grid-template-rows: auto auto 1fr;
  column-gap: 26px;
  margin-bottom: 80px;
  opacity: 0;
  transform: translateX(-20px);
  transition:
    opacity  0.8s cubic-bezier(0.16,1,0.3,1),
    transform 0.8s cubic-bezier(0.16,1,0.3,1);
  text-decoration: none;
  color: inherit;
}

a.entry:hover .entry-title { color: var(--sepia); }

.entry.visible {
  opacity: 1;
  transform: translateX(0);
}

.entry-image     { grid-area: img;    align-self: start; }
.entry-badge-row { grid-area: badge;  padding-bottom: 10px; }
.entry-header    { grid-area: header; }
.entry-desc      { grid-area: desc;   }

.entry-image {
  width: 140px;
  height: 200px;
  overflow: hidden;
  border: 1px solid var(--sepia-light);
}

.img-ph {
  width: 100%; height: 100%;
}

.img-ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── TYPE BADGE ── */
.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  padding: 3px 9px 3px 8px;
  border-radius: 2px;
  white-space: nowrap;
}

.type-badge-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }

.type-canonical {
  color: var(--blue-slate);
  border: 1px solid rgba(78,106,140,0.3);
  background: rgba(78,106,140,0.07);
}
.type-canonical .type-badge-dot { background: var(--blue-slate); }

.type-tradition {
  color: var(--green-ok);
  border: 1px solid rgba(61,122,74,0.3);
  background: rgba(61,122,74,0.07);
}
.type-tradition .type-badge-dot { background: var(--green-ok); }

.type-caution {
  color: var(--amber);
  border: 1px solid rgba(184,134,11,0.3);
  background: rgba(184,134,11,0.07);
}
.type-caution .type-badge-dot { background: var(--amber); }

.type-study {
  color: var(--rose);
  border: 1px solid rgba(184,88,80,0.28);
  background: rgba(184,88,80,0.07);
}
.type-study .type-badge-dot { background: var(--rose); }

.type-rejected {
  color: #8B4049;
  border: 1px solid rgba(139,64,73,0.28);
  background: rgba(139,64,73,0.07);
}
.type-rejected .type-badge-dot { background: #8B4049; }

.type-warning {
  color: #996633;
  border: 1px solid rgba(153,102,51,0.28);
  background: rgba(153,102,51,0.07);
}
.type-warning .type-badge-dot { background: #996633; }

/* Bar fill colors for stats */
.type-bg-canonical { background: var(--blue-slate) !important; }
.type-bg-tradition { background: var(--green-ok) !important; }
.type-bg-caution { background: var(--amber) !important; }
.type-bg-study { background: var(--rose) !important; }
.type-bg-rejected { background: #8B4049 !important; }
.type-bg-warning { background: #996633 !important; }

/* ── HEADER (title + location) ── */
.entry-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 5px;
  transition: color 0.3s;
}

.entry-location {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--sepia-light);
}

/* ── DESCRIPTION ── */
.entry-rule {
  width: 32px; height: 1px;
  background: var(--rose);
  opacity: 0.6;
  margin: 14px 0;
}

.entry-text {
  font-size: 0.88rem;
  color: #4A3820;
  line-height: 1.82;
}

.entry + .entry::before {
  content: '';
  position: absolute;
  top: -40px; left: 0; right: 0;
  height: 1px;
  background: var(--parch-dark);
  opacity: 0.7;
}

/* ── LEGEND ── */
.legend {
  margin-left: 80px;
  padding: 0 40px 80px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--sepia-light);
}

.legend-item { display: flex; align-items: center; gap: 7px; }
.legend-dot  { width: 8px; height: 8px; border-radius: 50%; }

/* ── FOOTER ── */
footer {
  text-align: center;
  padding: 56px 24px;
  color: var(--sepia-light);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  border-top: 1px solid var(--parch-dark);
}

/* ── DETAIL PAGE ── */
.detail-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 60px 40px 120px;
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--sepia);
  text-decoration: none;
  margin-bottom: 40px;
}

.detail-back:hover { color: var(--ink); }

.detail-hero {
  display: flex;
  gap: 32px;
  margin-bottom: 48px;
}

.detail-image {
  width: 200px;
  height: 280px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--sepia-light);
  border-radius: 4px;
}

.detail-meta h1 {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 8px;
}

.detail-location {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--sepia-light);
  margin-bottom: 12px;
}

.detail-dates {
  font-size: 0.85rem;
  color: var(--sepia);
  margin-bottom: 16px;
}

.detail-section {
  margin-bottom: 48px;
}

.detail-section h2 {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.detail-section-rule {
  width: 32px;
  height: 1px;
  background: var(--rose);
  opacity: 0.6;
  margin-bottom: 18px;
}

.detail-section p,
.detail-section li {
  font-size: 0.9rem;
  color: #4A3820;
  line-height: 1.85;
}

.detail-section ul {
  list-style: none;
  padding: 0;
}

.detail-section ul li {
  padding-left: 18px;
  position: relative;
  margin-bottom: 8px;
}

.detail-section ul li::before {
  content: '\2726';
  position: absolute;
  left: 0;
  color: var(--sepia-light);
  font-size: 0.6rem;
  top: 4px;
}

/* Mensajes */
.mensaje-card {
  background: rgba(139,100,40,0.04);
  border-left: 2px solid var(--sepia-light);
  padding: 16px 20px;
  margin-bottom: 16px;
  border-radius: 0 4px 4px 0;
}

.mensaje-fecha {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--sepia-light);
  margin-bottom: 6px;
}

.mensaje-texto {
  font-family: 'Libre Baskerville', serif;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.85;
}

/* Cronologia */
.crono-item {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
}

.crono-fecha {
  flex-shrink: 0;
  width: 90px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--sepia);
  text-align: right;
}

.crono-evento {
  font-size: 0.88rem;
  color: #4A3820;
  line-height: 1.7;
}

/* Fuentes */
.fuente-item {
  margin-bottom: 12px;
}

.fuente-tipo {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--sepia-light);
}

.fuente-titulo {
  font-size: 0.88rem;
  color: var(--ink);
}

.fuente-titulo a {
  color: var(--blue-slate);
  text-decoration: none;
}

.fuente-titulo a:hover { text-decoration: underline; }

/* Navigation between apparitions */
.detail-nav {
  display: flex;
  justify-content: space-between;
  padding-top: 40px;
  border-top: 1px solid var(--parch-dark);
}

.detail-nav a {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--sepia);
  text-decoration: none;
}

.detail-nav a:hover { color: var(--ink); }

/* ── TABLE PAGE ─────────────────────────────────────── */
.table-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.table-search {
  flex: 1;
  min-width: 200px;
  padding: 10px 16px;
  font-family: 'Lato', sans-serif;
  font-size: 0.88rem;
  border: 1px solid var(--parch-dark);
  border-radius: 4px;
  background: rgba(255,255,255,0.4);
  color: var(--ink);
  outline: none;
}

.table-search:focus { border-color: var(--sepia); }

.table-filter {
  padding: 10px 14px;
  font-family: 'Lato', sans-serif;
  font-size: 0.82rem;
  border: 1px solid var(--parch-dark);
  border-radius: 4px;
  background: rgba(255,255,255,0.4);
  color: var(--ink);
  cursor: pointer;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table thead th {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sepia);
  text-align: left;
  padding: 14px 12px;
  border-bottom: 2px solid var(--parch-dark);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.data-table thead th:hover { color: var(--ink); }

.sort-arrow { font-size: 0.6rem; margin-left: 4px; }
.sort-asc .sort-arrow::after { content: ' \25B2'; }
.sort-desc .sort-arrow::after { content: ' \25BC'; }

.data-table tbody td {
  padding: 12px;
  border-bottom: 1px solid rgba(232,216,184,0.6);
  color: #4A3820;
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: rgba(139,100,40,0.04);
}

.data-table tbody td a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.data-table tbody td a:hover { color: var(--blue-slate); }

.data-table tbody td .type-badge {
  font-size: 0.5rem;
  letter-spacing: 0.2em;
}

.table-count {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--sepia-light);
  text-align: right;
}

/* ── NIVELES PAGE ───────────────────────────────────── */
.niveles-content {
  max-width: 800px;
}

.niveles-intro {
  font-size: 0.92rem;
  color: #4A3820;
  line-height: 1.85;
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--parch-dark);
}

.niveles-group-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
}

.niveles-group-desc {
  font-size: 0.88rem;
  color: var(--sepia);
  line-height: 1.8;
  margin-bottom: 32px;
}

.nivel-card {
  background: rgba(255,255,255,0.3);
  border: 1px solid var(--parch-dark);
  border-radius: 6px;
  padding: 24px 28px;
  margin-bottom: 20px;
}

.nivel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.nivel-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sepia-light);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.nivel-desc {
  font-size: 0.9rem;
  color: #4A3820;
  line-height: 1.8;
  margin-bottom: 16px;
}

.nivel-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.nivel-aparicion {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--ink);
  text-decoration: none;
  padding: 4px 12px;
  background: rgba(139,100,40,0.06);
  border: 1px solid var(--parch-dark);
  border-radius: 3px;
  transition: background 0.2s, color 0.2s;
}

.nivel-aparicion:hover {
  background: rgba(78,106,140,0.1);
  color: var(--blue-slate);
}

.nivel-meta {
  font-size: 0.68rem;
  color: var(--sepia-light);
}

/* ── STATISTICS PAGE ────────────────────────────────── */
.stats-content {
  max-width: 800px;
}

.stats-counters {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

.stat-counter {
  text-align: center;
  padding: 24px 28px;
  background: rgba(255,255,255,0.3);
  border: 1px solid var(--parch-dark);
  border-radius: 6px;
  min-width: 130px;
  flex: 1;
}

.stat-number {
  display: block;
  font-family: 'Libre Baskerville', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.stat-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--sepia-light);
  margin-top: 6px;
}

.stats-section {
  margin-bottom: 48px;
}

.stats-section h2 {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--parch-dark);
}

.stats-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-bar-label {
  flex-shrink: 0;
  width: 200px;
  text-align: right;
}

.stat-bar-label-text {
  font-size: 0.82rem;
  color: #4A3820;
  font-weight: 600;
}

.stat-bar-track {
  flex: 1;
  height: 22px;
  background: rgba(139,100,40,0.06);
  border-radius: 3px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 3px;
  min-width: 4px;
  transition: width 0.6s ease;
}

.stat-bar-value {
  flex-shrink: 0;
  width: 32px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--sepia);
  text-align: right;
}

/* ── SCROLL REVEAL ─────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── MOBILE ─────────────────────────────────────────── */
@media (max-width: 680px) {

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: rgba(244,233,210,0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 16px 24px;
    border-bottom: 1px solid var(--parch-dark);
    box-shadow: 0 8px 24px rgba(80,50,10,0.1);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 10px 0;
    font-size: 0.78rem;
  }

  #tracker {
    width: 44px; height: 44px;
    z-index: 100;
    transition: border-color 0.5s;
  }

  .hero { padding: 80px 24px 60px; }
  .hero-short { min-height: 50vh; padding: 80px 24px 60px; }

  .tl-wrap  { margin-left: 24px; padding: 60px 20px 80px 24px; }
  .legend   { margin-left: 24px; padding-left: 24px; }

  .entry {
    grid-template-areas:
      "header  header"
      "img     desc"
      "badge   badge";
    grid-template-columns: 88px 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 14px;
  }

  .entry-header {
    position: relative;
    padding-bottom: 12px;
  }

  .entry-header::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 12px;
    height: 1px;
    background: var(--rose);
    opacity: 0.6;
  }

  .entry-image {
    width: 88px;
    height: auto;
    align-self: stretch;
    min-height: 0;
    overflow: hidden;
  }

  .entry-rule { display: none; }
  .entry-badge-row { padding: 8px 0 0; }

  .type-badge {
    width: 100%;
    justify-content: center;
  }

  /* Cards */
  .cards-grid { grid-template-columns: 1fr; gap: 20px; }
  .explore-grid { grid-template-columns: 1fr 1fr; gap: 14px; }

  /* Detail page mobile */
  .detail-wrap { padding: 40px 20px 80px; }

  .detail-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .detail-image { width: 160px; height: 220px; }

  /* Table */
  .table-controls { flex-direction: column; }
  .stat-bar-label { width: 120px; font-size: 0.72rem; }
  .stat-bar-label .type-badge { font-size: 0.45rem !important; letter-spacing: 0.15em; }

  /* Stats */
  .stats-counters { gap: 8px; }
  .stat-counter { min-width: 90px; padding: 18px 14px; }
  .stat-number { font-size: 1.5rem; }

  /* Map filters */
  .map-filters { top: 10px; right: 10px; padding: 10px 14px; font-size: 0.72rem; }
}

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