/* ==================================================================
   CompareMOTHistory - Clean Light Design System
   Inspired by: carVertical's sophistication + Our data-first doctrine
   Doctrine: Tufte's Integrity + Knaflc's Narrative + Clean Elegance
   ================================================================== */

:root {
  /* MOT Ninja Blue Palette - Matching Brand Colors */
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #60a5fa;
  --primary-glow: rgba(59, 130, 246, 0.15);
  --secondary: #0ea5e9;
  
  /* Diagnostic Framework Colors (Light theme) */
  --diagnostic-green: #059669;
  --diagnostic-green-bg: rgba(5, 150, 105, 0.08);
  --diagnostic-green-border: rgba(5, 150, 105, 0.25);
  --diagnostic-amber: #d97706;
  --diagnostic-amber-bg: rgba(217, 119, 6, 0.08);
  --diagnostic-amber-border: rgba(217, 119, 6, 0.25);
  --diagnostic-red: #dc2626;
  --diagnostic-red-bg: rgba(220, 38, 38, 0.08);
  --diagnostic-red-border: rgba(220, 38, 38, 0.25);
  
  /* Light Clean Palette */
  --bg-light: #ffffff;
  --bg-light-alt: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-elevated: #f8fafc;
  --bg-alt: #f1f5f9;
  
  /* Dark accents for contrast */
  --bg-darkest: #0f172a;
  --bg-dark: #1e293b;
  --bg-darker: #334155;
  
  /* Text colors for light theme */
  --text: #0f172a;
  --text-bright: #000000;
  --text-light: #475569;
  --text-muted: #64748b;
  --text-dark: #0f172a;
  
  /* Borders and dividers */
  --border: #e2e8f0;
  --border-light: #cbd5e1;
  --border-accent: rgba(59, 130, 246, 0.2);
  
  /* Shadows - clean and subtle */
  --shadow: rgba(0, 0, 0, 0.05);
  --shadow-medium: rgba(0, 0, 0, 0.08);
  --shadow-large: rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
  --shadow-glow-strong: 0 0 40px rgba(59, 130, 246, 0.2);
  
  /* Gradients - Light Blue Theme */
  --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --gradient-light: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  --gradient-card: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  --gradient-hero: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #e0f2fe 100%);
  
  /* Radius */
  --radius: 12px;
  --radius-large: 20px;
  --radius-xl: 24px;
  --radius-small: 6px;
  
  /* Fonts */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
  
  /* Spacing Scale */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 48px;
  --space-xl: 80px;
  --space-2xl: 120px;
}

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

body {
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
  background: #ffffff;
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.03) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(14, 165, 233, 0.02) 0px, transparent 50%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Content Pages (Privacy, Cookies, etc.) */
.content-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 24px;
}

.prose {
  color: var(--text);
}

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  color: var(--text);
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 16px;
  line-height: 1.3;
}

.prose h1 {
  font-size: 42px;
  margin-top: 0;
  margin-bottom: 24px;
}

.prose h2 {
  font-size: 32px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.prose h3 {
  font-size: 24px;
}

.prose p {
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.7;
}

.prose strong {
  color: var(--text);
  font-weight: 700;
}

.prose a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.prose a:hover {
  border-bottom-color: var(--primary);
}

.prose ul, .prose ol {
  margin: 24px 0;
  padding-left: 28px;
}

.prose li {
  margin-bottom: 12px;
  color: var(--text);
  line-height: 1.7;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.prose thead {
  background: var(--bg-elevated);
}

.prose th {
  text-align: left;
  padding: 16px;
  font-weight: 700;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.prose td {
  padding: 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.prose tr:last-child td {
  border-bottom: none;
}

.prose tr:hover {
  background: var(--bg-elevated);
}

.prose code {
  background: var(--bg-alt);
  color: var(--text);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 15px;
}

.prose pre {
  background: var(--bg-alt);
  color: var(--text);
  padding: 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 24px 0;
}

.prose pre code {
  background: none;
  padding: 0;
}

.prose blockquote {
  background: var(--bg-elevated);
  border-left: 4px solid var(--primary);
  padding: 20px 24px;
  margin: 32px 0;
  font-style: italic;
  color: var(--text-light);
}

.prose hr {
  border: none;
  border-top: 2px solid var(--border);
  margin: 48px 0;
}

/* Improved Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
}

h1 {
  font-size: 48px;
  font-weight: 800;
}

h2 {
  font-size: 36px;
  margin-bottom: var(--space-md);
}

h3 {
  font-size: 24px;
  margin-bottom: var(--space-sm);
}

p {
  margin-bottom: var(--space-sm);
}

a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
  text-decoration-thickness: 2px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header - Clean Light */
.site-header {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
}

.site-logo {
  text-decoration: none;
  display: flex;
  flex-direction: column;
}

.logo-text {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.tagline {
  font-size: 13px;
  color: var(--text-light);
  font-weight: 400;
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 30px;
  align-items: center;
}

.main-nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 16px;
  transition: all 0.3s ease;
  position: relative;
  padding-bottom: 4px;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
}

.main-nav a:hover {
  color: var(--primary-light);
}

.main-nav a:hover::after {
  width: 100%;
}

.cta-link {
  background: var(--gradient-primary) !important;
  color: white !important;
  padding: 10px 24px;
  border-radius: var(--radius-small);
  font-weight: 600;
  box-shadow: var(--shadow-glow);
}

.cta-link:hover {
  box-shadow: var(--shadow-glow-strong);
  transform: translateY(-1px);
  color: white !important;
  background: var(--gradient-primary) !important;
}

.cta-link::after {
  display: none !important;
}

/* Main Content */
.site-main {
  min-height: 70vh;
  padding: 60px 0;
}

/* Post */
.post {
  max-width: 800px;
  margin: 0 auto;
}

.post-header {
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 2px solid var(--border);
}

.post-title {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--text);
}

.post-meta {
  display: flex;
  gap: 20px;
  align-items: center;
  color: var(--text-light);
  font-size: 15px;
}

.post-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  background: var(--bg-alt);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-light);
}

/* Post Content */
.post-content {
  font-size: 19px;
  line-height: 1.8;
}

/* Fix nav label arrows/text via CSS to avoid encoding artifacts */
.post-nav .nav-label { font-size: 0; }
.post-nav-prev .nav-label::before { content: "\2190 Previous"; font-size: 14px; }
.post-nav-next .nav-label::before { content: "Next \2192"; font-size: 14px; }

.post-content h2 {
  font-size: 32px;
  font-weight: 700;
  margin: 50px 0 20px;
  color: var(--text);
}

.post-content h3 {
  font-size: 24px;
  font-weight: 600;
  margin: 35px 0 15px;
}

.post-content p {
  margin-bottom: 24px;
}

.post-content strong {
  font-weight: 600;
  color: var(--text);
}

.post-content a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.post-content a:hover {
  border-bottom-color: var(--primary);
}

.post-content ul, .post-content ol {
  margin: 20px 0 20px 30px;
}

.post-content li {
  margin-bottom: 10px;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 30px 0;
  box-shadow: 0 4px 12px var(--shadow);
}

.post-content blockquote {
  background: var(--bg-alt);
  border-left: 4px solid var(--primary);
  padding: 20px 25px;
  margin: 30px 0;
  border-radius: var(--radius);
  font-style: italic;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 30px 0;
  font-size: 16px;
}

.post-content th {
  background: var(--bg-alt);
  font-weight: 600;
  text-align: left;
  padding: 12px 15px;
  border-bottom: 2px solid var(--border);
}

.post-content td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
}

.post-content code {
  background: var(--bg-alt);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 16px;
}

.post-content pre {
  background: var(--bg-alt);
  color: var(--text);
  padding: 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 30px 0;
  border: 1px solid var(--border);
}

.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* CTAs */
.post-cta {
  margin: 60px 0;
}

.cta-box {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 40px;
  border-radius: var(--radius);
  text-align: center;
}

.cta-box h3 {
  font-size: 28px;
  margin-bottom: 15px;
}

.cta-box p {
  font-size: 18px;
  margin-bottom: 25px;
  opacity: 0.95;
}

/* Checklist CTA in Posts */
.post-checklist-cta {
  margin: 50px 0;
}

.checklist-cta-box {
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 35px;
  display: flex;
  gap: 25px;
  align-items: flex-start;
}

.checklist-cta-icon {
  font-size: 48px;
  flex-shrink: 0;
}

.checklist-cta-content h3 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.checklist-cta-content p {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: 20px;
  line-height: 1.6;
}

.checklist-cta-actions {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: color 0.2s;
}

.btn-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ==================================================================
   Pillar Page Components - Tufte-Knaflc Design System
   ================================================================== */

/* APP Intro (Agree, Promise, Preview) */
.app-intro {
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 32px;
  margin: 40px 0;
}

.app-intro .agree {
  font-size: 19px;
  color: var(--text);
  margin-bottom: 16px;
}

.app-intro .promise {
  font-size: 19px;
  color: var(--text);
  margin-bottom: 20px;
}

.app-intro .preview {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.app-intro ul {
  list-style: none;
  padding-left: 0;
}

.app-intro ul li {
  padding: 8px 0 8px 28px;
  position: relative;
  font-size: 16px;
  color: var(--text-light);
  line-height: 1.6;
}

.app-intro ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}

/* Stat Callout (Big Number Display) */
.stat-callout {
  text-align: center;
  padding: 60px 40px;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border: 2px solid var(--border);
  border-radius: var(--radius-large);
  margin: 50px 0;
  box-shadow: 0 4px 12px var(--shadow-medium);
}

.stat-callout .big-number {
  font-size: 120px;
  font-weight: 900;
  line-height: 1;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
}

.stat-callout .stat-label {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.stat-callout .stat-context {
  font-size: 16px;
  color: var(--text-muted);
}

/* Visualization Container - Tufte Principles */
.visualization-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  padding: 32px;
  margin: 40px 0;
  box-shadow: 0 2px 8px var(--shadow-medium);
}

.visualization-container .full-width-chart {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.viz-insight {
  background: var(--bg-elevated);
  border-left: 3px solid var(--primary);
  padding: 16px 20px;
  margin-top: 24px;
  border-radius: var(--radius-small);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-light);
}

.viz-insight strong {
  color: var(--text);
  font-weight: 600;
}

/* CTA Box Inline (Mid-Content Conversion) */
.cta-box-inline {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 40px;
  border-radius: var(--radius);
  margin: 50px 0;
  box-shadow: 0 8px 20px var(--shadow-glow);
}

.cta-box-inline .cta-content h3 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
  color: white;
}

.cta-box-inline .cta-content p {
  font-size: 17px;
  margin-bottom: 24px;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.6;
}

.cta-box-inline .cta-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.cta-box-inline .btn {
  background: white;
  color: var(--primary);
  font-weight: 600;
}

.cta-box-inline .btn:hover {
  background: var(--bg-elevated);
  transform: translateY(-2px);
}

.cta-box-inline .btn-outline {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.cta-box-inline .btn-outline:hover {
  background: white;
  color: var(--primary);
}

/* FAQ Section */
.faq-section {
  margin: 40px 0;
}

.faq-section p:first-child {
  font-weight: 600;
  font-size: 18px;
  color: var(--text);
  margin-top: 32px;
  margin-bottom: 12px;
}

.faq-section p:first-child::before {
  content: 'Q: ';
  color: var(--primary);
  font-weight: 700;
}

.faq-section p:first-child + p {
  padding-left: 24px;
  color: var(--text-light);
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

/* Methodology Note */
.methodology-note {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: var(--radius);
  margin: 50px 0;
  font-size: 15px;
  line-height: 1.7;
}

.methodology-note h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.methodology-note p {
  color: var(--text-light);
  margin-bottom: 0;
}

.methodology-note strong {
  color: var(--text);
  font-weight: 600;
}

/* Table of Contents Styling */
.post-content ul li a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.post-content ul li a:hover {
  text-decoration: underline;
}

/* Section Anchors */
.post-content h2[id],
.post-content h3[id] {
  scroll-margin-top: 100px;
}

/* Responsive Adjustments for Pillar Components */
@media (max-width: 768px) {
  .stat-callout .big-number {
    font-size: 80px;
  }
  
  .stat-callout {
    padding: 40px 24px;
  }
  
  .app-intro {
    padding: 24px;
  }
  
  .cta-box-inline {
    padding: 30px 20px;
  }
  
  .cta-box-inline .cta-buttons {
    flex-direction: column;
  }
  
  .cta-box-inline .btn {
    width: 100%;
    text-align: center;
  }
}

/* ==================================================================
   Tufte Model Card - The Foundational Unit of Trust
   Small Multiple design for rapid cohort comparison
   ================================================================== */

.model-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 340px;
}

.model-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px var(--shadow-medium);
  transform: translateY(-4px);
}

/* Diagnostic Coloring (Green/Amber/Red) */
.model-card[data-diagnostic="green"] {
  border-left: 4px solid var(--diagnostic-green);
}

.model-card[data-diagnostic="amber"] {
  border-left: 4px solid var(--diagnostic-amber);
}

.model-card[data-diagnostic="red"] {
  border-left: 4px solid var(--diagnostic-red);
}

/* Header with Title & Sparkline */
.model-card-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.model-card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.model-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
}

.model-card-age-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 4px 10px;
  border-radius: 12px;
}

.model-card-sparkline {
  height: 30px;
  display: flex;
  align-items: center;
}

.model-card-sparkline img,
.model-card-sparkline svg {
  width: 100%;
  max-width: 120px;
  height: 30px;
}

/* Statistics Row */
.model-card-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
}

.stat-label {
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value {
  font-weight: 700;
  font-size: 16px;
}

.stat-good {
  color: var(--diagnostic-green);
}

.stat-ok {
  color: var(--primary);
}

.stat-poor {
  color: var(--diagnostic-red);
}

.stat-muted {
  color: var(--text);
}

/* Dot Plot - Tufte-style minimal range indicator */
.model-card-dotplot {
  margin: 12px 0;
}

.dotplot-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.dotplot-track {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.dotplot-label-left,
.dotplot-label-right {
  font-weight: 600;
  min-width: 32px;
}

.dotplot-line {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  position: relative;
}

.dotplot-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: var(--primary);
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 4px var(--shadow);
}

/* Diagnostic Icon (CSS-injected) */
.model-card-diagnostic-icon::before {
  font-size: 24px;
  position: absolute;
  top: 16px;
  right: 16px;
}

.model-card[data-diagnostic="green"] .model-card-diagnostic-icon::before {
  content: '✓';
  color: var(--diagnostic-green);
}

.model-card[data-diagnostic="amber"] .model-card-diagnostic-icon::before {
  content: '⚠';
  color: var(--diagnostic-amber);
}

.model-card[data-diagnostic="red"] .model-card-diagnostic-icon::before {
  content: '⚠';
  color: var(--diagnostic-red);
}

/* Narrative - The "So What?" */
.model-card-narrative {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.model-card-narrative p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-light);
  font-style: italic;
  margin: 0;
}

/* Failure Signature - Minimalist Bar Chart */
.model-card-failure-sig {
  margin-top: 8px;
}

.sig-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 8px;
}

.sig-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 48px;
  padding: 4px 0;
}

.sig-bar {
  flex: 1;
  background: var(--primary);
  opacity: 0.7;
  border-radius: 3px 3px 0 0;
  transition: opacity 0.2s;
  min-height: 6px;
}

.sig-bar:hover {
  opacity: 1;
}

.sig-bar[data-category="suspension"] {
  background: #dc2626;
}

.sig-bar[data-category="brakes"] {
  background: #d97706;
}

.sig-bar[data-category="tyres"] {
  background: #3b82f6;
}

.sig-bar[data-category="lights"] {
  background: #6366f1;
}

.sig-bar[data-category="steering"] {
  background: #8b5cf6;
}

/* Model Card Grid (Small Multiples Layout) */
.model-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin: 40px 0;
}

@media (max-width: 768px) {
  .model-cards-grid {
    grid-template-columns: 1fr;
  }
  
  .model-card {
    min-height: auto;
  }
}

/* ==================================================================
   PILLAR POST HERO IMAGE
   ================================================================== */
.pillar-hero {
  max-width: 1400px;
  margin: 0 auto var(--space-xl);
  border-radius: var(--radius-large);
  overflow: hidden;
  box-shadow: 0 24px 60px var(--shadow-large);
}

.pillar-hero-img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s ease;
}

.pillar-hero:hover .pillar-hero-img {
  transform: scale(1.02);
}

/* ==================================================================
   ENHANCED BUTTON SYSTEM
   ================================================================== */
.btn {
  display: inline-block;
  padding: 14px 32px;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
}

.cta-note {
  margin-top: 15px;
  font-size: 14px;
  opacity: 0.85;
}

/* Post Navigation */
.post-nav {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.post-nav-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.post-nav-prev, .post-nav-next {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 20px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.2s;
}

.post-nav-prev:hover, .post-nav-next:hover {
  background: #e5e7eb;
}

.nav-label {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 500;
}

.nav-title {
  font-size: 16px;
  color: var(--text);
  font-weight: 600;
}

/* Footer */
.site-footer {
  background: var(--bg-elevated);
  color: var(--text);
  padding: 60px 0 30px;
  margin-top: 100px;
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h3 {
  font-size: 18px;
  margin-bottom: 15px;
  font-weight: 600;
}

.footer-col p {
  font-size: 15px;
  line-height: 1.6;
  opacity: 0.85;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 15px;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--primary);
}

.newsletter-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.newsletter-form input {
  flex: 1;
  padding: 10px 15px;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
}

.newsletter-form button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.newsletter-form button:hover {
  background: var(--primary-dark);
}

.social-links {
  display: flex;
  gap: 15px;
}

.footer-bottom {
  padding-top: 30px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 14px;
  opacity: 0.75;
}

.disclaimer {
  margin-top: 10px;
  font-size: 13px;
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 20px;
  }
  
  .main-nav ul {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .post-title {
    font-size: 32px;
  }
  
  .post-content {
    font-size: 17px;
  }
  
  .post-nav-links {
    grid-template-columns: 1fr;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

/* ==================================================================
   PLAYBOOK IMPLEMENTATION - Trust Manufacturing Components
   ================================================================== */

/* Diagnostic Badge System (Green/Amber/Red Framework) */
.diagnostic-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-small);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.diagnostic-badge.green {
  background: var(--diagnostic-green-bg);
  color: var(--diagnostic-green);
}

.diagnostic-badge.amber {
  background: var(--diagnostic-amber-bg);
  color: var(--diagnostic-amber);
}

.diagnostic-badge.red {
  background: var(--diagnostic-red-bg);
  color: var(--diagnostic-red);
}

.diagnostic-icon {
  font-size: 14px;
  font-weight: bold;
}

/* Model Card Grid (Small Multiples à la Tufte) */
.model-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin: 40px 0;
}

/* Three-Act Narrative Structure */
.narrative-section {
  margin: 60px 0;
  padding: 40px 0;
}

.narrative-section.setup {
  border-bottom: 2px solid var(--border);
}

.narrative-section.conflict {
  background: var(--bg-wash);
  padding: 60px 20px;
  margin-left: -20px;
  margin-right: -20px;
}

.narrative-section.resolution {
  border-top: 2px solid var(--border);
  padding-top: 60px;
}

/* The Big Number (Setup Act) */
.big-number {
  text-align: center;
  margin: 60px 0;
}

.big-number-value {
  font-size: 120px;
  font-weight: 900;
  line-height: 1;
  color: var(--primary);
  display: block;
  letter-spacing: -0.02em;
}

.big-number-label {
  font-size: 20px;
  color: var(--text-light);
  margin-top: 10px;
  display: block;
}

.big-number-hook {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin-top: 30px;
  font-style: italic;
}

/* Declarative Titles (Knaflc Principle) */
.declarative-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 12px;
}

.declarative-subtitle {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: 30px;
}

/* Strategic Annotations */
.annotation {
  position: relative;
  padding-left: 20px;
  border-left: 3px solid var(--primary);
  margin: 20px 0;
  font-style: italic;
  color: var(--text-light);
}

.annotation.critical {
  border-color: var(--diagnostic-red);
  background: var(--diagnostic-red-bg);
  padding: 15px 20px;
  border-radius: var(--radius-small);
}

.annotation.insight {
  border-color: var(--diagnostic-green);
  background: var(--diagnostic-green-bg);
  padding: 15px 20px;
  border-radius: var(--radius-small);
}

/* Data Tables (Tufte: Minimal Grid Lines) */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 30px 0;
  font-size: 15px;
}

.data-table thead {
  border-bottom: 2px solid var(--text);
}

.data-table th {
  text-align: left;
  padding: 12px;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-light);
}

.data-table tbody tr:hover {
  background: var(--bg-alt);
}

/* Remove vertical grid lines (Tufte principle) */
.data-table td,
.data-table th {
  border-left: none;
  border-right: none;
}

/* Funnel Navigation (Pillar → Model → VRM) */
.funnel-nav {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 40px;
  border-radius: var(--radius);
  text-align: center;
  margin: 60px 0;
}

.funnel-nav h3 {
  font-size: 28px;
  margin-bottom: 15px;
}

.funnel-nav p {
  font-size: 18px;
  opacity: 0.95;
  margin-bottom: 25px;
}

.funnel-steps {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.funnel-step {
  background: rgba(255, 255, 255, 0.15);
  padding: 15px 25px;
  border-radius: var(--radius-small);
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.funnel-arrow {
  font-size: 24px;
  opacity: 0.7;
}

/* MOT Ninja Diagnostic Framework Integration */
.diagnostic-card {
  padding: 20px;
  border-radius: var(--radius);
  margin: 20px 0;
  border-left: 4px solid;
}

.diagnostic-card.green {
  background: var(--diagnostic-green-bg);
  border-color: var(--diagnostic-green);
}

.diagnostic-card.amber {
  background: var(--diagnostic-amber-bg);
  border-color: var(--diagnostic-amber);
}

.diagnostic-card.red {
  background: var(--diagnostic-red-bg);
  border-color: var(--diagnostic-red);
}

.diagnostic-card h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 18px;
}

.diagnostic-card ul {
  margin-left: 20px;
  margin-top: 10px;
}

.diagnostic-card li {
  margin: 6px 0;
  line-height: 1.6;
}

/* Comparison Grid (For Small Multiples) */
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2px;
  background: var(--border);
  border: 2px solid var(--border);
  margin: 40px 0;
}

.comparison-cell {
  background: var(--bg-card);
  padding: 20px;
  text-align: center;
}

.comparison-cell-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  display: block;
  margin-bottom: 8px;
}

.comparison-cell-label {
  font-size: 13px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Ethical Tightrope - Methodology Notes */
.methodology-note {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: var(--radius);
  margin: 40px 0;
  font-size: 14px;
  color: var(--text-light);
}

.methodology-note h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  color: var(--text);
}

/* ==================================================================
   TUFTE-KNAFLC VISUAL VOCABULARY - The Missing Pieces
   ================================================================== */

/* Sparklines (Tufte: Data-words) */
.sparkline {
  display: inline-block;
  height: 20px;
  width: 60px;
  margin: 0 4px;
  vertical-align: middle;
  position: relative;
}

.sparkline-bar {
  display: flex;
  align-items: flex-end;
  height: 100%;
  gap: 1px;
}

.sparkline-bar span {
  flex: 1;
  background: var(--text-muted);
  border-radius: 1px;
  transition: background 0.2s;
}

.sparkline-bar span.highlight {
  background: var(--primary);
}

.sparkline-line {
  width: 100%;
  height: 100%;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
}

/* Dot Plots (Tufte: Minimal comparison) */
.dot-plot {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 12px 0;
  font-size: 14px;
  font-family: var(--font-mono);
}

.dot-plot-label {
  min-width: 80px;
  color: var(--text-light);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dot-plot-track {
  flex: 1;
  height: 2px;
  background: var(--border);
  position: relative;
  margin: 0 8px;
}

.dot-plot-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  top: -4px;
  transform: translateX(-5px);
}

.dot-plot-dot.your-car {
  background: var(--primary);
  width: 14px;
  height: 14px;
  top: -6px;
  box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 3px var(--primary);
  z-index: 2;
}

.dot-plot-dot.cohort {
  background: var(--text-muted);
  z-index: 1;
}

.dot-plot-range {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Failure Signatures (The IP Visual) */
.failure-signature {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 30px;
  margin: 0 8px;
  vertical-align: middle;
}

.failure-bar {
  width: 12px;
  background: var(--diagnostic-amber);
  border-radius: 2px 2px 0 0;
  transition: all 0.3s;
  position: relative;
}

.failure-bar.critical {
  background: var(--diagnostic-red);
}

.failure-bar.minor {
  background: var(--text-muted);
  opacity: 0.5;
}

.failure-bar:hover {
  transform: translateY(-2px);
  opacity: 0.8;
}

.failure-signature-legend {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 12px;
}

.failure-signature-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-light);
}

.failure-signature-legend-bar {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

/* Visualization Containers */
.visualization-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  padding: 32px;
  margin: 40px 0;
  box-shadow: 0 2px 8px var(--shadow-medium);
}

.viz-insight {
  background: var(--bg-elevated);
  border-left: 3px solid var(--primary);
  padding: 16px 20px;
  margin-top: 24px;
  border-radius: var(--radius-small);
  font-size: 15px;
  line-height: 1.6;
}

.viz-insight strong {
  color: var(--text);
}

/* Model Card - The Cornerstone Unit of Trust */
.model-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.3s;
  position: relative;
}

.model-card:hover {
  border-color: var(--border-accent);
  box-shadow: 0 4px 12px var(--shadow-medium);
  transform: translateY(-2px);
}

.model-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.model-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.model-card-metrics {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.model-card-narrative {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-light);
  font-style: italic;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* National Reliability Curve Placeholder */
.reliability-curve-container {
  position: relative;
  height: 300px;
  margin: 40px 0;
}

.curve-annotation {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--primary);
  border-radius: var(--radius-small);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  pointer-events: none;
  box-shadow: 0 2px 4px var(--shadow);
}

.curve-annotation.risky-tail {
  border-color: var(--diagnostic-red);
  color: var(--diagnostic-red);
  background: var(--diagnostic-red-bg);
}

.curve-annotation.reliable-cluster {
  border-color: var(--diagnostic-green);
  color: var(--diagnostic-green);
  background: var(--diagnostic-green-bg);
}

/* 2x2 Manufacturer Matrix */
.matrix-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  background: var(--border);
  border: 2px solid var(--border);
  margin: 40px 0;
  min-height: 400px;
}

.matrix-quadrant {
  background: var(--bg-card);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.matrix-quadrant-label {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  display: block;
}

.matrix-quadrant-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  display: block;
}

.matrix-quadrant-annotation {
  font-size: 13px;
  color: var(--text-light);
  font-style: italic;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.matrix-quadrant.workhorses {
  border-left: 3px solid var(--diagnostic-green);
}

.matrix-quadrant.hidden-gems {
  border-left: 3px solid var(--primary);
}

.matrix-quadrant.danger-zone {
  border-left: 3px solid var(--diagnostic-red);
}

.matrix-quadrant.quirks {
  border-left: 3px solid var(--diagnostic-amber);
}

.matrix-axis-label {
  position: absolute;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.matrix-axis-y {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  left: -30px;
  top: 50%;
  transform-origin: center;
}

.matrix-axis-x {
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
}

/* Responsive Playbook Styles */
@media (max-width: 768px) {
  .big-number-value {
    font-size: 72px;
  }
  
  .model-card-grid {
    grid-template-columns: 1fr;
  }
  
  .comparison-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .funnel-steps {
    flex-direction: column;
  }
  
  .funnel-arrow {
    transform: rotate(90deg);
  }
  
  .dot-plot {
    flex-wrap: wrap;
  }
  
  .dot-plot-track {
    width: 100%;
    order: 3;
  }
  
  .matrix-2x2 {
    grid-template-columns: 1fr;
    min-height: 800px;
  }
  
  .visualization-container {
    padding: 20px;
  }
}
