:root {
  --bg: #030712;
  --surface: #111827;
  --surface-2: #1f2937;
  --border: #374151;
  --text: #f9fafb;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --accent: #f9fafb;
  --accent-on: #030712;

  --clean: #22c55e;
  --dirty: #f59e0b;
  --ahead: #3b82f6;
  --behind: #ef4444;
  --diverged: #fb923c;

  --radius: 10px;
  --radius-sm: 6px;
  --container: 1040px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "SF Mono", "Menlo", "Monaco", "Consolas", ui-monospace, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --surface: #f9fafb;
    --surface-2: #f3f4f6;
    --border: #e5e7eb;
    --text: #111827;
    --text-muted: #4b5563;
    --text-dim: #6b7280;
    --accent: #111827;
    --accent-on: #ffffff;
  }
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--text-dim);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
}

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

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

h1 { font-size: 2.5rem; letter-spacing: -0.02em; }
h2 { font-size: 1.625rem; }
h3 { font-size: 1.125rem; }

p { margin: 0 0 1em; }

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--surface-2);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
}

pre {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  line-height: 1.5;
}

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

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 2rem;
  font-size: 0.95rem;
}

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

th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

ul, ol {
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.35rem;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}

.brand img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.95rem;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
}

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

/* ---------- Hero ---------- */
.hero {
  padding: 5rem 0 3rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  margin-bottom: 0.75rem;
}

.hero .subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 36rem;
  margin: 0 auto 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.hero-meta {
  font-size: 0.875rem;
  color: var(--text-dim);
  margin-top: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.btn:hover {
  background: var(--surface-2);
  border-color: var(--text-muted);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-on);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  opacity: 0.9;
}

/* ---------- Gatekeeper callout ---------- */
.callout {
  margin: 1.5rem auto 0;
  max-width: 38rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--dirty);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  text-align: left;
  color: var(--text-muted);
}

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

/* ---------- Hero screenshot ---------- */
.hero-shot {
  margin: 3rem auto 0;
  max-width: 960px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6);
}

/* ---------- Features ---------- */
.features {
  padding: 5rem 0 3rem;
}

.features h2 {
  text-align: center;
  margin-bottom: 0.5rem;
}

.features .lead {
  text-align: center;
  color: var(--text-muted);
  max-width: 38rem;
  margin: 0 auto 3rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.feature {
  padding: 1.4rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.feature h3 {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

.feature p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* ---------- Status legend ---------- */
.legend {
  padding: 4rem 0;
}

.legend h2 {
  text-align: center;
  margin-bottom: 2rem;
}

.dots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.6rem 1rem;
  max-width: 720px;
  margin: 0 auto;
}

.dot-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot.clean    { background: var(--clean); }
.dot.dirty    { background: var(--dirty); }
.dot.ahead    { background: var(--ahead); }
.dot.behind   { background: var(--behind); }
.dot.diverged { background: var(--diverged); }

.dot-label { color: var(--text-muted); margin-left: auto; font-size: 0.85rem; }

/* ---------- Secondary screenshots ---------- */
.shots {
  padding: 3rem 0 5rem;
}

.shot {
  margin: 0 auto 2rem;
  max-width: 960px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.shot-caption {
  font-size: 0.9rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 0.5rem;
  margin-bottom: 2.5rem;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-links a {
  margin-left: 1.25rem;
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover { color: var(--text); }

/* ---------- Docs pages ---------- */
.docs {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 3rem;
  padding: 3rem 0;
}

@media (max-width: 720px) {
  .docs { grid-template-columns: 1fr; gap: 1.5rem; }
}

.docs-nav {
  position: sticky;
  top: 80px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.95rem;
}

.docs-nav a {
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.35rem 0;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
}

.docs-nav a:hover { color: var(--text); }

.docs-nav a.active {
  color: var(--text);
  border-left-color: var(--text);
}

.docs-content {
  min-width: 0;
  max-width: 720px;
}

.docs-content h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.docs-content h2 {
  margin-top: 2.5rem;
  font-size: 1.4rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.docs-content h3 {
  margin-top: 1.5rem;
  font-size: 1.05rem;
}

.kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.82em;
  padding: 0.1em 0.5em;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text);
  white-space: nowrap;
}
