/* ═══════════════════════════════════════════
   Timeliner — Styles
   ═══════════════════════════════════════════ */

/* ─── Reset & Custom Properties ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:            #f8f6f1;
  --bg-surface:    #fffdf8;
  --bg-card:       #fffdf8;
  --bg-card-hover: #f3efe8;
  --border:        #d4c9b8;
  --border-hover:  #b8a994;
  --text:          #4a4540;
  --text-bright:   #1a1a1a;
  --text-secondary:#8b7355;
  --text-muted:    #a89880;
  --accent:        #7c2d36;
  --accent-dim:    rgba(124,45,54,0.08);

  --cat-science:     #2c5282;
  --cat-music:       #9b2c2c;
  --cat-art:         #b7791f;
  --cat-literature:  #2f6b4f;
  --cat-film:        #c05621;
  --cat-politics:    #4a5568;
  --cat-philosophy:  #6b46c1;
  --cat-exploration: #2b6cb0;
  --cat-sports:      #c53030;
  --cat-business:    #975a16;
  --cat-activism:    #97266d;

  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Georgia', 'Times New Roman', serif;
  --ease:         cubic-bezier(.4,0,.2,1);
  --ease-out:     cubic-bezier(0,0,.2,1);
}

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

::selection { background: rgba(124,45,54,.2); color: #1a1a1a; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ─── Header ─── */
.header {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-surface);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo-link { display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; }
.logo-icon { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
h1.logo-text, .logo-text {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--text-bright);
  margin: 0; line-height: 1.2;
}
.tagline { font-size: 12px; color: var(--text-secondary); font-style: italic; }

/* ─── Hero / Fact Card ─── */
.hero {
  padding: 56px 0 36px;
}

.fact-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 40px;
  max-width: 700px;
  margin: 0 auto;
  overflow: hidden;
}
.fact-label {
  font-family: var(--font-display);
  font-size: 10px; font-weight: 600; letter-spacing: 3px;
  color: var(--accent); margin-bottom: 20px;
}

/* Timeline visual inside fact card */
.fact-visual { margin-bottom: 20px; }
.fact-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.fact-bar-label {
  font-size: 11px; font-weight: 500; color: var(--text-secondary);
  min-width: 110px; text-align: right;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fact-bar-track {
  flex: 1; height: 7px;
  background: rgba(255,255,255,.03);
  border-radius: 4px;
  position: relative; overflow: hidden;
}
.fact-bar-fill {
  position: absolute; top: 0; height: 100%;
  border-radius: 4px;
  animation: barGrow .7s var(--ease-out) both;
}
@keyframes barGrow { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }
.fact-bar-years { font-size: 10px; color: var(--text-muted); min-width: 68px; font-variant-numeric: tabular-nums; }
.fact-overlap-label {
  text-align: center; font-size: 11px; color: var(--accent);
  font-weight: 600; margin-top: 4px; letter-spacing: .3px;
}

.fact-text {
  font-family: var(--font-display);
  font-size: 21px; font-weight: 600; line-height: 1.4;
  color: var(--text-bright); margin-bottom: 6px;
}
.fact-extra {
  font-size: 14px; color: var(--text-secondary); line-height: 1.5;
  margin-bottom: 24px;
}

.fact-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 15px;
  border: none; border-radius: 8px;
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all .2s var(--ease);
  white-space: nowrap;
}
.btn-ghost {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-card-hover); color: var(--text); border-color: var(--border-hover); }
.btn-accent {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(124,45,54,.15);
}
.btn-accent:hover { background: rgba(124,45,54,.13); border-color: rgba(124,45,54,.25); }
.btn-primary { background: var(--accent); color: #fff; font-weight: 600; border: none; }
.btn-primary:hover { opacity: 0.9; }

/* ─── Explorer ─── */
.explorer { padding: 36px 0 80px; }
.explorer-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; gap: 16px; flex-wrap: wrap;
}
.explorer-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.highlight { color: var(--accent); }

.search-box { position: relative; width: 260px; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search-input {
  width: 100%; padding: 9px 12px 9px 38px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-family: var(--font-body); font-size: 13px;
  outline: none; transition: all .2s var(--ease);
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: rgba(124,45,54,.3); box-shadow: 0 0 0 3px rgba(124,45,54,.06); }

/* ─── Filters ─── */
.filters { display: flex; gap: 7px; margin-bottom: 24px; flex-wrap: wrap; }
.filter-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 13px; border: 1px solid var(--border); border-radius: 20px;
  background: transparent; color: var(--text-secondary);
  font-family: var(--font-body); font-size: 12px; cursor: pointer;
  transition: all .2s var(--ease); white-space: nowrap;
}
.filter-pill:hover { border-color: var(--border-hover); color: var(--text); background: var(--bg-card); }
.filter-pill.active { background: var(--bg-card-hover); border-color: var(--border-hover); color: var(--text-bright); }
.filter-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ─── People Grid ─── */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.person-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease);
  position: relative; overflow: hidden;
  border-left: 3px solid var(--card-accent, var(--accent));
}
.person-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.person-name { font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--text-bright); margin-bottom: 2px; }
.person-years { font-size: 12px; color: var(--text-secondary); margin-bottom: 5px; font-variant-numeric: tabular-nums; }
.person-known { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.person-cat {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px;
  margin-top: 7px; opacity: .6;
}

.no-results { text-align: center; color: var(--text-muted); padding: 60px 0; font-size: 14px; }

/* ─── Detail Panel (overlay) ─── */
.overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; justify-content: flex-end;
  pointer-events: none;
}
.overlay.open { pointer-events: auto; }
.overlay-bg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.3);
  opacity: 0; transition: opacity .3s var(--ease);
}
.overlay.open .overlay-bg { opacity: 1; }

.detail-panel {
  width: 500px; max-width: 100vw; height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--border);
  overflow-y: auto; position: relative;
  transform: translateX(100%);
  transition: transform .35s var(--ease-out);
}
.overlay.open .detail-panel { transform: translateX(0); }

.detail-close {
  position: sticky; top: 0; float: right; margin: 14px 14px 0 0;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  padding: 5px; color: var(--text-secondary); cursor: pointer; z-index: 10;
  transition: all .2s var(--ease);
}
.detail-close:hover { color: var(--text-bright); border-color: var(--border-hover); }

.detail-body { padding: 28px 24px 40px; clear: both; }

.detail-name {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 700; color: var(--text-bright); margin-bottom: 2px;
}
.detail-years { font-size: 14px; color: var(--text-secondary); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.detail-known { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; }
.detail-cat-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
  padding: 3px 10px; border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 24px;
}
.detail-cat-dot { width: 7px; height: 7px; border-radius: 50%; }

.detail-section-title {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 600; letter-spacing: 2px;
  color: var(--accent); text-transform: uppercase;
  margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.contemp-list { list-style: none; }
.contemp-item {
  padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.03);
  display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: start;
  cursor: pointer; transition: background .15s;
  margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 6px;
}
.contemp-item:hover { background: rgba(255,255,255,.025); }
.contemp-name { font-size: 13px; font-weight: 500; color: var(--text-bright); }
.contemp-known { font-size: 11px; color: var(--text-muted); grid-column: 1; }
.contemp-overlap {
  font-size: 12px; font-weight: 600; color: var(--accent);
  text-align: right; white-space: nowrap;
}
.contemp-bar-track {
  grid-column: 1 / -1;
  height: 4px; background: rgba(255,255,255,.03); border-radius: 2px;
  overflow: hidden; margin-top: 4px;
}
.contemp-bar-fill { height: 100%; border-radius: 2px; opacity: .6; }

.contemp-share-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 3px 8px; font-size: 10px; color: var(--text-muted);
  cursor: pointer; transition: all .15s; margin-top: 4px;
  font-family: var(--font-body); display: inline-flex; align-items: center; gap: 3px;
}
.contemp-share-btn:hover { color: var(--accent); border-color: rgba(124,45,54,.3); }

/* ─── On This Day ─── */
.on-this-day {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.otd-card {
  max-width: 700px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
}
.otd-label {
  font-family: var(--font-display);
  font-size: 10px; font-weight: 600; letter-spacing: 3px;
  color: var(--accent); margin-bottom: 12px;
  text-transform: uppercase;
}
.otd-list { display: flex; flex-direction: column; }
.otd-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  border-radius: 6px;
  transition: background .15s var(--ease);
}
.otd-item:last-child { border-bottom: none; }
.otd-item:hover { background: rgba(255,255,255,.03); }
.otd-icon { font-size: 18px; flex-shrink: 0; line-height: 1; }
.otd-info { flex: 1; min-width: 0; }
.otd-name {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600; color: var(--text-bright);
}
.otd-desc { font-size: 12px; color: var(--text-secondary); }

/* Featured Links */
.featured-links {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.featured-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 8px;
  text-decoration: none; color: inherit;
  border-radius: 6px;
  transition: background .15s var(--ease);
}
.featured-link:hover { background: rgba(255,255,255,.03); }
.featured-icon { font-size: 24px; flex-shrink: 0; line-height: 1; }
.featured-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.featured-text strong {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600; color: var(--text-bright);
}
.featured-sub { font-size: 12px; color: var(--text-secondary); }
.featured-arrow { font-size: 16px; color: var(--accent); flex-shrink: 0; }

/* ─── Year Slider ─── */
.year-slider-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px; padding: 10px 0;
}
.year-slider-label {
  font-size: 13px; color: var(--text-secondary);
  white-space: nowrap; font-weight: 500;
}
.year-slider {
  flex: 1; height: 6px;
  -webkit-appearance: none; appearance: none;
  background: rgba(255,255,255,.06);
  border-radius: 3px; outline: none;
  cursor: pointer;
}
.year-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  cursor: pointer;
}
.year-slider::-webkit-slider-thumb:hover {
  opacity: 0.85;
}
.year-slider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
  cursor: pointer;
}
.year-slider::-moz-range-track {
  height: 6px; background: rgba(255,255,255,.06);
  border-radius: 3px; border: none;
}
.year-slider-value {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700;
  color: var(--accent);
  min-width: 56px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.year-slider-row.inactive .year-slider-value { color: var(--text-muted); }
.year-slider-row.inactive .year-slider-label { color: var(--text-muted); }
.btn-sm {
  padding: 5px 10px; font-size: 11px;
  border-radius: 6px;
}

/* ─── Compare Mode ─── */
.explorer-controls {
  display: flex; align-items: center; gap: 10px;
}
.compare-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; margin-bottom: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
}
.compare-status {
  flex: 1; font-size: 13px; color: var(--text-secondary); font-weight: 500;
}
.compare-active .person-card { cursor: crosshair; }
.compare-active .person-card:hover {
  border-color: rgba(124,45,54,.3);
}
.person-card.compare-selected {
  border-color: var(--accent) !important;
}
.person-card.compare-selected::before { opacity: 1; background: var(--accent); }
.btn-compare-active {
  background: var(--accent-dim) !important;
  color: var(--accent) !important;
  border-color: rgba(124,45,54,.25) !important;
}
.fact-gap-label {
  text-align: center; font-size: 11px; color: #975a16;
  font-weight: 600; margin-top: 4px; letter-spacing: .3px;
}

/* ─── Toast ─── */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--accent); color: #fff;
  padding: 10px 22px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: all .3s var(--ease);
  z-index: 999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Footer ─── */
.footer {
  padding: 30px 0;
  border-top: 1px solid var(--border);
  text-align: center; font-size: 12px; color: var(--text-muted);
}
.footer-credit { margin-top: 6px; }
.footer a { color: var(--text-secondary); text-decoration: none; transition: color .2s; }
.footer a:hover { color: var(--accent); }

/* ─── Detail Page ─── */
.detail-page {
  padding: 0 0 80px;
  min-height: 60vh;
}
.detail-container { max-width: 800px; margin: 0 auto; }

.detail-back { padding: 16px 0; }

.detail-hero { text-align: center; padding: 24px 0 32px; }

.detail-portrait-wrap { margin-bottom: 16px; }
.detail-portrait-img {
  width: 88px; height: 88px; border-radius: 50%;
  border: 2px solid var(--accent);
  object-fit: cover;
}
.detail-portrait-placeholder {
  width: 88px; height: 88px; border-radius: 50%;
  border: 2px solid var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-card-hover);
}
.detail-portrait-initial {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 700;
}

.detail-page-name {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 700; color: var(--text-bright);
  margin-bottom: 4px;
}
.detail-page-years {
  font-size: 14px; color: var(--text-secondary);
  font-variant-numeric: tabular-nums; margin-bottom: 8px;
}
.detail-page-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
  padding: 3px 10px; border-radius: 12px;
  border: 1px solid; margin-bottom: 16px;
}
.detail-page-summary {
  color: var(--text); font-size: 14px; line-height: 1.7;
  max-width: 560px; margin: 0 auto 12px;
}
.detail-wiki-link {
  color: var(--accent); font-size: 13px; text-decoration: none;
  border-bottom: 1px solid rgba(124,45,54,0.3);
  transition: border-color 0.2s;
}
.detail-wiki-link:hover { border-color: var(--accent); }
.detail-fallback-msg {
  color: var(--text-muted); font-size: 13px; margin-top: 16px;
  font-style: italic;
}

/* Skeleton shimmer */
.detail-summary-skeleton { max-width: 400px; margin: 0 auto; }
.shimmer-bar {
  height: 14px; border-radius: 4px; margin-bottom: 8px;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
.shimmer-bar.short { width: 60%; }
.shimmer-bar.medium { width: 80%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Timelines */
.detail-timelines {
  display: flex; gap: 32px;
  padding: 32px 0; border-top: 1px solid var(--border);
}
.detail-timelines-col { flex: 1; min-width: 0; }

.detail-section-heading {
  font-family: var(--font-display);
  font-size: 11px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; margin-bottom: 16px;
}

.detail-timeline {
  list-style: none; border-left: 2px solid rgba(255,255,255,0.08);
  padding-left: 18px;
}
.detail-timeline.world-global { border-left-color: rgba(151,90,22,0.3); }
.detail-timeline.world-domain { border-left-color: rgba(43,108,176,0.3); }

.detail-event {
  position: relative; margin-bottom: 14px;
  font-size: 13px; color: var(--text);
}
.detail-event::before {
  content: '';
  position: absolute; left: -23px; top: 5px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}
.detail-timeline.world-global .detail-event::before { background: #975a16; }
.detail-timeline.world-domain .detail-event::before { background: #2b6cb0; }

.detail-event-year {
  display: block; font-size: 11px; font-weight: 600;
  font-variant-numeric: tabular-nums; margin-bottom: 2px;
}
.detail-event-link {
  color: var(--text); text-decoration: none;
  border-bottom: 1px dotted rgba(255,255,255,0.2);
  transition: border-color 0.2s;
}
.detail-event-link:hover { border-bottom-color: var(--accent); }

.detail-world-events { display: flex; flex-direction: column; gap: 24px; }
.detail-world-sublabel {
  font-size: 9px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 8px; opacity: 0.8;
}

/* Contemporaries */
.detail-contemporaries {
  padding: 24px 0; border-top: 1px solid var(--border);
}
.detail-contemp-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.detail-contemp-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; text-decoration: none;
  transition: all 0.2s var(--ease);
}
.detail-contemp-chip:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}
.detail-contemp-portrait {
  width: 32px; height: 32px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.detail-contemp-initial {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.detail-contemp-info { display: flex; flex-direction: column; }
.detail-contemp-name { font-size: 12px; font-weight: 500; color: var(--text-bright); }
.detail-contemp-years { font-size: 10px; color: var(--text-muted); }

/* ─── Enriched Fact Card ─── */
.fact-portraits-row {
  display: flex; align-items: center; justify-content: center;
  gap: 24px; margin-bottom: 20px;
}
.fact-person-col { text-align: center; }
.fact-portrait {
  border-radius: 50%; border: 2px solid;
  object-fit: cover; display: block; margin: 0 auto;
  box-shadow: 0 0 16px rgba(124,45,54,0.1);
}
.fact-portrait-placeholder {
  border-radius: 50%; border: 2px solid;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.03);
}
.fact-portrait-placeholder span {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 700;
}
.fact-person-name {
  font-size: 13px; font-weight: 600; color: var(--text-bright);
  margin-top: 8px;
}
.fact-person-dates { font-size: 11px; color: var(--text-secondary); }
.fact-explore-link {
  display: block; font-size: 10px; color: var(--accent);
  text-decoration: none; margin-top: 4px;
}
.fact-explore-link:hover { text-decoration: underline; }

.fact-overlap-badge, .fact-gap-badge {
  display: flex; flex-direction: column; align-items: center;
  padding: 6px 14px;
  background: var(--accent-dim);
  border: 1px solid rgba(124,45,54,0.2);
  border-radius: 20px;
}
.fact-gap-badge {
  background: rgba(151,90,22,0.08);
  border-color: rgba(151,90,22,0.2);
}
.fact-overlap-num { font-size: 14px; font-weight: 700; color: var(--accent); }
.fact-gap-badge .fact-overlap-num { color: #975a16; }
.fact-overlap-unit { font-size: 9px; color: var(--accent); opacity: 0.7; }
.fact-gap-badge .fact-overlap-unit { color: #975a16; }

.fact-world-strip {
  margin-top: 16px; padding: 10px 14px;
  background: rgba(151,90,22,0.04);
  border: 1px solid rgba(151,90,22,0.1);
  border-radius: 8px;
}
.fact-world-label {
  font-size: 9px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.5px; color: #975a16; margin-bottom: 6px;
}
.fact-world-events {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
}
.fact-world-event { font-size: 12px; color: var(--text-secondary); text-decoration: none; }
a.fact-world-event:hover { color: #975a16; }
.fact-world-sep { color: var(--text-muted); font-size: 10px; }

/* ─── Grid Card Portraits ─── */
.person-card-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
}
.person-portrait {
  width: 32px; height: 32px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.person-portrait-ph {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.person-card-info { min-width: 0; }
.person-card-header .person-name { margin-bottom: 0; }
.person-card-header .person-years { margin-bottom: 0; }
.person-known {
  font-size: 11px; color: var(--text-muted); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; gap: 4px; align-items: flex-start; }
  .hero { padding: 36px 0 24px; }
  .fact-card { padding: 24px 20px; }
  .fact-text { font-size: 18px; }
  .fact-bar-label { min-width: 80px; font-size: 10px; }
  .explorer-header { flex-direction: column; align-items: stretch; }
  .explorer-controls { flex-direction: column; align-items: stretch; }
  .search-box { width: 100%; }
  .explorer-title { font-size: 18px; }
  .people-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .detail-panel { width: 100%; }
  .detail-body { padding: 20px 16px 30px; }
  .detail-name { font-size: 22px; }
  .year-slider-row { flex-wrap: wrap; }
  .year-slider { min-width: 120px; }
  .otd-card { padding: 16px 18px; }
  .detail-portrait-img, .detail-portrait-placeholder { width: 72px; height: 72px; }
  .detail-portrait-initial { font-size: 26px; }
  .detail-page-name { font-size: 22px; }
  .detail-timelines { flex-direction: column; gap: 24px; }
  .detail-contemp-grid { flex-direction: column; }
  .detail-contemp-chip { width: 100%; }
  .fact-portraits-row { gap: 12px; }
  .fact-portrait, .fact-portrait-placeholder { width: 48px !important; height: 48px !important; }
  .fact-portrait-placeholder span { font-size: 18px; }
  .fact-person-name { font-size: 11px; }
  .fact-overlap-badge, .fact-gap-badge { padding: 4px 10px; }
  .fact-overlap-num { font-size: 12px; }
}

@media (max-width: 480px) {
  .people-grid { grid-template-columns: 1fr; }
  .fact-actions { flex-direction: column; }
  .fact-actions .btn { justify-content: center; }
  .year-slider-row { gap: 8px; }
  .year-slider-value { font-size: 18px; min-width: 48px; }
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(74,69,64,.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(74,69,64,.25); }

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ─── Breadcrumb Navigation ─── */
.breadcrumb {
  max-width: 900px;
  margin: 0.75rem auto 0;
  padding: 0 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}
.breadcrumb a:hover {
  text-decoration: underline;
}
.breadcrumb span[aria-hidden] {
  margin: 0 0.4rem;
}

/* ─── Person Pages (static) ─── */

.sp-page { max-width: 800px; margin: 0 auto; padding: 24px 20px; }

/* Hero */
.sp-hero { text-align: center; padding: 40px 0 24px; }
.sp-portrait { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); }
.sp-portrait-ph { width: 120px; height: 120px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 48px; font-weight: 700; font-family: var(--font-display); }
.sp-name { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--text-bright); margin: 16px 0 4px; }
.sp-years { color: var(--text-secondary); font-size: 15px; margin-bottom: 8px; }
.sp-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; padding: 4px 12px; border: 1px solid; border-radius: 20px; }

/* Summary */
.sp-summary { color: var(--text); font-size: 15px; line-height: 1.7; margin: 20px 0; }
.sp-wiki-link { display: inline-block; color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: none; margin-top: 8px; }
.sp-wiki-link:hover { text-decoration: underline; }

/* Contemporaries */
.sp-section-heading { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--text-bright); margin: 32px 0 16px; }
.sp-contemp-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.sp-contemp-chip { display: flex; align-items: center; gap: 8px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 24px; padding: 6px 14px 6px 6px; text-decoration: none; transition: border-color 0.2s, background 0.2s; }
.sp-contemp-chip:hover { background: var(--bg-card-hover); border-color: var(--border-hover); }
.sp-contemp-portrait { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.sp-contemp-initial { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; }
.sp-contemp-name { font-size: 13px; font-weight: 500; color: var(--text-bright); }
.sp-contemp-years { font-size: 11px; color: var(--text-secondary); }

/* World Events */
.sp-world-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 16px 0 32px; }
.sp-world-sublabel { font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 12px; }
.sp-event { display: flex; gap: 10px; padding: 6px 0; font-size: 13px; color: var(--text); }
.sp-event-year { font-weight: 600; flex-shrink: 0; min-width: 40px; }
.sp-event a { color: inherit; text-decoration: none; }
.sp-event a:hover { color: var(--accent); }

/* Footer nav */
.sp-footer-nav { text-align: center; padding: 32px 0; border-top: 1px solid var(--border); margin-top: 40px; }
.sp-footer-nav a { color: var(--accent); text-decoration: none; font-size: 14px; font-weight: 600; margin: 0 16px; }
.sp-footer-nav a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
  .sp-name { font-size: 22px; }
  .sp-world-cols { grid-template-columns: 1fr; }
  .sp-contemp-grid { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 8px; }
}

/* ─── Calendar & Category Pages (static) ─── */

/* Person list (calendar pages) */
.sp-person-list { display: flex; flex-direction: column; gap: 12px; margin: 16px 0 32px; }
.sp-person-row { display: flex; align-items: center; gap: 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; text-decoration: none; transition: border-color 0.2s, background 0.2s; }
.sp-person-row:hover { background: var(--bg-card-hover); border-color: var(--border-hover); }
.sp-person-row-portrait { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.sp-person-row-initial { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: #fff; flex-shrink: 0; }
.sp-person-row-info { flex: 1; min-width: 0; }
.sp-person-row-name { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--text-bright); }
.sp-person-row-meta { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.sp-person-row-known { font-size: 12px; color: var(--text-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Day navigation */
.sp-day-nav { display: flex; justify-content: space-between; align-items: center; padding: 24px 0; border-top: 1px solid var(--border); margin-top: 32px; }
.sp-day-nav a { color: var(--accent); text-decoration: none; font-size: 14px; font-weight: 600; }
.sp-day-nav a:hover { text-decoration: underline; }

/* Empty state */
.sp-empty-msg { color: var(--text-secondary); font-size: 14px; font-style: italic; padding: 24px 0; }

/* Section label (born/died) */
.sp-date-section { font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--text-secondary); margin: 32px 0 12px; }
.sp-date-section:first-of-type { margin-top: 16px; }

/* Category page */
.sp-category-desc { color: var(--text); font-size: 15px; line-height: 1.7; margin: 12px 0 24px; }
.sp-people-grid-full { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 16px 0 32px; }
.sp-grid-card { display: flex; align-items: center; gap: 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; text-decoration: none; transition: border-color 0.2s, background 0.2s; }
.sp-grid-card:hover { background: var(--bg-card-hover); border-color: var(--border-hover); }
.sp-grid-card-portrait { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.sp-grid-card-initial { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; color: #fff; flex-shrink: 0; }
.sp-grid-card-info { flex: 1; min-width: 0; }
.sp-grid-card-name { font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--text-bright); }
.sp-grid-card-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* Responsive */
@media (max-width: 768px) {
  .sp-people-grid-full { grid-template-columns: 1fr; }
}

/* ─── Year Pages (static) ─── */
.sp-count-line { color: var(--text-secondary); font-size: 14px; margin: 8px 0 24px; }
.sp-year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 16px 0 32px; }
.sp-year-card { display: flex; align-items: center; gap: 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; text-decoration: none; transition: border-color 0.2s, background 0.2s; }
.sp-year-card:hover { background: var(--bg-card-hover); border-color: var(--border-hover); }
.sp-year-card-portrait { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.sp-year-card-info { flex: 1; min-width: 0; }
.sp-year-card-name { font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--text-bright); }
.sp-year-card-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.sp-age-badge { display: inline-block; background: rgba(255,255,255,0.08); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: 11px; font-weight: 600; color: var(--text-bright); margin-left: 6px; }

/* ─── Comparison Pages (static) ─── */
.sp-overlap-summary { color: var(--text-secondary); font-size: 15px; margin: 8px 0 24px; text-align: center; }
.sp-curated-callout { background: linear-gradient(135deg, rgba(249,168,37,0.1), rgba(0,229,255,0.05)); border: 1px solid rgba(249,168,37,0.3); border-radius: 12px; padding: 20px 24px; margin: 0 0 28px; }
.sp-curated-callout-text { font-size: 15px; color: var(--text-bright); line-height: 1.6; }
.sp-curated-callout-extra { font-size: 13px; color: var(--text-secondary); margin-top: 8px; line-height: 1.5; font-style: italic; }
.sp-compare-portraits { display: flex; gap: 24px; justify-content: center; margin: 0 0 32px; flex-wrap: wrap; }
.sp-compare-person { display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; min-width: 140px; max-width: 200px; flex: 1; }
.sp-compare-person-portrait { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.sp-compare-person-name { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--text-bright); text-align: center; }
.sp-compare-person-years { font-size: 12px; color: var(--text-secondary); }
.sp-compare-person-known { font-size: 12px; color: var(--text-secondary); text-align: center; margin-top: 2px; }
.sp-overlap-bar-container { position: relative; margin: 0 0 32px; padding: 8px 0; }
.sp-overlap-bar-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-secondary); margin-bottom: 8px; }
.sp-overlap-bar-row { position: relative; height: 24px; margin: 4px 0; border-radius: 4px; }
.sp-overlap-bar { position: absolute; height: 100%; border-radius: 4px; opacity: 0.7; }
.sp-overlap-bar-name { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100% - 16px); }
.sp-overlap-highlight { position: absolute; height: 100%; background: rgba(255,255,255,0.08); border-left: 2px solid rgba(255,255,255,0.3); border-right: 2px solid rgba(255,255,255,0.3); z-index: 1; top: 0; }
.sp-key-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0 0 28px; }
.sp-key-fact { font-size: 13px; color: var(--text-secondary); }
.sp-key-fact-label { font-weight: 600; color: var(--text-bright); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.sp-world-events-shared { margin: 0 0 28px; }
.sp-more-comparisons { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin: 12px 0 28px; }
.sp-more-comp-link { display: block; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; text-decoration: none; transition: border-color 0.2s, background 0.2s; }
.sp-more-comp-link:hover { background: var(--bg-card-hover); border-color: var(--border-hover); }
.sp-more-comp-names { font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--text-bright); }
.sp-more-comp-overlap { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

@media (max-width: 768px) {
  .sp-year-grid { grid-template-columns: 1fr; }
  .sp-compare-portraits { flex-direction: column; align-items: center; }
  .sp-key-facts { grid-template-columns: 1fr; }
  .sp-more-comparisons { grid-template-columns: 1fr; }
}
