/* ── DarkArchive — main.css ─────────────────────────────────────────────────
   Palette: #0f1117 bg / #1a1f2e cards / #f59e0b amber accent / #e2e8f0 text
   Typography: Libre Baskerville (headings) + Inter (body)
   Dark-mode only by design.
   ──────────────────────────────────────────────────────────────────────────── */

:root {
  --bg:           #0f1117;
  --surface:      #1a1f2e;
  --surface-2:    #212840;
  --border:       #2a3150;
  --accent:       #f59e0b;
  --accent-dim:   #b45309;
  --text:         #e2e8f0;
  --text-muted:   #94a3b8;
  --text-subtle:  #64748b;
  --seized:       #ef4444;
  --seized-bg:    rgba(239, 68, 68, 0.12);
  --exit-scam:    #f97316;
  --exit-scam-bg: rgba(249, 115, 22, 0.12);
  --shutdown:     #64748b;
  --shutdown-bg:  rgba(100, 116, 139, 0.15);
  --radius:       6px;
  --radius-lg:    10px;
  --shadow:       0 2px 12px rgba(0, 0, 0, 0.45);
  --font-serif:   'Libre Baskerville', Georgia, 'Times New Roman', serif;
  --font-sans:    'Inter', system-ui, -apple-system, sans-serif;
  --max-w:        1140px;
  --transition:   0.18s ease;
}

/* ── Reset & Base ─────────────────────────────────────────────────────────── */

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #fbbf24; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

img { max-width: 100%; display: block; }

ul, ol { padding-left: 1.5rem; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

/* ── Layout ───────────────────────────────────────────────────────────────── */

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

main { min-height: calc(100vh - 220px); }

/* ── Header ───────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 17, 23, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 24px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.site-logo:hover { color: var(--text); }
.logo-icon {
  color: var(--accent);
  font-size: 1.2rem;
  line-height: 1;
}
.logo-text strong { color: var(--accent); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
}
.nav-link:hover { color: var(--text); background: var(--surface); }
.nav-link.active { color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(26, 31, 46, 0.5) 0%, transparent 100%);
}

.hero-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--text);
  max-width: 700px;
  margin-bottom: 16px;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 620px;
  margin-bottom: 36px;
}

.hero-stats {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
}
.stat-num {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-subtle);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Section headers ──────────────────────────────────────────────────────── */

.markets-section { padding: 56px 0; }

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

.section-header h2 {
  font-size: 1.5rem;
  font-family: var(--font-serif);
}

.page-header {
  padding: 48px 0 36px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.page-header h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: 12px; }

.page-lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 680px;
  margin-bottom: 12px;
}

.page-count {
  font-size: 0.8rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Filter bar ───────────────────────────────────────────────────────────── */

.filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-sans);
  padding: 5px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--accent); color: var(--text); }
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0f1117;
  font-weight: 600;
}

/* ── Market grid ──────────────────────────────────────────────────────────── */

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

.market-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.market-card:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.08);
  transform: translateY(-2px);
}

.card-header { display: flex; flex-direction: column; gap: 6px; }

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.card-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
}
.card-name a { color: var(--text); }
.card-name a:hover { color: var(--accent); }

.card-meta {
  font-size: 0.8rem;
  color: var(--text-subtle);
  display: flex;
  gap: 6px;
}
.card-sep { opacity: 0.4; }

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.card-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.tag {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-subtle);
  background: rgba(100, 116, 139, 0.12);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 3px;
  font-family: var(--font-sans);
}

.card-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}
.card-link:hover { color: #fbbf24; }

/* ── Status badges ────────────────────────────────────────────────────────── */

.status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-sans);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-seized {
  background: var(--seized-bg);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.status-exit_scam {
  background: var(--exit-scam-bg);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.3);
}
.status-shutdown {
  background: var(--shutdown-bg);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}
.status-lg { font-size: 0.8rem; padding: 5px 14px; }

/* ── Market detail page ───────────────────────────────────────────────────── */

.market-detail { padding: 40px 0; }

.detail-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.detail-name {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-family: var(--font-serif);
}

.detail-years { color: var(--text-subtle); font-size: 0.9rem; }

.detail-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.fact {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fact dt {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-subtle);
  font-family: var(--font-sans);
}
.fact dd {
  font-size: 0.925rem;
  color: var(--text);
  font-family: var(--font-sans);
}

.detail-body { max-width: 760px; }

.detail-body h2 {
  font-size: 1.35rem;
  margin: 32px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.detail-body h2:first-child { margin-top: 0; }

.detail-text {
  color: var(--text-muted);
  font-size: 0.975rem;
  line-height: 1.75;
}

.lessons-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lessons-list li {
  display: flex;
  gap: 12px;
  font-size: 0.925rem;
  color: var(--text-muted);
  padding: 12px 16px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.lessons-list li::before {
  content: "▸";
  color: var(--accent);
  flex-shrink: 0;
  font-size: 0.85rem;
  margin-top: 1px;
}

.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 28px; }

.back-link {
  margin: 40px 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
}
.back-link a { color: var(--text-muted); }
.back-link a:hover { color: var(--accent); }

/* ── Timeline ─────────────────────────────────────────────────────────────── */

.timeline {
  padding: 16px 0 56px;
  position: relative;
}

.tl-item {
  display: grid;
  grid-template-columns: 20px 2px 1fr;
  gap: 0 20px;
  margin-bottom: 40px;
  position: relative;
}

.tl-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  margin-top: 5px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  align-self: start;
  justify-self: center;
}
.tl-dot-seized     { background: var(--seized); box-shadow: 0 0 0 3px var(--seized-bg); }
.tl-dot-exit_scam  { background: var(--exit-scam); box-shadow: 0 0 0 3px var(--exit-scam-bg); }
.tl-dot-shutdown   { background: var(--shutdown); box-shadow: 0 0 0 3px var(--shutdown-bg); }

.tl-connector {
  width: 2px;
  background: var(--border);
  align-self: stretch;
  justify-self: center;
  margin-top: 14px;
}
.tl-item:last-child .tl-connector { display: none; }

.tl-content {
  padding-bottom: 8px;
}

.tl-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.tl-year {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}

.tl-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
}
.tl-name a { color: var(--text); }
.tl-name a:hover { color: var(--accent); }

.tl-meta {
  font-size: 0.8rem;
  color: var(--text-subtle);
  margin-bottom: 8px;
}

.tl-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 680px;
  line-height: 1.65;
  margin-bottom: 10px;
}

.tl-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}

/* ── Breadcrumb ───────────────────────────────────────────────────────────── */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-subtle);
  padding: 20px 0 0;
}
.breadcrumb a { color: var(--text-subtle); }
.breadcrumb a:hover { color: var(--accent); }
.bc-sep { opacity: 0.4; }

/* ── Prose (about page) ───────────────────────────────────────────────────── */

.prose {
  max-width: 720px;
  padding-bottom: 64px;
}
.prose h2 {
  font-size: 1.3rem;
  margin: 32px 0 12px;
}
.prose p {
  color: var(--text-muted);
  font-size: 0.975rem;
  line-height: 1.75;
  margin-bottom: 16px;
}
.prose ul {
  color: var(--text-muted);
  font-size: 0.975rem;
  line-height: 1.75;
  margin-bottom: 16px;
}
.prose ul li { margin-bottom: 6px; }
.prose strong { color: var(--text); }

.about-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn-primary, .btn-outline {
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: var(--radius);
  transition: all var(--transition);
  font-family: var(--font-sans);
}
.btn-primary {
  background: var(--accent);
  color: #0f1117;
  border: 1px solid var(--accent);
}
.btn-primary:hover { background: #fbbf24; color: #0f1117; border-color: #fbbf24; }
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
}
.btn-outline:hover { background: rgba(245, 158, 11, 0.08); color: var(--accent); }

/* ── 404 page ─────────────────────────────────────────────────────────────── */

.error-page {
  text-align: center;
  padding: 100px 0;
}
.error-code {
  font-family: var(--font-serif);
  font-size: 6rem;
  font-weight: 700;
  color: var(--border);
  line-height: 1;
  margin-bottom: 16px;
}
.error-title { font-size: 2rem; margin-bottom: 12px; }
.error-desc {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 400px;
  margin: 0 auto 32px;
}
.error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 40px;
  background: var(--surface);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer-tagline {
  font-size: 0.8rem;
  color: var(--text-subtle);
  margin-top: 4px;
}
.footer-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.footer-nav a {
  font-size: 0.82rem;
  color: var(--text-subtle);
}
.footer-nav a:hover { color: var(--accent); }
.footer-legal {
  grid-column: 1 / -1;
  font-size: 0.78rem;
  color: var(--text-subtle);
  max-width: 700px;
  line-height: 1.6;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ── Hidden cards (filter) ────────────────────────────────────────────────── */

.market-card.hidden {
  display: none;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 16px;
    gap: 2px;
  }
  .site-nav.open { display: flex; }
  .nav-toggle { display: flex; }

  .hero { padding: 48px 0 36px; }
  .hero-stats { gap: 24px; }

  .markets-grid { grid-template-columns: 1fr; }

  .section-header { flex-direction: column; align-items: flex-start; }

  .detail-title-row { flex-direction: column; }
  .detail-facts { grid-template-columns: 1fr 1fr; }

  .footer-inner { grid-template-columns: 1fr; }
  .footer-nav { margin-top: 8px; }

  .tl-item { grid-template-columns: 14px 2px 1fr; gap: 0 14px; }

  .card-footer { flex-direction: column; align-items: flex-start; }

  .hero-stats { gap: 20px; }
  .stat-num { font-size: 1.6rem; }
}

@media (max-width: 480px) {
  .filter-bar { gap: 4px; }
  .filter-btn { padding: 4px 10px; font-size: 0.75rem; }
  .markets-grid { gap: 14px; }
  .market-card { padding: 18px; }
  .detail-facts { grid-template-columns: 1fr; }
}

/* ── Utility ──────────────────────────────────────────────────────────────── */

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