/* ================================================================
   Inside CX Chain — Intelligence Report
   ================================================================ */

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-dim: #1f6feb;
  --green: #3fb950;
  --yellow: #d29922;
  --red: #f85149;
  --purple: #bc8cff;
  --orange: #f0883e;
  --font-mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

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

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

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

/* Header */
header {
  padding: 80px 0 48px;
  border-bottom: 1px solid var(--border);
}

header h1 {
  font-size: 2.8em;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 1.25em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.meta {
  font-size: 0.9em;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Hero Metrics */
.hero-metrics {
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s;
}

.metric-card:hover {
  border-color: var(--accent-dim);
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.8em;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.metric-label {
  font-size: 0.9em;
  font-weight: 600;
  color: var(--text);
}

.metric-detail {
  font-size: 0.78em;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .metrics-grid { grid-template-columns: 1fr; }
}

/* Table of Contents */
.toc {
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
}

.toc ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  counter-reset: toc;
}

.toc li {
  counter-increment: toc;
}

.toc li::before {
  content: counter(toc) ".";
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.85em;
  margin-right: 4px;
}

.toc a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95em;
}

.toc a:hover { text-decoration: underline; }

/* Main content */
main { padding: 24px 0 80px; }

section {
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
}

section:last-child { border-bottom: none; }

h2 {
  font-size: 1.8em;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text);
}

h3 {
  font-size: 1.2em;
  font-weight: 600;
  margin: 32px 0 16px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.95em;
}

p { margin-bottom: 16px; }

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 0.92em;
}

th, td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
}

tr:hover { background: rgba(88, 166, 255, 0.04); }

.highlight-row { background: rgba(63, 185, 80, 0.08); }

td.yes { color: var(--green); font-weight: 600; }
td.no { color: var(--red); font-weight: 600; }
td.maybe { color: var(--yellow); }

.status-green { color: var(--green); font-weight: 600; }
.status-yellow { color: var(--yellow); font-weight: 600; }
.status-red { color: var(--red); font-weight: 600; }

/* Callouts */
.callout {
  background: var(--surface);
  border-left: 4px solid var(--accent);
  padding: 20px 24px;
  margin: 24px 0;
  border-radius: 0 8px 8px 0;
}

.callout.warning {
  border-left-color: var(--yellow);
}

.callout strong { color: var(--accent); }
.callout.warning strong { color: var(--yellow); }

/* Charts */
figure.chart {
  margin: 24px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
}

figure.chart svg {
  width: 100%;
  height: auto;
}

figcaption {
  font-size: 0.82em;
  color: var(--text-muted);
  margin-top: 12px;
  line-height: 1.5;
  font-style: italic;
}

.metrics-small {
  grid-template-columns: repeat(4, 1fr);
  margin: 20px 0;
}

.metrics-small .metric-card {
  padding: 14px;
}

.metrics-small .metric-value {
  font-size: 1.4em;
}

@media (max-width: 640px) {
  .metrics-small { grid-template-columns: repeat(2, 1fr); }
}

/* Code blocks */
.code-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  margin: 24px 0;
  overflow-x: auto;
}

.code-block pre {
  font-family: var(--font-mono);
  font-size: 0.85em;
  line-height: 1.6;
  white-space: pre;
}

.highlight { color: var(--orange); font-weight: 600; }

/* Timeline (identity crisis) */
.timeline {
  margin: 24px 0;
  padding-left: 24px;
  border-left: 3px solid var(--border);
}

.timeline-item {
  padding: 16px 0 16px 20px;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -31px;
  top: 22px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
}

.timeline-item.wrong::before {
  border-color: var(--red);
  background: rgba(248, 81, 73, 0.2);
}

.timeline-item.correct::before {
  border-color: var(--green);
  background: rgba(63, 185, 80, 0.2);
}

.sprint {
  font-family: var(--font-mono);
  font-size: 0.8em;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Flow diagram */
.flow-diagram {
  margin: 24px 0;
}

.flow-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 8px 0;
}

.flow-step.cx { border-left: 4px solid var(--purple); }
.flow-step.c { border-left: 4px solid var(--accent); }

.chain-tag {
  font-family: var(--font-mono);
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.flow-step strong {
  display: block;
  margin: 4px 0 8px;
  font-size: 1.05em;
}

.flow-step p {
  font-size: 0.9em;
  color: var(--text-muted);
  margin: 0;
}

.flow-arrow {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.2em;
  padding: 4px 0;
}

/* Poker steps */
.poker-steps li {
  margin-bottom: 12px;
  padding-left: 8px;
}

/* Sprint timeline */
.sprint-timeline {
  margin: 24px 0;
}

.sprint-item {
  display: flex;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.sprint-item:last-child { border-bottom: none; }

.sprint-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--accent-dim);
  color: var(--text);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9em;
  margin-top: 2px;
}

.sprint-item strong {
  display: block;
  margin-bottom: 4px;
}

.sprint-item p {
  font-size: 0.9em;
  color: var(--text-muted);
  margin: 0;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85em;
}

footer code {
  border: none;
  background: none;
  padding: 0;
}

/* Responsive */
@media (max-width: 640px) {
  header h1 { font-size: 2em; }
  .toc ol { flex-direction: column; gap: 8px; }
  table { font-size: 0.82em; }
  th, td { padding: 8px 10px; }
}
