/* ════════════════════════════════════════════════════════════════════════════
   MAS Documentation — Styles (rebased on miloch.dev brand 2026-06-08)
   ────────────────────────────────────────────────────────────────────────────
   Original draft (2026-06-08 first pass) used the MAS-App brand palette
   (Electric Blue + Cyan Glow on Navy). That created a visible design break
   vs the rest of miloch.dev (Landing, Blog, MAS, Pricing — all Steel Blue
   + Light-Premium Surfaces).

   This rebased stylesheet uses the miloch.dev brand tokens:
     - Light-mode default with Stripe/Notion/Apple cleanness
     - Steel Blue #2D6BE4 as accent (matches Landing + Blog + MAS pages)
     - Plus Jakarta Sans (headings) + Inter (body) + JetBrains Mono (code)
     - Light surfaces (FAFBFC / FFFFFF) with subtle borders
     - Code-blocks stay always-dark (standard reading-pattern, matches Blog)
     - Dark-mode toggle is secondary
   ════════════════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════
   TOKENS — Light (default)
   ════════════════════════════════════ */
:root, [data-theme="light"] {
  /* Surfaces */
  --bg:              #FAFBFC;
  --surface:         #FFFFFF;
  --bg-alt:          #F1F3F6;

  /* Text */
  --text:            #151B28;
  --text-2:          #4A5567;
  --text-3:          #8895A7;
  --text-faint:      #CBD3DC;

  /* Brand — Steel Blue (miloch.dev) */
  --accent:          #2D6BE4;
  --accent-hover:    #1E54C4;
  --accent-subtle:   #EBF0FF;
  --accent-2:        #1E8A9E;        /* secondary teal-blue, used for code-block gradients */

  /* Semantic */
  --success:         #1A7A4A;
  --warning:         #B57E00;
  --danger:          #B91C1C;
  --info:            #2563EB;

  /* Borders */
  --border:          #E4E8EE;
  --border-strong:   #CDD3DC;
  --border-accent:   rgba(45,107,228,0.30);

  /* Code (always-dark navy across both themes — matches blog) */
  --code-bg:         #1A2332;
  --code-header:     #151B28;
  --code-text:       #E2E6EC;
  --code-border:     rgba(255,255,255,0.06);
  --code-shadow:     0 4px 24px rgba(21,27,40,0.12);

  /* Shadows */
  --shadow-card:     0 1px 2px rgba(21,27,40,0.03), 0 2px 12px rgba(21,27,40,0.05);
  --shadow-hover:    0 4px 24px rgba(45,107,228,0.12), 0 1px 4px rgba(21,27,40,0.04);

  /* Nav-bar (glass blur) */
  --nav-bg:          rgba(250,251,252,0.85);

  /* Hero — Light-Premium treatment instead of navy billboard */
  --hero-bg:         linear-gradient(135deg, #FFFFFF 0%, #F4F8FF 100%);
  --hero-border:     #E4E8EE;
  --hero-grain:      radial-gradient(circle at 20% 30%, rgba(45,107,228,0.06) 0%, transparent 55%);

  /* Geometry */
  --radius:          12px;
  --radius-sm:       8px;
  --radius-xs:       6px;

  --transition:      all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ════════════════════════════════════
   TOKENS — Dark (secondary)
   ════════════════════════════════════ */
[data-theme="dark"] {
  --bg:              #0F1219;
  --surface:         #171D2A;
  --bg-alt:          #131825;

  --text:            #E4E8F0;
  --text-2:          #9AA3B5;
  --text-3:          #5E6A7E;
  --text-faint:      #3F4860;

  --accent:          #4B8BF5;
  --accent-hover:    #6EA0FF;
  --accent-subtle:   rgba(75,139,245,0.10);
  --accent-2:        #2AB5C9;

  --success:         #2EAA6A;
  --warning:         #D9A030;
  --danger:          #F87171;
  --info:            #60A5FA;

  --border:          #222A3A;
  --border-strong:   #2F3A4E;
  --border-accent:   rgba(75,139,245,0.30);

  --code-bg:         #0B0F17;
  --code-header:     #0F1420;
  --code-text:       #CBD3E0;
  --code-border:     rgba(255,255,255,0.04);
  --code-shadow:     0 4px 24px rgba(0,0,0,0.3);

  --shadow-card:     0 1px 2px rgba(0,0,0,0.2), 0 2px 12px rgba(0,0,0,0.15);
  --shadow-hover:    0 4px 24px rgba(75,139,245,0.15), 0 1px 4px rgba(0,0,0,0.2);

  --nav-bg:          rgba(15,18,25,0.88);

  --hero-bg:         linear-gradient(135deg, #171D2A 0%, #1B2440 100%);
  --hero-border:     #2F3A4E;
  --hero-grain:      radial-gradient(circle at 20% 30%, rgba(75,139,245,0.10) 0%, transparent 55%);
}

/* ════════════════════════════════════
   RESET + BASE
   ════════════════════════════════════ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; transition: background 0.3s ease, color 0.3s ease; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.3s ease, color 0.3s ease;
}
::selection { background: var(--accent); color: white; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent-hover); }

/* ════════════════════════════════════
   TOP-NAV — matches blog/landing pattern
   ════════════════════════════════════ */
.topnav {
  position: sticky; top: 0; z-index: 100;
  height: 64px;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topnav-inner {
  max-width: 1280px; margin: 0 auto;
  height: 100%; padding: 0 48px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 32px;
}
.brand {
  display: flex; align-items: center; gap: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700; font-size: 20px;
  color: var(--text);
  letter-spacing: -0.03em;
}
.brand .dot {
  display: none;     /* matches landing — no logo-tile, just wordmark */
}
.brand .sub {
  color: var(--text-3);
  font-weight: 500;
  font-size: 14px;
  margin-left: 8px;
  letter-spacing: 0;
}
/* "miloch.dev" wordmark — the `.dev` gets the Steel-Blue gradient, same
   as Landing + Blog. The build-time template still emits "MAS" inside
   the brand element; we override here so the visual reads miloch.dev. */
.brand span:first-of-type {
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: initial;
  color: var(--text);
}
.topnav-links { display: flex; align-items: center; gap: 32px; }
.topnav-links a {
  color: var(--text-2);
  font-size: 14px; font-weight: 500;
  position: relative;
}
.topnav-links a:hover { color: var(--text); }
.topnav-links a::after {
  content: '';
  position: absolute; bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.topnav-links a:hover::after, .topnav-links a.current::after { width: 100%; }
.topnav-links a.current { color: var(--text); }
.topnav-actions { display: flex; align-items: center; gap: 10px; }
.search-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-3);
  font-size: 13px;
  cursor: pointer;
  min-width: 220px;
  transition: var(--transition);
  font-family: inherit;
}
.search-btn:hover { border-color: var(--border-strong); color: var(--text-2); }
.search-btn .kbd {
  margin-left: auto;
  padding: 1px 6px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-3);
}
.theme-btn {
  width: 36px; height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.theme-btn:hover { color: var(--text); border-color: var(--border-strong); }
.theme-btn svg { width: 16px; height: 16px; }

/* ════════════════════════════════════
   LAYOUT
   ════════════════════════════════════ */
/* 2026-06-09: Layout-chrome auf Diät — vorher hat der 3-col layout bei
   1280px Viewport nur ~608px Content-Spalte gelassen (Tabellen wurden
   zerquetscht). Jetzt: max-width 1280→1400 für wider monitors, gap
   48→36, padding 48→28, left rail 260→230, right rail 220→190.
   Net effect: +160-220px Content-Breite je nach Viewport. */
.layout {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 190px;
  gap: 36px;
  padding: 0 28px;
}
.layout.layout-2col {
  max-width: 1240px;
  grid-template-columns: 230px minmax(0, 1fr);
}

/* ── Left rail: cluster nav ───── */
.sidebar {
  position: sticky; top: 64px;
  height: calc(100vh - 64px);
  padding: 32px 0;
  overflow-y: auto;
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.nav-cluster { margin-bottom: 22px; }
.nav-cluster-header {
  padding: 6px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.nav-cluster.current .nav-cluster-header { color: var(--accent); }
.nav-item {
  display: block;
  padding: 7px 12px 7px 44px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-xs);
  margin-bottom: 1px;
  transition: var(--transition);
  position: relative;
}
.nav-item:hover { color: var(--text); background: var(--bg-alt); }
.nav-item.current {
  color: var(--accent);
  background: var(--accent-subtle);
  font-weight: 600;
}
.nav-item.current::before {
  content: '';
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--accent);
  border-radius: 2px;
}
.nav-status {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
}
.nav-status.draft { background: var(--text-faint); }
.nav-status.review { background: var(--warning); }
.nav-status.published { background: var(--success); }

/* ── Right rail: on-this-page ──── */
.on-this-page {
  position: sticky; top: 64px;
  height: calc(100vh - 64px);
  padding: 32px 0;
  overflow-y: auto;
}
.otp-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-left: 12px;
}
.otp-link {
  display: block;
  padding: 4px 12px;
  color: var(--text-3);
  font-size: 13px;
  border-left: 2px solid transparent;
  transition: var(--transition);
}
.otp-link:hover { color: var(--text-2); }
.otp-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}
.otp-link.depth-3 { padding-left: 28px; }

/* ════════════════════════════════════
   MAIN CONTENT
   ════════════════════════════════════ */
.content { padding: 0 0 96px 0; min-width: 0; }

/* ── Chapter Hero — Light-Premium-Card with subtle accent ──────────── */
.chapter-hero {
  margin: 40px 0 48px;
  padding: 36px 40px;
  background: var(--hero-bg);
  border: 1px solid var(--hero-border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.chapter-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--hero-grain);
  pointer-events: none;
}
.chapter-hero > * { position: relative; z-index: 1; }
.breadcrumb {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-3); border-bottom: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { opacity: 0.5; }
.cluster-tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px;
  background: var(--accent-subtle);
  border: 1px solid var(--border-accent);
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.cluster-tag .dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}
.chapter-hero h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 42px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  color: var(--text);
}
.chapter-lead {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-2);
  max-width: 680px;
  margin-bottom: 24px;
  font-weight: 400;
}
.chapter-meta {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.meta-item {
  display: flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-3);
}
.meta-item svg { width: 14px; height: 14px; opacity: 0.7; }
.meta-item strong { color: var(--text); font-weight: 600; }
.meta-status {
  padding: 3px 9px;
  border-radius: 4px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}
.meta-status.review { background: rgba(181,126,0,0.10); color: var(--warning); }
.meta-status.published { background: rgba(26,122,74,0.10); color: var(--success); }
.meta-status.draft { background: var(--bg-alt); color: var(--text-3); }

/* ════════════════════════════════════
   PROSE
   ════════════════════════════════════ */
/* 2026-06-09: max-width 760→860 zusammen mit dem Layout-Chrome-Trim.
   Inhaltliche Text-Lesbarkeit bleibt OK (≈ 95 chars/zeile bei body-font),
   Tabellen mit dichten Code-Cells haben deutlich mehr Luft. */
.prose { max-width: 860px; }
.prose p {
  margin-bottom: 18px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.75;
}
.prose strong { color: var(--text); font-weight: 600; }
.prose em { color: var(--text); }
.prose code:not(pre code) {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88em;
  padding: 2px 6px;
  background: var(--accent-subtle);
  color: var(--accent);
  border-radius: 4px;
}
[data-theme="dark"] .prose code:not(pre code) {
  background: var(--accent-subtle);
  color: var(--accent-hover);
}
.prose a {
  font-weight: 500;
  border-bottom: 1px solid var(--accent-subtle);
  padding-bottom: 1px;
}
.prose a:hover { border-bottom-color: var(--accent); }

.prose h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-top: 56px;
  margin-bottom: 18px;
  scroll-margin-top: 80px;
  position: relative;
}
.prose h2::before {
  content: '';
  position: absolute;
  top: 6px;
  left: -16px;
  width: 3px;
  height: calc(100% - 12px);
  background: var(--accent);
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.prose h2:hover::before { opacity: 1; }
.prose h2 a.anchor {
  margin-left: 12px;
  color: var(--text-faint);
  font-weight: 400;
  opacity: 0;
  transition: opacity 0.2s ease;
  border-bottom: none;
}
.prose h2:hover a.anchor { opacity: 1; }
.prose h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-top: 40px;
  margin-bottom: 14px;
  scroll-margin-top: 80px;
}

/* Prose lists */
.prose ul, .prose ol {
  margin: 16px 0 16px 24px;
  color: var(--text);
}
.prose li { margin-bottom: 8px; line-height: 1.7; }
.prose li strong { color: var(--text); }

/* ════════════════════════════════════
   CALLOUTS — Light-Premium card style
   ════════════════════════════════════ */
.callout {
  margin: 24px 0;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--info);
  border-radius: var(--radius-sm);
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  align-items: start;
}
.callout-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(37,99,235,0.10);
  color: var(--info);
  flex-shrink: 0;
}
.callout-icon svg { width: 16px; height: 16px; }
.callout-body { font-size: 15px; line-height: 1.65; color: var(--text-2); }
.callout-body strong { color: var(--text); display: block; margin-bottom: 4px; font-size: 14px; }
.callout-body p:last-child { margin-bottom: 0; }
.callout-body p { margin-bottom: 10px; }

.callout.warning { border-left-color: var(--warning); }
.callout.warning .callout-icon { background: rgba(181,126,0,0.12); color: var(--warning); }
.callout.success { border-left-color: var(--success); }
.callout.success .callout-icon { background: rgba(26,122,74,0.10); color: var(--success); }
.callout.danger { border-left-color: var(--danger); }
.callout.danger .callout-icon { background: rgba(185,28,28,0.10); color: var(--danger); }
.callout.tip { border-left-color: var(--accent); }
.callout.tip .callout-icon { background: var(--accent-subtle); color: var(--accent); }

/* ════════════════════════════════════
   CODE BLOCKS — always-dark navy (matches blog)
   ════════════════════════════════════ */
.code-block {
  margin: 24px 0;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  box-shadow: var(--code-shadow);
}
.code-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: var(--code-header);
  border-bottom: 1px solid var(--code-border);
}
.code-lang {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.code-copy {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  color: rgba(255,255,255,0.6);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  cursor: pointer;
  transition: var(--transition);
}
.code-copy:hover { color: #FFFFFF; border-color: rgba(255,255,255,0.3); }
.code-block pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--code-text);
}
.code-block pre code { color: inherit; background: transparent; border: 0; padding: 0; font-family: inherit; }

/* ════════════════════════════════════
   TABLES — clean, accent-tinted
   ════════════════════════════════════ */
.prose table {
  width: 100%;
  margin: 32px 0;
  border-collapse: collapse;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: var(--surface);
  border: 1px solid var(--border);
}
.prose thead { background: var(--bg-alt); }
.prose th {
  padding: 14px 18px;
  text-align: left;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-strong);
}
.prose td {
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text);
  border-top: 1px solid var(--border);
  vertical-align: top;
}
.prose tr:hover td { background: rgba(45,107,228,0.03); }
.prose td code { white-space: nowrap; }

/* ════════════════════════════════════
   UP-NEXT FINISHER — gradient card
   ════════════════════════════════════ */
.up-next {
  margin-top: 64px;
  padding: 28px 32px;
  background: linear-gradient(135deg, var(--surface) 0%, #F4F8FF 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-card);
}
[data-theme="dark"] .up-next { background: linear-gradient(135deg, var(--surface) 0%, var(--bg-alt) 100%); }
.up-next:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.up-next-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.up-next-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.up-next-desc { color: var(--text-2); font-size: 14px; }
.up-next-arrow {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--accent), #4B8BF5);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(45,107,228,0.25);
  transition: var(--transition);
  flex-shrink: 0;
}
.up-next:hover .up-next-arrow { transform: translateX(4px); }

/* ════════════════════════════════════
   READING-PROGRESS BAR
   ════════════════════════════════════ */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), #4B8BF5, var(--accent-2));
  z-index: 200;
  transition: width 0.1s ease;
}

/* ════════════════════════════════════
   CLUSTER-LANDING PATTERNS
   ════════════════════════════════════ */

.cluster-hero {
  margin: 40px 0 36px;
  padding: 32px 36px 28px;
  background: var(--hero-bg);
  border: 1px solid var(--hero-border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.cluster-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--hero-grain);
  pointer-events: none;
}
.cluster-hero > * { position: relative; z-index: 1; }
/* 2026-06-09: .cluster-hero-grid + .cluster-number-display entfernt — die
   60px-Gradient-Number war ein Vault-Sort-Artefakt ("00", "100", "200")
   und hat Non-IT-Tester verwirrt. Hero-Body läuft jetzt direkt unter dem
   Breadcrumb, full-width. */
.cluster-hero-body { padding-top: 0; }
.cluster-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.cluster-label .dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}
.cluster-hero h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--text);
}
.cluster-lead {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-2);
  max-width: 640px;
  margin-bottom: 16px;
  font-weight: 400;
}
.cluster-stats {
  display: flex; gap: 24px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.cluster-stat-item { display: flex; align-items: baseline; gap: 6px; }
.cluster-stat-num {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700; font-size: 15px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.cluster-stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Framing block */
.framing {
  margin-bottom: 48px;
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}
.framing-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.framing-text {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-2);
}
.framing-text strong { color: var(--text); font-weight: 600; }

/* Chapter cards (visual TOC) */
.chapters-section { margin-bottom: 56px; }
.section-heading {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 26px;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.section-sub { color: var(--text-3); font-size: 14px; margin-bottom: 24px; }
.chapter-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.chapter-card {
  display: flex;
  flex-direction: column;
  padding: 24px 26px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  min-height: 220px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-card);
}
.chapter-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), #4B8BF5);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.chapter-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-hover);
}
.chapter-card:hover::before { opacity: 1; }
.chapter-card-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.chapter-num {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 30px;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), #4B8BF5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.04em;
}
.status-badge {
  padding: 3px 9px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  /* 2026-06-09: Pin status-badge to the right of chapter-card-top regardless
     of how many siblings there are (Top-Level Index cards have just the
     badge after chapter-num was removed; Cluster-Landing cards have
     step-num + badge). */
  margin-left: auto;
}
.status-badge.review { background: rgba(181,126,0,0.10); color: var(--warning); }
.status-badge.draft  { background: var(--bg-alt); color: var(--text-3); }
.status-badge.published { background: rgba(26,122,74,0.10); color: var(--success); }

.chapter-card h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 19px;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.chapter-card p {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.6;
  flex: 1;
  margin-bottom: 18px;
}
.chapter-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-3);
}
.chapter-card-footer .read-arrow {
  color: var(--accent);
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  transition: transform 0.3s ease;
}
.chapter-card:hover .read-arrow {
  transform: translateX(4px);
}

/* Adjacent clusters footer */
.adjacent {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 48px;
}
.adj-card {
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.adj-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}
.adj-direction {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.adj-next { text-align: right; }
.adj-next .adj-direction { justify-content: flex-end; }
.adj-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.adj-sub { color: var(--text-3); font-size: 13px; margin-top: 4px; }

/* ════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════ */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 220px minmax(0, 1fr); padding: 0 32px; }
  .on-this-page { display: none; }
}
@media (max-width: 900px) {
  .topnav-inner { padding: 0 20px; }
  .layout, .layout.layout-2col {
    grid-template-columns: 1fr;
    padding: 0 20px;
    gap: 0;
  }
  .sidebar { display: none; }
  .topnav-links { display: none; }
  .topnav-actions .search-btn { display: none; }
  .chapter-hero, .cluster-hero {
    margin: 24px 0 32px;
    padding: 24px 22px;
  }
  .chapter-hero h1 { font-size: 30px; }
  .cluster-hero h1 { font-size: 24px; }
  .cluster-stats { flex-wrap: wrap; gap: 18px; }
  .adjacent { grid-template-columns: 1fr; }
  .adj-next { text-align: left; }
  .adj-next .adj-direction { justify-content: flex-start; }
}
