@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --olive: #2d3b2d;
  --olive-deep: #1e2a1e;
  --olive-light: #3d4f3d;
  --cream: #faf6ef;
  --cream-dark: #f0ebe0;
  --gold: #c4a265;
  --gold-light: #d4b87a;
  --gold-muted: #a8895a;
  --charcoal: #2c2c2c;
  --text: #3a3a3a;
  --text-light: #6b6b6b;
  --text-sidebar: #c8c2b4;
  --text-sidebar-active: #faf6ef;
  --border: #e0dbd0;
  --code-bg: #f0ebe0;
  --warning-bg: #fdf6e3;
  --warning-border: #c4a265;
  --note-bg: #f0f4f0;
  --note-border: #7a9a7a;
  --sidebar-w: 280px;
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--cream);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--olive-deep);
  border-bottom: 1px solid rgba(196,162,101,0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--cream);
}

.logo-img {
  height: 36px;
  width: auto;
  opacity: 0.95;
}

.logo-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--cream);
}

.logo-divider {
  width: 1px;
  height: 20px;
  background: rgba(196,162,101,0.3);
  margin: 0 4px;
}

.logo-sub {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--gold);
  text-transform: uppercase;
}

.header-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.header-nav a {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-sidebar);
  text-decoration: none;
  transition: color 0.2s;
}

.header-nav a:hover { color: var(--gold); }

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 64px;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--olive-deep);
  overflow-y: auto;
  padding: 24px 0 40px;
  z-index: 90;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--olive-light); border-radius: 2px; }

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-muted);
  padding: 0 28px;
  margin-bottom: 6px;
}

.sidebar-link {
  display: block;
  padding: 7px 28px 7px 32px;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-sidebar);
  text-decoration: none;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}

.sidebar-link:hover {
  color: var(--cream);
  background: rgba(255,255,255,0.04);
}

.sidebar-link.active {
  color: var(--gold-light);
  border-left-color: var(--gold);
  background: rgba(196,162,101,0.08);
  font-weight: 500;
}

.sidebar-version {
  padding: 20px 28px 0;
  font-size: 0.7rem;
  color: var(--olive-light);
  letter-spacing: 0.04em;
}

/* ── Main content ── */
.main {
  margin-left: var(--sidebar-w);
  margin-top: 64px;
  min-height: calc(100vh - 64px);
  display: flex;
  justify-content: center;
}

.content {
  max-width: 760px;
  width: 100%;
  padding: 48px 40px 80px;
}

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--olive-deep);
  line-height: 1.3;
}

h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 36px;
  margin-bottom: 12px;
}

h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 8px;
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.85rem;
  color: var(--olive-light);
}

p { margin-bottom: 16px; }

a {
  color: var(--gold-muted);
  text-decoration: underline;
  text-decoration-color: rgba(168,137,90,0.3);
  text-underline-offset: 2px;
  transition: all 0.15s;
}

a:hover {
  color: var(--gold);
  text-decoration-color: var(--gold);
}

strong { font-weight: 600; color: var(--charcoal); }
em { font-style: italic; }

ul, ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

li {
  margin-bottom: 6px;
}

li::marker {
  color: var(--gold-muted);
}

/* ── Code ── */
code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--olive-deep);
}

pre {
  background: var(--olive-deep);
  color: #d4d0c8;
  padding: 20px 24px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 20px;
  line-height: 1.6;
  border: 1px solid rgba(196,162,101,0.15);
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: 0.85rem;
}

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 0.9rem;
}

thead th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--olive-light);
  background: var(--cream-dark);
  border-bottom: 2px solid var(--border);
}

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

tbody tr:hover { background: rgba(196,162,101,0.04); }

/* ── Callouts ── */
.callout {
  padding: 16px 20px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  line-height: 1.6;
  border-left: 3px solid;
}

.callout-warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
}

.callout-warning .callout-title {
  color: var(--gold-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.callout-note {
  background: var(--note-bg);
  border-color: var(--note-border);
}

.callout-note .callout-title {
  color: var(--olive-light);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

/* ── Pipeline / Steps ── */
.pipeline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0;
  flex-wrap: wrap;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--olive-deep);
}

.pipeline-step {
  background: var(--cream-dark);
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.pipeline-arrow {
  color: var(--gold-muted);
  font-size: 1.1rem;
}

/* ── Status badges ── */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.green { background: #4caf50; }
.status-dot.yellow { background: #ffc107; }
.status-dot.red { background: #f44336; }

/* ── Beta badge ── */
.beta-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 4px;
  background: rgba(196,162,101,0.12);
  color: var(--gold-muted);
  border: 1px solid rgba(196,162,101,0.2);
  vertical-align: middle;
  margin-left: 8px;
}

/* ── Intro lead ── */
.lead {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 24px;
}

/* ── Quick nav grid ── */
.nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 24px 0;
}

.nav-card {
  display: block;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
}

.nav-card:hover {
  border-color: var(--gold-muted);
  background: rgba(196,162,101,0.04);
  transform: translateY(-1px);
}

.nav-card-title {
  font-weight: 600;
  color: var(--olive-deep);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.nav-card-desc {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* ── Footer ── */
.site-footer {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-light);
  text-align: center;
  line-height: 1.8;
}

.site-footer .powered {
  color: var(--gold-muted);
  font-weight: 500;
}

/* ── Page nav (prev/next) ── */
.page-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  gap: 16px;
}

.page-nav a {
  display: block;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s;
  color: var(--text);
}

.page-nav a:hover {
  border-color: var(--gold-muted);
  background: rgba(196,162,101,0.04);
}

.page-nav .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 2px;
}

.page-nav .title {
  font-weight: 600;
  color: var(--olive-deep);
}

/* ── On this page (right sidebar) ── */
.toc {
  position: fixed;
  right: 32px;
  top: 100px;
  width: 200px;
  font-size: 0.78rem;
}

.toc-title {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--olive-light);
  margin-bottom: 10px;
  font-size: 0.68rem;
}

.toc a {
  display: block;
  color: var(--text-light);
  text-decoration: none;
  padding: 3px 0 3px 12px;
  border-left: 1px solid var(--border);
  transition: all 0.15s;
}

.toc a:hover,
.toc a.active {
  color: var(--gold-muted);
  border-left-color: var(--gold);
}

/* ── Mobile hamburger ── */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--cream);
  margin: 4px 0;
  transition: 0.2s;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .toc { display: none; }
}

@media (max-width: 768px) {
  .menu-toggle { display: block; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s;
  }

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

  .main { margin-left: 0; }

  .content { padding: 32px 20px 60px; }

  .nav-grid { grid-template-columns: 1fr; }

  .header-nav { display: none; }
}
