:root {
  color-scheme: light;
  --paper: #f7f3e8;
  --ink: #101010;
  --muted: #69645c;
  --line: #d8d0c2;
  --green: #1ed760;
  --code: #151515;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
}

a {
  color: inherit;
}

.agent-index {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-width: 0;
}

.sidebar {
  border-right: 1px solid var(--line);
  height: calc(100vh - 64px);
  overflow: auto;
  padding: 1.5rem 1rem;
  position: sticky;
  top: 64px;
}

.sidebar section + section {
  margin-top: 1.5rem;
}

.sidebar h2 {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  margin: 0 0 0.5rem;
  text-transform: uppercase;
}

.sidebar a {
  border-radius: 0;
  display: block;
  font-size: 0.95rem;
  padding: 0.45rem 0.55rem;
  text-decoration: none;
}

.sidebar a[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
}

.doc {
  max-width: 960px;
  padding: clamp(2rem, 5vw, 5rem);
}

.eyebrow,
.module {
  border: 1px solid var(--ink);
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  font-weight: 800;
  margin: 0 0 1rem;
  padding: 0.3rem 0.45rem;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0;
  line-height: 1;
}

h1 {
  font-size: clamp(2.75rem, 6vw, 4.8rem);
  margin: 0;
  max-width: 14ch;
}

h2 {
  border-top: 1px solid var(--line);
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin: 3rem 0 1rem;
  padding-top: 1rem;
}

h3 {
  font-size: 1.75rem;
  margin: 0;
}

h4 {
  margin: 1rem 0 0.35rem;
}

p,
li {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.intro {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  max-width: 760px;
}

pre {
  background: var(--code);
  color: #f8f3e6;
  margin: 1rem 0;
  overflow-x: auto;
  padding: 1rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.quick-grid {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 2rem 0;
}

.callout,
.api-symbol {
  border: 1px solid var(--line);
  padding: 1rem;
}

.callout strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.api-section {
  margin-top: 2rem;
}

.api-symbol + .api-symbol {
  margin-top: 1rem;
}

.api-symbol ul {
  margin: 0;
  padding-left: 1.25rem;
}

.layout > *,
.doc,
.sidebar {
  min-width: 0;
}

@media (max-width: 860px) {
  .layout,
  .quick-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    border-bottom: 1px solid var(--line);
    border-right: 0;
    display: flex;
    gap: 1rem;
    height: auto;
    overflow-x: auto;
    position: static;
    white-space: nowrap;
  }

  .sidebar section {
    flex: 0 0 auto;
  }

  .sidebar section + section {
    margin-top: 0;
  }

  .sidebar a {
    display: inline-block;
    margin-right: 0.2rem;
  }
}
