:root {
  color-scheme: light dark;
  --bg: #fdfcf9;
  --fg: #1f2328;
  --muted: #59636e;
  --accent: #0b6b4f;
  --rule: #d8dee4;
  --code-bg: #f3f1ea;
  --focus: #b35c00;
  --measure: 40rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --fg: #e6e8eb;
    --muted: #a3acb6;
    --accent: #5fd0a8;
    --rule: #30363d;
    --code-bg: #1f2328;
    --focus: #ffb066;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0 auto;
  max-width: calc(var(--measure) + 2rem);
  padding: 0 1rem 3rem;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:focus-visible,
pre:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  z-index: 1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.site-header {
  padding: 3rem 0 1.5rem;
  border-bottom: 1px solid var(--rule);
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 2.75rem);
  line-height: 1.15;
}

.tagline {
  margin: 0.5rem 0 0;
  font-size: 1.2rem;
  color: var(--muted);
}

.version {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
}

.toc ol {
  padding-left: 1.25rem;
  columns: 2 14rem;
  column-gap: 2rem;
}

h2 {
  margin: 2.75rem 0 0.5rem;
  font-size: 1.6rem;
  line-height: 1.25;
}

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

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

:not(pre) > code {
  padding: 0.1em 0.3em;
  border-radius: 4px;
  background: var(--code-bg);
}

figure {
  margin: 0;
}

pre.example {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--code-bg);
  font-size: 0.85rem;
  line-height: 1.5;
}

figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.principles li,
dd {
  margin-bottom: 0.75rem;
}

dt {
  font-weight: 700;
  margin-top: 1rem;
}

dd {
  margin-left: 0;
}

.site-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.95rem;
}

.agent-discovery {
  margin-top: 1.5rem;
  font-size: 0.85rem;
}

.agent-discovery h2 {
  margin: 0 0 0.25rem;
  font-size: inherit;
  font-weight: 600;
}

.agent-discovery ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.agent-discovery a {
  color: inherit;
}
