/* =========================
   TOKENS (from your design system)
========================= */
:root {
  --bg: #f7f8fc;
  --surface: #ffffff;
  --surface2: #f0f1f7;
  --border: #dde0f0;
  --border2: #c8cce8;

  --purple: #6c5ce7;
  --purple-l: #ede9fc;

  --text: #2d3436;
  --muted: #8a9bb0;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

/* =========================
   NAV (MATCHES .toc STYLE)
========================= */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 60px;

  display: flex;
  gap: 6px;
  flex-wrap: wrap;

  position: sticky;
  top: 0;
  z-index: 100;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

/* hover = pill highlight */
.nav a:hover {
  background: var(--purple-l);
  color: var(--purple);
  border-color: var(--purple);
}

/* active pill */
.nav a.active {
  background: var(--purple-l);
  color: var(--purple);
  border-color: var(--purple);
  font-weight: 600;
}

/* =========================
   DIAGRAMS WRAPPER
========================= */
.diagrams-wrapper {
  padding: 40px 60px;
  background: var(--bg);
  min-height: 100vh;
  width: 100%;
}

/* sections */
.diagrams-wrapper section {
  margin-bottom: 60px;
  scroll-margin-top: 80px;
}

.diagrams-wrapper section h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  border-left: 4px solid var(--purple);
  padding-left: 12px;
  margin-bottom: 8px;
}

.diagrams-wrapper section p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.6;
}

/* cards */
.diagrams-wrapper .diagram-card {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  overflow: visible;
}

/* SVG scaling */
.diagrams-wrapper svg {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
}

/* TEXT CLASSES */
.diagrams-wrapper .lb {
  font-size: 12px;
  font-weight: 700;
  fill: #222;
}

.diagrams-wrapper .ls {
  font-size: 10px;
  fill: #555;
}

.diagrams-wrapper .lh {
  font-size: 13px;
  font-weight: 700;
  fill: #1a1a2e;
}

.diagrams-wrapper .sec {
  font-size: 11px;
  fill: #888;
}

/* =========================
   DARK MODE
========================= */
.dark-mode {
  --bg: #1a1a1a;
  --surface: #2a2a2a;
  --surface2: #222;
  --border: #333;
  --text: #ffffff;
  --muted: #bbbbbb;
}

.dark-mode .nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.dark-mode .nav a:hover,
.dark-mode .nav a.active {
  background: rgba(108, 92, 231, 0.2);
  border-color: var(--purple);
}

.dark-mode .diagram-card {
  background: var(--surface);
  border-color: var(--border);
}
