/* ============================================================
   THE MEWSEUM — design system
   Claude-inspired: warm ivory, crail terracotta, serif display,
   hairline borders, soft rounded surfaces.
   ============================================================ */

:root {
  --bg: #faf9f5;
  --bg-soft: #f0eee6;
  --bg-deep: #e9e6db;
  --surface: #ffffff;
  --ink: #141413;
  --ink-soft: #63615a;
  --ink-faint: #98958a;
  --crail: #d97757;
  --crail-deep: #c15f3c;
  --crail-tint: #faf0ea;
  --olive: #6b7d68;
  --olive-tint: #eef2ec;
  --gold: #b08a3e;
  --line: #e6e3d9;
  --line-strong: #d6d2c4;
  --dark: #191918;
  --dark-soft: #262624;
  --dark-text: #b9b6a9;
  --dark-faint: #7c7a70;

  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --shell: 1180px;
  --radius: 16px;
  --radius-sm: 9px;
  --shadow-card: 0 1px 2px rgba(20, 20, 19, .05), 0 6px 20px -14px rgba(20, 20, 19, .12);
  --shadow-lift: 0 2px 4px rgba(20, 20, 19, .06), 0 16px 36px -18px rgba(20, 20, 19, .22);
  --header-h: 72px;
}

/* ---------- reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.14; margin: 0; color: var(--ink); letter-spacing: -.015em; }
p { margin: 0 0 1em; }
a { color: var(--crail-deep); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--crail); }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
kbd {
  font-family: var(--font-mono);
  font-size: .72em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  background: var(--surface);
  color: var(--ink-soft);
}
::selection { background: rgba(217, 119, 87, .25); }
:focus-visible { outline: 2px solid var(--crail); outline-offset: 2px; border-radius: 4px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 24px; }
section { padding: 60px 0 8px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 249, 245, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 28px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 32px; height: 32px; color: var(--crail); transform: rotate(-4deg); flex-shrink: 0; }
.brand-word { font-family: var(--font-display); font-weight: 600; font-size: 24px; letter-spacing: -.02em; }
.brand-word em { font-style: italic; color: var(--crail-deep); }
.brand-tag {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-faint); border-left: 1px solid var(--line-strong); padding-left: 12px; margin-left: 2px;
}
.main-nav { display: flex; gap: 4px; margin-left: auto; }
.main-nav a {
  color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: 15px;
  padding: 8px 13px; border-radius: 999px; transition: background .15s, color .15s;
}
.main-nav a:hover { background: var(--bg-soft); color: var(--ink); }
.main-nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.header-actions { display: flex; gap: 10px; align-items: center; }

.nav-burger { display: none; background: none; border: 1px solid var(--line-strong); border-radius: 10px; width: 44px; height: 44px; padding: 10px; }
.nav-burger span { display: block; height: 2px; background: var(--ink); margin: 4px 0; border-radius: 2px; }
.mobile-nav { border-top: 1px solid var(--line); padding: 8px 24px 16px; background: var(--bg); }
.mobile-nav a { display: block; padding: 12px 4px; font-weight: 600; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.mobile-nav a:last-of-type { border-bottom: 1px solid var(--line); }
.mobile-nav .mobile-random { display: block; width: 100%; text-align: left; padding: 12px 4px; font-size: 15px; border-bottom: 0; color: var(--crail-deep); font-weight: 700; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 15px;
  border-radius: 999px; padding: 11px 22px;
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s, transform .12s ease, box-shadow .12s ease;
  text-decoration: none;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-accent { background: var(--crail); color: #fffdf7; box-shadow: 0 1px 2px rgba(20,20,19,.12); }
.btn-accent:hover { background: var(--crail-deep); color: #fff; transform: translateY(-1px); }
.btn-green { background: var(--ink); color: var(--bg); }
.btn-green:hover { background: #2e2e2b; color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface); color: var(--ink); border-color: var(--ink-faint); }
.btn-sm { padding: 8px 15px; font-size: 13.5px; }
.search-btn-label { display: inline; }

/* ---------- hero ---------- */
.hero { padding: 76px 0 40px; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 56px; align-items: center; }
.starburst {
  position: absolute; top: 34px; right: 8%;
  width: 210px; height: 210px; pointer-events: none; opacity: .08;
  background: url("/img/ui/starburst.svg") center/contain no-repeat;
  animation: spin-slow 120s linear infinite;
}
@keyframes spin-slow { to { transform: rotate(360deg); } }
.hero-eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--crail-deep); display: flex; align-items: center; gap: 10px; margin-bottom: 22px; font-weight: 500;
}
.hero-eyebrow::before {
  content: ""; width: 16px; height: 16px;
  background: url("/img/ui/starburst.svg") center/contain no-repeat;
}
.hero h1 { font-size: clamp(44px, 6.2vw, 78px); font-weight: 600; letter-spacing: -.025em; margin-bottom: 14px; }
.hero h1 em { font-style: italic; color: var(--crail-deep); }
.hero-lede { font-size: 20px; color: var(--ink-soft); max-width: 34em; margin-bottom: 32px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 44px; }

.hero-stats { display: flex; gap: 0; flex-wrap: wrap; border-top: 1px solid var(--line-strong); }
.stat { padding: 20px 30px 16px 0; min-width: 140px; }
.stat + .stat { padding-left: 30px; border-left: 1px solid var(--line); }
.stat-num {
  font-family: var(--font-mono); font-size: 32px; font-weight: 500; line-height: 1;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.stat-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); margin-top: 8px; }

/* hero side: the "cat of the moment" card */
.moment-ticket {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.moment-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 12px; }
.moment-title { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); font-weight: 500; }
.moment-live { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--crail-deep); }
.moment-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--crail); animation: pulse 1.6s infinite; }
.moment-media { aspect-ratio: 4/3.4; background: var(--bg-soft); position: relative; overflow: hidden; margin: 0 12px; border-radius: 10px; }
.moment-media img { width: 100%; height: 100%; object-fit: cover; }
.moment-caption { padding: 14px 20px 18px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.moment-caption p { margin: 0; font-size: 13.5px; color: var(--ink-soft); }
.moment-refresh { background: none; border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 13px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); }
.moment-refresh:hover { border-color: var(--ink); color: var(--ink); }
.moment-fallback { display: grid; place-items: center; height: 100%; color: var(--ink-faint); font-family: var(--font-mono); font-size: 12px; text-align: center; padding: 20px; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* ---------- section headers ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.section-kicker {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--crail-deep); display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-weight: 500;
}
.section-kicker::before {
  content: ""; width: 14px; height: 14px; flex-shrink: 0;
  background: url("/img/ui/starburst.svg") center/contain no-repeat;
}
.section-head h2 { font-size: clamp(28px, 3.4vw, 42px); letter-spacing: -.02em; }
.section-head h2 em { font-style: italic; color: var(--crail-deep); }
.section-more { font-weight: 600; font-size: 15px; white-space: nowrap; }

/* ---------- ticker ---------- */
.ticker {
  overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--dark); color: var(--bg);
}
.ticker-track { display: flex; width: max-content; animation: ticker 60s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item {
  display: flex; align-items: center; gap: 26px; padding: 13px 0; white-space: nowrap;
  font-family: var(--font-mono); font-size: 13.5px; color: var(--dark-text);
}
.ticker-item::after { content: "✳"; opacity: .7; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- cat cards ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 24px; }
.cat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow-card);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  position: relative;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: var(--line-strong); color: var(--ink); }
.cat-card-media { position: relative; background: var(--bg-soft); aspect-ratio: 1/1; overflow: hidden; }
.cat-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.cat-card:hover .cat-card-media img { transform: scale(1.04); }
.card-noimg { display: grid; place-items: center; height: 100%; font-size: 60px; filter: grayscale(.3) opacity(.8); }
.cat-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-num { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .13em; color: var(--ink-faint); text-transform: uppercase; }
.card-era { font-family: var(--font-mono); font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--olive); border: 1px solid var(--line); padding: 3px 8px; border-radius: 999px; }
.cat-card h3 { font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.cat-card .card-claim { font-size: 14px; color: var(--ink-soft); line-height: 1.5; margin: 0; flex: 1; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.card-years { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); }
.card-years .dash { color: var(--ink-faint); }
.card-fame { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--crail-deep); }

/* ---------- stamps & badges ---------- */
.stamp {
  display: inline-block; font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; padding: 5px 12px;
  border-radius: 999px; line-height: 1.3; border: 1px solid transparent;
}
.stamp-terracotta { background: var(--crail-tint); color: var(--crail-deep); border-color: rgba(217,119,87,.35); }
.stamp-green { background: var(--olive-tint); color: #4f6248; border-color: rgba(107,125,104,.4); }
.stamp-ink { background: var(--bg-soft); color: var(--ink-soft); border-color: var(--line-strong); }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .05em;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft);
  border-radius: 999px; padding: 4px 12px;
}
.badge-alive { border-color: rgba(107,125,104,.45); color: #4f6248; background: var(--olive-tint); }
.badge-deceased { border-color: var(--line-strong); color: var(--ink-faint); }
.badge-era { border-style: dashed; }

/* ---------- catalog page ---------- */
.page-head { padding: 46px 0 6px; }
.page-head h1 { font-size: clamp(36px, 5vw, 56px); font-weight: 600; letter-spacing: -.025em; }
.page-head .page-sub { color: var(--ink-soft); font-size: 18px; max-width: 44em; }
.filter-bar {
  position: sticky; top: var(--header-h); z-index: 40;
  background: rgba(250, 249, 245, .95); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 14px 0; margin: 18px 0 26px;
}
.filter-inner { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.search-field {
  display: flex; align-items: center; gap: 8px; flex: 1 1 260px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; padding: 10px 16px;
}
.search-field:focus-within { border-color: var(--crail); box-shadow: 0 0 0 3px rgba(217, 119, 87, .18); }
.search-field .icon-search { color: var(--ink-faint); }
.search-field input { border: 0; background: none; flex: 1; font: inherit; font-size: 15px; color: var(--ink); outline: none; min-width: 0; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .02em;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft);
  border-radius: 999px; padding: 8px 15px; transition: all .15s;
}
.chip:hover { border-color: var(--ink-faint); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.sort-select {
  font: inherit; font-family: var(--font-mono); font-size: 12.5px;
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink);
  border-radius: 999px; padding: 8px 13px; cursor: pointer;
}
.result-line { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; flex-wrap: wrap; gap: 8px; }
.result-count { font-family: var(--font-mono); font-size: 13px; color: var(--ink-soft); letter-spacing: .04em; }
.result-count strong { color: var(--crail-deep); font-size: 16px; }
.clear-filters { background: none; border: none; color: var(--crail-deep); font-weight: 600; font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; padding: 0; }
.load-more-row { text-align: center; margin: 34px 0 20px; }

.empty-state { text-align: center; padding: 70px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.empty-state .big { font-size: 56px; display: block; margin-bottom: 14px; }
.empty-state h3 { font-size: 26px; margin-bottom: 8px; }
.empty-state p { color: var(--ink-soft); max-width: 30em; margin: 0 auto 22px; }

/* ---------- detail page ---------- */
.cat-hero { padding: 42px 0 8px; }
.cat-hero-grid { display: grid; grid-template-columns: minmax(300px, 440px) 1fr; gap: 48px; align-items: start; }
.cat-portrait { position: relative; }
.cat-portrait .frame {
  background: var(--surface); border: 1px solid var(--line);
  padding: 12px; border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.cat-portrait .frame-inner { position: relative; overflow: hidden; border-radius: 10px; background: var(--bg-soft); aspect-ratio: 4/4.6; }
.cat-portrait .frame-inner img { width: 100%; height: 100%; object-fit: cover; }
.portrait-noimg { display: grid; place-items: center; height: 100%; font-size: 100px; filter: grayscale(.3) opacity(.8); }
.cat-portrait .stamps { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 3; }
.attribution { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); margin-top: 10px; text-align: center; line-height: 1.5; }
.attribution a { color: var(--ink-soft); }

.cat-title { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 6px; }
.cat-title h1 { font-size: clamp(34px, 5vw, 58px); font-weight: 600; letter-spacing: -.025em; }
.cat-realname { font-size: 17px; color: var(--ink-soft); font-style: italic; margin-bottom: 14px; }
.cat-claim { font-size: 20px; line-height: 1.5; font-weight: 600; color: var(--crail-deep); margin-bottom: 20px; font-family: var(--font-display); }
.cat-story { font-size: 17px; color: var(--ink); max-width: 60ch; margin-bottom: 22px; }

.quick-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 20px 0 26px; }
.qf { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.qf dt { font-family: var(--font-mono); font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 3px; }
.qf dd { margin: 0; font-weight: 600; font-size: 15px; }
.fame-meter { margin: 6px 0 22px; }
.fame-meter .fm-top { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px; }
.fame-meter .fm-track { height: 10px; background: var(--bg-deep); border-radius: 999px; overflow: hidden; }
.fame-meter .fm-fill { height: 100%; background: var(--crail); border-radius: 999px; width: 0; transition: width 1.1s cubic-bezier(.2,.8,.2,1); }

.cat-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 26px; }
.cat-links .btn { border-color: var(--line-strong); background: var(--surface); color: var(--crail-deep); }

.fact-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 30px 0; box-shadow: var(--shadow-card); }
.fact-panel-head { padding: 16px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.fact-panel-head h2 { font-size: 20px; }
.fact-list { list-style: none; margin: 0; padding: 10px 22px 16px; }
.fact-list li { position: relative; padding: 12px 0 12px 44px; border-bottom: 1px solid var(--line); }
.fact-list li:last-child { border-bottom: 0; }
.fact-list .fact-num {
  position: absolute; left: 0; top: 12px; font-family: var(--font-mono); font-weight: 500;
  font-size: 13px; color: var(--crail-deep); width: 30px; height: 30px;
  background: var(--crail-tint); border-radius: 50%; display: grid; place-items: center;
}
.fact-list p { margin: 0; }

.awards-line { margin: 18px 0; }
.awards-line .award { display: inline-flex; align-items: center; gap: 8px; margin: 0 10px 8px 0; background: var(--crail-tint); color: var(--crail-deep); font-size: 13.5px; font-weight: 600; padding: 7px 14px; border-radius: 999px; }
.awards-line .award::before { content: "✳"; }

.related-head { display: flex; align-items: baseline; justify-content: space-between; margin: 34px 0 18px; }
.related-head h2 { font-size: 26px; }

/* ---------- timeline ---------- */
.timeline-wrap { position: relative; padding: 10px 0 30px; }
.tl-legend { display: flex; gap: 18px; justify-content: flex-end; margin-bottom: 14px; flex-wrap: wrap; }
.tl-legend span { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 7px; }
.tl-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.tl-era-ancient i { background: var(--crail-deep); }
.tl-era-historical i { background: var(--gold); }
.tl-era-internet i { background: var(--olive); }
.tl-track {
  display: flex; gap: 44px; overflow-x: auto; padding: 34px 6px 26px;
  scroll-snap-type: x proximity; scrollbar-color: var(--line-strong) transparent;
}
.tl-era { flex-shrink: 0; position: relative; }
.tl-era-label {
  position: sticky; left: 0; display: inline-block; font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft);
  border: 1px solid var(--line-strong); background: var(--bg); border-radius: 999px; padding: 5px 13px;
  margin-bottom: 26px; z-index: 2;
}
.tl-items { position: relative; display: flex; align-items: flex-start; gap: 26px; min-height: 150px; }
.tl-items::before { content: ""; position: absolute; left: 0; right: 0; top: 56px; height: 2px; background: var(--line-strong); border-radius: 2px; }
.tl-dot {
  position: relative; display: block; text-decoration: none; color: var(--ink);
  width: 64px; text-align: center; flex-shrink: 0; z-index: 1;
  margin-top: calc(56px - var(--d, 18px) / 2);
}
.tl-dot .dot {
  width: var(--d, 18px); height: var(--d, 18px); margin: 0 auto 10px;
  border-radius: 50%; border: 3px solid var(--bg);
  box-shadow: 0 0 0 1.5px currentColor; background: currentColor;
  transition: transform .15s;
}
.tl-dot:hover .dot { transform: scale(1.35); }
.tl-dot .yr { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; display: block; }
.tl-dot .nm { font-size: 11.5px; font-weight: 600; line-height: 1.25; display: block; margin-top: 2px; }
.tl-dot.era-ancient { color: var(--crail-deep); }
.tl-dot.era-historical { color: var(--gold); }
.tl-dot.era-internet { color: var(--olive); }
.tl-tip { position: absolute; z-index: 5; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; font-size: 13px; max-width: 250px; pointer-events: none; box-shadow: var(--shadow-lift); }
.tl-tip strong { display: block; font-family: var(--font-display); font-size: 15px; }
.tl-tip span { color: var(--dark-text); font-size: 12px; }

/* ---------- map ---------- */
.map-shell { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--dark); }
.map-shell canvas { display: block; width: 100%; height: auto; }
.map-tip {
  position: absolute; z-index: 5; background: var(--surface); color: var(--ink);
  padding: 10px 14px; border-radius: 10px; font-size: 13px; pointer-events: none;
  box-shadow: var(--shadow-lift); max-width: 240px; transform: translate(-50%, calc(-100% - 14px));
}
.map-tip strong { display: block; font-family: var(--font-display); font-size: 15px; }
.map-tip span { color: var(--ink-soft); font-size: 12px; }
.map-controls { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0 8px; align-items: center; }
.map-hint { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); margin-left: auto; }
.map-legend { display: flex; gap: 16px; flex-wrap: wrap; margin: 14px 0 6px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); }
.map-legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: -1px; }

/* ---------- about ---------- */
.prose { max-width: 68ch; }
.prose h2 { font-size: 28px; margin: 34px 0 10px; }
.prose h3 { font-size: 20px; margin: 24px 0 8px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.api-table { width: 100%; border-collapse: collapse; font-size: 14.5px; margin: 14px 0; }
.api-table th, .api-table td { text-align: left; padding: 10px 12px; border: 1px solid var(--line); }
.api-table th { background: var(--bg-soft); font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.api-table code { font-family: var(--font-mono); font-size: 13px; background: var(--bg-soft); padding: 2px 6px; border-radius: 5px; }

/* ---------- search overlay ---------- */
.search-overlay, .kbd-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(20, 20, 19, .45); backdrop-filter: blur(4px);
  display: flex; justify-content: center; align-items: flex-start; padding: 12vh 20px 20px;
}
.search-box {
  width: min(640px, 100%); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-lift); overflow: hidden;
}
.search-input-row { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.search-input-row .icon-search { color: var(--ink-faint); flex-shrink: 0; }
.search-input-row input { flex: 1; border: 0; outline: none; background: none; font: inherit; font-size: 19px; color: var(--ink); }
.search-results { max-height: 50vh; overflow-y: auto; padding: 10px; }
.search-result {
  display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 10px;
  text-decoration: none; color: var(--ink);
}
.search-result:hover, .search-result[aria-selected="true"] { background: var(--bg-soft); }
.search-result img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-deep); flex-shrink: 0; }
.search-result .sr-name { font-weight: 600; }
.search-result .sr-sub { font-size: 13px; color: var(--ink-soft); }
.search-empty { padding: 26px; text-align: center; color: var(--ink-soft); font-size: 15px; }
.kbd-box { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 24px 28px; width: min(420px, 100%); box-shadow: var(--shadow-lift); }
.kbd-box h3 { margin-bottom: 14px; }
.kbd-box ul { list-style: none; margin: 0; padding: 0; }
.kbd-box li { display: flex; align-items: center; gap: 12px; padding: 7px 0; font-size: 15px; }
.kbd-box li kbd { min-width: 52px; text-align: center; }

/* ---------- footer ---------- */
.site-footer { background: var(--dark); color: var(--dark-text); margin-top: 96px; }
.site-footer a { color: var(--bg); }
.site-footer a:hover { color: var(--crail); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; padding: 56px 24px 36px; }
.footer-brand .footer-mark { font-size: 32px; }
.footer-brand p { font-size: 14.5px; margin-top: 10px; max-width: 30ch; color: var(--dark-text); }
.footer-col h3 { color: var(--crail); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; font-family: var(--font-mono); font-weight: 500; margin-bottom: 14px; }
.footer-col a, .linklike { display: block; font-size: 14.5px; margin-bottom: 9px; text-decoration: none; }
.linklike { background: none; border: none; padding: 0; color: var(--bg); cursor: pointer; }
.linklike:hover { color: var(--crail); }
.footer-fact p { font-size: 14px; font-style: italic; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--dark-soft); padding: 18px 24px 26px; font-size: 12.5px; color: var(--dark-faint); }
.footer-bottom p { margin: 0; }
.footer-bottom a { color: var(--dark-text); }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px;
  font-size: 14.5px; font-weight: 600; z-index: 400; box-shadow: var(--shadow-lift);
  animation: toast-in .25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- skeleton ---------- */
.skeleton { background: linear-gradient(100deg, var(--bg-soft) 40%, var(--bg-deep) 50%, var(--bg-soft) 60%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- misc ---------- */
.icon-search { width: 16px; height: 16px; display: inline-block; position: relative; flex-shrink: 0; }
.icon-search::before { content: ""; position: absolute; inset: 1px; border: 2px solid currentColor; border-radius: 50%; }
.icon-search::after { content: ""; position: absolute; width: 2px; height: 6px; background: currentColor; transform: rotate(-45deg); right: 1px; bottom: -2px; border-radius: 1px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fade-in { animation: fadeUp .45s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.spin { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .cat-hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .cat-portrait { max-width: 460px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .main-nav { display: none; }
  .nav-burger { display: block; margin-left: auto; }
  .header-actions .search-btn-label { display: none; }
  .header-actions { margin-left: 0; }
}
@media (max-width: 620px) {
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .hero { padding-top: 48px; }
  .stat { min-width: 110px; padding-right: 16px; }
  .stat + .stat { padding-left: 16px; }
  .brand-tag { display: none; }
  .surprise-btn { display: none; } /* surprise lives in the mobile menu + hero + footer */
  .header-search-btn { padding: 10px 14px; }
  .header-search-btn kbd { display: none; }
  .header-inner { gap: 12px; }
  .brand-word { font-size: 20px; }
  .section-head h2 { font-size: 30px; }
  .tl-track { gap: 26px; }
  .starburst { right: -40px; top: 10px; width: 150px; height: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .ticker-track { animation: none; }
}
