/* Shared look of the site's content pages (index.html, examples.html,
   docs.html): colour tokens and the top bar. The navigation inside the bar is
   site-nav.css, shared with editor.html. */
:root {
  --color-brand:   #a78bfa;
  --color-bg:      #1a1a2e;
  --color-surface: #16213e;
  --color-panel:   #0f3460;
  --color-text:    #e8e8e8;
  --color-muted:   #a0a0b8;
  --color-border:  #2a2a4a;
}
@media (prefers-color-scheme: light) {
  :root {
    --color-brand:   #7c3aed;
    --color-bg:      #f5f3ff;
    --color-surface: #fff;
    --color-panel:   #ede9fe;
    --color-text:    #1a1a1a;
    --color-muted:   #6b7280;
    --color-border:  #ddd6fe;
  }
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

/* ── Top bar: brand + site navigation (same markup as editor.html) ── */
#toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  padding: 0.6rem 1.5rem;
  background: linear-gradient(135deg, #4f62d6 0%, #764ba2 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 10;
}
#toolbar .title-group { display: flex; align-items: baseline; gap: 0.75rem; }
#toolbar h1 { font-size: 1.3rem; font-weight: 700; margin: 0; line-height: 1.2; }
#toolbar h1 a { color: inherit; text-decoration: none; }
#toolbar .tagline { font-size: 0.85rem; }
#audience-toggle a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ── Human/Agent toggle (site.js) ── */
#audience-toggle {
  display: inline-flex;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 999px;
  overflow: hidden;
}
#audience-toggle a {
  padding: 0.1rem 0.75rem;
  color: #fff;
  text-decoration: none;
  font-size: 0.8rem;
}
#audience-toggle a:hover { background: rgba(255,255,255,0.15); }
#audience-toggle a[aria-current="true"] { background: #fff; color: #5b3fa0; font-weight: 600; }
html[data-audience="agent"] .human-only,
html:not([data-audience="agent"]) .agent-only { display: none !important; }

/* Agent view: what an agent reads — raw files and commands. */
.agent-panel {
  margin: 0 0 1.5rem;
  padding: 0.8rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-brand);
  border-radius: 8px;
}
.agent-panel a { color: var(--color-brand); }
.agent-panel pre, pre.raw {
  background: var(--color-panel);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  overflow-x: auto;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
}
pre.raw { white-space: pre-wrap; word-break: break-word; border: 1px solid var(--color-border); background: var(--color-surface); }

/* ── Page body ── */
main { max-width: 960px; margin: 0 auto; padding: 2rem 1rem 3rem; }
main > h2:first-child, .page-title { font-size: 1.6rem; margin: 0 0 0.4rem; }
.page-intro { color: var(--color-muted); margin: 0 0 1.5rem; }
h2 { font-size: 1.2rem; margin: 0 0 1rem; }
section + section { margin-top: 2.5rem; }

/* Cards that link somewhere: the homepage's tiles, the docs overview. */
.links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.75rem; }
.links a {
  display: block;
  height: 100%;
  padding: 0.8rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}
.links a:hover, .links a:focus-visible { border-color: var(--color-brand); }
.links strong { display: block; }
.links span { color: var(--color-muted); font-size: 0.9rem; }

footer { text-align: center; color: var(--color-muted); font-size: 0.85rem; padding: 0 1rem 2rem; }
footer a { color: inherit; }
