/* AgentBeck Docs shell — structure like Deepgram/Kimi; brand tokens locked */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@700;800;900&family=Fira+Code:wght@400;500;600&display=swap");

:root {
  --yellow: #ffc82c;
  --ink: #111;
  --muted: #555;
  --paper: #fffef8;
  --card: #fff;
  --accent: #ff3b00;
  --blue: #1a56db;
  --sidebar: #111;
  --sidebar-text: #e8e8e8;
  --sidebar-muted: #999;
  --sidebar-w: 260px;
  --top-h: 56px;
  --font: "Inter", system-ui, sans-serif;
  --display: "Outfit", system-ui, sans-serif;
  --mono: "Fira Code", ui-monospace, monospace;
  --shadow: 4px 4px 0 #111;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #f4f1e8;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--blue); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; }
code, kbd {
  font-family: var(--mono);
  font-size: 0.88em;
  background: #fff3c4;
  border: 1px solid #111;
  padding: 0.1em 0.35em;
}

/* Top bar */
.docs-top {
  position: sticky; top: 0; z-index: 50;
  height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0 1.25rem;
  background: var(--yellow);
  border-bottom: 3px solid var(--ink);
}
.docs-top .brand {
  display: flex; align-items: center; gap: 0.55rem;
  font-family: var(--display); font-weight: 900; font-size: 1.05rem;
  color: var(--ink); text-decoration: none;
}
.docs-top .brand:hover { text-decoration: none; }
.docs-top .brand span.badge {
  font-size: 0.65rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; background: var(--ink); color: var(--yellow);
  padding: 0.2rem 0.45rem; border: 2px solid var(--ink);
}
.docs-top-links { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; font-size: 0.88rem; }
.docs-top-links a { color: var(--ink); font-weight: 700; }
.docs-top-links a.cta {
  background: var(--ink); color: var(--yellow); padding: 0.35rem 0.7rem;
  border: 2px solid var(--ink); box-shadow: 2px 2px 0 #111; text-decoration: none;
}
.docs-top-links a.cta:hover { transform: translate(1px,1px); box-shadow: 1px 1px 0 #111; text-decoration: none; }

/* Layout */
.docs-shell { display: flex; min-height: calc(100vh - var(--top-h)); }

/* Sidebar */
.docs-side {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--sidebar); color: var(--sidebar-text);
  padding: 1.25rem 0 2.5rem;
  position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h));
  overflow-y: auto; border-right: 3px solid var(--ink);
}
.docs-side .group { margin-bottom: 1.35rem; padding: 0 1rem; }
.docs-side .group-title {
  font-size: 0.65rem; font-weight: 800; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--sidebar-muted); margin-bottom: 0.45rem;
}
.docs-side a {
  display: block; color: var(--sidebar-text); font-weight: 500; font-size: 0.9rem;
  padding: 0.35rem 0.55rem; border-radius: 2px; margin: 0.1rem 0;
  text-decoration: none; border-left: 3px solid transparent;
}
.docs-side a:hover { background: #222; color: var(--yellow); text-decoration: none; }
.docs-side a.active {
  background: #1a1a1a; color: var(--yellow); font-weight: 700;
  border-left-color: var(--yellow);
}

/* Main */
.docs-main {
  flex: 1; min-width: 0;
  padding: 2rem 2.25rem 4rem;
  max-width: 860px;
}
.docs-main h1 {
  font-family: var(--display); font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 900; letter-spacing: -0.02em; line-height: 1.15; margin: 0.25rem 0 0.75rem;
}
.docs-main h2 {
  font-family: var(--display); font-size: 1.35rem; font-weight: 900;
  margin: 2rem 0 0.65rem; padding-top: 0.5rem; border-top: 2px solid #ddd;
}
.docs-main h2:first-of-type { border-top: none; padding-top: 0; }
.docs-main h3 { font-size: 1.05rem; font-weight: 800; margin: 1.25rem 0 0.4rem; }
.docs-main p { margin: 0.55rem 0; color: #222; }
.docs-main ul, .docs-main ol { margin: 0.5rem 0 0.75rem 1.25rem; }
.docs-main li { margin: 0.3rem 0; }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 38em; }

.crumb {
  font-size: 0.8rem; color: var(--muted); margin-bottom: 0.75rem;
}
.crumb a { color: var(--muted); font-weight: 600; }
.k {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent);
}

/* Cards grid (docs home) */
.card-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  margin: 1.25rem 0 1.75rem;
}
.dcard {
  display: block; background: var(--card); border: 3px solid var(--ink);
  box-shadow: var(--shadow); padding: 1.1rem 1.15rem; color: inherit;
  text-decoration: none; transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.dcard:hover {
  transform: translate(-2px, -2px); box-shadow: 6px 6px 0 #111; text-decoration: none; color: inherit;
}
.dcard .k { margin-bottom: 0.35rem; }
.dcard h3 { font-family: var(--display); font-size: 1.1rem; font-weight: 900; margin: 0 0 0.35rem; }
.dcard p { font-size: 0.9rem; color: var(--muted); margin: 0; font-weight: 500; }

/* Callout */
.callout {
  background: var(--yellow); border: 3px solid var(--ink); box-shadow: var(--shadow);
  padding: 1rem 1.15rem; margin: 1.25rem 0;
}
.callout strong { font-weight: 800; }

/* Code */
.pre-wrap { position: relative; margin: 0.85rem 0 1.15rem; }
pre {
  background: #111; color: #e8e8e8; padding: 1rem 1.1rem; overflow-x: auto;
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.5;
  border: 3px solid #111;
}
.copy-btn {
  position: absolute; top: 0.5rem; right: 0.5rem;
  background: var(--yellow); color: var(--ink); border: 2px solid var(--ink);
  font-size: 0.7rem; font-weight: 800; padding: 0.25rem 0.5rem; cursor: pointer;
  font-family: var(--font);
}
.copy-btn:hover { background: #fff; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.92rem; }
th, td { border: 2px solid #111; padding: 0.55rem 0.7rem; text-align: left; background: #fff; }
th { background: var(--yellow); font-weight: 800; }

/* Footer strip */
.docs-foot {
  margin-top: 3rem; padding-top: 1.25rem; border-top: 2px solid #ccc;
  font-size: 0.85rem; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; justify-content: space-between;
}

/* Mobile */
.side-toggle {
  display: none; background: var(--ink); color: var(--yellow);
  border: 2px solid var(--ink); font-weight: 800; padding: 0.3rem 0.6rem; cursor: pointer;
}
@media (max-width: 860px) {
  .docs-shell { flex-direction: column; }
  .docs-side {
    position: relative; top: 0; height: auto; width: 100%; flex: none;
    display: none; border-right: none; border-bottom: 3px solid var(--ink);
  }
  .docs-side.open { display: block; }
  .side-toggle { display: inline-block; }
  .docs-main { padding: 1.25rem 1.1rem 3rem; }
}
