/* ============================================
   base.css — Tokens, reset, typography, tables
   Pure black theme (Anthropic docs-inspired)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Pure black surface — no grayish tint */
  --bg: #000000;
  --bg-soft: #0a0a0a;
  --bg-sidebar: #000000;
  --bg-elevated: #0d0d0d;
  --border: #1c1c1c;
  --border-strong: #2a2a2a;

  /* Light text tuned for pure black (slightly warm off-white) */
  --text: #f2f0eb;
  --text-muted: #a8a59d;
  --text-subtle: #6a6863;

  /* Book cloth coral — brightened for dark bg contrast */
  --accent: #d97757;
  --accent-soft: #5a2f22;
  --accent-dark: #e89677;
  --accent-bg: #1a0e09;

  /* Code — subtle lift from pure black so blocks read as surfaces */
  --code-bg: #0a0a0a;
  --code-bg-inline: #141412;
  --code-text: #e8e5dd;
  --code-text-inline: #d4d1c8;

  --pill-bg: #141412;
  --pill-text: #a8a59d;

  /* Typography */
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  --max-content: 760px;
  --sidebar-width: 260px;
  --header-height: 56px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background: var(--bg);
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv01", "cv11";
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Headings & body text
   ============================================ */

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
  scroll-margin-top: 24px;
}

h1 {
  font-size: 40px;
  line-height: 1.15;
  margin: 0 0 14px;
  letter-spacing: -0.03em;
}

h2 {
  font-size: 28px;
  line-height: 1.25;
  margin: 56px 0 18px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  letter-spacing: -0.02em;
}

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

h3 {
  font-size: 20px;
  line-height: 1.35;
  margin: 32px 0 12px;
  font-weight: 500;
  letter-spacing: -0.015em;
}

h4 {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  margin: 20px 0 8px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

p {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
}

.lead {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 32px;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s, color 0.15s;
}

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

/* ============================================
   Code
   ============================================ */

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--code-bg-inline);
  color: var(--code-text-inline);
  padding: 1.5px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 18px 0 24px;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: var(--code-text);
  font-family: var(--font-mono);
}

/* ============================================
   Lists, strong, hr
   ============================================ */

ul, ol {
  padding-left: 22px;
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 15px;
}

li {
  margin-bottom: 4px;
}

li::marker {
  color: var(--text-subtle);
}

strong {
  color: var(--text);
  font-weight: 600;
}

hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 64px auto;
  max-width: 60px;
  position: relative;
}

hr::after {
  content: "◆";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  padding: 0 12px;
  color: var(--accent);
  font-size: 10px;
}

/* ============================================
   Tables
   ============================================ */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 28px;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--border-strong);
  background: transparent;
}

td {
  color: var(--text-muted);
  line-height: 1.55;
}

td code {
  font-size: 12.5px;
}

/* ============================================
   Selection & scrollbar
   ============================================ */

::selection {
  background: rgba(217, 119, 87, 0.3);
  color: var(--text);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-soft);
  background-clip: padding-box;
  border: 2px solid transparent;
}
