/* ============================================================
   EPSTEIN DROPS — Stylesheet
   Light theme, institutional credibility, zero dependencies
   ============================================================ */

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

:root {
  --bg: #fafaf8;
  --bg-card: #ffffff;
  --bg-code: #f0f0ee;
  --text: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #595959;
  --accent: #1a5f8a;
  --accent-hover: #134a6b;
  --border: #d4d4d0;
  --border-light: #e8e8e4;
  --border-doc: #b0b0aa;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-doc: 0 2px 8px rgba(0,0,0,0.10);
  --font-serif: Georgia, 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  --max-width: 820px;
  --max-width-wide: 1080px;
}

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
a:hover {
  border-bottom-color: var(--accent);
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: rgba(26, 95, 138, 0.15);
}

/* --- Skip Link (accessibility) --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
  font-size: 0.85rem;
  border-radius: 0 0 4px 4px;
  border: none;
}
.skip-link:focus {
  top: 0;
}

/* --- Layout --- */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
  background: var(--bg);
}

.site-header-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.site-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.site-title a {
  color: inherit;
  border: none;
}

.site-nav {
  display: flex;
  gap: 1.75rem;
}
.site-nav a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.site-nav a:hover {
  color: var(--text);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.container-wide {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 2rem;
}

/* --- Landing Page --- */
.hero {
  padding: 4rem 0 1.5rem;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  max-width: 680px;
  margin: 0 auto 1rem;
  letter-spacing: -0.02em;
}

.hero .subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

.stats-bar {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  padding: 1.5rem 0;
  margin: 2rem 0 2.5rem;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.stat {
  text-align: center;
}
.stat-number {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  display: block;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.15rem;
  display: block;
}

/* --- Finding Cards (The Wall) --- */
.findings-grid {
  display: grid;
  gap: 1.25rem;
  padding-bottom: 4rem;
}

.finding-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--border);
  border-radius: 4px;
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
  display: block;
  color: inherit;
}
.finding-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-color: var(--border);
  transform: translateY(-1px);
}
.finding-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.finding-card.featured {
  border-left: 3px solid var(--accent);
}

.card-headline {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.6rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.card-summary {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 0.85rem;
}

.card-meta {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-meta .date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.card-meta .source-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: var(--bg-code);
  padding: 0.15rem 0.45rem;
  border-radius: 2px;
}

.card-meta .doc-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.card-read {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Finding Page --- */
.finding-header {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 2.5rem;
}

.finding-header .back-link {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
  display: inline-block;
}

.finding-header h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.finding-header .finding-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.finding-body {
  padding-bottom: 4rem;
}

.finding-body h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text);
}

.finding-body p {
  margin-bottom: 1.15rem;
}

.finding-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  background: var(--bg-code);
  font-style: italic;
  color: var(--text-secondary);
  border-radius: 0 3px 3px 0;
}

.finding-body blockquote p {
  margin-bottom: 0.5rem;
}
.finding-body blockquote p:last-child {
  margin-bottom: 0;
}

/* --- Document Proof Images --- */
.doc-proof {
  margin: 2rem 0;
  border: 1px solid var(--border-doc);
  border-radius: 3px;
  box-shadow: var(--shadow-doc);
  overflow: hidden;
  background: #fff;
}

.doc-proof img {
  width: 100%;
  display: block;
}

.doc-proof-caption {
  padding: 0.5rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg-code);
  border-top: 1px solid var(--border-light);
}

/* --- Source Download --- */
.source-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.source-block h3 {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.source-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  font-size: 0.85rem;
}
.source-row + .source-row {
  border-top: 1px solid var(--border-light);
}

.source-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.source-value {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  word-break: break-all;
}

.download-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.65rem 1.5rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 3px;
  border: none;
  border-bottom: none;
  transition: background 0.15s;
  cursor: pointer;
}
.download-btn:hover {
  background: var(--accent-hover);
  border-bottom: none;
  color: #fff;
}

/* --- Hash Display --- */
.hash-display {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg-code);
  padding: 0.5rem 0.75rem;
  border-radius: 3px;
  word-break: break-all;
  margin-top: 0.5rem;
  display: block;
}

/* --- /how page --- */
.method-body h2 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  color: var(--text);
}

.method-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.75rem 0 0.75rem;
}

.method-body p {
  margin-bottom: 1.15rem;
}

.method-body ul, .method-body ol {
  margin: 0.75rem 0 1.25rem 1.25rem;
}
.method-body li {
  margin-bottom: 0.4rem;
}

.method-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}
.method-stat {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  text-align: center;
}
.method-stat .num {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  display: block;
  color: var(--text);
}
.method-stat .label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.2rem;
  display: block;
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 2rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.site-footer p {
  margin-bottom: 0.3rem;
}

.site-footer .license {
  font-size: 0.7rem;
}

/* --- Placeholder state --- */
.placeholder-content {
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  border: 2px dashed var(--border-light);
  border-radius: 4px;
  margin: 2rem 0;
}

/* --- Tables --- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.88rem;
}
th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--border);
}
td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

/* --- Key Findings Summary Box --- */
.findings-summary {
  background: #f7f5f0;
  border-left: 4px solid var(--accent);
  padding: 1.25rem 1.5rem;
  margin: 0 0 2.5rem;
  border-radius: 0 4px 4px 0;
}
.findings-summary h3 {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.findings-summary ul {
  margin: 0;
  padding-left: 1.15rem;
}
.findings-summary li {
  margin-bottom: 0.35rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text);
}

/* --- Figure (proof images with numbering) --- */
.doc-proof-figure {
  margin: 2rem 0;
}
.doc-proof-figure .doc-proof {
  margin: 0;
}
.doc-proof-figure figcaption {
  padding: 0.5rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg-code);
  border: 1px solid var(--border-doc);
  border-top: none;
  border-radius: 0 0 3px 3px;
}
.doc-proof-figure figcaption strong {
  color: var(--text-secondary);
}

/* --- Citation Block --- */
.citation-block {
  background: var(--bg-code);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  margin: 2.5rem 0 1rem;
}
.citation-block h3 {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.citation-block pre {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  margin: 0;
}

/* --- Print Stylesheet --- */
@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  .site-header, .site-footer, .site-nav, .card-read, .skip-link,
  .download-btn { display: none; }
  .finding-card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .stats-bar { border: 1px solid #ccc; }
  a { color: #000; border: none; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #555; }
  .hero { padding: 1rem 0; }
  .doc-proof { box-shadow: none; border: 1px solid #999; }
  .source-block { border: 1px solid #ccc; }
  .citation-block { border: 1px solid #ccc; background: #f5f5f5; }
}

/* --- Responsive --- */
@media (max-width: 768px) {
  html { font-size: 16px; }

  .site-header-inner {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0 1.25rem;
  }

  .container, .container-wide {
    padding: 0 1.25rem;
  }

  .hero { padding: 2.5rem 0 1.5rem; }
  .hero h1 { font-size: 1.4rem; }

  .stats-bar {
    flex-wrap: wrap;
    gap: 1.5rem;
  }

  .finding-card { padding: 1.25rem 1.5rem; }
  .card-headline { font-size: 1.15rem; }

  .finding-header h1 { font-size: 1.5rem; }

  .source-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  .card-meta {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .download-btn {
    width: 100%;
    text-align: center;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .site-nav { gap: 1rem; }
  .stats-bar { gap: 1rem; }
}
