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

:root {
  --bg: #F4F1EB;
  --bg-alt: #EDE9E0;
  --surface: #FAFAF6;
  --sidebar-bg: #3D3F36;
  --sidebar-text: #C8C4B8;
  --sidebar-active: #D4C078;
  --sidebar-hover: rgba(212, 192, 120, 0.1);
  --text: #2A2A26;
  --text-secondary: #5A5850;
  --text-muted: #6A6560;
  --accent: #8B6914;
  --accent-light: rgba(139, 105, 20, 0.08);
  --border: #D4CFC4;
  --border-light: #E0DBD2;

  --spec-blue: #4A6B8A;
  --build-amber: #946008;
  --verify-green: #5B7A5B;
  --alert-red: #8B3A3A;
  --alert-red-dark: #5C2020;
  --growth-purple: #6B5B7B;
  --integrity-green: #3D5A40;

  --font-display: 'EB Garamond', 'Georgia', serif;
  --font-body: 'Crimson Pro', 'Georgia', serif;
  --font-mono: 'IBM Plex Mono', 'Consolas', monospace;

  --shadow-card: 0 2px 8px rgba(44, 42, 40, 0.06);
  --shadow-subtle: 0 1px 4px rgba(44, 42, 40, 0.04);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --content-width: 90%;
}

html {
  font-size: 125%;
}

body {
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

/* SIDEBAR */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
}

.sidebar-header {
  padding: 32px 24px 0;
  margin-bottom: 0;
}

.sidebar-header h2 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--sidebar-active);
  line-height: 1.3;
}

.sidebar-ornament {
  text-align: center;
  padding: 12px 0 8px;
  color: rgba(212, 192, 120, 0.3);
  font-size: 12px;
  letter-spacing: 8px;
  border-bottom: 1px solid rgba(212, 192, 120, 0.2);
  margin: 0 24px 8px;
}

.sidebar-nav {
  list-style: none;
  padding: 8px 0;
  flex: 1;
}

.sidebar-nav li {
  margin: 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--sidebar-text);
  text-decoration: none;
  min-height: 44px;
  letter-spacing: 0.5px;
  transition: background 0.15s ease, color 0.15s ease;
  border-left: 2px solid transparent;
}

.sidebar-nav a:hover {
  color: #E0DCD0;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: none;
}

.sidebar-nav a.active {
  color: var(--sidebar-active);
  border-left-color: var(--sidebar-active);
  background: var(--sidebar-hover);
  font-weight: 500;
}

/* CONTENT AREA */
.content-area {
  margin-left: 240px;
  padding: 24px 48px;
  min-height: 100vh;
  background: var(--bg);
}

.prose {
  max-width: var(--content-width);
  text-align: justify;
  text-justify: inter-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.prose h2, .prose h3, .prose h4,
.prose .key-insight, .prose .pull-quote,
.prose .chapter-rule, .prose .chart-container,
.prose .failure-card, .prose .variant-card,
.prose .warning-card, .prose .week-timeline {
  text-align: left;
}

/* DROP CAPS */
.drop-cap::first-letter {
  font-family: var(--font-display);
  font-size: 4.2em;
  font-weight: 700;
  float: left;
  line-height: 0.8;
  margin-right: 8px;
  margin-top: 6px;
  color: var(--accent);
  text-shadow: 2px 3px 0px rgba(139, 105, 20, 0.2);
}

.wide {
  max-width: var(--content-width);
}

/* CHAPTER VISIBILITY */
.chapter {
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  position: relative;
  overflow: hidden;
}

.chapter.visible {
  opacity: 1;
}

/* CHAPTER TRANSITION ANIMATION */
.chapter-entering {
  animation: chapterFadeIn 0.3s ease-out;
}
@keyframes chapterFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* HAMBURGER */
.hamburger {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  width: 44px;
  height: 44px;
  background: var(--sidebar-bg);
  color: var(--sidebar-active);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(44, 42, 40, 0.15);
}

.hamburger svg {
  width: 20px;
  height: 20px;
  stroke: var(--sidebar-active);
  stroke-width: 2;
  stroke-linecap: round;
}

/* BACKDROP */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(44, 42, 40, 0.4);
  z-index: 99;
}

.sidebar-backdrop.open {
  display: block;
}

/* COVER PAGE */
.cover-page {
  min-height: calc(100vh - 48px);
  display: flex;
  align-items: flex-start;
}

.cover-inner {
  text-align: left;
  max-width: var(--content-width);
  padding: 0;
  width: 100%;
}

.cover-illustration {
  margin: 0 0 24px;
  max-width: 100%;
  opacity: 0.9;
}

.cover-title {
  font-family: var(--font-display);
  font-size: 96px;
  font-weight: 700;
  letter-spacing: 16px;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.cover-rule {
  width: 120px;
  height: 2px;
  background: var(--accent);
  margin: 16px 0;
}

.cover-subtitle {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.5;
  letter-spacing: 1px;
  max-width: 100%;
}

.cover-tagline {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 24px;
}

.cover-edition {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.cover-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 8px;
}

.cover-description {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-secondary);
  font-style: italic;
  max-width: 100%;
  margin: 0 0 20px;
}

.cover-start-btn {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--surface);
  background: var(--accent);
  border: none;
  padding: 14px 36px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  box-shadow: 0 2px 8px rgba(139, 105, 20, 0.2);
}

.cover-start-btn:hover {
  background: #7A5C10;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 105, 20, 0.3);
}

.cover-start-btn:active {
  transform: translateY(0);
}

.cover-start-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .cover-title {
    font-size: 56px;
    letter-spacing: 10px;
  }
  .cover-subtitle {
    font-size: 18px;
  }
  .cover-tagline {
    font-size: 20px;
  }
  .cover-illustration {
    max-width: 260px;
  }
}

/* CHAPTER GEOMETRY — decorative shapes from the datum diagram */
.chapter-geo {
  position: absolute;
  top: 20px;
  right: -20px;
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
  color: var(--accent);
}
.chapter-geo svg {
  width: 280px;
  height: 280px;
}

@media (max-width: 768px) {
  .chapter-geo { display: none; }
}

/* CHAPTER HEADER */
.chapter-header {
  padding: 0 0 32px;
  max-width: 800px;
}

.chapter-number {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.chapter-header h1 {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 4px;
}

.chapter-header .subtitle {
  font-family: var(--font-body);
  font-size: 20px;
  font-style: italic;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 580px;
  margin-bottom: 24px;
}

.chapter-header .chapter-rule {
  width: 60px;
  height: 1px;
  background: var(--accent);
  margin-bottom: 24px;
}

.chapter-header .byline {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

h2 {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--text);
  margin: 0 0 8px;
}

.chapter-rule {
  width: 60px;
  height: 1px;
  background: var(--accent);
  margin: 20px 0 32px;
}

h3 {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  margin: 48px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

h4 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  font-style: italic;
  line-height: 1.3;
  color: var(--text);
  margin: 32px 0 10px;
}

p {
  margin-bottom: 20px;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(139, 105, 20, 0.3);
}

a:hover {
  border-bottom-color: var(--accent);
}

hr {
  border: none;
  text-align: center;
  margin: 32px 0;
}
hr::after {
  content: '\25C6';
  color: var(--border);
  font-size: 18px;
  letter-spacing: 12px;
}

/* SCROLL-TRIGGERED FADE-INS */
.animate-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease-spring),
              transform 0.5s var(--ease-spring);
}
.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}
.stagger-children > .animate-in {
  transition-delay: calc(var(--stagger-index, 0) * 100ms);
}
@media (prefers-reduced-motion: reduce) {
  .animate-in { opacity: 1; transform: none; transition: none; }
}

/* HERO STAT CARDS */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 32px 0;
}

.hero-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow-card);
  text-align: center;
}

.hero-stat .number {
  font-family: var(--font-display);
  font-size: 60px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}

.hero-stat .label {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 8px;
}

/* PULL QUOTES */
.pull-quote {
  font-family: var(--font-display);
  font-size: 27px;
  font-style: italic;
  line-height: 1.6;
  color: var(--text);
  text-align: center;
  max-width: 600px;
  margin: 48px auto;
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(139, 105, 20, 0.03) 0%, rgba(139, 105, 20, 0.06) 100%);
  border-radius: 4px;
  position: relative;
}

.pull-quote::before {
  content: '\201C';
  font-family: var(--font-display);
  font-size: 64px;
  color: rgba(139, 105, 20, 0.15);
  position: absolute;
  top: -8px;
  left: 16px;
  line-height: 1;
}

.pull-quote cite {
  display: block;
  font-size: 18px;
  font-style: normal;
  color: var(--text-muted);
  margin-top: 12px;
}

/* KEY INSIGHT BOXES */
.key-insight {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 20px 24px;
  margin: 32px 0;
  box-shadow: var(--shadow-card);
}
.key-insight .key-insight-label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.key-insight .key-insight-label::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.key-insight p {
  margin: 0;
  font-size: 18px;
  line-height: 1.7;
}
.key-insight p strong {
  color: var(--text);
}

/* TABLES */
.table-wrap {
  max-width: var(--content-width);
  margin: 28px 0;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
}

thead th {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-align: left;
  padding: 10px 16px;
  border-bottom: 2px solid var(--text);
}

tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

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

tbody tr {
  transition: background 0.15s ease;
}
tbody tr:hover {
  background: rgba(139, 105, 20, 0.04);
}

/* AXIOM LIST */
.axiom-list {
  list-style: none;
  padding: 0;
  margin: 24px 0;
  counter-reset: axiom;
}

.axiom-list li {
  counter-increment: axiom;
  margin-bottom: 24px;
  padding: 20px 24px 20px 80px;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-subtle);
}

.axiom-list li::before {
  content: counter(axiom);
  position: absolute;
  left: 20px;
  top: 20px;
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: var(--surface);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.axiom-list li strong {
  display: block;
  font-size: 18px;
  margin-bottom: 4px;
}

/* ORDERED & UNORDERED LISTS */
ul, ol {
  margin: 16px 0 20px 24px;
}

li {
  margin-bottom: 8px;
}

/* BOEHM CHART */
.boehm-chart {
  margin: 32px 0;
}

.boehm-bar {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.boehm-label {
  flex: 0 0 220px;
  font-size: 18px;
  color: var(--text);
  text-align: right;
  padding-right: 16px;
  line-height: 1.3;
}

.boehm-fill {
  height: 44px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding-left: 14px;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  min-width: 52px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: width 0.6s var(--ease-spring);
}

/* CALLOUT CARDS */
.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--alert-red);
  border-radius: 0 8px 8px 0;
  padding: 20px 24px;
  margin: 28px 0;
  box-shadow: var(--shadow-card);
}

.callout-label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--alert-red);
  margin-bottom: 8px;
}

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

/* CODE / LABEL */
code {
  font-family: var(--font-mono);
  font-size: 18px;
  background: var(--accent-light);
  padding: 2px 6px;
  border-radius: 2px;
}

/* MERMAID CONTAINER */
.mermaid-container {
  max-width: var(--content-width);
  margin: 32px 0;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow-x: auto;
}

.mermaid-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.mermaid-controls button {
  font-family: var(--font-mono);
  font-size: 18px;
  padding: 4px 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
  color: var(--text-secondary);
}

.mermaid-controls button:hover {
  background: var(--border);
  color: var(--text);
}

.mermaid-viewport {
  overflow: auto;
  max-height: 600px;
}

.mermaid-inner {
  transform-origin: top left;
  transition: transform 0.2s ease;
}

/* REFERENCES */
.references {
  font-size: 18px;
  line-height: 1.6;
}

.references li {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

/* FOOTER */
.footer {
  text-align: center;
  padding: 48px 24px;
  font-size: 14px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 2px;
}

/* CHARTS */

/* Donut chart */
.donut-chart {
  display: flex;
  align-items: center;
  gap: 32px;
  margin: 32px 0;
  flex-wrap: wrap;
}
.donut-ring {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
.donut-ring .donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.donut-center .donut-value {
  font-family: var(--font-display);
  font-size: 35px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.donut-center .donut-sublabel {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-top: 4px;
}
.donut-legend {
  flex: 1;
  min-width: 200px;
}
.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 18px;
  color: var(--text-secondary);
}
.donut-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}
.donut-legend-item strong {
  color: var(--text);
  margin-right: 2px;
}

/* Comparison bars (side by side) */
.comparison-bars {
  margin: 32px 0;
}
.comparison-bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}
.comparison-bar-label {
  flex: 0 0 140px;
  font-size: 18px;
  color: var(--text);
  text-align: right;
  padding-right: 16px;
  line-height: 1.3;
}
.comparison-bar-track {
  flex: 1;
  background: var(--border-light);
  border-radius: 4px;
  height: 44px;
  position: relative;
  overflow: hidden;
}
.comparison-bar-fill {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding-left: 12px;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Stacked horizontal bar */
.stacked-bar {
  margin: 32px 0;
}
.stacked-bar-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.stacked-bar-track {
  display: flex;
  height: 50px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}
.stacked-bar-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  min-width: 36px;
}
.stacked-bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}
.stacked-bar-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 18px;
  color: var(--text-secondary);
}
.stacked-bar-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Pod blocks */
.pod-blocks {
  display: flex;
  gap: 4px;
  margin: 32px 0;
  height: 75px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}
.pod-block {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  line-height: 1.2;
  padding: 4px;
}

/* Chart container */
.chart-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin: 32px 0;
  box-shadow: var(--shadow-card);
}
.chart-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .donut-chart { flex-direction: column; align-items: flex-start; gap: 20px; }
  .donut-ring { width: 140px; height: 140px; }
  .donut-center .donut-value { font-size: 22px; }
  .comparison-bar-label { flex: 0 0 100px; font-size: 12px; }
  .stacked-bar-segment { font-size: 9px; }
  .pod-blocks { height: 48px; }
  .pod-block { font-size: 10px; }
}

/* TEAM LAYOUT */
.team-layout {
  display: grid;
  grid-template-columns: 1fr 253px;
  gap: 32px;
  align-items: start;
}
.team-layout .margin-note {
  position: sticky;
  top: 24px;
}
@media (max-width: 1024px) {
  .team-layout { grid-template-columns: 1fr; }
  .team-layout .margin-note { position: static; }
}

/* AXIOM DECK (3x2 grid) */
.axiom-deck {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 768px) {
  .axiom-deck { grid-template-columns: 1fr 1fr; }
}

/* PERSONA CARDS (playing-card style) */
.persona-deck {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.persona-card {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 32px 20px 28px;
  text-align: center;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.persona-card:hover {
  transform: translateY(-4px) rotate(-1deg);
  box-shadow: 0 8px 24px rgba(44, 42, 40, 0.12);
}
.persona-card-corner {
  position: absolute;
  font-size: 16px;
  color: var(--persona-color);
  line-height: 1;
}
.persona-card-corner-top { top: 10px; left: 12px; }
.persona-card-corner-bottom { bottom: 10px; right: 12px; transform: rotate(180deg); }
.persona-card-suit {
  font-size: 40px;
  color: var(--persona-color);
  line-height: 1;
  margin-bottom: 4px;
  opacity: 0.8;
}
.persona-card-rank {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--persona-color);
  margin-bottom: 12px;
}
.persona-card-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.persona-card-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.persona-card-rule {
  width: 40px;
  height: 2px;
  background: var(--persona-color);
  margin: 0 auto 10px;
  opacity: 0.4;
}
.persona-card-tagline {
  font-family: var(--font-body);
  font-size: 14px;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}
.persona-card-traits {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.persona-card-traits li {
  padding: 4px 0;
  border-bottom: 1px solid var(--border-light);
  margin: 0;
}
.persona-card-traits li:last-child { border-bottom: none; }
.persona-card-traits li::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--persona-color);
  margin-right: 8px;
  vertical-align: middle;
  opacity: 0.5;
}
@media (max-width: 1024px) {
  .persona-deck { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .persona-deck { grid-template-columns: 1fr 1fr; }
  .persona-card { padding: 24px 16px 20px; }
  .persona-card-name { font-size: 18px; }
  .persona-card-suit { font-size: 28px; }
}

/* ROLE CARDS (used in Agent Governance) */
.role-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.role-card {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.role-card-count {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}

.role-card-body {
  padding: 16px 20px;
  flex: 1;
}

.role-card-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.role-card-phase {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.role-card p {
  font-size: 18px;
  margin: 0;
  color: var(--text-secondary);
}

/* ARTIFACT GRID */
.artifact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.artifact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 0 0 8px 8px;
  padding: 18px 20px;
  box-shadow: var(--shadow-subtle);
}

.artifact-card-owner {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.artifact-card-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.artifact-card p {
  font-size: 18px;
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.artifact-card-clickable {
  position: relative;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.artifact-card-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(44, 42, 40, 0.10);
}
.artifact-card-clickable.expanded {
  transform: none;
  box-shadow: var(--shadow-card);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  margin-bottom: 0;
}
.artifact-card-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}
.artifact-card-clickable:hover .artifact-card-hint {
  opacity: 1;
}
.artifact-card-clickable.expanded .artifact-card-hint span {
  display: none;
}
.artifact-card-clickable.expanded .artifact-card-hint::after {
  content: 'Click to close';
}
.artifact-detail {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  margin-bottom: 14px;
  overflow: hidden;
  grid-column: 1 / -1;
}
.artifact-detail.open {
  display: block;
}
.artifact-detail-inner {
  padding: 20px 24px 24px;
  border-top: 1px dashed var(--border-light);
}
.artifact-detail h4 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 20px 0 8px;
}
.artifact-detail h4:first-child {
  margin-top: 0;
}
.artifact-detail p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.artifact-example {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 16px 20px;
  margin: 12px 0 16px;
  overflow-x: auto;
}
.artifact-example pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre;
}
.artifact-example code {
  font-family: inherit;
}

@media (max-width: 768px) {
  .role-card-count { min-width: 44px; font-size: 22px; }
  .role-card-title { font-size: 18px; }
  .artifact-grid { grid-template-columns: 1fr; }
}

/* RACI MATRIX */
.raci-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
  margin-bottom: 28px;
  font-size: 16px;
  color: var(--text-secondary);
}

.raci-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.raci-badge {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-left: 16px;
}
.raci-badge:first-child { margin-left: 0; }

.raci-badge.raci-r { background: var(--spec-blue); }
.raci-badge.raci-a { background: var(--accent); }
.raci-badge.raci-c { background: var(--verify-green); }
.raci-badge.raci-i { background: var(--text-muted); }

.raci-legend-item span {
  margin-right: 0;
}

.raci-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  align-items: start;
  clear: both;
}
.raci-layout .margin-note {
  position: sticky;
  top: 24px;
  order: -1;
}
.raci-legend-aside {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}
.raci-legend-aside-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}
.raci-legend-aside-item .raci-badge {
  width: 28px;
  height: 28px;
  font-size: 13px;
  margin-left: 0;
}
.raci-content {
  min-width: 0;
}
@media (max-width: 1024px) {
  .raci-layout { grid-template-columns: 1fr; }
  .raci-layout .margin-note { position: static; }
  .raci-legend-aside { flex-direction: row; flex-wrap: wrap; gap: 8px 16px; }
}

.raci-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

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

.raci-grid .raci-section {
  margin-bottom: 0;
}

.raci-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  margin-bottom: 20px;
  overflow: hidden auto;
  box-shadow: var(--shadow-card);
}

.raci-section-header {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #fff;
  padding: 10px 20px;
}

.raci-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.5;
}

.raci-table thead th {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.raci-table thead th:first-child {
  text-align: left;
  padding-left: 20px;
}

.raci-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  text-align: center;
  vertical-align: middle;
}

.raci-table tbody td:first-child {
  text-align: left;
  padding-left: 20px;
  color: var(--text);
}

.raci-table tbody tr:last-child td {
  border-bottom: none;
}

.raci-table tbody tr:hover {
  background: rgba(139, 105, 20, 0.03);
}

/* Color-coded RACI cells */
.raci-ra {
  font-weight: 700;
  color: #fff;
  background: var(--spec-blue);
  border-radius: 4px;
}

.raci-r {
  font-weight: 700;
  color: var(--spec-blue);
  background: rgba(74, 107, 138, 0.18);
  border-radius: 4px;
}

.raci-a {
  font-weight: 700;
  color: var(--accent);
  background: rgba(139, 105, 20, 0.18);
  border-radius: 4px;
}

.raci-c {
  font-weight: 600;
  color: var(--verify-green);
  background: rgba(91, 122, 91, 0.15);
  border-radius: 4px;
}

.raci-i {
  color: var(--text-muted);
  background: rgba(106, 101, 96, 0.12);
  border-radius: 4px;
  font-weight: 600;
}

.raci-none {
  color: var(--text-muted);
  opacity: 0.5;
}

@media (max-width: 768px) {
  .raci-legend { font-size: 13px; gap: 8px 16px; grid-template-columns: 1fr; }
  .raci-legend-item { gap: 6px; }
  .raci-badge { width: 26px; height: 26px; font-size: 12px; margin-left: 0; }
  .raci-table { font-size: 14px; }
  .raci-table thead th { font-size: 10px; padding: 8px 6px; }
  .raci-table tbody td { padding: 8px 6px; }
  .raci-section-header { font-size: 11px; letter-spacing: 2px; }
}

/* GROWTH LADDER */
.growth-ladder {
  margin: 40px 0;
}

.growth-stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.growth-stage-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}

.growth-stage-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--surface);
  flex-shrink: 0;
}

.growth-stage-1 .growth-stage-number { background: var(--build-amber); }
.growth-stage-2 .growth-stage-number { background: var(--spec-blue); }
.growth-stage-3 .growth-stage-number { background: var(--verify-green); }
.growth-stage-4 .growth-stage-number { background: var(--accent); }

.growth-stage-1 { border-left: 4px solid var(--build-amber); }
.growth-stage-2 { border-left: 4px solid var(--spec-blue); }
.growth-stage-3 { border-left: 4px solid var(--verify-green); }
.growth-stage-4 { border-left: 4px solid var(--accent); }

.growth-stage-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
}

.growth-stage-subtitle {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.growth-stage-body {
  padding: 20px 24px;
}

.growth-stage-body p {
  margin-bottom: 16px;
}

/* Skill bars */
.growth-skills {
  margin-top: 12px;
}

.growth-skill-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.growth-skill-label {
  flex: 0 0 120px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  text-align: right;
}

.growth-skill-bar {
  flex: 1;
  height: 10px;
  background: var(--border-light);
  border-radius: 5px;
  overflow: hidden;
}

.growth-skill-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.8s var(--ease-spring);
}

/* Gate badge */
.growth-gate {
  padding: 16px 24px;
  background: var(--bg);
  border-top: 1px solid var(--border-light);
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.growth-gate-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 6px;
}

/* Connector arrow */
.growth-connector {
  text-align: center;
  font-size: 24px;
  color: var(--border);
  padding: 8px 0;
  line-height: 1;
}

@media (max-width: 768px) {
  .growth-stage-header { padding: 16px 18px; gap: 12px; }
  .growth-stage-number { width: 40px; height: 40px; font-size: 18px; }
  .growth-stage-title { font-size: 20px; }
  .growth-stage-body { padding: 16px 18px; }
  .growth-gate { padding: 14px 18px; }
  .growth-skill-label { flex: 0 0 90px; font-size: 12px; }
}

/* RESPONSIVE: TABLET */
@media (max-width: 1024px) {
  .sidebar {
    width: 200px;
  }
  .content-area {
    margin-left: 200px;
  }
}

/* RESPONSIVE: MOBILE */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .sidebar {
    width: 240px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 1000;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .content-area {
    margin-left: 0;
    padding: 72px 20px 48px;
  }

  .chapter-header {
    padding-top: 16px;
  }

  .chapter-header h1 {
    font-size: 28px;
    letter-spacing: 1px;
  }

  .chapter-header .subtitle {
    font-size: 17px;
  }

  hr {
    margin: 16px 0;
  }

  h2 {
    font-size: 24px;
    letter-spacing: 1px;
  }

  h3 {
    font-size: 19px;
  }

  .hero-stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .hero-stat .number {
    font-size: 36px;
  }

  .axiom-list li {
    padding-left: 56px;
  }
  .axiom-list li::before {
    width: 32px;
    height: 32px;
    font-size: 14px;
    top: 16px;
    left: 12px;
  }

  .pull-quote {
    font-size: 17px;
    padding: 20px 16px;
  }

  .boehm-label {
    flex: 0 0 140px;
    font-size: 12px;
  }

  .boehm-fill {
    font-size: 11px;
    height: 28px;
  }

  .mermaid-container {
    margin: 24px 0;
    padding: 16px;
  }

  .variant-changes { grid-template-columns: 1fr; }
}

/* GROWTH LAYOUT */
.growth-layout {
  display: grid;
  grid-template-columns: 1fr 253px;
  gap: 32px;
  align-items: start;
}
.growth-layout .margin-note {
  position: sticky;
  top: 24px;
}
.growth-cards {
  min-width: 0;
}
@media (max-width: 1024px) {
  .growth-layout { grid-template-columns: 1fr; }
  .growth-layout .margin-note { position: static; order: -1; }
  .growth-layout .persona-deck { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 768px) {
  .growth-layout .persona-deck { grid-template-columns: 1fr !important; }
}

/* TEAM SIZING LAYOUT */
.team-sizing-layout {
  display: grid;
  grid-template-columns: 1fr 253px;
  gap: 32px;
  align-items: start;
}
.team-sizing-layout .margin-note {
  position: sticky;
  top: 24px;
}
.team-sizing-cards {
  min-width: 0;
}
@media (max-width: 1024px) {
  .team-sizing-layout { grid-template-columns: 1fr; }
  .team-sizing-layout .margin-note { position: static; order: -1; }
}

/* MECHANICS GRID (How It Works chapter) */
.mechanics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.mechanics-grid .raci-section {
  margin-bottom: 0;
}
.mechanics-grid .raci-section:last-child {
  grid-column: 1 / -1;
}
@media (max-width: 1024px) {
  .mechanics-grid { grid-template-columns: 1fr; }
}

/* MARGIN NOTES (textbook-style sidebar callouts) */
.margin-note {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  padding: 24px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 8px 8px 0;
  box-shadow: var(--shadow-subtle);
}
.margin-note-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 12px;
}
.margin-note p {
  margin-bottom: 6px;
  font-weight: 600;
}
.margin-note-rule {
  width: 40px;
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}
.margin-note-muted {
  font-weight: 400 !important;
  font-style: italic;
  color: var(--text-secondary);
}

/* DELIVERY STYLES LAYOUT */
.delivery-styles-layout {
  display: grid;
  grid-template-columns: 1fr 253px;
  gap: 32px;
  align-items: start;
}
.delivery-styles-layout .margin-note {
  position: sticky;
  top: 24px;
}
.delivery-styles-cards {
  min-width: 0;
}
@media (max-width: 1024px) {
  .delivery-styles-layout {
    grid-template-columns: 1fr;
  }
  .delivery-styles-layout .margin-note {
    position: static;
  }
}

/* DELIVERY STYLES */
.delivery-style {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}
.delivery-style-header {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #fff;
  padding: 12px 24px;
}
.delivery-style-body {
  padding: 24px;
}
.delivery-style-tagline {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.3;
}
.delivery-style-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 32px;
}
.delivery-style-section h4 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
  font-style: normal;
  border-bottom: none;
  padding-bottom: 0;
}
.delivery-style-section p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.delivery-style-section ul {
  margin: 0 0 8px 20px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.delivery-style-section li {
  margin-bottom: 4px;
}
.delivery-style-flow {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 0 8px;
  flex-wrap: wrap;
  position: relative;
}
.flow-step {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 20px;
  border-radius: 4px;
  color: #fff;
}
.flow-spec { background: var(--spec-blue); }
.flow-build { background: var(--build-amber); }
.flow-verify { background: var(--verify-green); }
.flow-learn { background: var(--growth-purple); }
.flow-arrow {
  font-size: 20px;
  color: var(--text-muted);
}
.flow-label {
  width: 100%;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* DELIVERY BOARD (Kanban) */
.delivery-board {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 14px;
}
.delivery-board thead th {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
}
.delivery-board tbody td {
  padding: 12px 10px;
  vertical-align: top;
  border-bottom: none;
}
.board-card {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  margin: 2px 4px 2px 0;
}
.board-card-muted { background: var(--bg-alt); color: var(--text-muted); }
.board-card-spec { background: rgba(74, 107, 138, 0.15); color: var(--spec-blue); }
.board-card-build { background: rgba(148, 96, 8, 0.15); color: var(--build-amber); }
.board-card-review { background: rgba(91, 122, 91, 0.15); color: var(--verify-green); }
.board-card-done { background: rgba(106, 101, 96, 0.10); color: var(--text-muted); }
.delivery-board-note {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 8px;
}

@media (max-width: 768px) {
  .delivery-style-detail { grid-template-columns: 1fr; }
  .delivery-style-tagline { font-size: 20px; }
  .flow-step { font-size: 11px; padding: 6px 14px; }
  .delivery-board { font-size: 12px; }
}

/* FAILURE CARDS */
.failure-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--alert-red);
  border-radius: 0 10px 10px 0;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}
.failure-card-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.failure-card-title .axiom-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--alert-red);
  background: rgba(139, 58, 58, 0.08);
  padding: 3px 10px;
  border-radius: 4px;
}
.failure-card p {
  margin-bottom: 12px;
}
.failure-card .detection {
  background: var(--bg);
  border-radius: 6px;
  padding: 12px 16px;
  margin-top: 12px;
}
.failure-card .detection-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--verify-green);
  margin-bottom: 6px;
}

/* VARIANT CARDS */
.variant-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}
.variant-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.variant-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.variant-card-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}
.variant-card-subtitle {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}
.variant-changes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.variant-change-box {
  background: var(--bg);
  border-radius: 6px;
  padding: 12px 16px;
}
.variant-change-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}

/* WARNING CARDS */
.warning-card {
  background: rgba(139, 58, 58, 0.04);
  border: 1px solid rgba(139, 58, 58, 0.15);
  border-left: 3px solid var(--alert-red);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin-bottom: 12px;
  font-size: 18px;
  line-height: 1.6;
}

/* WEEK TIMELINE */
.week-timeline {
  position: relative;
  padding-left: 40px;
  margin: 32px 0;
}
.week-timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.week-card {
  position: relative;
  margin-bottom: 24px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-subtle);
}
.week-card::before {
  content: '';
  position: absolute;
  left: -33px;
  top: 24px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg);
}
.week-card-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

/* GLOSSARY */
.glossary-list {
  margin: 0;
}
.glossary-entry {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}
.glossary-entry:last-child {
  border-bottom: none;
}
.glossary-term {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  flex: 0 0 200px;
}
.glossary-def {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-secondary);
}
@media (max-width: 768px) {
  .glossary-entry { flex-direction: column; gap: 4px; }
  .glossary-term { flex: none; }
}

/* ============================================================
   MOBILE: ≤480px (iPhone SE/14, Pixel, Galaxy S)
   Defeats inline styles via !important where necessary.
   One block, end of file, do not scatter.
   ============================================================ */
@media (max-width: 480px) {

  /* --- CRITICAL: Broken layouts --- */

  .persona-deck {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .persona-card {
    padding: 20px 16px 16px;
  }
  .persona-card-name { font-size: 16px; }
  .persona-card-suit { font-size: 24px; }
  .persona-card-rank { font-size: 12px; }
  .persona-card-tagline { font-size: 13px; }
  .persona-card-traits { font-size: 13px; }

  .axiom-deck {
    grid-template-columns: 1fr;
  }

  .delivery-styles-layout {
    grid-template-columns: 1fr !important;
  }
  .delivery-styles-layout .margin-note {
    position: static;
  }

  .mechanics-grid {
    grid-template-columns: 1fr !important;
  }

  .delivery-style-tagline {
    font-size: 28px !important;
  }

  .donut-center {
    width: 60px !important;
    height: 60px !important;
  }
  .donut-center .donut-value { font-size: 16px !important; }
  .donut-center .donut-sublabel { font-size: 8px; }
  .donut-ring { width: 110px; height: 110px; }

  /* --- HIGH: Readability --- */

  .hero-stat { padding: 16px; }
  .hero-stat .number { font-size: 28px; }
  .hero-stat .label { font-size: 14px; }

  .failure-card { padding: 16px; }
  .failure-card-title { font-size: 18px; gap: 8px; }
  .failure-card p { font-size: 15px; }
  .failure-card .detection { padding: 10px 12px; }

  .week-timeline { padding-left: 24px; }
  .week-timeline::before { left: 7px; }
  .week-card { padding: 16px; }
  .week-card::before { left: -25px; width: 10px; height: 10px; }
  .week-card-label { font-size: 11px; }

  .variant-card { padding: 16px; }
  .variant-card-title { font-size: 18px; }
  .variant-card-icon { width: 36px; height: 36px; font-size: 16px; }
  .variant-changes { grid-template-columns: 1fr; }

  .raci-table { font-size: 12px; }
  .raci-table thead th { font-size: 9px; padding: 6px 4px; letter-spacing: 1px; }
  .raci-table tbody td { padding: 6px 4px; }
  .raci-badge { width: 22px; height: 22px; font-size: 10px; }

  /* --- MEDIUM: Polish --- */

  .comparison-bar-label { flex: 0 0 80px; font-size: 11px; padding-right: 8px; }
  .stacked-bar-segment { min-width: 24px; font-size: 8px; }
  .glossary-term { font-size: 16px; }
  .glossary-def { font-size: 15px; }
  .margin-note { padding: 16px; font-size: 14px; }
  .margin-note-label { font-size: 10px; letter-spacing: 1.5px; margin-bottom: 8px; }
}
