/* ============================================================
   HISTORY SLAVE TRACKER — DESIGN SYSTEM
   Premium dark scholarly dashboard
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;600;700;900&display=swap');

/* ── CSS Custom Properties ────────────────────────────────── */
:root {
  /* Background & Surface */
  --bg-base: #0a0e17;
  --bg-surface: rgba(255, 255, 255, 0.03);
  --bg-surface-hover: rgba(255, 255, 255, 0.06);
  --bg-elevated: #111827;
  --bg-input: rgba(255, 255, 255, 0.05);
  --bg-table-head: #0d1117;

  /* Accent — Gold / Amber */
  --gold: #c9a84c;
  --gold-bright: #d4a847;
  --gold-dim: rgba(201, 168, 76, 0.15);
  --gold-glow: rgba(201, 168, 76, 0.35);
  --gold-bg: rgba(201, 168, 76, 0.08);
  --gold-bg-strong: rgba(201, 168, 76, 0.20);
  --gold-border: rgba(201, 168, 76, 0.15);
  --gold-border-hover: rgba(201, 168, 76, 0.45);

  /* Category Colors */
  --cat-transatlantic: #e74c3c;
  --cat-arab: #e67e22;
  --cat-african: #f39c12;
  --cat-asian: #9b59b6;
  --cat-european: #3498db;
  --cat-indigenous: #1abc9c;

  /* Text */
  --text-primary: #e8e6e1;
  --text-muted: #8a8578;
  --text-faint: rgba(255, 255, 255, 0.35);

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.1);

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Playfair Display', 'Georgia', serif;

  /* Sizing */
  --container-max: 100%;
  --container-pad: 20px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 100px;

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --transition-fast: 0.2s var(--ease-out);
  --transition-med: 0.3s var(--ease-out);
}

/* ============================================================
   1. CSS RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

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

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

::selection {
  background: var(--gold);
  color: var(--bg-base);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--gold-dim);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}
/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
}

/* ============================================================
   2. ANIMATED BACKGROUND
   ============================================================ */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  will-change: transform;
}

.orb-1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.6), transparent 70%);
  top: -10%;
  left: -5%;
  animation: float1 24s ease-in-out infinite;
}

.orb-2 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(212, 168, 71, 0.5), transparent 70%);
  bottom: 10%;
  right: -8%;
  animation: float2 28s ease-in-out infinite;
}

.orb-3 {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.35), transparent 70%);
  top: 50%;
  left: 40%;
  animation: float3 22s ease-in-out infinite;
}

/* ============================================================
   3. FACT TICKER MARQUEE
   ============================================================ */
.fact-marquee {
  width: 100%;
  background: var(--gold-bg);
  border-bottom: 1px solid var(--gold-border);
  overflow: hidden;
  padding: 8px 0;
  position: relative;
  z-index: 10;
}

.fact-marquee-items {
  display: inline-flex;
  white-space: nowrap;
  animation: marquee-scroll 240s linear infinite;
}

.fact-marquee:hover .fact-marquee-items {
  animation-play-state: paused;
}

.fact-item {
  padding: 0 32px;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative;
}

.fact-item::after {
  content: '•';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-dim);
  font-size: 0.6rem;
}

.fact-item:last-child::after {
  content: none;
}

/* ============================================================
   4. HEADER
   ============================================================ */
.top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  max-height: 40px;
  width: auto;
  object-fit: contain;
}

.site-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--gold);
  letter-spacing: 0.02em;
  line-height: 1.25;
  max-width: 280px;
}

.site-subtitle {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-nav a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  position: relative;
}

.header-nav a:hover {
  color: var(--gold);
}

.header-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--gold);
  transition: width var(--transition-med);
}

.header-nav a:hover::after {
  width: 100%;
}

.dark-mode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.dark-mode-toggle:hover {
  border-color: var(--gold-border-hover);
  color: var(--gold);
  box-shadow: 0 0 16px rgba(201, 168, 76, 0.15);
}

/* ============================================================
   5. FEATURED HISTORY CARDS
   ============================================================ */
.featured-cards-wrap {
  position: relative;
  margin-top: 28px;
}

.featured-cards {
  width: 100%;
  overflow: hidden;
}

.featured-cards-track {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 8px 4px 16px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.featured-cards-track::-webkit-scrollbar {
  display: none;
}

.featured-card {
  flex: 0 0 300px;
  min-width: 300px;
  max-width: 300px;
  text-align: left;
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: var(--radius-lg);
  padding: 22px;
  scroll-snap-align: start;
  transition: all var(--transition-med);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

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

.featured-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow:
    0 8px 32px rgba(201, 168, 76, 0.12),
    0 0 0 1px rgba(201, 168, 76, 0.25);
}

.featured-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.featured-card:active {
  transform: translateY(-2px);
}

.featured-card-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  display: block;
}

.featured-card-year {
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.featured-card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.featured-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.featured-card-category {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Category color variants for pill badges */
.featured-card-category[data-cat="transatlantic"],
.pill[data-cat="transatlantic"],
.cat-transatlantic {
  background: rgba(231, 76, 60, 0.15);
  color: var(--cat-transatlantic);
  border: 1px solid rgba(231, 76, 60, 0.25);
}
.featured-card-category[data-cat="arab"],
.pill[data-cat="arab"],
.cat-arab {
  background: rgba(230, 126, 34, 0.15);
  color: var(--cat-arab);
  border: 1px solid rgba(230, 126, 34, 0.25);
}
.featured-card-category[data-cat="african"],
.pill[data-cat="african"],
.cat-african {
  background: rgba(243, 156, 18, 0.15);
  color: var(--cat-african);
  border: 1px solid rgba(243, 156, 18, 0.25);
}
.featured-card-category[data-cat="asian"],
.pill[data-cat="asian"],
.cat-asian {
  background: rgba(155, 89, 182, 0.15);
  color: var(--cat-asian);
  border: 1px solid rgba(155, 89, 182, 0.25);
}
.featured-card-category[data-cat="european"],
.pill[data-cat="european"],
.cat-european {
  background: rgba(52, 152, 219, 0.15);
  color: var(--cat-european);
  border: 1px solid rgba(52, 152, 219, 0.25);
}
.featured-card-category[data-cat="indigenous"],
.pill[data-cat="indigenous"],
.cat-indigenous {
  background: rgba(26, 188, 156, 0.15);
  color: var(--cat-indigenous);
  border: 1px solid rgba(26, 188, 156, 0.25);
}

/* Scroll buttons */
.featured-scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.featured-scroll-btn:hover {
  background: var(--gold);
  color: var(--bg-base);
  box-shadow: 0 0 20px rgba(201, 168, 76, 0.3);
}

.featured-scroll-left {
  left: 0;
}

.featured-scroll-right {
  right: 0;
}

/* ============================================================
   6. GLOBE + STATS ROW
   ============================================================ */
.globe-stats-row {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  margin-top: 32px;
  align-items: start;
}

/* 6a. Globe Section */
.globe-hero {
  position: relative;
}

.globe-canvas-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid rgba(201, 168, 76, 0.1);
}

#globeCanvas, #globeViz {
  width: 100%;
  height: 100%;
  display: block;
}

.globe-legend {
  position: absolute;
  bottom: 14px;
  left: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(10, 14, 23, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.globe-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.globe-hover-card {
  position: absolute;
  z-index: 10;
  max-width: 280px;
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--gold-border);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.globe-hover-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.globe-hover-card-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.globe-hover-card-detail {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Flat map-style globe pins */
.globe-pin {
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  pointer-events: auto;
}

.globe-pin-single {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pin-color);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 8px var(--pin-color), 0 2px 6px rgba(0, 0, 0, 0.5);
}

.globe-pin-cluster {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(10, 14, 23, 0.92);
  border: 2.5px solid var(--pin-color);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px var(--pin-color), 0 3px 10px rgba(0, 0, 0, 0.55);
}

.globe-pin:hover,
.globe-pin-cluster:hover {
  transform: translate(-50%, -50%) scale(1.15);
  z-index: 10;
}

.globe-pin-highlight {
  box-shadow: 0 0 16px #fff, 0 0 24px var(--pin-color);
}

.globe-cluster-panel {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 20;
  width: min(300px, calc(100% - 28px));
  max-height: 340px;
  overflow-y: auto;
  background: rgba(10, 14, 23, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.globe-cluster-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  background: rgba(10, 14, 23, 0.98);
}

.globe-cluster-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--gold);
  margin: 0;
}

.globe-cluster-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-default);
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.globe-cluster-close:hover {
  color: var(--gold);
  border-color: var(--gold-border-hover);
}

.globe-cluster-list {
  list-style: none;
  margin: 0;
  padding: 8px;
}

.globe-cluster-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.globe-cluster-item:hover {
  background: var(--gold-bg);
}

.globe-cluster-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.globe-cluster-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.globe-cluster-item-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.35;
}

.globe-cluster-item-years {
  font-size: 0.7rem;
  color: var(--gold);
  margin-top: 2px;
}

.globe-rotate-toggle {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(10, 14, 23, 0.7);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-default);
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.globe-rotate-toggle:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.globe-rotate-toggle.active {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-bg);
}

/* 6b. Statistics Sidebar */
.stats-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-card {
  background: var(--bg-surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold);
  transition: all var(--transition-med);
  position: relative;
  overflow: hidden;
}

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

.stat-card:hover {
  border-color: var(--gold-border-hover);
  box-shadow: 0 4px 24px rgba(201, 168, 76, 0.08);
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

.stat-detail {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* ============================================================
   7. FILTER TOOLBAR
   ============================================================ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  margin-top: 28px;
  flex-wrap: wrap;
}

.cat-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  padding: 4px 0;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.cat-scroll::-webkit-scrollbar {
  display: none;
}

.cat-btn {
  flex: 0 0 auto;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.cat-btn:hover {
  border-color: var(--gold-border-hover);
  color: var(--gold);
}

.cat-btn.active {
  background: var(--gold-bg-strong);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 16px rgba(201, 168, 76, 0.12);
}

.search-wrap {
  display: flex;
  align-items: center;
  position: relative;
  flex-shrink: 0;
}

#searchInput {
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 10px 16px 10px 40px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  width: 240px;
  outline: none;
  transition: all var(--transition-fast);
}

#searchInput::placeholder {
  color: var(--text-faint);
}

#searchInput:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}

/* ============================================================
   8. DATA TABLE
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  margin-top: 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-table-head);
  padding: 14px 16px;
  text-align: left;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--gold-dim);
  white-space: nowrap;
}

.data-table thead th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast);
}

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

.sort-icon {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.65rem;
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}

.data-table thead th.sortable:hover .sort-icon {
  opacity: 1;
}

.data-table thead th.sorted .sort-icon {
  opacity: 1;
  color: var(--gold);
}

.data-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.data-table tbody tr:hover {
  background: rgba(201, 168, 76, 0.06);
}

.data-table tbody tr:last-child {
  border-bottom: none;
}

.data-table td {
  padding: 14px 16px;
  vertical-align: middle;
  font-size: 0.88rem;
}

/* Column-specific styles */
.col-rank {
  width: 50px;
  text-align: center;
  font-weight: 600;
  color: var(--gold);
  font-size: 0.85rem;
}

.col-country {
  font-weight: 500;
}

.col-country-flag {
  margin-right: 8px;
  font-size: 1.1rem;
  vertical-align: middle;
}

.col-groups {
  line-height: 1.5;
}

.col-groups .enslaver {
  font-weight: 500;
  color: var(--text-primary);
}

.col-groups .enslaved {
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.8;
}

.col-years {
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', 'Fira Code', monospace, var(--font-body);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.col-type {
  /* Pill badge */
}

.col-type .pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.col-category .pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.col-estimated {
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.col-duration {
  color: var(--text-muted);
  text-align: right;
  font-size: 0.82rem;
}

.col-view {
  text-align: center;
}

.col-view a,
.col-view button {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold-border);
  background: transparent;
  transition: all var(--transition-fast);
}

.col-view a:hover,
.col-view button:hover {
  background: var(--gold-bg);
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(201, 168, 76, 0.15);
}

/* ============================================================
   9. DETAIL MODAL
   ============================================================ */
.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.detail-modal.active {
  display: flex;
}

.detail-modal.globe-focus {
  justify-content: flex-end;
  align-items: center;
  padding: 20px 24px 20px 0;
}

.detail-modal.globe-focus .detail-modal-backdrop {
  background: linear-gradient(
    105deg,
    rgba(0, 0, 0, 0.15) 0%,
    rgba(0, 0, 0, 0.15) 42%,
    rgba(0, 0, 0, 0.55) 52%,
    rgba(0, 0, 0, 0.88) 100%
  );
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.detail-modal.globe-focus .detail-modal-content {
  width: min(480px, 44vw);
  max-width: 480px;
  margin-right: 0;
  animation: modalSlideFromRight 0.45s var(--ease-out);
  box-shadow: -12px 0 60px rgba(0, 0, 0, 0.5);
}

.detail-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.4s ease;
}

.detail-modal-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
  width: 90%;
  background: var(--bg-elevated);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: var(--radius-xl);
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  animation: modalSlideIn 0.3s var(--ease-out);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  transition: width 0.4s var(--ease-out), max-width 0.4s var(--ease-out);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.modal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-bg);
}

.modal-category-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.modal-category-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.modal-info-item {
  background: var(--bg-surface);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.modal-info-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.modal-info-value {
  font-weight: 500;
  margin-top: 4px;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.modal-info-item.modal-info-full {
  grid-column: 1 / -1;
}

.modal-info-big {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--gold);
}

.modal-notable {
  margin-top: 24px;
  padding: 20px;
  border-left: 3px solid var(--gold);
  background: rgba(201, 168, 76, 0.05);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.modal-notable-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 10px;
}

.modal-notable-body p {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.modal-notable-body p:last-child {
  margin-bottom: 0;
}

.modal-sources {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}

.modal-sources-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.modal-sources-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-source-link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.modal-source-link:hover {
  border-color: var(--gold-border-hover);
  background: var(--gold-bg);
  transform: translateX(2px);
}

.modal-source-icon {
  color: var(--gold);
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.modal-source-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.modal-source-host {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
}

.modal-source-path {
  font-size: 0.75rem;
  color: var(--text-muted);
  word-break: break-all;
  line-height: 1.4;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.modal-action-btn {
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--gold-bg-strong);
  border: 1px solid var(--gold-border-hover);
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.modal-action-btn:hover {
  background: var(--gold);
  color: var(--bg-base);
  box-shadow: 0 4px 16px var(--gold-glow);
}

.modal-action-btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border-default);
  color: var(--text-primary);
}

.modal-action-btn-secondary:hover {
  background: var(--bg-surface-hover);
  color: var(--gold);
  box-shadow: none;
}



/* ============================================================
   10. TIMELINE SIDEBAR
   ============================================================ */
.timeline-section {
  margin-top: 40px;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.timeline-header h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold);
}

.timeline-header .timeline-toggle {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.timeline-header .timeline-toggle:hover {
  color: var(--gold);
}

.timeline-container {
  position: relative;
  padding-left: 30px;
}

.timeline-line {
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gold-dim);
}

.timeline-item {
  position: relative;
  padding: 12px 0 12px 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
  border-radius: var(--radius-sm);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 18px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--bg-base);
  transition: all var(--transition-fast);
  z-index: 1;
}

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

.timeline-item:hover::before {
  box-shadow: 0 0 10px rgba(201, 168, 76, 0.5);
  transform: scale(1.2);
}

.timeline-item.active::before {
  box-shadow: 0 0 12px rgba(201, 168, 76, 0.6);
  background: var(--gold-bright);
  transform: scale(1.3);
}

.timeline-year {
  font-weight: 700;
  color: var(--gold);
  font-size: 1rem;
  line-height: 1.3;
}

.timeline-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

.timeline-flag {
  margin-right: 4px;
  font-size: 0.95rem;
}

/* ============================================================
   11. FOOTER
   ============================================================ */
.site-footer {
  margin-top: 60px;
  padding: 40px 0 32px;
  border-top: 1px solid rgba(201, 168, 76, 0.1);
  text-align: center;
}

.site-footer p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-disclaimer {
  max-width: 600px;
  margin: 0 auto;
  font-size: 0.72rem;
  color: var(--text-faint);
  line-height: 1.6;
  margin-top: 12px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 14px;
}

.footer-links a {
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

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

/* ============================================================
   12. UTILITY CLASSES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

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

.gold-text {
  color: var(--gold);
}

.fade-in {
  animation: fadeInUp 0.5s var(--ease-out) both;
}

.pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.pill-gold {
  background: var(--gold-bg);
  color: var(--gold);
  border-color: var(--gold-border);
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.gap-sm {
  gap: 8px;
}

.gap-md {
  gap: 16px;
}

.gap-lg {
  gap: 24px;
}

/* Loading skeleton / shimmer */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-surface) 25%,
    rgba(255, 255, 255, 0.06) 50%,
    var(--bg-surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* 11. DISCREPANCIES FEATURE */
.modal-discrepancies {
  margin-top: 24px;
  padding: 20px;
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.4);
  border-radius: var(--radius-md);
}

.modal-discrepancies-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.modal-discrepancies-header .warning-icon {
  font-size: 1.2rem;
}

.modal-discrepancies-header span:last-child {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: #ff6b6b;
  letter-spacing: 0.02em;
}

.modal-discrepancies-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-discrepancies-list li {
  position: relative;
  padding-left: 20px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #e8e6e1;
}

.modal-discrepancies-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e74c3c;
}

/* 12. DEMOGRAPHICS CHART */
.demographics-chart-section {
  margin: 40px 0;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(201, 168, 76, 0.1);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.demo-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.demo-bar-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.demo-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-main);
}

.demo-bar-name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.demo-bar-sublabel {
  font-weight: 400;
  opacity: 0.65;
  font-size: 0.8rem;
  margin-left: 4px;
}

.demo-skin-swatch {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 -3px 6px rgba(0, 0, 0, 0.25),
    0 1px 3px rgba(0, 0, 0, 0.3);
}

.demo-bar-val {
  color: var(--gold);
  white-space: nowrap;
}

.demo-bar-track {
  width: 100%;
  height: 14px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.demo-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 1s ease-out;
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}

/* Live indicator dot */
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse 2s ease-in-out infinite;
  display: inline-block;
  margin-right: 6px;
}

/* ============================================================
   13. ANIMATIONS & KEYFRAMES
   ============================================================ */

/* Floating orbs */
@keyframes float1 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(60px, 40px) scale(1.05);
  }
  50% {
    transform: translate(30px, -30px) scale(0.95);
  }
  75% {
    transform: translate(-40px, 20px) scale(1.02);
  }
}

@keyframes float2 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(-50px, -40px) scale(0.97);
  }
  50% {
    transform: translate(40px, 30px) scale(1.04);
  }
  75% {
    transform: translate(20px, -50px) scale(0.98);
  }
}

@keyframes float3 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(-30px, 50px) scale(1.06);
  }
  66% {
    transform: translate(50px, -20px) scale(0.94);
  }
}

/* Marquee scroll */
@keyframes marquee-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Modal entrance */
@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modalSlideFromRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade in up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Pulse for live indicator */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.85);
  }
}

/* Shimmer for loading states */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Subtle glow keyframe for special highlights */
@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(201, 168, 76, 0.1);
  }
  50% {
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.25);
  }
}

/* ============================================================
   14. RESPONSIVE BREAKPOINTS
   ============================================================ */

/* ── Large tablets / small desktops ─────────────────────── */
@media (max-width: 1200px) {
  .globe-stats-row {
    grid-template-columns: 1fr;
  }

  .stats-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .stat-card {
    flex: 1 1 calc(50% - 8px);
    min-width: 200px;
  }
}

/* ── Tablets ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  .container {
    padding: 0 16px;
  }

  .top-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
  }

  .site-title {
    font-size: 1.25rem;
  }

  .featured-card {
    flex: 0 0 260px;
    min-width: 260px;
    max-width: 260px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  #searchInput {
    width: 100%;
  }

  .search-wrap {
    width: 100%;
  }

  /* Table adjustments */
  .table-wrap {
    margin-left: -16px;
    margin-right: -16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .data-table td,
  .data-table thead th {
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  .col-duration {
    display: none;
  }

  .col-view {
    display: none;
  }

  .modal-info-grid {
    grid-template-columns: 1fr;
  }

  .detail-modal-content {
    padding: 24px 20px;
    border-radius: var(--radius-lg);
    width: 95%;
  }

  .detail-modal.globe-focus {
    justify-content: center;
    padding: 16px;
  }

  .detail-modal.globe-focus .detail-modal-content {
    width: 95%;
    max-width: none;
  }

  .detail-modal.globe-focus .detail-modal-backdrop {
    background: rgba(0, 0, 0, 0.88);
  }

  .modal-title {
    font-size: 1.25rem;
  }

  .stat-card {
    flex: 1 1 100%;
  }

  .globe-canvas-wrap {
    aspect-ratio: 4 / 3;
  }

  .globe-legend {
    position: relative;
    bottom: auto;
    left: auto;
    margin-top: 8px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    justify-content: center;
  }

  .timeline-container {
    padding-left: 24px;
  }

  .timeline-item::before {
    left: -20px;
  }
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .container {
    padding: 0 12px;
  }

  .site-title {
    font-size: 1.1rem;
  }

  .site-subtitle {
    font-size: 0.65rem;
  }

  .featured-card {
    flex: 0 0 240px;
    min-width: 240px;
    max-width: 240px;
    padding: 16px;
  }

  .featured-card-title {
    font-size: 1rem;
  }

  .stat-number {
    font-size: 1.6rem;
  }

  .data-table td,
  .data-table thead th {
    padding: 8px 10px;
    font-size: 0.75rem;
  }

  .col-groups .enslaved {
    display: none;
  }

  .col-years {
    font-size: 0.72rem;
  }

  .header-nav {
    gap: 12px;
  }

  .header-nav a {
    font-size: 0.75rem;
  }

  .fact-item {
    padding: 0 20px;
    font-size: 0.72rem;
  }

  .toolbar {
    gap: 10px;
  }

  .cat-btn {
    padding: 6px 14px;
    font-size: 0.75rem;
  }

  .detail-modal-content {
    padding: 20px 16px;
    max-height: 95vh;
  }

  .orb-1 { width: 250px; height: 250px; }
  .orb-2 { width: 200px; height: 200px; }
  .orb-3 { width: 160px; height: 160px; }
}

/* ============================================================
   15. LIGHT MODE — [data-theme='light']
   ============================================================ */
[data-theme='light'] {
  --bg-base: #f5f3ee;
  --bg-surface: rgba(0, 0, 0, 0.03);
  --bg-surface-hover: rgba(0, 0, 0, 0.06);
  --bg-elevated: #ffffff;
  --bg-input: rgba(0, 0, 0, 0.04);
  --bg-table-head: #eae8e2;

  --gold: #9a7b2e;
  --gold-bright: #b08c33;
  --gold-dim: rgba(154, 123, 46, 0.15);
  --gold-glow: rgba(154, 123, 46, 0.25);
  --gold-bg: rgba(154, 123, 46, 0.08);
  --gold-bg-strong: rgba(154, 123, 46, 0.15);
  --gold-border: rgba(154, 123, 46, 0.2);
  --gold-border-hover: rgba(154, 123, 46, 0.45);

  --text-primary: #1a1a17;
  --text-muted: #6b665c;
  --text-faint: rgba(0, 0, 0, 0.35);

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-default: rgba(0, 0, 0, 0.12);
}

[data-theme='light'] body {
  background-color: var(--bg-base);
  color: var(--text-primary);
}

[data-theme='light'] .orb {
  opacity: 0.06;
}

[data-theme='light'] .fact-marquee {
  background: rgba(154, 123, 46, 0.06);
  border-bottom-color: rgba(154, 123, 46, 0.12);
}

[data-theme='light'] .featured-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border-color: rgba(154, 123, 46, 0.15);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

[data-theme='light'] .featured-card:hover {
  box-shadow:
    0 8px 28px rgba(154, 123, 46, 0.1),
    0 0 0 1px rgba(154, 123, 46, 0.2);
}

[data-theme='light'] .stat-card {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme='light'] .globe-canvas-wrap {
  background: rgba(245, 243, 238, 0.9);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme='light'] .globe-legend {
  background: rgba(255, 255, 255, 0.85);
}

[data-theme='light'] .globe-hover-card {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(154, 123, 46, 0.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

[data-theme='light'] .globe-rotate-toggle {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme='light'] .data-table thead th {
  background: var(--bg-table-head);
  border-bottom-color: rgba(154, 123, 46, 0.15);
}

[data-theme='light'] .data-table tbody tr {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-theme='light'] .data-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.015);
}

[data-theme='light'] .data-table tbody tr:hover {
  background: rgba(154, 123, 46, 0.06);
}

[data-theme='light'] .table-wrap {
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme='light'] .detail-modal-backdrop {
  background: rgba(0, 0, 0, 0.45);
}

[data-theme='light'] .detail-modal-content {
  background: #ffffff;
  border-color: rgba(154, 123, 46, 0.15);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.15);
}

[data-theme='light'] .modal-close {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme='light'] .modal-info-item {
  background: rgba(0, 0, 0, 0.025);
  border-color: rgba(0, 0, 0, 0.06);
}

[data-theme='light'] .modal-notable {
  background: rgba(154, 123, 46, 0.05);
}

[data-theme='light'] #searchInput {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text-primary);
}

[data-theme='light'] #searchInput:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(154, 123, 46, 0.1);
}

[data-theme='light'] .cat-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme='light'] .cat-btn.active {
  background: var(--gold-bg-strong);
  border-color: var(--gold);
}

[data-theme='light'] .dark-mode-toggle {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme='light'] .site-footer {
  border-top-color: rgba(0, 0, 0, 0.08);
}

[data-theme='light'] .timeline-line {
  background: rgba(154, 123, 46, 0.15);
}

[data-theme='light'] .timeline-item::before {
  border-color: var(--bg-base);
}

[data-theme='light'] .timeline-item:hover {
  background: rgba(154, 123, 46, 0.04);
}

[data-theme='light'] .featured-scroll-btn {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

[data-theme='light'] .col-view a,
[data-theme='light'] .col-view button {
  border-color: rgba(154, 123, 46, 0.25);
}

[data-theme='light'] .col-view a:hover,
[data-theme='light'] .col-view button:hover {
  background: rgba(154, 123, 46, 0.08);
  border-color: var(--gold);
}

/* ── Light mode category pills keep vibrant colors ──────── */
[data-theme='light'] .cat-transatlantic {
  background: rgba(231, 76, 60, 0.1);
  border-color: rgba(231, 76, 60, 0.2);
}
[data-theme='light'] .cat-arab {
  background: rgba(230, 126, 34, 0.1);
  border-color: rgba(230, 126, 34, 0.2);
}
[data-theme='light'] .cat-african {
  background: rgba(243, 156, 18, 0.1);
  border-color: rgba(243, 156, 18, 0.2);
}
[data-theme='light'] .cat-asian {
  background: rgba(155, 89, 182, 0.1);
  border-color: rgba(155, 89, 182, 0.2);
}
[data-theme='light'] .cat-european {
  background: rgba(52, 152, 219, 0.1);
  border-color: rgba(52, 152, 219, 0.2);
}
[data-theme='light'] .cat-indigenous {
  background: rgba(26, 188, 156, 0.1);
  border-color: rgba(26, 188, 156, 0.2);
}

/* ============================================================
   END — HISTORY SLAVE TRACKER DESIGN SYSTEM
   ============================================================ */

/* ============================================================
   MODERN TRAFFICKING EXTENSION STYLES
   ============================================================ */

/* Mode Switcher */
.mode-switcher {
  display: flex;
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 24px;
  padding: 4px;
  margin-right: 24px;
  backdrop-filter: blur(8px);
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mode-btn:hover {
  color: var(--gold);
}

.mode-btn.active {
  background: rgba(201, 168, 76, 0.15);
  color: var(--gold);
  box-shadow: 0 0 10px rgba(201, 168, 76, 0.2);
}

/* Region Filter Select */
.select-wrap {
  position: relative;
  margin-right: 16px;
}

.region-select {
  appearance: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 10px 36px 10px 16px;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.region-select:hover,
.region-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.2);
}

.region-select option {
  background: var(--bg-dark);
  color: var(--text-main);
}

.select-wrap::after {
  content: '▼';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.6rem;
  color: var(--text-muted);
  pointer-events: none;
}

/* Trafficking Mode Theme Adjustments */
body.mode-trafficking {
  --bg-base: #07090e;
  --gold: #ff4757;
  --gold-bright: #ff6b81;
  --gold-dim: rgba(255, 71, 87, 0.15);
  --gold-glow: rgba(255, 71, 87, 0.35);
  --gold-bg: rgba(255, 71, 87, 0.08);
  --gold-bg-strong: rgba(255, 71, 87, 0.20);
  --gold-border: rgba(255, 71, 87, 0.15);
  --gold-border-hover: rgba(255, 71, 87, 0.45);
  background-color: var(--bg-base);
}

body.mode-trafficking .brand-icon {
  filter: hue-rotate(320deg) saturate(200%); /* Make it reddish */
}

body.mode-trafficking .orb {
  background: radial-gradient(circle, rgba(255,71,87,0.15) 0%, rgba(10,14,23,0) 70%);
}

body.mode-trafficking .mode-btn.active {
  background: rgba(255, 71, 87, 0.15);
  color: var(--gold);
  box-shadow: 0 0 10px rgba(255, 71, 87, 0.2);
}

/* Category pills for Trafficking Mode */
.cat-sex_trafficking { color: #ff4757; border-color: rgba(255, 71, 87, 0.3); background: rgba(255, 71, 87, 0.1); }
.cat-forced_labor { color: #ffa502; border-color: rgba(255, 165, 2, 0.3); background: rgba(255, 165, 2, 0.1); }
.cat-debt_bondage { color: #9b59b6; border-color: rgba(155, 89, 182, 0.3); background: rgba(155, 89, 182, 0.1); }
.cat-child_exploitation { color: #ff6b81; border-color: rgba(255, 107, 129, 0.3); background: rgba(255, 107, 129, 0.1); }
.cat-organ_trafficking { color: #c0392b; border-color: rgba(192, 57, 43, 0.3); background: rgba(192, 57, 43, 0.1); }
.cat-other_mixed { color: #7f8c8d; border-color: rgba(127, 140, 141, 0.3); background: rgba(127, 140, 141, 0.1); }

/* Ensure Light Mode handles Trafficking nicely */
[data-theme='light'].mode-trafficking {
  --bg-base: #f0f2f5;
  --text-primary: #1a1a1a;
  --text-muted: #555;
  --gold: #d63031;
  --gold-bright: #e84343;
  --gold-glow: rgba(214, 48, 49, 0.35);
  --gold-bg: rgba(214, 48, 49, 0.08);
  background-color: var(--bg-base);
}

[data-theme='light'].mode-trafficking .orb {
  background: radial-gradient(circle, rgba(214,48,49,0.1) 0%, transparent 70%);
}
