@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

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

:root {
  --ink: #1a1917;
  --ink-2: #3d3c39;
  --ink-3: #6b6a66;
  --ink-4: #9b9a96;
  --rule: #e4e2dc;
  --rule-2: #f0ede6;
  --bg: #faf9f6;
  --bg-2: #f3f0e9;
  --accent: #1a4d8f;
  --accent-light: #e8eef8;
  --green: #0f6e56;
  --green-light: #e1f5ee;
  --amber: #854f0b;
  --amber-light: #faeeda;
  --pink: #993556;
  --pink-light: #fbeaf0;
  --serif: 'DM Serif Display', Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
  --max: 860px;
  --nav-w: 240px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: var(--nav-w) 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--rule);
  background: var(--bg);
  padding: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--rule);
}

.sidebar-brand-title {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.3;
  color: var(--ink);
  display: block;
}

.sidebar-brand-sub {
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-nav { padding: 16px 0 32px; flex: 1; }

.nav-section { margin-bottom: 4px; }

.nav-section-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-4);
  padding: 12px 24px 6px;
  display: block;
}

.nav-link {
  display: block;
  padding: 7px 24px;
  font-size: 13px;
  color: var(--ink-3);
  text-decoration: none;
  transition: color 0.12s, background 0.12s;
  line-height: 1.4;
}

.nav-link:hover { color: var(--ink); background: var(--rule-2); }
.nav-link.active { color: var(--accent); font-weight: 500; background: var(--accent-light); }

.nav-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  background: var(--ink-4);
}

.nav-link.active .nav-dot { background: var(--accent); }

/* Main content */
.main {
  max-width: var(--max);
  padding: 64px 72px 120px;
}

/* Page header */
.page-header {
  margin-bottom: 56px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--rule);
}

.page-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 12px;
}

.page-title {
  font-family: var(--serif);
  font-size: 42px;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 16px;
  font-weight: 400;
}

.page-intro {
  font-size: 17px;
  color: var(--ink-2);
  line-height: 1.7;
  max-width: 600px;
  font-weight: 300;
}

/* Section headings */
h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  color: var(--ink);
  margin: 56px 0 20px;
  padding-top: 56px;
  border-top: 1px solid var(--rule);
}

h2:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }

h3 {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  margin: 32px 0 12px;
  letter-spacing: -0.01em;
}

h4 {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-4);
  margin: 24px 0 8px;
}

p {
  margin-bottom: 16px;
  color: var(--ink-2);
}

/* Lists */
ul, ol {
  margin: 0 0 16px 0;
  padding-left: 20px;
  color: var(--ink-2);
}

li { margin-bottom: 6px; line-height: 1.65; }

li::marker { color: var(--ink-4); }

/* Callouts */
.callout {
  border-left: 3px solid var(--rule);
  background: var(--rule-2);
  padding: 14px 18px;
  border-radius: 0 6px 6px 0;
  margin: 20px 0;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.65;
}

.callout strong { color: var(--ink); font-weight: 500; }

.callout.warn {
  border-left-color: var(--amber);
  background: var(--amber-light);
  color: #4a2c07;
}

.callout.warn strong { color: #2d1a04; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 20px 0 28px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead tr { border-bottom: 2px solid var(--rule); }

th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 10px 14px 10px 0;
  white-space: nowrap;
}

td {
  padding: 11px 14px 11px 0;
  color: var(--ink-2);
  border-bottom: 1px solid var(--rule-2);
  vertical-align: top;
  line-height: 1.55;
}

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

/* Level cards */
.level-card {
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

.level-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--rule-2);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.level-card-header::-webkit-details-marker { display: none; }

.level-card[open] .level-card-header {
  border-bottom: 1px solid var(--rule);
}

.level-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-ic { background: var(--accent-light); color: var(--accent); }
.badge-mgmt { background: var(--green-light); color: var(--green); }
.badge-ops { background: #eaf3de; color: #3b6d11; }
.badge-pm { background: var(--amber-light); color: var(--amber); }
.badge-research { background: var(--pink-light); color: var(--pink); }
.badge-shared { background: var(--rule-2); color: var(--ink-3); border: 1px solid var(--rule); }

.level-card-title { font-weight: 500; font-size: 14px; flex: 1; }
.level-card-scope { font-size: 12px; color: var(--ink-4); }

.level-card-body { padding: 20px 20px 24px; }

.comp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.comp-block {
  border: 1px solid var(--rule);
  border-radius: 7px;
  padding: 14px;
}

.comp-block-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-4);
  margin-bottom: 10px;
}

.comp-block ul {
  padding-left: 14px;
  margin: 0;
}

.comp-block li {
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 5px;
  line-height: 1.55;
}

.ai-block {
  border: 1px solid var(--rule);
  border-radius: 7px;
  padding: 14px;
  margin-top: 12px;
  background: var(--amber-light);
  border-color: #f5c88a;
}

.ai-block .comp-block-label { color: var(--amber); }

.signals { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }

.signal {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 4px;
  background: var(--rule-2);
  border: 1px solid var(--rule);
  color: var(--ink-3);
}

.signal.gap {
  background: #fde8e8;
  border-color: #f8bfbf;
  color: #7a1f1f;
}

/* Scale table */
.scale-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 20px 0 28px;
}

.scale-cell {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 14px;
}

.scale-name { font-weight: 500; font-size: 14px; margin-bottom: 6px; }
.scale-def { font-size: 12px; color: var(--ink-3); line-height: 1.5; }

/* Track overview grid */
.track-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0 28px;
}

.track-col {
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
}

.track-col-header {
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 500;
}

.track-col-header.ic { background: var(--accent-light); color: var(--accent); }
.track-col-header.mgmt { background: var(--green-light); color: var(--green); }
.track-col-header.ops { background: #eaf3de; color: #3b6d11; }
.track-col-header.pm { background: var(--amber-light); color: var(--amber); }
.track-col-header.research { background: var(--pink-light); color: var(--pink); }

.track-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 16px;
  border-top: 1px solid var(--rule-2);
  font-size: 13px;
}

.track-row-num { font-size: 11px; color: var(--ink-4); width: 22px; flex-shrink: 0; }
.track-row-name { flex: 1; font-weight: 500; }
.track-row-scope { font-size: 11px; color: var(--ink-4); }

.tag-eligible {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--amber-light);
  color: var(--amber);
}

/* Homepage cards */
.doc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 24px 0;
}

.doc-card {
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s, box-shadow 0.12s;
  display: block;
}

.doc-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(26,77,143,0.08);
}

.doc-card-num {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 8px;
}

.doc-card-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.3;
}

.doc-card-desc {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.55;
}

.doc-card-disc {
  display: inline-block;
  margin-top: 10px;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 4px;
}

/* Principles list */
.principles { margin: 20px 0 28px; }
.principle { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--rule-2); }
.principle:last-child { border-bottom: none; }
.principle-num { font-size: 13px; font-weight: 500; color: var(--ink-4); width: 24px; flex-shrink: 0; padding-top: 1px; }
.principle-body { }
.principle-title { font-weight: 500; font-size: 14px; margin-bottom: 4px; }
.principle-desc { font-size: 13px; color: var(--ink-3); line-height: 1.6; }

/* Responsive */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--rule); }
  .main { padding: 40px 28px 80px; }
  .comp-grid, .track-grid, .doc-grid { grid-template-columns: 1fr; }
  .scale-grid { grid-template-columns: 1fr 1fr; }
  .page-title { font-size: 32px; }
}

/* Scrollbar */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 2px; }
