/* Light theme (default). Dark overrides via prefers-color-scheme. */
:root {
  color-scheme: light;
  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --bg-hover: #f4f4f5;
  --border: #e4e4e7;
  --border-subtle: #ececee;
  --text: #09090b;
  --text-muted: #52525b;
  --text-dim: #71717a;
  --accent: #059669;
  --accent-dim: rgba(5, 150, 105, 0.1);
  --accent-border: rgba(5, 150, 105, 0.28);
  --code-bg: #f4f4f5;
  --code-text: #18181b;
  --code-comment: #71717a;
  --code-keyword: #4f46e5;
  --code-string: #047857;
  --btn-primary-fg: #ecfdf5;
  --grid-line: rgba(0, 0, 0, 0.04);
  --radius: 10px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;
  --max: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0a0a0b;
    --bg-elevated: #121214;
    --bg-hover: #1a1a1e;
    --border: #27272a;
    --border-subtle: #1f1f23;
    --text: #fafafa;
    --text-muted: #a1a1aa;
    --text-dim: #71717a;
    --accent: #34d399;
    --accent-dim: rgba(52, 211, 153, 0.12);
    --accent-border: rgba(52, 211, 153, 0.35);
    --code-bg: #18181b;
    --code-text: #e4e4e7;
    --code-comment: #71717a;
    --code-keyword: #a5b4fc;
    --code-string: #86efac;
    --btn-primary-fg: #052e1c;
    --grid-line: rgba(255, 255, 255, 0.02);
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

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

/* subtle grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black, transparent);
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

code,
pre {
  font-family: var(--mono);
  font-size: 0.875em;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

/* nav */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 3rem;
}

.logo {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.logo span {
  color: var(--accent);
}

.logo:hover {
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  font-size: 0.875rem;
}

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

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

/* hero */
.hero {
  margin-bottom: 3.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero .lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 36rem;
  margin-bottom: 1.75rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover {
  text-decoration: none;
}

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

.btn-primary:hover {
  filter: brightness(1.06);
}

@media (prefers-color-scheme: light) {
  .btn-primary:hover {
    filter: brightness(0.95);
  }
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  border-color: var(--text-dim);
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.45rem 0.8rem;
  border-radius: 7px;
}

/* endpoint — prominent, copyable MCP url */
.endpoint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin: 1.1rem 0;
}

.endpoint-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
}

.endpoint code {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--code-text);
  word-break: break-all;
}

.endpoint-copy {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.endpoint-copy:hover {
  border-color: var(--accent-border);
  color: var(--text);
}

.endpoint-copy.copied {
  color: var(--accent);
  border-color: var(--accent-border);
}

.endpoint-sm {
  padding: 0.6rem 0.75rem;
  margin: 0.85rem 0;
}

.endpoint-sm code {
  font-size: 0.78rem;
}

/* sections */
section {
  margin-bottom: 3.25rem;
}

section h2 {
  font-size: 0.75rem;
  font-family: var(--mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
}

section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.6rem;
  letter-spacing: -0.02em;
}

section p {
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

/* cards */
.cards {
  display: grid;
  gap: 0.75rem;
}

.card {
  display: block;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.card:hover {
  border-color: var(--accent-border);
}

.card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.card h3 {
  margin: 0;
  font-size: 1rem;
  font-family: var(--mono);
  font-weight: 500;
  color: var(--text);
}

.card h3 a {
  color: inherit;
  text-decoration: none;
}

.card h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card .tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  white-space: nowrap;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.card p {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

/* why mcp.build — plain list, deliberately not link-like or clickable */
.why-list {
  list-style: none;
  display: grid;
  gap: 1rem;
}

.why-list li {
  padding-left: 1rem;
  border-left: 2px solid var(--border);
}

.why-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.why-list h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.why-list .tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.why-list p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* steps */
.steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 0.75rem;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: start;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  line-height: 1.6;
}

.steps strong {
  display: block;
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.steps span {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* code blocks */
.pre-wrap {
  position: relative;
  margin: 0.85rem 0 1.1rem;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  color: var(--code-text);
  line-height: 1.55;
  font-size: 0.8rem;
}

pre .c {
  color: var(--code-comment);
}

pre .k {
  color: var(--code-keyword);
}

pre .s {
  color: var(--code-string);
}

/* tree */
.tree {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.tree .dir {
  color: var(--text);
}

.tree .file {
  color: var(--accent);
}

/* agent callout */
.callout {
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin: 1rem 0;
}

.callout p {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
}

.callout code {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85em;
}

/* table */
.meta {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 0.75rem 0 1.25rem;
}

.meta th,
.meta td {
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
}

.meta th {
  color: var(--text-dim);
  font-weight: 500;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.meta td {
  color: var(--text-muted);
}

.meta td:first-child {
  font-family: var(--mono);
  color: var(--text);
  font-size: 0.8rem;
}

/* footer */
.footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-dim);
}

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

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

@media (max-width: 520px) {
  .nav-links {
    gap: 0.85rem;
  }

  .card-top {
    flex-direction: column;
    align-items: flex-start;
  }
}
