/* /agents: the darker, docs-style page (design: brand h4-terminal). Always dark, by design.
   The tokens are set on body.agents, so they win even if a visitor chose light mode on another page.
   Fonts, nav, buttons and footer come from whozit.css. */
.agents {
  --bg: #0B0D11; --panel: #12151B; --chip: #12151B; --fg: #ECEEF2; --muted: #939BAC; --dim: #7C8394; --line: #262B36;
  --blue: #8F9BFF; --peach: #FFB38A; --danger: #FF9E8F;
  color-scheme: dark;
}
.agents .footer { margin-top: clamp(56px, 9vw, 96px); }

/* ---------- Hero: the whole thing is a prompt ---------- */
.prompt { margin-top: clamp(28px, 7vh, 80px); font-family: var(--mono); }
.prompt p { margin: 0; }
.ask { font-size: clamp(1.75rem, 5.2vw, 4.5rem); line-height: 1.08; letter-spacing: -.035em; text-wrap: balance; }
.ask .gt { color: var(--dim); margin-right: .3em; }
.call { margin-top: 26px !important; font-size: clamp(.8125rem, 1.4vw, 1rem); color: var(--muted); overflow-wrap: anywhere; }
.call b { color: var(--blue); font-weight: 400; }
.answer { margin-top: 18px !important; font: 500 clamp(1.25rem, 3.4vw, 2.75rem)/1.2 var(--sans); letter-spacing: -.03em; max-width: 28ch; min-height: 2.4em; }
.answer .n { color: var(--peach); font-weight: 700; }
.cur { display: inline-block; width: .5em; height: .95em; background: var(--peach); vertical-align: -.1em; margin-left: .1em; }
.src { list-style: none; margin: 18px 0 0; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.src li { font: .8125rem var(--mono); border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 6px 10px; color: var(--muted); overflow-wrap: anywhere; }
.src li b { color: var(--peach); font-weight: 400; }
.src li.q b { color: var(--blue); }
.eg { margin-top: 14px !important; font-size: .75rem; color: var(--dim); }

/* Typing (agents.js). Without the script, or with reduced motion, none of this applies and the full answer shows. */
html.typing .answer, html.typing .src { opacity: 0; }
.typed .c { visibility: hidden; }
.typed .c.on { visibility: visible; }
.typed .c.caret { background: linear-gradient(var(--peach), var(--peach)) 100% 0 / .1em 100% no-repeat; }
.typed .cur { display: none; }
.typed.done .cur { display: inline-block; }
.src.pending { opacity: 0; }
.src { transition: opacity .4s ease; }
@media (prefers-reduced-motion: no-preference) { .cur { animation: blink 1s steps(2) infinite; } @keyframes blink { 50% { opacity: 0; } } }
@media (prefers-reduced-motion: reduce) { .src { transition: none; } }

/* ---------- Intro ---------- */
.intro-wrap { margin-top: clamp(40px, 8vh, 88px); }
.intro { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; border-top: 1px solid var(--line); padding-top: 26px; align-items: start; }
.intro h1 { margin: 0; font-size: clamp(1.75rem, 3.6vw, 2.75rem); font-weight: 800; letter-spacing: -.045em; line-height: 1; }
.intro h1 s { color: var(--dim); font-weight: 500; white-space: nowrap; }
.intro p { margin: 0; color: var(--muted); font-size: 1.0625rem; max-width: 44ch; }
.intro .today { margin-top: 14px; font-size: .9375rem; }
.intro .today a { color: var(--fg); text-underline-offset: 3px; }
.intro .ctas { margin-top: 18px; }

/* ---------- Docs ---------- */
.docs { margin-top: clamp(48px, 8vh, 96px); display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.toc { position: sticky; top: 24px; font: .8125rem var(--mono); }
.toc .eyebrow { margin: 0 0 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: block; padding: 5px 0; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--fg); }
.doc { min-width: 0; max-width: 760px; }
.doc section { margin-top: clamp(52px, 8vw, 80px); scroll-margin-top: 16px; }
.doc section:first-child { margin-top: 0; }
.doc h2 { margin: 0 0 .5em; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.04em; }
.doc h3 { margin: 1.8em 0 .4em; font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.doc p, .doc li { max-width: 66ch; }
.doc p { margin: 0 0 .9em; }
.doc a { text-underline-offset: 3px; }
.doc code { font-family: var(--mono); font-size: .875em; overflow-wrap: anywhere; }
.doc p code, .doc li code { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.doc .aside { color: var(--muted); font-size: .9375rem; margin-top: 12px; }
.ph { color: var(--blue); }
.nm { color: var(--peach); font-weight: 400; }
.uq { color: var(--blue); }

.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.steps > li { counter-increment: s; position: relative; padding-left: 44px; max-width: none; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 1.5px; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; font: .8125rem var(--mono); color: var(--muted); }
.steps h3 { margin-top: .8em; }
.steps > li:first-child h3 { margin-top: 0; }

/* Code blocks scroll inside themselves. */
.code { margin: 14px 0 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); min-width: 0; max-width: 100%; overflow: hidden; }
.code figcaption { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--line); font: .75rem var(--mono); color: var(--muted); min-height: 44px; }
.code figcaption .where { margin-left: auto; text-align: right; }
.code figcaption .copy { order: 2; }
.code pre { margin: 0; padding: 14px; overflow-x: auto; font: .8125rem/1.65 var(--mono); tab-size: 2; white-space: pre; }
.code pre:focus-visible { outline-offset: -3px; }
.doc .code code { font: inherit; background: none; border: 0; padding: 0; overflow-wrap: normal; }
.copy { flex: none; font: .75rem var(--mono); color: var(--fg); background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px; min-height: 32px; min-width: 64px; cursor: pointer; }
.copy:hover { border-color: var(--muted); }
.copy:active { background: var(--line); }

/* The five tools. */
.tools { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.tools > li { border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 16px 18px 14px; max-width: none; }
.tools h3 { margin: 0 0 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-weight: 400; }
.tools h3 code { font-size: 1rem; }
.tools p { margin: 0 0 6px; }
.tools .args { color: var(--muted); font: .8125rem var(--mono); margin: 8px 0 0; }
.hint { font: .75rem var(--mono); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; color: var(--muted); }
.hint.write { color: var(--danger); border-color: currentColor; }

/* How names are marked. */
.marks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 18px 0 22px; }
.mark { border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 16px 18px; }
.mark p { margin: 8px 0 0; }
.mark .label { margin: 0; font: 600 .9375rem var(--sans); }
.mark .ex { display: block; margin-top: 8px; font: .875rem var(--mono); overflow-wrap: anywhere; color: var(--fg); }

.plain { padding-left: 1.25em; margin: 0 0 1em; }
.plain li { margin-bottom: .5em; }
.doc .ctas { margin-top: 20px; }

@media (max-width: 1000px) {
  .docs { grid-template-columns: 1fr; gap: 28px; }
  .toc { position: static; }
  .toc ol { display: flex; flex-wrap: wrap; gap: 0 18px; }
  .toc a { padding: 6px 0; }
}
@media (max-width: 760px) { .intro { grid-template-columns: 1fr; gap: 22px; } }
@media (max-width: 520px) {
  .code figcaption { flex-wrap: wrap; row-gap: 0; padding-block: 6px; }
  .code figcaption .copy { margin-left: auto; }
  .code figcaption .where { order: 3; flex-basis: 100%; margin-left: 0; text-align: left; padding-bottom: 6px; }
}
