/* Nomograph Labs design tokens — shared with nomograph.ai */
:root {
  --paper-50: #faf9f7;
  --paper-100: #f2f0eb;
  --paper-200: #e2e0da;
  --paper-300: #c8c5bc;
  --paper-400: #9c9890;

  --ink-300: #5c5c5c;
  --ink-400: #3d3d3d;
  --ink-500: #1a1a1a;
  --ink-600: #111111;

  --steel-100: #dde4e9;
  --steel-200: #b8c6cf;
  --steel-300: #7d9aaa;
  --steel-400: #4a6072;
  --steel-500: #364858;
  --steel-600: #243040;

  --bg: var(--paper-100);
  --bg-secondary: var(--paper-50);
  --bg-subtle: var(--paper-200);
  --text: var(--ink-500);
  --text-2: var(--ink-300);
  --text-muted: var(--paper-400);
  --border: var(--paper-200);
  --accent: var(--steel-400);
  --accent-hover: var(--steel-500);
  --accent-subtle: var(--steel-100);

  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-serif: 'DM Serif Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --text-xs: 0.7rem;
  --text-sm: 0.84rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--ink-600);
    --bg-secondary: var(--ink-500);
    --bg-subtle: var(--ink-400);
    --text: var(--paper-100);
    --text-2: var(--paper-300);
    --text-muted: var(--paper-400);
    --border: var(--ink-400);
    --accent: var(--steel-300);
    --accent-hover: var(--steel-200);
    --accent-subtle: var(--steel-600);
  }
}

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

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

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 5rem 2rem 6rem;
}

/* Typography */
h1 {
  font-family: var(--font-serif);
  font-size: var(--text-4xl);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

h1 + p {
  font-size: var(--text-lg);
  color: var(--text-2);
  margin-bottom: 3rem;
  max-width: 50ch;
}

h2 {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-top: 3.5rem;
  margin-bottom: 1rem;
}

h3 {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

p {
  margin-bottom: 1rem;
  max-width: 65ch;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 0.12s;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  font-size: var(--text-sm);
  line-height: 1.6;
}

pre code {
  background: none;
  padding: 0;
}

/* Primitives grid */
.primitives {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin: 1.5rem 0 2.5rem;
}

.primitive {
  background: var(--bg);
  padding: 1.5rem;
  border-left: 3px solid var(--accent);
}

.primitive h3 {
  margin-top: 0;
  margin-bottom: 0.25rem;
  color: var(--accent);
}

.primitive p {
  margin-bottom: 0;
  color: var(--text-2);
  font-size: var(--text-sm);
  line-height: 1.55;
}

.question {
  color: var(--text-muted);
  font-style: italic;
  font-size: var(--text-xs);
  margin-top: 0.5rem;
}

/* Callout */
.callout {
  border-left: 3px solid var(--accent);
  padding: 1.5rem 2rem;
  background: color-mix(in srgb, var(--accent) 4%, transparent);
  border-radius: 0 4px 4px 0;
  margin: 2rem 0;
}

.callout p {
  max-width: none;
}

.callout strong {
  color: var(--text);
}

/* Stat cards */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin: 2rem 0;
}

.stat {
  background: var(--bg);
  padding: 1rem;
  text-align: center;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  line-height: 1.15;
}

.stat-detail {
  font-size: var(--text-xs);
  color: var(--text-2);
  margin-top: 0.15rem;
}

/* Page nav */
.page-nav {
  display: flex;
  gap: 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

section {
  padding-top: 1rem;
}

/* Back link */
.back {
  font-size: var(--text-sm);
  margin-bottom: 2rem;
  display: block;
}

/* Read more links */
.links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.links li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}

.links li:last-child { border-bottom: none; }

/* Status */
.status {
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 4%, transparent);
  border-radius: 0 4px 4px 0;
  padding: 1rem 1.25rem;
  margin: 2rem 0;
  font-size: var(--text-sm);
  color: var(--text-2);
}

.status strong { color: var(--text); }

/* Footer */
footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
}

footer a { color: var(--text-muted); }

/* Lists */
ul, ol {
  margin: 0.5rem 0 1rem 1.5rem;
}

li { margin-bottom: 0.25rem; }

strong { font-weight: 600; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: var(--text-sm);
}

th {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-2);
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1.5px solid var(--text);
}

td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

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

/* Responsive */
@media (max-width: 600px) {
  main { padding: 3rem 1.25rem 4rem; }
  .stats { grid-template-columns: 1fr 1fr; }
}
