/* ============================================================
   VAN ORDEN FACTS — design tokens
   Palette: ink navy / paper / evidence-red / badger gold / slate
   Type: Spectral (display serif) + Source Sans 3 (body) + IBM Plex Mono (citations)
   Signature element: numbered "exhibit" cards with a citation stamp
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500;600;700;800;900&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --ink: #16233a;
  --ink-soft: #263b5c;
  --paper: #f9f8f4;
  --card: #ffffff;
  --red: #a32638;
  --red-deep: #7e1c2b;
  --gold: #c9a227;
  --slate: #45505e;
  --line: #dad4c4;
  --line-soft: #e7e2d3;

  --font-display: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --radius: 3px;
  --max-width: 700px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(22,35,58,0.05) 1px, transparent 0);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--red-deep); }
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* ---------- Masthead ---------- */

.masthead {
  background: var(--ink);
  color: var(--paper);
  border-bottom: 6px solid var(--gold);
}

.masthead-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px 24px 44px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.eyebrow::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(163,38,56,0.35);
}

.masthead h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  line-height: 0.98;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}

.masthead h1 em {
  font-style: italic;
  font-weight: 500;
  color: rgba(241,238,228,0.6);
  font-size: 0.5em;
  display: block;
  margin-top: 6px;
}

.masthead p.dek {
  max-width: 58ch;
  font-size: 1.15rem;
  color: rgba(241,238,228,0.82);
  margin: 0 0 28px;
}

.masthead-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(241,238,228,0.18);
}

.stat .num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.9rem;
  color: var(--paper);
  display: block;
}

.stat .label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(241,238,228,0.55);
}

/* ---------- Sticky category nav ---------- */

.catnav-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(241,238,228,0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.catnav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.catnav::-webkit-scrollbar { display: none; }

.catnav a {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 16px 14px;
  border-bottom: 4px solid transparent;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.catnav a:hover { color: var(--red-deep); background: rgba(163,38,56,0.06); }

.catnav a.active {
  color: var(--red-deep);
  border-bottom-color: var(--red);
  font-weight: 700;
}

/* ---------- Main content ---------- */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 80px;
}

.intro-note {
  font-size: 0.98rem;
  color: var(--slate);
  border-left: 3px solid var(--gold);
  padding: 14px 18px;
  margin: 44px 0 8px;
  background: rgba(201,162,39,0.08);
}

.intro-note strong { color: var(--ink); }

section.category {
  scroll-margin-top: 58px;
  padding-top: 44px;
}

.category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--ink);
  border-left: 8px solid var(--gold);
  padding: 22px 28px;
  margin: 0 0 18px;
  border-radius: var(--radius);
}

.category-head h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--paper);
  text-transform: uppercase;
}

.category-head .count {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  color: var(--paper);
  background: var(--red);
  padding: 6px 14px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.category-dek {
  color: var(--slate);
  max-width: 62ch;
  margin: 0 0 28px;
  padding: 0 28px;
  font-size: 1.05rem;
}

/* ---------- Exhibit cards ---------- */

.exhibit {
  position: relative;
  scroll-margin-top: 66px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 104px 28px 22px;
  margin-bottom: 18px;
  box-shadow: 0 1px 0 rgba(22,35,58,0.03);
}

.exhibit-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--slate);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.exhibit-tag .id { color: var(--red-deep); font-weight: 600; }

.exhibit h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.74rem;
  line-height: 1.24;
  margin: 0 0 10px;
  color: var(--ink);
}

.exhibit p {
  margin: 0 0 16px;
  color: #2c3549;
}

.exhibit p:last-of-type { margin-bottom: 0; }

.exhibit blockquote {
  margin: 0 0 16px;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--red);
  font-style: italic;
  color: var(--ink-soft);
}

.citation {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.citation .stamp {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--card);
  background: var(--ink);
  padding: 3px 7px;
  border-radius: 2px;
  flex: 0 0 auto;
  transform: rotate(-1.5deg);
  margin-top: 1px;
}

.citation .source-text {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--slate);
  line-height: 1.5;
}

.citation .source-text a {
  color: var(--red-deep);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(163,38,56,0.4);
  text-underline-offset: 2px;
}
.citation .source-text a:hover {
  color: var(--red);
  text-decoration-color: var(--red);
}

.card-actions {
  position: absolute;
  top: 20px;
  right: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.action-row,
.share-row {
  display: flex;
  gap: 8px;
}

.copy-link,
.copy-photo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--slate);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 6px 11px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-link::before {
  content: '\1F517'; /* link emoji as a lightweight icon */
  font-size: 10px;
}

.copy-photo::before {
  content: '\1F5BC'; /* framed picture icon */
  font-size: 10px;
}

.copy-link:hover,
.copy-photo:hover {
  border-color: var(--red);
  color: var(--red-deep);
  background: rgba(163,38,56,0.06);
}

.copy-link.copied,
.copy-photo.copied {
  background: var(--red);
  border-color: var(--red);
  color: var(--card);
}

.copy-link.copied::before {
  content: '\2713'; /* checkmark once copied */
}

.copy-photo.copied::before {
  content: '\2713';
}

.share-btn {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--slate);
  font-family: var(--font-sans, var(--font-body));
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}

.share-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: rgba(22,35,58,0.06);
  transform: translateY(-1px);
}

/* context / caveat callouts inside a category */
.caveat {
  font-size: 0.92rem;
  color: var(--slate);
  background: rgba(91,100,114,0.07);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 4px 0 30px;
}

.caveat strong { color: var(--ink); }

/* ---------- Footer ---------- */

footer {
  background: var(--ink);
  color: rgba(241,238,228,0.7);
  margin-top: 70px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 46px 24px 40px;
}

footer h4 {
  font-family: var(--font-display);
  color: var(--paper);
  font-size: 1.2rem;
  margin: 0 0 10px;
}

footer p {
  font-size: 0.92rem;
  max-width: 62ch;
  line-height: 1.6;
}

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

.footer-meta {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(241,238,228,0.15);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(241,238,228,0.45);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Responsive ---------- */

@media (max-width: 600px) {
  .masthead-inner { padding: 40px 18px 32px; }
  main { padding: 0 18px 60px; }
  .exhibit { padding: 20px 18px 18px; }
  .card-actions { position: static; margin-bottom: 12px; align-items: flex-start; }
  .action-row, .share-row { flex-wrap: wrap; }
  .exhibit-tag { flex-wrap: wrap; row-gap: 8px; }
  .category-head h2 { font-size: 1.7rem; }
}
