/* ============================================================
   SPECS COMPONENTS - Shared CSS Component Library
   ============================================================
   Canonical source of truth for all Specs client deliverable
   websites. Extracted from The Coders Guild BA site.

   Usage: <link rel="stylesheet" href="specs-components.css">
   Only add page-specific CSS inline after this stylesheet.
   ============================================================ */


/* ============ 1. FOUNDATION ============ */

@import url('https://api.fontshare.com/v2/css?f[]=satoshi@300,400,500,600,700&display=swap');

:root {
  --cream: hsl(40, 43%, 95%);
  --black: hsl(0, 0%, 0%);
  --navy: hsl(216, 53%, 24%);
  --navy-mid: hsl(212, 49%, 34%);
  --blue-light: hsl(209, 37%, 47%);
  --gold: hsl(32, 39%, 56%);
  --gold-dark: hsl(32, 40%, 51%);
  --card: hsl(40, 43%, 97%);
  --muted: hsl(0, 0%, 40%);
  --border: hsl(40, 10%, 88%);
  --subtle: hsl(0, 0%, 53%);
  --challenge-bg: hsl(10, 60%, 95%);
  --opportunity-bg: hsl(130, 30%, 93%);
  --opportunity-text: hsl(122, 39%, 40%);
  --green: hsl(152, 45%, 40%);
  --green-bg: hsl(148, 30%, 94%);
  --amber: hsl(36, 80%, 50%);
  --amber-bg: hsl(40, 60%, 94%);
  --red: hsl(4, 55%, 50%);
  --red-bg: hsl(6, 60%, 95%);
  --dept-sales: hsl(216, 53%, 50%);
  --dept-delivery: hsl(152, 45%, 40%);
  --dept-compliance: hsl(4, 55%, 50%);
  --dept-ops: hsl(32, 60%, 50%);
  --dept-finance: hsl(270, 40%, 50%);
}

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

body {
  font-family: 'Satoshi', sans-serif;
  background: var(--cream);
  color: var(--black);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-top: 64px;
}


/* ============ 1b. SPECS HEADER ============ */

.specs-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: hsla(40, 43%, 95%, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.specs-logo { display: flex; align-items: center; text-decoration: none; }
.specs-logo svg { height: 20px; width: auto; }
.specs-header-meta { display: flex; align-items: center; gap: 1.5rem; }
.specs-header-meta span { font-size: 13px; font-weight: 500; color: hsla(0, 0%, 0%, 0.5); }
.specs-header-meta .client-name { font-weight: 600; color: var(--navy); }
.specs-header-divider { width: 1px; height: 20px; background: var(--border); }
.specs-nav-link { font-size: 13px; font-weight: 500; color: hsla(0,0%,0%,0.4); text-decoration: none; transition: color 0.15s; }
.specs-nav-link:hover { color: var(--navy); }
.specs-nav-link.active { color: var(--navy); font-weight: 600; }


/* ============ 2. HERO SECTION ============ */

.hero {
  background: linear-gradient(135deg, hsl(213,53%,23%), hsl(211,48%,33%), hsl(207,38%,47%));
  padding: 100px 24px 64px;
  color: var(--cream);
}
.hero-inner { max-width: 1100px; margin: 0 auto; }
.hero-eyebrow {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 16px; display: block;
}
.hero h1 {
  font-family: 'Satoshi', sans-serif; font-weight: 400;
  font-size: clamp(28px, 4vw, 48px); line-height: 1.15;
  max-width: 700px; margin-bottom: 16px;
}
.hero-sub {
  font-weight: 300; font-size: clamp(15px, 1.8vw, 18px);
  color: hsla(40, 43%, 95%, 0.7); max-width: 600px;
}

/* Compact hero variant for inner pages */
.hero-compact { padding: 80px 24px 56px; }
.hero-compact h1 { font-size: clamp(26px, 4vw, 44px); margin-bottom: 12px; }
.hero-compact .hero-eyebrow { margin-bottom: 12px; }
.hero-compact .hero-sub { font-size: clamp(14px, 1.6vw, 17px); color: hsla(40,43%,95%,0.65); }


/* ============ 3. LAYOUT (Sections, Containers) ============ */

.container { max-width: 1100px; margin: 0 auto; padding: 3rem 2rem; }
.section { padding: 72px 24px; }
.section-alt { background: var(--card); }
.section-dark { background: var(--navy); color: var(--cream); }
.section-inner { max-width: 1100px; margin: 0 auto; }
.section-eyebrow {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px; display: block;
}
.section-dark .section-eyebrow { color: var(--gold); }
.section-title {
  font-family: 'Satoshi', sans-serif; font-weight: 400;
  font-size: clamp(22px, 3vw, 38px); line-height: 1.15;
  margin-bottom: 8px;
}
.section-sub {
  font-size: clamp(14px, 1.4vw, 17px); color: var(--muted);
  max-width: 640px; margin-bottom: 40px;
}
.section-dark .section-sub { color: hsla(40,43%,95%,0.6); }


/* ============ 4. NAVIGATION TABS ============ */

.nav-tabs {
  position: sticky; top: 64px; z-index: 50;
  background: hsla(40, 43%, 95%, 0.95); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.nav-tabs-inner {
  max-width: 1100px; margin: 0 auto; display: flex; gap: 0; padding: 0 24px;
}
.nav-tab {
  font-size: 13px; font-weight: 500; padding: 14px 16px;
  color: var(--muted); cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; transition: all 0.2s;
}
.nav-tab:hover { color: var(--black); }
.nav-tab.active { color: var(--black); border-bottom-color: var(--black); }


/* ============ 5. COLLAPSIBLE CARDS (stage-card) ============ */

.stage-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 8px; overflow: hidden; transition: all 0.2s;
}
.stage-card:hover { border-color: var(--navy); box-shadow: 0 2px 10px rgba(0,0,0,0.04); background: white; }
.stage-card.expanded { border-color: var(--navy); box-shadow: 0 3px 16px rgba(27,54,93,0.08); background: white; }
.stage-header {
  display: grid; grid-template-columns: 1fr auto;
  align-items: center; cursor: pointer; padding: 16px 20px;
}
.stage-header-left { display: flex; align-items: flex-start; gap: 14px; }
.stage-expand-icon {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: hsla(216,53%,24%,0.07); color: var(--navy);
  flex-shrink: 0; transition: all 0.25s;
}
.stage-expand-icon svg { width: 12px; height: 12px; transition: transform 0.25s; }
.stage-card.expanded .stage-expand-icon { background: var(--navy); color: white; }
.stage-card.expanded .stage-expand-icon svg { transform: rotate(90deg); }
.stage-info { flex: 1; }
.stage-num {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--navy); opacity: 0.5; margin-bottom: 2px;
}
.stage-name { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.stage-summary { font-size: 12px; color: var(--muted); line-height: 1.4; }
.stage-tags { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.stage-header-right {
  display: flex; align-items: center; gap: 12px;
  padding-left: 16px; border-left: 1px solid hsl(40,10%,93%);
}
.stage-owner { font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }
.stage-content { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }
.stage-card.expanded .stage-content { max-height: 10000px; }
.stage-content-inner { padding: 0 20px 20px 62px; border-top: 1px solid var(--border); }


/* ============ 6. SUBSTEPS & DECISION CARDS ============ */

.substep {
  background: var(--card); border: 1px solid var(--border); border-radius: 6px;
  padding: 14px 16px; margin-top: 10px; transition: all 0.2s;
}
.substep:hover { border-color: hsla(216,53%,24%,0.3); }
.substep-eyebrow {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--subtle); margin-bottom: 4px;
}
.substep-desc { font-size: 13px; color: var(--black); line-height: 1.6; }
.substep-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.substep.decision { border-left: 3px solid var(--gold); background: hsla(32,39%,56%,0.04); }
.decision-paths { margin-top: 8px; }
.decision-path { font-size: 12px; color: var(--muted); padding: 3px 0; }
.decision-path.yes::before { content: '\2713\00a0\00a0'; color: var(--opportunity-text); font-weight: 700; }
.decision-path.no::before { content: '\2717\00a0\00a0'; color: var(--red); font-weight: 700; }


/* ============ 7. PAIN & OPPORTUNITY PANELS ============ */

.pain-panel {
  margin-top: 16px; background: var(--challenge-bg); border-radius: 6px;
  padding: 14px 16px; border-left: 3px solid hsl(10,50%,65%);
}
.pain-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: hsl(10,50%,45%); margin-bottom: 8px;
}
.pain-item {
  font-size: 13px; color: hsl(10,50%,35%); line-height: 1.5;
  padding: 4px 0; border-bottom: 1px solid hsla(10,50%,65%,0.15);
}
.pain-item:last-child { border-bottom: none; }
.opportunity-panel {
  margin-top: 16px; background: var(--opportunity-bg); border-radius: 6px;
  padding: 14px 16px; border-left: 3px solid var(--opportunity-text);
}
.opp-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--opportunity-text); margin-bottom: 8px;
}
.opp-item { font-size: 13px; color: hsl(122, 30%, 30%); line-height: 1.5; padding: 4px 0; }


/* ============ 8. BADGES & TAGS ============ */

.badge {
  display: inline-block; font-size: 9px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  border-radius: 9999px; padding: 2px 7px;
}
.badge.navy { background: var(--navy); color: var(--cream); }
.badge.blue { background: var(--blue-light); color: white; }
.badge.gold { background: var(--gold); color: white; }
.badge.green { background: var(--green); color: white; }
.badge.grey { background: var(--border); color: var(--muted); }
.badge.red { background: var(--red); color: white; }
.badge.outlined { background: hsla(0,0%,0%,0.04); color: var(--muted); border: 1px solid var(--border); }
.tool-tag {
  font-size: 9px; font-weight: 500; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 3px;
  background: hsla(216,53%,24%,0.06); color: var(--navy);
}


/* ============ 9. TRACKING STATUS BADGES ============ */

.tracking-status {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 3px 8px; border-radius: 4px;
}
.ts-dot { width: 5px; height: 5px; border-radius: 50%; }
.ts-tracked { color: var(--green); background: var(--green-bg); }
.ts-tracked .ts-dot { background: var(--green); }
.ts-partial { color: var(--amber); background: var(--amber-bg); }
.ts-partial .ts-dot { background: var(--amber); }
.ts-gap { color: var(--red); background: var(--red-bg); }
.ts-gap .ts-dot { background: var(--red); }


/* ============ 10. METRICS ============ */

/* Status badges (metrics tree variant) */
.status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 3px 10px; border-radius: 4px;
}
.status-tracked { background: var(--green-bg); color: var(--green); }
.status-partial { background: var(--amber-bg); color: var(--amber); }
.status-gap { background: var(--red-bg); color: var(--red); }
.status-proposed { background: hsl(216,53%,24%,0.08); color: var(--navy); }
.status-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.status-tracked .status-dot { background: var(--green); }
.status-partial .status-dot { background: var(--amber); }
.status-gap .status-dot { background: var(--red); }
.status-proposed .status-dot { background: var(--navy); }

/* Goal cards */
.goal-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.goal-card {
  background: white; border: 1px solid var(--border); border-radius: 10px;
  padding: 28px; position: relative; overflow: hidden;
  display: flex; flex-direction: column;
}
.goal-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.goal-card.growth::before { background: var(--navy); }
.goal-card.quality::before { background: var(--green); }
.goal-card.efficiency::before { background: var(--gold); }
.goal-label {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 600; margin-bottom: 8px;
}
.goal-card.growth .goal-label { color: var(--navy); }
.goal-card.quality .goal-label { color: var(--green); }
.goal-card.efficiency .goal-label { color: var(--gold-dark); }
.goal-name { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.goal-target { font-size: 14px; color: var(--muted); margin-bottom: 12px; flex: 1; }
.goal-current {
  font-size: 13px; padding: 8px 12px; border-radius: 6px;
  background: hsl(40,30%,96%); border: 1px solid var(--border);
}
.goal-current strong { font-weight: 600; }

/* Metric category */
.metric-category { margin-bottom: 48px; }
.category-header {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 12px; border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.category-icon { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.category-title { font-size: 16px; font-weight: 600; }
.category-desc { font-size: 13px; color: var(--muted); margin-left: auto; }

/* Metric rows */
.metric-header {
  display: grid; grid-template-columns: 2fr 1fr 1fr 2fr 1fr;
  gap: 16px; padding: 8px 0 10px; font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--subtle); font-weight: 600;
  border-bottom: 2px solid var(--border); margin-bottom: 4px;
}
.metric-row {
  display: grid; grid-template-columns: 2fr 1fr 1fr 2fr 1fr;
  gap: 16px; padding: 14px 0; border-bottom: 1px solid hsl(40,10%,92%);
  align-items: center; font-size: 14px; transition: background 0.15s;
}
.metric-row:hover {
  background: hsl(40,43%,98%); margin: 0 -12px;
  padding-left: 12px; padding-right: 12px; border-radius: 6px;
}
.metric-row:last-child { border-bottom: none; }
.metric-name { font-weight: 600; }
.metric-name-sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.metric-current { color: var(--muted); }
.metric-target { font-weight: 500; }
.metric-how { font-size: 13px; color: var(--muted); }
.metric-how strong { font-weight: 600; color: var(--black); }

/* Connection lines */
.drives-label {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--subtle); margin: 24px 0 8px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
}
.drives-label::before {
  content: ''; width: 20px; height: 1px; background: var(--border);
}

/* Proposed metrics */
.proposed-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.proposed-card {
  background: white; border: 1px solid var(--border); border-radius: 8px;
  padding: 24px; border-left: 3px solid var(--navy);
}
.proposed-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.proposed-why { font-size: 13px; color: var(--muted); margin-bottom: 12px; line-height: 1.6; }
.proposed-detail { font-size: 12px; color: var(--subtle); line-height: 1.5; }
.proposed-detail dt { font-weight: 600; color: var(--black); display: inline; }
.proposed-detail dd { display: inline; margin: 0; }
.proposed-detail div { margin-bottom: 4px; }

/* Summary stats */
.stat-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 40px; }
.stat-box {
  flex: 1; min-width: 160px; text-align: center; padding: 24px 16px;
  background: white; border: 1px solid var(--border); border-radius: 8px;
}
.stat-num { font-size: 28px; font-weight: 700; line-height: 1; margin-bottom: 8px; }
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; line-height: 1.4; }
.stat-box.green .stat-num { color: var(--green); }
.stat-box.amber .stat-num { color: var(--amber); }
.stat-box.red .stat-num { color: var(--red); }
.stat-box.navy .stat-num { color: var(--navy); }


/* ============ 11. METRICS DRILLDOWN TREE ============ */

/* Tree container */
.tree-container { max-width: 1100px; margin: 0 auto; padding: 32px 24px 80px; overflow: hidden; }

/* How to read legend */
.how-to-read {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 32px;
  padding: 24px; background: white; border: 1px solid var(--border);
  border-radius: 10px;
}
.htr-item {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: var(--muted); line-height: 1.5;
}
.htr-icon {
  width: 32px; height: 32px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0; margin-top: 1px;
  line-height: 1;
}
.htr-item strong { color: var(--black); font-weight: 600; }

/* Node states */
.metric-node { transition: opacity 0.3s; min-width: 0; }
.metric-node.dimmed { opacity: 0.15; pointer-events: none; }

/* Node card base layout */
.node-card {
  display: grid; grid-template-columns: 1fr auto;
  align-items: center; cursor: pointer;
  transition: all 0.2s; position: relative; overflow: hidden;
}

/* Depth 0 - Root */
.node-card.depth-0 {
  background: var(--navy); border: none; border-radius: 12px;
  color: var(--cream); cursor: pointer;
}
.node-card.depth-0:hover { box-shadow: 0 4px 20px rgba(27,54,93,0.25); }
.node-card.depth-0 .node-name { font-size: 22px; color: var(--cream); }
.node-card.depth-0 .node-desc { color: hsla(40,43%,95%,0.6); font-size: 14px; }
.node-card.depth-0 .node-relationship { color: hsla(40,43%,95%,0.4); }
.node-card.depth-0 .node-value-num { color: var(--cream); font-size: 20px; }
.node-card.depth-0 .node-value-label { color: hsla(40,43%,95%,0.5); }
.node-card.depth-0 .level-badge { background: hsla(40,43%,95%,0.15); color: hsla(40,43%,95%,0.7); }
.node-card.depth-0 .node-expand-icon { background: hsla(40,43%,95%,0.15); color: var(--cream); }
.node-card.depth-0.expanded { box-shadow: 0 4px 20px rgba(27,54,93,0.25); }
.node-card.depth-0.expanded .node-expand-icon { background: var(--gold); color: var(--navy); }
.node-card.depth-0 .tracking-status { background: hsla(40,43%,95%,0.15); color: hsla(40,43%,95%,0.8); }
.node-card.depth-0 .ts-dot { background: hsla(40,43%,95%,0.6); }

/* Depth 1 - Primary drivers */
.node-card.depth-1 {
  background: white; border: 2px solid var(--navy); border-radius: 10px;
}
.node-card.depth-1:hover { box-shadow: 0 3px 16px rgba(27,54,93,0.1); }
.node-card.depth-1 .node-name { font-size: 17px; }
.node-card.depth-1.expanded { background: hsl(216,53%,24%,0.03); }

/* Depth 2 - Secondary */
.node-card.depth-2 {
  background: white; border: 1px solid var(--border); border-radius: 8px;
}
.node-card.depth-2:hover { border-color: var(--blue-light); box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.node-card.depth-2 .node-name { font-size: 15px; }

/* Depth 3 - Operational */
.node-card.depth-3 {
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
}
.node-card.depth-3:hover { border-color: var(--gold); }
.node-card.depth-3 .node-name { font-size: 14px; }
.node-card.depth-3 .node-desc { font-size: 11px; }

/* Depth 4 - Activity */
.node-card.depth-4 {
  background: var(--card); border: 1px solid hsl(40,10%,90%); border-radius: 6px;
}
.node-card.depth-4:hover { border-color: var(--subtle); }
.node-card.depth-4 .node-name { font-size: 13px; }
.node-card.depth-4 .node-desc { font-size: 11px; }
.node-card.depth-4 .node-body { padding: 10px 14px; min-height: auto; gap: 10px; }
.node-card.depth-4 .node-meta { padding: 10px 14px; }
.node-card.depth-4 .node-value-num { font-size: 13px; }

/* Leaf styling */
.node-card.leaf .node-expand-icon { background: transparent; color: var(--border); }
.node-card.depth-0.leaf .node-expand-icon { background: transparent; color: hsla(40,43%,95%,0.3); }

/* Node card inner layout */
.node-body {
  padding: 16px 20px; display: flex; align-items: center;
  gap: 14px; min-height: 56px;
}
.node-expand-icon {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: hsl(216,53%,24%,0.07); color: var(--navy);
  flex-shrink: 0; transition: all 0.25s;
}
.node-expand-icon svg { width: 12px; height: 12px; transition: transform 0.25s; }
.node-card.expanded .node-expand-icon svg { transform: rotate(90deg); }
.node-card.expanded .node-expand-icon { background: var(--navy); color: white; }

.node-info { flex: 1; min-width: 0; }
.node-name { font-weight: 600; margin-bottom: 1px; line-height: 1.3; word-wrap: break-word; }
.node-desc { font-size: 12px; color: var(--muted); line-height: 1.4; }
.node-relationship { font-size: 11px; color: var(--subtle); margin-top: 3px; font-style: italic; }

.node-tags { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; align-items: center; }
.level-badge {
  font-size: 9px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 3px;
  background: hsl(216,53%,24%,0.08); color: var(--navy);
}
.dept-tag {
  font-size: 9px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 3px;
}
.dept-tag.sales { background: hsla(216,53%,50%,0.1); color: var(--dept-sales); }
.dept-tag.delivery { background: hsla(152,45%,40%,0.1); color: var(--dept-delivery); }
.dept-tag.compliance { background: hsla(4,55%,50%,0.1); color: var(--dept-compliance); }
.dept-tag.ops { background: hsla(32,60%,50%,0.1); color: var(--dept-ops); }
.dept-tag.finance { background: hsla(270,40%,50%,0.1); color: var(--dept-finance); }
.process-tag {
  font-size: 9px; font-weight: 500; letter-spacing: 0.03em;
  padding: 2px 7px; border-radius: 3px;
  background: hsl(40,20%,92%); color: var(--muted);
}

.node-meta {
  padding: 16px 20px; display: flex; align-items: center; gap: 16px;
  flex-shrink: 0; border-left: 1px solid hsl(40,10%,93%);
}
.node-card.depth-0 .node-meta { border-left-color: hsla(40,43%,95%,0.1); }
.node-value { text-align: right; }
.node-value-num { font-size: 16px; font-weight: 700; line-height: 1.2; }
.node-value-label { font-size: 10px; color: var(--subtle); text-transform: uppercase; letter-spacing: 0.04em; }

/* Children containers */
.node-children { display: none; position: relative; }
.node-children.open { display: block; }
.children-depth-0 { padding: 12px 0 0 0; }
.children-depth-1 { padding: 8px 0 0 32px; }
.children-depth-2 { padding: 6px 0 0 32px; }
.children-depth-3 { padding: 4px 0 0 32px; }
.children-depth-0 > .child-item { margin-bottom: 12px; }
.children-depth-1, .children-depth-2, .children-depth-3 { position: relative; }

/* Vertical connector line - disabled, tree works without them */
.tree-connector-line { display: none; }

/* Child items */
.child-item { position: relative; margin-bottom: 6px; min-width: 0; overflow: hidden; }
.child-item:last-child { margin-bottom: 0; }


/* Children label */
.children-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--subtle);
  padding: 4px 0 6px 4px;
  display: flex; align-items: center; gap: 6px;
}
.children-label svg { width: 12px; height: 12px; color: var(--border); }

/* Detail panel */
.detail-panel {
  display: none; overflow: hidden;
  animation: slideDown 0.2s ease;
  margin-top: -1px; margin-bottom: 8px;
  min-width: 0;
}
.detail-panel.open { display: block; }
@keyframes slideDown {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 200px; }
}
.detail-body {
  padding: 16px 20px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px; font-size: 13px;
  background: hsl(216,53%,24%,0.03);
  border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 8px 8px;
}
.node-card.depth-0 + .detail-panel .detail-body {
  background: hsl(216,53%,24%,0.06);
  border-color: var(--navy);
}
.detail-item dt {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--subtle); font-weight: 600; margin-bottom: 1px;
}
.detail-item dd { color: var(--muted); margin: 0; line-height: 1.5; }


/* ============ 12. CONTROLS & FILTERS ============ */

.controls {
  position: sticky; top: 64px; z-index: 50;
  background: hsla(40,43%,95%,0.96); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border); padding: 10px 24px;
}
.controls-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.control-group { display: flex; align-items: center; gap: 6px; }
.control-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--subtle); margin-right: 2px;
}
.filter-btn {
  font-size: 12px; font-weight: 500; padding: 5px 12px;
  border-radius: 16px; border: 1px solid var(--border);
  background: white; cursor: pointer; transition: all 0.15s;
  font-family: 'Satoshi', sans-serif; color: var(--muted);
}
.filter-btn:hover { border-color: var(--navy); color: var(--black); }
.filter-btn.active { background: var(--navy); color: white; border-color: var(--navy); }


/* ============ 13. TOGGLE ALL BUTTON ============ */

.toggle-all-btn {
  font-family: 'Satoshi', sans-serif; font-size: 12px; font-weight: 500;
  padding: 6px 14px; border-radius: 16px; border: 1px solid var(--border);
  background: white; cursor: pointer; color: var(--muted); transition: all 0.15s;
  margin-bottom: 16px;
}
.toggle-all-btn:hover { border-color: var(--navy); color: var(--black); }
.expand-all-btn {
  margin-left: auto; font-size: 12px; font-weight: 500;
  padding: 5px 14px; border-radius: 16px; border: 1px solid var(--border);
  background: white; cursor: pointer; font-family: 'Satoshi', sans-serif;
  color: var(--muted); transition: all 0.15s;
}
.expand-all-btn:hover { border-color: var(--navy); color: var(--black); }


/* ============ 14. PATH DIVIDERS & SECTION LABELS ============ */

.path-divider {
  margin-top: 14px; padding: 6px 12px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--navy);
  background: hsla(216,53%,24%,0.05); border-radius: 4px;
  border-left: 3px solid var(--navy);
}
.section-label {
  margin-top: 16px; padding: 5px 12px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--navy-mid);
  background: hsla(212,49%,34%,0.06); border-radius: 4px;
}


/* ============ 15. MUTED / UNMAPPED CARDS ============ */

.stage-card.muted-card { opacity: 0.6; border-style: dashed; }
.stage-card.muted-card:hover { opacity: 0.8; }
.unmapped-note { font-size: 12px; color: var(--subtle); font-style: italic; margin-top: 10px; }


/* ============ 16. INDEX CARDS (landing page card grid) ============ */

.cards-section { padding: 64px 24px 80px; }
.cards-inner { max-width: 1100px; margin: 0 auto; }
.cards-label {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--subtle); margin-bottom: 24px; display: block;
}
.cards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px;
}
.tool-card {
  background: white; border: 1px solid var(--border); border-radius: 12px;
  padding: 32px 28px; text-decoration: none; color: inherit;
  transition: all 0.2s ease; display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.tool-card:hover {
  border-color: var(--navy);
  box-shadow: 0 8px 32px hsla(216, 53%, 24%, 0.08);
  transform: translateY(-2px);
}
.tool-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.tool-card.card-navy::before { background: var(--navy); }
.tool-card.card-blue::before { background: var(--blue-light); }
.tool-card.card-amber::before { background: var(--amber); }
.tool-card.card-green::before { background: var(--green); }
.card-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.card-navy .card-icon { background: hsla(216, 53%, 24%, 0.08); color: var(--navy); }
.card-blue .card-icon { background: hsla(209, 37%, 47%, 0.1); color: var(--blue-light); }
.card-amber .card-icon { background: hsla(36, 80%, 50%, 0.1); color: var(--amber); }
.card-green .card-icon { background: hsla(152, 45%, 40%, 0.1); color: var(--green); }
.card-title { font-size: 20px; font-weight: 600; margin-bottom: 8px; line-height: 1.3; }
.card-desc { font-size: 14px; color: var(--muted); line-height: 1.6; margin-bottom: 20px; flex: 1; }
.card-features { list-style: none; margin-bottom: 24px; }
.card-features li {
  font-size: 13px; color: var(--muted); padding: 4px 0;
  padding-left: 20px; position: relative;
}
.card-features li::before {
  content: ''; position: absolute; left: 0; top: 11px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--border);
}
.card-navy .card-features li::before { background: var(--navy); opacity: 0.3; }
.card-blue .card-features li::before { background: var(--blue-light); opacity: 0.3; }
.card-amber .card-features li::before { background: var(--amber); opacity: 0.4; }
.card-green .card-features li::before { background: var(--green); opacity: 0.4; }
.card-cta {
  font-size: 13px; font-weight: 600; color: var(--navy);
  display: flex; align-items: center; gap: 6px;
}
.card-cta svg { width: 14px; height: 14px; transition: transform 0.2s; }
.tool-card:hover .card-cta svg { transform: translateX(3px); }


/* ============ 17. CONTEXT GRID (project context on index) ============ */

.context-section {
  background: var(--card); padding: 56px 24px;
  border-top: 1px solid var(--border);
}
.context-inner { max-width: 1100px; margin: 0 auto; }
.context-label {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--subtle); margin-bottom: 20px; display: block;
}
.context-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px;
}
.context-item { padding: 16px 0; }
.context-item dt {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--subtle); margin-bottom: 4px;
}
.context-item dd { font-size: 15px; color: var(--black); }


/* ============ 18. PERSONA CARDS ============ */

.persona-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.persona-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 28px 28px 24px;
  cursor: pointer; transition: all 0.3s; position: relative;
  display: flex; flex-direction: column;
}
.persona-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.persona-card.active { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy); }
.persona-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.persona-summary { font-size: 14px; color: var(--muted); line-height: 1.6; flex: 1; }
.persona-tag {
  display: inline-block; font-size: 9px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  border-radius: 9999px; padding: 4px 10px;
  margin-top: 12px; align-self: flex-start;
}
.persona-view-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; color: var(--navy);
  margin-top: auto; padding-top: 16px; opacity: 0.7; transition: opacity 0.2s;
}
.persona-card:hover .persona-view-btn { opacity: 1; }
.persona-view-btn svg { width: 14px; height: 14px; }

/* Persona detail panel */
.persona-detail {
  display: none; margin-top: 32px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
  animation: fadeSlideIn 0.3s ease;
}
.persona-detail.visible { display: block; }
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.persona-detail-header {
  padding: 28px 32px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
}
.persona-detail-close {
  margin-left: auto; background: none; border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 14px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
  font-family: 'Satoshi', sans-serif; color: var(--muted);
}
.persona-detail-close:hover { background: var(--cream); color: var(--black); }
.persona-detail-body { padding: 32px; }

/* Sub-persona tabs */
.sub-persona-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
  margin-bottom: 24px; overflow-x: auto;
}
.sub-persona-tab {
  font-size: 13px; font-weight: 500; padding: 12px 20px;
  color: var(--muted); cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; transition: all 0.2s;
}
.sub-persona-tab:hover { color: var(--black); }
.sub-persona-tab.active { color: var(--black); border-bottom-color: var(--gold); }

/* JTBD sections */
.jtbd-section { margin-bottom: 32px; }
.jtbd-section-title {
  font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 12px; color: var(--black);
}
.jtbd-item {
  font-size: 15px; color: var(--muted); padding: 10px 0;
  border-bottom: 1px solid var(--border); line-height: 1.65;
}
.jtbd-item:last-child { border-bottom: none; }


/* ============ 19. SCROLL REVEAL & PAGE TRANSITIONS ============ */

/* Scroll reveal - applied by IntersectionObserver in components.js */
.reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Staggered children - add .stagger to parent, children get delayed */
.stagger > .reveal:nth-child(1) { transition-delay: 0s; }
.stagger > .reveal:nth-child(2) { transition-delay: 0.08s; }
.stagger > .reveal:nth-child(3) { transition-delay: 0.16s; }
.stagger > .reveal:nth-child(4) { transition-delay: 0.24s; }
.stagger > .reveal:nth-child(5) { transition-delay: 0.32s; }
.stagger > .reveal:nth-child(6) { transition-delay: 0.4s; }

/* Page load fade-in */
body {
  animation: pageIn 0.4s ease both;
}
@keyframes pageIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Hero entrance */
.hero, .hero-compact {
  animation: heroIn 0.6s ease both;
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Smooth stage-card expand/collapse */
.stage-content {
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smoother tool-card hover + staggered entrance */
.tool-card {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s ease;
  animation: cardSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.cards-grid .tool-card:nth-child(1) { animation-delay: 0.1s; }
.cards-grid .tool-card:nth-child(2) { animation-delay: 0.2s; }
.cards-grid .tool-card:nth-child(3) { animation-delay: 0.3s; }
.cards-grid .tool-card:nth-child(4) { animation-delay: 0.4s; }
@keyframes cardSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}


/* ============ 20. RESPONSIVE ============ */

@media (max-width: 768px) {
  body { padding-top: 52px; }

  /* Header */
  .specs-header { height: 52px; padding: 0 1rem; }
  .specs-logo svg { height: 16px; }
  .specs-header-meta { gap: 0.75rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .specs-header-meta span, .specs-nav-link { font-size: 11px; white-space: nowrap; }

  /* Nav & controls */
  .nav-tabs { top: 52px; }
  .controls { top: 52px; padding: 8px 16px; }
  .controls-inner { gap: 6px; }
  .control-group { flex-wrap: wrap; }
  .filter-btn { font-size: 11px; padding: 4px 10px; }
  .expand-all-btn { font-size: 11px; padding: 6px 12px; }

  /* Hero */
  .hero { padding: 64px 20px 40px; }
  .hero-compact { padding: 56px 20px 36px; }

  /* Sections */
  .section { padding: 48px 16px; }
  .container { padding: 2rem 1rem 3rem; }

  /* Stage cards */
  .stage-header { grid-template-columns: 1fr; }
  .stage-header-right { border-left: none; padding-left: 0; padding-top: 8px; }
  .stage-content-inner { padding-left: 20px; }

  /* Index cards */
  .cards-grid { grid-template-columns: 1fr; }
  .tool-card { padding: 24px 20px; }

  /* Context */
  .context-section { padding: 40px 20px; }
  .context-grid { grid-template-columns: 1fr 1fr; gap: 12px; }

  /* Metrics tree */
  .tree-container { padding: 24px 12px 60px; }
  .node-body { padding: 12px 14px; gap: 10px; }
  .node-meta { padding: 12px 14px; gap: 10px; }
  .children-depth-1, .children-depth-2, .children-depth-3 { padding-left: 24px; }
  .tree-connector-line { left: 12px !important; }
  .children-depth-1 > .child-item::before,
  .children-depth-2 > .child-item::before,
  .children-depth-3 > .child-item::before { left: -12px; width: 12px; }
  .how-to-read { grid-template-columns: 1fr; gap: 8px; padding: 16px; }
  .detail-body { grid-template-columns: 1fr; }
  .node-card { grid-template-columns: 1fr; }
  .node-meta { border-left: none; border-top: 1px solid hsl(40,10%,93%); justify-content: space-between; }
  .node-name { font-size: 14px !important; }

  /* Metrics rows */
  .metric-row { grid-template-columns: 1fr; gap: 8px; }
  .metric-header { display: none; }

  /* Personas */
  .persona-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 22px; }
  .container { padding: 1.5rem 0.75rem 2rem; }
  .children-depth-1, .children-depth-2, .children-depth-3 { padding-left: 16px; }
  .tree-connector-line { left: 8px !important; }
  .children-depth-1 > .child-item::before,
  .children-depth-2 > .child-item::before,
  .children-depth-3 > .child-item::before { left: -8px; width: 8px; }
  .tree-container { padding: 16px 8px 48px; }
}
