:root {
  --canvas: #151716;
  --surface: #1d2120;
  --surface-soft: #242928;
  --surface-raised: #2b3130;
  --text: #f8f4ea;
  --muted: #b8b8ad;
  --faint: #818a83;
  --line: #3b4642;
  --line-soft: #303936;
  --accent: #cc785c;
  --accent-strong: #e08b6f;
  --success: #89b885;
  --info: #8fbcc2;
  --warning: #d5a553;
  --danger: #d97870;
  --code-bg: #101312;
  --code-line: #33403b;
  --max: 1360px;
  color-scheme: dark;
  font-family:
    Inter,
    "DM Sans",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(36, 41, 40, 0.58), rgba(21, 23, 22, 0) 360px),
    var(--canvas);
  color: var(--text);
  font-size: 16px;
  line-height: 1.58;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent-strong);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(204, 120, 92, 0.28);
  outline-offset: 3px;
}

.agent-directive {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(21, 23, 22, 0.94);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(204, 120, 92, 0.45);
  border-radius: 8px;
  background: #202523;
  color: var(--accent-strong);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
}

.brand-mark img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.top-actions a {
  padding: 7px 10px;
  border-radius: 6px;
  transition:
    background 120ms ease,
    color 120ms ease;
}

.top-actions a:hover {
  background: var(--surface-soft);
}

.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 210px;
  gap: 34px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 24px 72px;
}

.sidebar {
  position: sticky;
  top: 75px;
  align-self: start;
  max-height: calc(100dvh - 100px);
  overflow: auto;
  padding-right: 8px;
}

.sidebar-group {
  margin-bottom: 22px;
}

.sidebar-label {
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.sidebar a {
  display: block;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
}

.sidebar a[aria-current="page"],
.sidebar a:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.page-toc {
  position: sticky;
  top: 75px;
  align-self: start;
  max-height: calc(100dvh - 100px);
  overflow: auto;
  padding-left: 14px;
  border-left: 1px solid var(--line-soft);
}

.page-toc a {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.content {
  min-width: 0;
}

.hero {
  padding: 10px 0 24px;
  border-bottom: 1px solid var(--line-soft);
}

.compact-hero {
  padding-bottom: 22px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

h1 {
  max-width: 850px;
  margin: 0;
  font-size: 48px;
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-weight: 650;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    color 120ms ease;
}

.button.primary {
  border-color: rgba(204, 120, 92, 0.6);
  background: var(--accent);
  color: #1a120f;
}

.button:hover {
  border-color: rgba(204, 120, 92, 0.65);
  color: var(--text);
}

.button.primary:hover {
  color: #110c09;
  background: var(--accent-strong);
}

.quick-grid,
.cards-grid,
.machine-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.quick-card,
.card,
.callout,
.resource-card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
}

.quick-card,
.card,
.resource-card {
  padding: 18px;
}

.resource-card {
  display: block;
  min-height: 120px;
  transition:
    border-color 120ms ease,
    background 120ms ease;
}

.resource-card:hover {
  border-color: rgba(204, 120, 92, 0.5);
  background: var(--surface-soft);
  color: var(--text);
}

.resource-card span {
  display: block;
  font-weight: 750;
}

.resource-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.quick-card h2,
.card h2,
.section h2 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

.quick-card p,
.card p,
.section p,
.section li {
  color: var(--muted);
}

.section {
  padding: 28px 0;
  border-bottom: 1px solid var(--line-soft);
}

.section:last-child {
  border-bottom: 0;
}

.section h2,
.section-heading h2 {
  font-size: 28px;
}

.section-heading {
  margin-bottom: 12px;
}

.section-heading .eyebrow {
  margin-bottom: 6px;
}

.section h3 {
  margin: 24px 0 8px;
  font-size: 18px;
}

.callout {
  padding: 16px;
  margin: 18px 0;
  border-color: rgba(204, 120, 92, 0.3);
  background: rgba(204, 120, 92, 0.07);
}

code,
pre {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

code {
  color: #f2c2b1;
}

pre {
  position: relative;
  overflow: auto;
  margin: 16px 0 0;
  padding: 16px;
  border: 1px solid var(--code-line);
  border-radius: 8px;
  background: var(--code-bg);
  color: #f8f4ea;
  font-size: 13px;
  line-height: 1.6;
}

.copyable {
  padding-top: 42px;
}

.copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  padding: 5px 8px;
}

.copy-button:hover {
  color: var(--text);
  border-color: rgba(204, 120, 92, 0.55);
}

.reference-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0;
}

.search {
  flex: 1;
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

.search::placeholder {
  color: var(--faint);
}

.capability-list {
  display: grid;
  gap: 10px;
}

.capability {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
}

.capability-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.method {
  align-self: start;
  justify-self: start;
  min-width: 64px;
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(159, 181, 195, 0.12);
  color: var(--info);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.method.POST,
.method.PUT,
.method.PATCH {
  background: rgba(204, 120, 92, 0.13);
  color: var(--accent-strong);
}

.method.DELETE {
  background: rgba(217, 120, 112, 0.13);
  color: var(--danger);
}

.capability h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.path {
  display: block;
  overflow-wrap: anywhere;
  color: #e6c2b4;
  font-size: 13px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.scope-line {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--muted);
  font-size: 12px;
}

.footer {
  border-top: 1px solid var(--line-soft);
  color: var(--faint);
  font-size: 13px;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 24px;
}

@media (max-width: 1120px) {
  .shell {
    grid-template-columns: 232px minmax(0, 1fr);
  }

  .page-toc {
    display: none;
  }
}

@media (max-width: 880px) {
  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .shell {
    display: block;
    padding: 20px 18px 56px;
  }

  .sidebar {
    position: static;
    display: flex;
    gap: 16px;
    overflow-x: auto;
    max-height: none;
    margin-bottom: 24px;
    padding-bottom: 8px;
  }

  .sidebar-group {
    min-width: 170px;
    margin-bottom: 0;
  }

  .quick-grid,
  .cards-grid,
  .machine-grid {
    grid-template-columns: 1fr;
  }

  .capability {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 36px;
  }
}
