/* brain.maibot.io — shared styles. Dark by default, light via prefers-color-scheme. */
:root {
  --bg: #0b0d10;
  --panel: #12151a;
  --panel-2: #171b22;
  --text: #e7ebf0;
  --muted: #9aa4b2;
  --muted-2: #6b7482;
  --border: #232833;
  --accent: #5e8bff;
  --accent-2: #7be0c8;
  --code-bg: #0e1116;
  --max: 46rem;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff; --panel: #f6f8fa; --panel-2: #eef1f5;
    --text: #1a1f27; --muted: #55606e; --muted-2: #7b8593;
    --border: #e2e6eb; --accent: #2563eb; --accent-2: #0f9d8a; --code-bg: #f6f8fa;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.75rem 1.25rem; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px); border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 650; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 18px; height: 18px; border-radius: 5px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.site-nav a { color: var(--muted); font-size: 0.92rem; }
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a.active { color: var(--text); }

/* Shell + optional docs sidebar */
.shell { max-width: 72rem; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.shell.with-sidebar {
  display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: 2.5rem; max-width: 76rem;
}
.docs-sidebar { align-self: start; position: sticky; top: 4.5rem; }
.docs-sidebar-title {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted-2); margin-bottom: 0.6rem;
}
.docs-sidebar a {
  display: block; padding: 0.28rem 0.6rem; margin-left: -0.6rem; border-radius: 7px;
  color: var(--muted); font-size: 0.92rem;
}
.docs-sidebar a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.docs-sidebar a.active { color: var(--text); background: var(--panel-2); font-weight: 550; }

/* Content column */
.content { min-width: 0; max-width: var(--max); }
.with-sidebar .content { max-width: none; }
.content h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 1rem; letter-spacing: -0.01em; }
.content h2 { font-size: 1.35rem; margin: 2.4rem 0 0.8rem; padding-top: 0.4rem; border-top: 1px solid var(--border); }
.content h3 { font-size: 1.08rem; margin: 1.8rem 0 0.5rem; }
.content p, .content li { color: var(--text); }
.content strong { color: var(--text); }
.content a { text-decoration: underline; text-underline-offset: 2px; }
.content ul, .content ol { padding-left: 1.3rem; }
.content li { margin: 0.3rem 0; }
.content blockquote {
  margin: 1.2rem 0; padding: 0.6rem 1rem; border-left: 3px solid var(--accent);
  background: var(--panel); color: var(--muted); border-radius: 0 8px 8px 0;
}
.content hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.content code {
  font-family: var(--mono); font-size: 0.86em; background: var(--code-bg);
  border: 1px solid var(--border); border-radius: 5px; padding: 0.1em 0.35em;
}
.content pre {
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 1rem; overflow-x: auto; font-size: 0.85rem; line-height: 1.55;
}
.content pre code { background: none; border: none; padding: 0; font-size: inherit; }
.content table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: 0.92rem; display: block; overflow-x: auto; }
.content th, .content td { border: 1px solid var(--border); padding: 0.5rem 0.7rem; text-align: left; }
.content th { background: var(--panel); }

/* Landing */
.hero { padding: 2.5rem 0 1.5rem; }
.hero h1 { font-size: 2.6rem; margin: 0 0 0.5rem; letter-spacing: -0.02em; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 40rem; }
.hero-links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.4rem; }
.btn {
  display: inline-block; padding: 0.55rem 1.1rem; border-radius: 9px; font-weight: 550;
  background: var(--accent); color: #fff;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.card { display: block; padding: 1.1rem 1.2rem; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); color: var(--text); }
.card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.card h3 { margin: 0 0 0.3rem; font-size: 1rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border); padding: 1.5rem 1.25rem; margin-top: 2rem;
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; align-items: center; justify-content: space-between;
  color: var(--muted-2); font-size: 0.85rem; max-width: 76rem; margin-left: auto; margin-right: auto;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.site-footer a { color: var(--muted); }

@media (max-width: 52rem) {
  .shell.with-sidebar { grid-template-columns: 1fr; gap: 1rem; }
  .docs-sidebar { position: static; border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 1rem; }
  .hero h1 { font-size: 2.1rem; }
}
