/* SPM Docs — cold monochrome, aligned with the landing design system. */

:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #525252;
  --faint: #8a8a8a;
  --border: #e5e5e5;
  --surface: #fafafa;
  --code-bg: #0a0a0a;
  --code-fg: #e5e5e5;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Geist", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* ---- top bar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { height: 26px; width: 26px; object-fit: contain; }
.brand-word { height: 18px; width: auto; object-fit: contain; }
.brand-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 8px;
}
.topnav { display: flex; gap: 24px; }
.topnav a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.topnav a:hover { color: var(--fg); }

/* ---- layout ---- */
.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  max-width: 1200px;
  margin: 0 auto;
}
.sidebar {
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 28px 16px 48px 24px;
  border-right: 1px solid var(--border);
}
.nav-section {
  margin: 18px 0 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}
.nav-section:first-child { margin-top: 0; }
.nav-link {
  display: block;
  padding: 5px 10px;
  margin: 1px 0;
  border-radius: 6px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.nav-link:hover { color: var(--fg); background: var(--surface); transform: translateX(2px); }
.nav-link.active { color: var(--fg); background: var(--surface); font-weight: 600; }

.content {
  max-width: 780px;
  min-width: 0;
  padding: 44px 48px 80px;
  font-size: 15px;
  line-height: 1.75;
}

/* ---- reveal on load ---- */
.reveal { animation: page-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---- typography ---- */
h1 { font-size: 30px; letter-spacing: -0.02em; margin: 0 0 18px; }
h2 {
  font-size: 21px;
  letter-spacing: -0.01em;
  margin: 40px 0 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
h3 { font-size: 16px; margin: 28px 0 8px; }
p { margin: 12px 0; color: #262626; }
a { color: var(--fg); text-underline-offset: 3px; }
strong { font-weight: 600; }
hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

ul, ol { padding-left: 22px; color: #262626; }
li { margin: 5px 0; }
li::marker { color: var(--faint); }

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  overflow-wrap: anywhere;
}

pre {
  position: relative;
  max-width: 100%;
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: 10px;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.7;
  transition: box-shadow 0.2s ease;
}
pre:hover { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); }
pre code { background: none; border: none; padding: 0; color: inherit; }
pre .copy-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  font-family: var(--mono);
  font-size: 10px;
  color: #8a8a8a;
  background: #161616;
  border: 1px solid #262626;
  border-radius: 6px;
  padding: 3px 8px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease;
}
pre:hover .copy-btn { opacity: 1; }
pre .copy-btn:hover { color: #fafafa; }

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

/* Mobile: tables scroll horizontally instead of widening the page. */
@media (max-width: 900px) {
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  thead, tbody {
    min-width: max-content;
  }
}
th {
  text-align: left;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom: 1px solid var(--fg);
  padding: 8px 10px;
}
td { border-bottom: 1px solid var(--border); padding: 8px 10px; vertical-align: top; }
tr { transition: background 0.12s ease; }
tbody tr:hover { background: var(--surface); }

blockquote {
  margin: 16px 0;
  padding: 10px 16px;
  border-left: 2px solid var(--fg);
  background: var(--surface);
  color: var(--muted);
  border-radius: 0 8px 8px 0;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 64px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
  }
  .content { padding: 28px 24px 64px; }
  .topnav { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; }
  * { transition: none !important; }
}
