/* Ephemera Documentation Site - CSS */
/* Dark, static, documentation-first */

:root {
  --bg-primary: #0d0d0d;
  --bg-secondary: #151515;
  --bg-tertiary: #1a1a1a;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0a0;
  --text-muted: #707070;
  --accent: #4a9eff;
  --accent-dim: #2a5a8f;
  --border: #2a2a2a;
  --code-bg: #0a0a0a;
  --warning-bg: #1a1a0a;
  --warning-border: #3a3a1a;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
}

/* Layout */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

header {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}

nav {
  display: flex;
  gap: 24px;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
}

nav a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

nav a.active {
  color: var(--text-primary);
}

.repo-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 4px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.repo-btn:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  text-decoration: none !important;
}

main {
  padding: 48px 0 80px;
}

footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Typography */
h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 48px 0 16px;
  color: var(--text-primary);
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 32px 0 12px;
  color: var(--text-primary);
}

p {
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

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

a:hover {
  text-decoration: underline;
}

/* Code blocks */
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 20px;
  overflow-x: auto;
  margin: 16px 0 24px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 3px;
}

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

/* Conceptual flow */
.flow {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px 32px;
  margin: 24px 0 32px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.flow-arrow {
  color: var(--text-muted);
  margin: 0 8px;
}

/* Note boxes */
.note {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-dim);
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.note-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  border-left-color: #8a7a2a;
}

/* Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
  margin: 16px 0 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 500px;
  /* Ensure table doesn't get too squished */
}

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

th {
  color: var(--text-primary);
  font-weight: 600;
  background: var(--bg-secondary);
}

td {
  color: var(--text-secondary);
}

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

/* Lists */
ul,
ol {
  margin: 16px 0 24px;
  padding-left: 24px;
  color: var(--text-secondary);
}

li {
  margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 640px) {
  header .container {
    flex-direction: column;
    gap: 16px;
  }

  nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }

  footer .container {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  h1 {
    font-size: 1.6rem;
  }

  .flow {
    padding: 20px;
    font-size: 0.85rem;
  }
}