/* Proof of Intelligence — inherits Hyperspace academic aesthetic */

:root {
  --bg: #fafaf8;
  --fg: #1a1a1a;
  --surface: #f5f5f0;
  --surface-raised: #ffffff;
  --surface-hover: #f0f0eb;
  --card-bg: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #555555;
  --text-muted: #888888;
  --teal: #00ccbc;
  --border-divider: transparent;
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 6px 24px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.18), 0 4px 14px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.22), 0 8px 20px rgba(0,0,0,0.12);
  --font-serif: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --font-mono: "JetBrains Mono", "Fira Code", "SF Mono", monospace;
  --font-chalk: "Caveat", "Virgil", "Segoe Print", cursive;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
::selection { background: rgba(0,0,0,0.1); color: var(--text-primary); }

body {
  background: var(--bg);
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--text-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 960px; margin: 0 auto; padding: 0 32px; }

/* ── Header ─────────────────────────────────── */
.header {
  height: 56px; background: var(--bg); display: flex; align-items: center;
  border-bottom: 1px solid var(--border-divider);
}
.header .container { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.logo { font-family: var(--font-serif); font-size: 17px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.04em; }
.logo:hover { text-decoration: none; }
.logo .logo-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); margin-left: 6px; vertical-align: middle; position: relative; top: -1px; }
.nav { display: flex; align-items: center; gap: 24px; }
.nav a { font-family: var(--font-serif); font-size: 13px; font-weight: 400; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); }
.nav a:hover { color: var(--text-primary); text-decoration: none; }

/* ── Hero ────────────────────────────────────── */
.hero { padding: 60px 0 48px; }
.section-label {
  display: block; font-family: var(--font-serif); font-size: 11px; font-weight: 400;
  text-transform: uppercase; letter-spacing: 2px; color: var(--text-muted); margin-bottom: 16px;
}
.hero h1 { font-family: var(--font-serif); font-size: 42px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; color: var(--text-primary); margin-bottom: 12px; }
.hero-subtitle { font-family: var(--font-serif); font-size: 18px; font-style: italic; color: var(--text-secondary); margin-bottom: 8px; }
.hero-desc { font-family: var(--font-serif); font-size: 15px; color: var(--text-secondary); line-height: 1.7; max-width: 640px; margin-bottom: 32px; }
.hero-stats { display: flex; gap: 40px; flex-wrap: wrap; margin-bottom: 32px; }
.stat { display: flex; flex-direction: column; }
.stat-value { font-family: var(--font-mono); font-size: 20px; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.stat-label { font-family: var(--font-serif); font-size: 10px; font-weight: 400; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); margin-top: 4px; }

.hero-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 40px; }
.btn-primary {
  font-family: var(--font-serif); font-size: 14px; font-weight: 600;
  color: #fff; background: var(--text-primary); padding: 10px 24px;
  border-radius: 3px; border: none; cursor: pointer; text-decoration: none;
  display: inline-block;
}
.btn-primary:hover { background: #333; text-decoration: none; }
.btn-ghost {
  font-family: var(--font-serif); font-size: 14px; font-weight: 600;
  color: var(--text-primary); background: transparent; padding: 10px 24px;
  border-radius: 3px; border: 1px solid var(--text-primary); cursor: pointer; text-decoration: none;
  display: inline-block;
}
.btn-ghost:hover { background: var(--text-primary); color: #fff; text-decoration: none; }

/* ── Install block ───────────────────────────── */
.install-block {
  background: #0a0d14; border-radius: 8px; overflow: hidden;
  box-shadow: var(--shadow-lg); margin-bottom: 8px;
}
.install-header {
  display: flex; align-items: center; gap: 6px; padding: 10px 16px;
  background: #161b22; border-bottom: 1px solid #21262d;
}
.install-dot { width: 12px; height: 12px; border-radius: 50%; }
.install-dot:nth-child(1) { background: #ff5f56; }
.install-dot:nth-child(2) { background: #ffbd2e; }
.install-dot:nth-child(3) { background: #27c93f; }
.install-label { font-family: var(--font-mono); font-size: 12px; color: #8b949e; margin-left: auto; }
.install-body { padding: 16px 20px; }
.install-body code {
  font-family: var(--font-mono); font-size: 14px; color: #e1e4e8;
  background: none; padding: 0; border: none;
}
.install-body .comment { color: #6a737d; }
.install-body .cmd { color: #79c0ff; }
.install-body .flag { color: #ff7b72; }
.install-body .arg { color: #a5d6ff; }
.install-note { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.install-placeholder {
  background: rgba(255,123,114,0.08); border: 1px dashed rgba(255,123,114,0.3);
  border-radius: 4px; padding: 8px 12px; margin-top: 8px;
  font-family: var(--font-mono); font-size: 11px; color: #ff7b72;
}

/* ── Paper snapshot (bitcoin.org style) ──────── */
.paper-snapshot {
  display: flex; gap: 32px; align-items: flex-start; flex-wrap: wrap;
}
.paper-card {
  flex: 0 0 280px; background: #fff; border-radius: 2px; padding: 32px 24px;
  box-shadow: var(--shadow-md); font-family: var(--font-serif);
  border: 1px solid rgba(0,0,0,0.06);
  transform: rotate(-0.5deg);
}
.paper-card .paper-title {
  font-size: 16px; font-weight: 700; color: var(--text-primary);
  text-align: center; margin-bottom: 16px; line-height: 1.3;
}
.paper-card .paper-authors {
  font-size: 11px; color: var(--text-muted); text-align: center; margin-bottom: 16px;
}
.paper-card .paper-date {
  font-size: 10px; color: var(--text-muted); text-align: center; margin-bottom: 16px;
  text-transform: uppercase; letter-spacing: 1px;
}
.paper-card .paper-abstract {
  font-size: 10px; color: var(--text-secondary); line-height: 1.5;
  border-top: 1px solid rgba(0,0,0,0.08); padding-top: 12px;
}
.paper-card .paper-abstract strong { font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; }
.paper-info { flex: 1; min-width: 280px; }
.paper-info h3 { font-family: var(--font-serif); font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.paper-info p { font-size: 14px; margin-bottom: 12px; }
.paper-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

/* ── Sections ────────────────────────────────── */
.section { padding: 60px 0; border-top: 1px solid var(--border-divider); }
.section h2 { font-family: var(--font-serif); font-size: 24px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.01em; margin-bottom: 12px; }
.section h3 { font-family: var(--font-serif); font-size: 18px; font-weight: 700; color: #333; margin-bottom: 8px; margin-top: 24px; }
.section p { margin-bottom: 16px; max-width: 720px; }

/* ── Chalk diagrams (Excalidraw style) ───────── */
.chalk {
  background: #000; border-radius: 8px; overflow: hidden;
  box-shadow: var(--shadow-md); margin: 24px 0; padding: 32px 24px;
  font-family: var(--font-chalk); color: rgba(255,255,255,0.9);
  position: relative;
}
.chalk-title {
  font-size: 22px; text-align: center; margin-bottom: 24px;
  color: rgba(255,255,255,0.7); font-weight: 700;
}
.chalk-row {
  display: flex; gap: 16px; align-items: stretch; justify-content: center;
  flex-wrap: wrap;
}
.chalk-box {
  border: 1.5px solid rgba(255,255,255,0.25); border-radius: 8px;
  padding: 16px 20px; text-align: center; flex: 1; min-width: 140px; max-width: 260px;
  position: relative;
}
.chalk-box.highlight { border-color: var(--teal); }
.chalk-box-label {
  font-size: 18px; font-weight: 700; margin-bottom: 6px;
  color: rgba(255,255,255,0.95);
}
.chalk-box-sub {
  font-size: 14px; color: rgba(255,255,255,0.55); line-height: 1.4;
}
.chalk-arrow {
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: rgba(255,255,255,0.3); flex-shrink: 0;
  min-width: 30px;
}
.chalk-arrow-down {
  text-align: center; font-size: 24px; color: rgba(255,255,255,0.3);
  padding: 8px 0;
}
.chalk-cols { display: flex; gap: 24px; flex-wrap: wrap; }
.chalk-col { flex: 1; min-width: 200px; }
.chalk-col h4 { font-size: 16px; color: rgba(255,255,255,0.7); margin-bottom: 8px; text-align: center; }
.chalk-item {
  border: 1px solid rgba(255,255,255,0.15); border-radius: 6px;
  padding: 8px 12px; margin-bottom: 6px; font-size: 14px;
  color: rgba(255,255,255,0.7);
}
.chalk-item.teal { border-color: rgba(0,204,188,0.4); color: rgba(0,204,188,0.9); }
.chalk-vs-row { display: flex; gap: 12px; align-items: stretch; justify-content: center; flex-wrap: wrap; }
.chalk-vs-card {
  flex: 1; min-width: 180px; max-width: 280px; border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 8px; padding: 16px; text-align: center;
}
.chalk-vs-card.poi { border-color: var(--teal); }
.chalk-vs-card h4 { font-size: 16px; font-weight: 700; margin-bottom: 6px; color: rgba(255,255,255,0.85); }
.chalk-vs-card .metric { font-size: 13px; color: rgba(255,255,255,0.5); margin-bottom: 4px; }
.chalk-vs-card .metric.teal { color: var(--teal); }
.chalk-flow {
  display: flex; gap: 4px; align-items: center; justify-content: center;
  flex-wrap: wrap; margin: 16px 0;
}
.chalk-flow-step {
  border: 1.5px solid rgba(255,255,255,0.25); border-radius: 8px;
  padding: 10px 14px; text-align: center; font-size: 14px;
  color: rgba(255,255,255,0.8); min-width: 100px;
}
.chalk-flow-arrow { font-size: 18px; color: rgba(255,255,255,0.3); }
.chalk-layer-stack { display: flex; flex-direction: column; gap: 4px; }
.chalk-layer {
  border: 1.5px solid rgba(255,255,255,0.2); border-radius: 6px;
  padding: 10px 16px; display: flex; justify-content: space-between;
  align-items: center; font-size: 14px;
}
.chalk-layer .l-name { color: rgba(255,255,255,0.85); font-weight: 700; }
.chalk-layer .l-desc { color: rgba(255,255,255,0.45); font-size: 13px; text-align: right; }
.chalk-layer.active { border-color: var(--teal); background: rgba(0,204,188,0.06); }

/* ── Validator gate diagram ──────────────────── */
.chalk-gate { display: flex; gap: 16px; align-items: center; justify-content: center; flex-wrap: wrap; }
.chalk-gate-input { display: flex; flex-direction: column; gap: 8px; }
.chalk-gate-box {
  border: 1.5px solid rgba(255,255,255,0.25); border-radius: 8px;
  padding: 12px 18px; font-size: 15px; color: rgba(255,255,255,0.8);
  text-align: center;
}
.chalk-gate-box.key { border-color: #ffa657; }
.chalk-gate-box.poi-cert { border-color: var(--teal); }
.chalk-gate-box.points { border-color: #d2a8ff; }
.chalk-gate-merge {
  border: 2px solid rgba(255,255,255,0.4); border-radius: 12px;
  padding: 14px 20px; font-size: 16px; font-weight: 700;
  color: rgba(255,255,255,0.9); text-align: center;
}
.chalk-gate-output {
  border: 1.5px solid var(--teal); border-radius: 8px;
  padding: 12px 18px; font-size: 15px; color: var(--teal);
  text-align: center; font-weight: 700;
}
.chalk-tag {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 4px;
  margin-top: 4px;
}
.chalk-tag.orange { background: rgba(255,166,87,0.15); color: #ffa657; }
.chalk-tag.teal { background: rgba(0,204,188,0.15); color: var(--teal); }
.chalk-tag.purple { background: rgba(210,168,255,0.15); color: #d2a8ff; }

/* ── Tables ──────────────────────────────────── */
.table-wrapper { overflow-x: auto; margin: 20px 0; }
table { width: 100%; border-collapse: collapse; font-family: var(--font-serif); }
thead th {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-primary);
  padding: 10px 12px; text-align: left; border-bottom: 2px solid var(--text-primary);
}
tbody td {
  font-size: 14px; color: var(--text-secondary); padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
tbody td code {
  font-family: var(--font-mono); font-size: 12px; background: #f0ede8;
  padding: 1px 5px; border-radius: 3px; color: #1a1a1a;
}
tbody tr:last-child td { border-bottom: none; }

/* ── Cards ───────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 24px 0; }
.card {
  background: var(--card-bg); border-radius: 8px; padding: 24px;
  box-shadow: var(--shadow-sm); transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: var(--shadow-md); }
.card h4 { font-family: var(--font-serif); font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.card p { font-size: 14px; color: var(--text-secondary); margin-bottom: 0; }
.card .card-stat {
  font-family: var(--font-mono); font-size: 24px; font-weight: 600;
  color: var(--text-primary); margin-bottom: 4px;
}

/* ── Blockquote ──────────────────────────────── */
blockquote {
  border-left: 3px solid var(--text-primary); background: var(--surface);
  padding: 16px 20px; margin: 20px 0; border-radius: 0 4px 4px 0;
}
blockquote p { font-size: 15px; font-style: italic; margin-bottom: 8px; }
blockquote cite { font-size: 13px; color: var(--text-muted); font-style: normal; }

/* ── Code blocks ─────────────────────────────── */
pre {
  background: #0a0d14; border: none; padding: 20px 24px; border-radius: 8px;
  overflow-x: auto; font-family: var(--font-mono); font-size: 13.5px;
  line-height: 1.6; color: #e1e4e8; margin: 20px 0;
}
pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
code {
  font-family: var(--font-mono); background: #f0ede8; border: none;
  padding: 2px 6px; border-radius: 3px; font-size: 13px; color: #1a1a1a;
}

/* ── Primitive list ──────────────────────────── */
.primitive-list { display: flex; flex-direction: column; gap: 0; margin-top: 24px; }
.primitive-row { display: flex; align-items: baseline; gap: 16px; padding: 14px 0; border-bottom: 1px solid rgba(0,0,0,0.06); }
.primitive-row:last-child { border-bottom: none; }
.pnum { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); flex-shrink: 0; width: 24px; }
.pname { font-family: var(--font-serif); font-size: 15px; font-weight: 700; color: var(--text-primary); flex-shrink: 0; width: 160px; }
.pdesc { font-family: var(--font-serif); font-size: 14px; color: var(--text-secondary); line-height: 1.5; }

/* ── Compare grid ────────────────────────────── */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0; }
.compare-box {
  background: var(--card-bg); border-radius: 8px; padding: 20px;
  box-shadow: var(--shadow-sm);
}
.compare-box h4 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.compare-box ul { list-style: none; padding: 0; }
.compare-box li { font-size: 14px; color: var(--text-secondary); padding: 4px 0; }
.compare-box li::before { content: "\2014\00a0"; color: var(--text-muted); }

/* ── Footer ──────────────────────────────────── */
.footer {
  padding: 40px 0; border-top: 1px solid var(--border-divider);
}
.footer .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-left { font-size: 13px; color: var(--text-muted); }
.footer-right { display: flex; gap: 20px; }
.footer-right a { font-size: 13px; color: var(--text-muted); }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 1024px) {
  .container { padding: 0 24px; }
  .hero h1 { font-size: 32px; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .header { height: 48px; }
  .hero h1 { font-size: 26px; }
  .hero-subtitle { font-size: 15px; }
  .hero-desc { font-size: 14px; }
  .hero-stats { gap: 20px; }
  .section h2 { font-size: 20px; }
  .stat-value { font-size: 16px; }
  pre { font-size: 12px; padding: 16px; }
  .chalk { padding: 20px 16px; }
  .chalk-row { flex-direction: column; align-items: center; }
  .chalk-arrow { transform: rotate(90deg); }
  .chalk-vs-row { flex-direction: column; align-items: center; }
  .chalk-flow { flex-direction: column; }
  .chalk-flow-arrow { transform: rotate(90deg); }
  .chalk-gate { flex-direction: column; align-items: center; }
  .chalk-cols { flex-direction: column; }
  .compare-grid { grid-template-columns: 1fr; }
  .paper-snapshot { flex-direction: column; align-items: center; }
  .paper-card { flex: none; width: 100%; max-width: 320px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn-primary, .btn-ghost { text-align: center; }
  .footer .container { flex-direction: column; text-align: center; }
  .primitive-row { flex-direction: column; gap: 4px; }
  .pname { width: auto; }
  .nav { display: none; }
  .chalk-layer { flex-direction: column; gap: 4px; text-align: center; }
  .chalk-layer .l-desc { text-align: center; }
}
