/* Wayfinder Evolved tokens applied to blog */
:root {
  --gray-50: #F8F8FA;
  --gray-100: #F0F0F4;
  --gray-200: #E0E0E6;
  --gray-300: #CCCCD4;
  --gray-400: #9898A4;
  --gray-500: #6E6E7C;
  --gray-600: #4E4E5A;
  --gray-700: #36363E;
  --gray-800: #222228;
  --gray-900: #141418;
  --accent-300: #FFD27A;
  --accent-400: #FFC44D;
  --accent-500: #FFAE1A;
  --accent-600: #E69800;
  --accent-700: #B87A00;
}

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

body {
  font-family: 'Satoshi', sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.container { max-width: 960px; margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* Hero */
.blog-hero {
  background: var(--gray-900);
  color: white;
  padding: 96px 24px 80px;
  text-align: center;
}
.blog-hero h1 {
  font-weight: 900;
  font-size: clamp(32px, 5vw, 56px);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 20px;
}
.blog-hero .subtitle {
  font-size: 18px;
  color: var(--gray-400);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.6;
}
.blog-hero .meta {
  font-family: 'Source Code Pro', monospace;
  font-size: 12px;
  color: var(--gray-500);
  letter-spacing: 0.04em;
}
.blog-hero .meta span { color: var(--accent-500); }

/* Chapter nav */
.chapter-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: white;
  border-bottom: 1px solid var(--gray-200);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.chapter-nav-inner {
  display: flex;
  gap: 0;
  max-width: 960px;
  margin: 0 auto;
}
.chapter-nav a {
  flex-shrink: 0;
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}
.chapter-nav a:hover { color: var(--gray-900); }
.chapter-nav a.active {
  color: var(--gray-900);
  border-bottom-color: var(--accent-500);
}

/* Chapter sections */
.chapter {
  padding: 80px 0;
  border-bottom: 1px solid var(--gray-200);
}
.chapter:last-child { border-bottom: none; }
.chapter-header {
  margin-bottom: 48px;
}
.chapter-number {
  font-family: 'Source Code Pro', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-600);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.chapter h2 {
  font-weight: 900;
  font-size: 32px;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.chapter .chapter-subtitle {
  font-size: 16px;
  color: var(--gray-500);
}

/* Conversation messages */
.conversation { display: flex; flex-direction: column; gap: 24px; }

.msg {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
.msg-user .msg-avatar {
  background: var(--gray-900);
  color: white;
}
.msg-assistant .msg-avatar {
  background: var(--accent-500);
  color: var(--gray-900);
}
.msg-body {
  flex: 1;
  min-width: 0;
}
.msg-role {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.msg-user .msg-role { color: var(--gray-900); }
.msg-assistant .msg-role { color: var(--accent-700); }
.msg-content {
  font-size: 15px;
  line-height: 1.7;
  color: var(--gray-700);
}
.msg-content p { margin-bottom: 12px; }
.msg-content p:last-child { margin-bottom: 0; }
.msg-content strong { color: var(--gray-900); font-weight: 600; }
.msg-content code {
  font-family: 'Source Code Pro', monospace;
  font-size: 13px;
  background: var(--gray-100);
  padding: 2px 6px;
  border-radius: 4px;
}
.msg-tools {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.msg-tool-tag {
  font-family: 'Source Code Pro', monospace;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--gray-100);
  color: var(--gray-500);
}
.msg.decision-point {
  border-left: 3px solid var(--accent-500);
  padding-left: 16px;
  margin-left: -19px;
}
.msg-timestamp {
  font-family: 'Source Code Pro', monospace;
  font-size: 10px;
  color: var(--gray-400);
  margin-top: 6px;
}

/* Expandable sections */
.expandable { margin: 32px 0; }
.expandable-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-600);
  padding: 12px 16px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  width: 100%;
  text-align: left;
  transition: all 0.15s;
}
.expandable-toggle:hover { background: var(--gray-200); }
.expandable-toggle .arrow { transition: transform 0.2s; }
.expandable-toggle.open .arrow { transform: rotate(90deg); }
.expandable-content {
  display: none;
  padding: 16px;
  border: 1px solid var(--gray-200);
  border-top: none;
  border-radius: 0 0 8px 8px;
  background: white;
}
.expandable-content.open { display: block; }

/* Artifact cards */
.artifact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.artifact-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.15s;
}
.artifact-card:hover { box-shadow: 0 4px 16px rgba(20,20,24,0.08); }
.artifact-card h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}
.artifact-card p {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 12px;
}
.artifact-card a {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-700);
  text-decoration: none;
}
.artifact-card a:hover { text-decoration: underline; }

/* Preview iframes */
.preview-container {
  margin: 32px 0;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  overflow: hidden;
  background: var(--gray-200);
}
.preview-label {
  font-family: 'Source Code Pro', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-600);
  padding: 8px 16px;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.preview-label a {
  color: var(--accent-700);
  text-decoration: none;
  font-size: 11px;
}
.preview-container iframe {
  width: 100%;
  border: none;
  background: white;
}

/* Stats bar */
.stats-bar {
  display: flex;
  gap: 40px;
  justify-content: center;
  padding: 32px 0;
  border-bottom: 1px solid var(--gray-200);
  flex-wrap: wrap;
}
.stat {
  text-align: center;
}
.stat-value {
  font-weight: 900;
  font-size: 28px;
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 12px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* Evaluation table */
.eval-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}
.eval-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
  border-bottom: 2px solid var(--gray-200);
}
.eval-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: top;
}
.badge-pass {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  background: #ECFDF5;
  color: #047857;
}
.badge-concern {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  background: #FFFBEB;
  color: #B45309;
}

/* JSON viewer */
.json-viewer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: 20px;
  border-radius: 8px;
  font-family: 'Source Code Pro', monospace;
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  max-height: 400px;
  overflow-y: auto;
}
.json-key { color: var(--accent-400); }
.json-string { color: #A5D6A7; }
.json-number { color: #90CAF9; }

/* Footer */
.blog-footer {
  background: var(--gray-900);
  color: var(--gray-400);
  padding: 48px 24px;
  text-align: center;
  font-size: 14px;
}
.blog-footer a { color: var(--accent-500); text-decoration: none; }

/* Responsive */
@media (max-width: 768px) {
  .blog-hero { padding: 64px 24px 48px; }
  .chapter { padding: 48px 0; }
  .stats-bar { gap: 24px; }
  .stat-value { font-size: 22px; }
  .artifact-grid { grid-template-columns: 1fr; }
}
