@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,700;0,9..144,900;1,9..144,400&display=swap');

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

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-2: #1c1c1c;
  --border: #2a2a2a;
  --text: #e8e4de;
  --text-dim: #8a8680;
  --accent: #f0c040;
  --accent-dim: #f0c04020;
  --red: #e05040;
  --green: #40c870;
  --blue: #4090f0;
  --purple: #a070f0;
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Nav ── */
.site-nav {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-nav .logo {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
  text-decoration: none;
}
.site-nav .logo span { color: var(--accent); }
.breadcrumb {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--text-dim);
}
.breadcrumb a {
  color: var(--text-dim);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { margin: 0 8px; opacity: 0.4; }

/* ── Header ── */
header {
  padding: 80px 0 60px;
  border-bottom: 1px solid var(--border);
}
header p.meta {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 20px;
}
header h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}
header h1 span { color: var(--accent); }
header .subtitle {
  font-size: 19px;
  color: var(--text-dim);
  max-width: 600px;
  line-height: 1.6;
}

/* ── Sections ── */
section { padding: 64px 0; border-bottom: 1px solid var(--border); }
section:last-child { border-bottom: none; }

h2 {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}
h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  margin-top: 32px;
}
p { margin-bottom: 16px; }
p:last-child { margin-bottom: 0; }

strong { color: var(--accent); font-weight: 500; }

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

/* ── Flow diagrams ── */
.flow {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  margin: 32px 0;
  overflow-x: auto;
}
.flow-title {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 24px;
}

.pipeline {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.pipeline-stage {
  flex: 1;
  position: relative;
  padding: 20px;
  min-width: 200px;
}
.pipeline-stage::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 10px solid var(--border);
}
.pipeline-stage:last-child::after { display: none; }

.stage-num {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.stage-name {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}
.stage-desc {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ── Problem cards ── */
.problem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin: 32px 0;
}
@media (max-width: 640px) {
  .problem-grid { grid-template-columns: 1fr; }
  .pipeline { flex-direction: column; }
  .pipeline-stage::after {
    right: 50%;
    top: auto;
    bottom: 0;
    transform: translateX(50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--border);
  }
}
.problem-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}
.problem-card h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--red);
}
.problem-card p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ── Synthesis phases ── */
.phases { margin: 32px 0; }
.phase-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 4px;
}
.phase-num {
  width: 36px;
  height: 36px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  flex-shrink: 0;
}
.phase-num.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.phase-content { padding: 6px 0 20px; }
.phase-content h4 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.phase-content p { font-size: 14px; color: var(--text-dim); line-height: 1.5; margin: 0; }
.phase-content .gate {
  display: inline-block;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--red);
  background: #e0504010;
  border: 1px solid #e0504030;
  border-radius: 4px;
  padding: 2px 8px;
  margin-top: 6px;
}

/* ── Example cards ── */
.example {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 32px 0;
  overflow: hidden;
}
.example-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.example-tag {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 4px;
  flex-shrink: 0;
}
.tag-input { background: var(--blue); color: #000; }
.tag-output { background: var(--green); color: #000; }
.tag-insight { background: var(--accent); color: #000; }
.example-header h4 { font-size: 15px; font-weight: 500; }
.example-body { padding: 24px; }
.example-body .row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  margin-bottom: 16px;
  align-items: baseline;
}
.example-body .row:last-child { margin-bottom: 0; }
.example-body .label {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.example-body .value { font-size: 15px; line-height: 1.5; }
.example-body .value.small { font-size: 13px; color: var(--text-dim); }
.example-body .insight-box {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
}
.example-body .insight-box p { font-size: 14px; line-height: 1.6; margin: 0; }
.example-body .insight-box .label { color: var(--accent); margin-bottom: 6px; display: block; }

/* ── Comparison table ── */
.compare {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}
.compare th {
  text-align: left;
  padding: 10px 14px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.compare td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}
.compare tr:last-child td { border-bottom: none; }
.compare .bad { color: var(--red); }
.compare .good { color: var(--green); }

/* ── Stats ── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 32px 0;
}
@media (max-width: 640px) { .stats { grid-template-columns: 1fr 1fr; } }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}
.stat .num {
  font-family: 'Fraunces', serif;
  font-size: 32px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}
.stat .desc { font-size: 12px; color: var(--text-dim); line-height: 1.3; }

/* ── Convergence map ── */
.convergence-mini {
  display: grid;
  grid-template-columns: 140px repeat(6, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 16px 0;
  font-size: 12px;
}
.convergence-mini .cell {
  background: var(--surface);
  padding: 8px 6px;
  text-align: center;
  line-height: 1.3;
}
.convergence-mini .cell.header {
  background: var(--surface-2);
  font-weight: 500;
  font-size: 11px;
  color: var(--text-dim);
}
.convergence-mini .cell.claim { text-align: left; font-weight: 500; font-size: 11px; }
.convergence-mini .agree { color: var(--green); }
.convergence-mini .contra { color: var(--red); }
.convergence-mini .silent { color: #444; }
.convergence-mini .qualify { color: var(--accent); }

/* ── Callout ── */
.callout {
  border-left: 3px solid var(--accent);
  padding: 16px 20px;
  margin: 24px 0;
  background: var(--surface);
  border-radius: 0 8px 8px 0;
}
.callout p { font-size: 15px; font-style: italic; margin: 0; }

/* ── Code ── */
code {
  font-family: 'DM Mono', monospace;
  font-size: 0.85em;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 3px;
}

/* ── Footer ── */
footer {
  padding: 48px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
}

/* ── Home: Post listing ── */
.home-header {
  padding: 80px 0 48px;
  border-bottom: 1px solid var(--border);
}
.home-header h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(32px, 4.5vw, 44px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.home-header h1 span { color: var(--accent); }
.home-header .tagline {
  font-size: 18px;
  color: var(--text-dim);
  max-width: 540px;
  line-height: 1.6;
}

.post-list { padding: 48px 0; }

.post-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 20px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.post-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}
.post-card .post-date {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.post-card .post-title {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
}
.post-card .post-desc {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.6;
}
.post-card .post-tags {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.post-card .tag {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
