/* ===== docs.css — the /docs/ documentation shell =====
   Reference density: agentation.com (/features, /mcp) — a fixed side panel
   of links next to a dense content column. Own palette (for.css tokens),
   own type scale. New rules only, prefixed `docs-` — nothing here touches
   an existing .class from for.css or use-case.css. Shared across every page
   under /docs/ (overview, recipes, MCP reference, CLI reference).

   Restraint rules for this shell (owner, 2026-07-25 — "plainer, easier to
   read"). Documentation is read, not admired:
   - body copy is full-size and ink-coloured, never grey and never below 16px;
   - a section is separated by space, not by a rule under its heading;
   - headings are sentence case — small-caps letterspaced labels read as
     marketing rubrics, not as document structure;
   - blocks stay light: no dark panels, no pills, no browser chrome, no fake
     page stubs, no shadows;
   - red appears in exactly two places — the active panel item and the pin. */

/* padding-top/bottom only: the shorthand would zero out .wrap's horizontal
   padding, and on a narrow screen the text ends up flush against the edge. */
.docs-shell{display:grid;grid-template-columns:220px 1fr;gap:64px;align-items:start;padding-top:56px;padding-bottom:110px}

/* ---- side panel ---- */
/* the panel is a <details>, always-open on wide screens (no chrome, the
   summary is hidden) — it only becomes an actual disclosure widget once the
   media query below turns the summary back on and lets it collapse. */
/* sticky lives on the grid item itself, not on the <nav> inside it: the
   <details> is only as tall as its own content, so a sticky child has no room
   to travel and scrolls away with the page. */
.docs-nav-toggle{border:0;padding:0;position:sticky;top:32px;align-self:start}
.docs-nav-toggle summary{display:none}
/* the panel is a <nav>, so for.css's site-header rule (`nav{display:flex;
   justify-content:space-between;align-items:center;padding:26px 0}`) lands on
   it — centring every item and adding stray padding. Reset both explicitly. */
.docs-nav{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:28px;padding:0}
.docs-navgroup h6{font-family:var(--sans);font-size:12px;font-weight:600;letter-spacing:.04em;color:var(--grey);margin-bottom:10px}
.docs-navgroup .docs-links{display:flex;flex-direction:column}
.docs-navgroup a{display:block;padding:7px 10px;margin:0 -10px;border-radius:6px;font-size:14.5px;color:var(--grey);line-height:1.45}
.docs-navgroup a:hover{color:var(--ink);background:var(--acc-soft)}
.docs-navgroup a.on{color:var(--ink);font-weight:600;box-shadow:inset 2px 0 0 var(--red)}

/* ---- main column ---- */
.docs-main{min-width:0}
.docs-main h1{font-family:var(--disp);font-weight:800;font-size:clamp(28px,3.6vw,34px);letter-spacing:-.02em;line-height:1.15}
.docs-main .docs-sub{margin-top:12px;font-size:17px;color:var(--grey);max-width:62ch;line-height:1.6}

/* for.css sets a blanket `section{padding:120px 0}` for the marketing pages —
   override it here, this shell uses tight margins instead. The gap above a
   heading is what separates sections; there is deliberately no rule under it. */
.docs-section{padding:0;margin-top:64px}
.docs-section:first-of-type{margin-top:44px}
.docs-section h2{font-family:var(--disp);font-weight:700;font-size:21px;letter-spacing:-.015em;line-height:1.25;color:var(--ink);margin-bottom:18px}
.docs-section p{font-size:16px;color:var(--ink);max-width:72ch;line-height:1.75}
.docs-section p + p{margin-top:14px}
.docs-section .btn{margin-top:6px}

/* dense unmarked list with mono values — the "seven cases" list and any
   key/value rundown in this shell */
.docs-list{display:flex;flex-direction:column}
.docs-list > *{padding:18px 0;border-top:1px solid var(--line)}
.docs-list > *:first-child{border-top:none;padding-top:0}
.docs-row{display:block}
.docs-row .docs-name{font-family:var(--disp);font-weight:700;font-size:16.5px;letter-spacing:-.01em}
.docs-row .docs-name:hover{text-decoration:underline}
.docs-row .docs-desc{margin-top:5px;font-size:15.5px;color:var(--ink);max-width:68ch;line-height:1.65}
.docs-kv{display:flex;gap:14px;align-items:baseline}
.docs-kv .docs-k{flex:none;width:110px;font-family:var(--mono);font-size:13px;color:var(--grey)}
.docs-kv .docs-v{font-family:var(--mono);font-size:14px;color:var(--ink)}

/* the four-step mechanic — the number is a mono marker, not a filled badge */
.docs-steps{display:flex;flex-direction:column}
.docs-step{display:flex;gap:16px;padding:20px 0;border-top:1px solid var(--line)}
.docs-step:first-child{border-top:none;padding-top:0}
.docs-step .docs-stepnum{flex:none;width:22px;font-family:var(--mono);font-size:14px;font-weight:600;color:var(--grey);line-height:1.55}
.docs-step h3{font-family:var(--disp);font-weight:700;font-size:16.5px;letter-spacing:-.01em;margin-bottom:5px}
.docs-step p{font-size:15.5px;color:var(--ink);max-width:64ch;line-height:1.65}

/* for.css resets every link to `color:inherit;text-decoration:none`, which is
   right for marketing chrome and wrong inside documentation prose — a link the
   reader can't see is a link they don't follow. Underline them here. */
.docs-main .docs-sub a,.docs-section p a,.docs-section li a,.docs-tool p a{text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px}
.docs-main .docs-sub a{color:var(--ink)}
.docs-section p a:hover,.docs-tool p a:hover,.docs-main .docs-sub a:hover{color:var(--red)}
/* links inside a code chip keep the chip's own look; a button is not prose */
.docs-section p a code{text-decoration:none}
.docs-section p a.btn,.docs-section p a.btn:hover{text-decoration:none;color:#fff}

/* pointer from a recipe to its long marketing version — quiet, end of section.
   No colour override on purpose: body copy in this shell stays ink (the guard
   in tests/landing.spec.ts enforces it), and `.docs-section p` would win over
   a single-class grey rule anyway. */
.docs-section .docs-more{margin-top:16px;font-size:15px}

/* a sub-heading inside a long section (plan syntax, one recipe) */
.docs-section .docs-subhead{font-family:var(--disp);font-weight:700;font-size:17px;letter-spacing:-.01em;margin:34px 0 10px}

/* ---- one tool / one command: mono heading, signature, prose ---- */
.docs-tool{padding:26px 0;border-top:1px solid var(--line)}
.docs-tool:first-of-type{border-top:none;padding-top:0;margin-top:26px}
.docs-tool h3{font-family:var(--mono);font-size:15.5px;font-weight:600;letter-spacing:-.01em}
.docs-tool .docs-sig{margin-top:6px;font-size:14px;color:var(--grey);max-width:none}
.docs-tool .docs-sig code{font-family:var(--mono);background:none;padding:0;color:var(--grey)}
.docs-tool p{font-size:16px;color:var(--ink);max-width:72ch;line-height:1.75}
.docs-tool p + p{margin-top:12px}
.docs-tool .docs-sig + p{margin-top:12px}

/* "what the agent gets" — a light key/value block, same weight as the table
   below it; scoped under docs- so it doesn't collide with .ctx .card */
.docs-card{background:var(--acc-soft);border:1px solid var(--line);border-radius:10px;padding:18px 20px;margin-top:20px;font-family:var(--mono);font-size:13.5px;line-height:1.9;overflow-x:auto}
.docs-card > div{display:flex;gap:14px;align-items:baseline;white-space:nowrap}
.docs-card .docs-k{flex:none;width:78px;color:var(--grey)}
.docs-card .docs-v{color:var(--ink)}
.docs-card .docs-sel{color:var(--ink)}

/* ---- example tabs — underlined, sharing one baseline rule ---- */
/* shared by inert link-tabs (recipes/reference pages) and the real <button>
   tabs of the interactive flow demo below — same look, button gets a UA reset */
.docs-tabs{display:flex;gap:26px;flex-wrap:wrap;margin-bottom:22px;border-bottom:1px solid var(--line)}
.docs-tabs a,.docs-tabs button{font-family:var(--sans);font-weight:500;font-size:14.5px;color:var(--grey);padding:0 0 10px;border:0;border-bottom:2px solid transparent;margin-bottom:-1px}
.docs-tabs button{background:none;cursor:pointer}
.docs-tabs a:hover,.docs-tabs button:hover{color:var(--ink)}
.docs-tabs a.on,.docs-tabs button.on{color:var(--ink);font-weight:600;border-bottom-color:var(--ink)}

/* ---- interactive flow demo — Pin / Agent reply / Board, pure JS mock ---- */
/* the "this is a mock, not the extension" line: full-strength ink on purpose —
   an honesty label that reads as a caption gets skipped */
.docs-demo-note{font-size:15px;max-width:70ch;line-height:1.7;margin-bottom:20px}
.docs-panel{margin-top:20px}

/* the stage the mock element sits on — a plain bordered surface, no browser
   chrome and no grey bars pretending to be a page */
.docs-stage{border:1px solid var(--line);border-radius:10px;background:#fff;padding:30px 28px}
.docs-page-btnwrap{position:relative;display:inline-block}
.docs-page-btn{font-family:var(--disp);font-weight:600;font-size:14px;color:#fff;background:var(--ink);border:0;border-radius:8px;padding:10px 20px;cursor:pointer}

/* the pin marker — appears on click, transform/opacity only (paint-cost rule) */
.docs-pin{position:absolute;top:-10px;right:-14px;width:22px;height:22px;border-radius:50%;background:var(--red);color:#fff;font-family:var(--mono);font-weight:700;font-size:11px;display:flex;align-items:center;justify-content:center;opacity:0;transform:scale(.5);transition:transform .18s ease,opacity .18s ease}
.docs-pin.is-set{opacity:1;transform:scale(1)}
@media(prefers-reduced-motion:reduce){.docs-pin{transition:none}}

.docs-demo-hint{margin-top:14px;font-family:var(--mono);font-size:13px;color:var(--grey)}

.docs-reply{margin-top:18px;font-size:15.5px;color:var(--ink);max-width:68ch;line-height:1.65}

/* .acc (for.css) is built for the dark .ctx card — its "Reopen" outline is
   near-invisible on this shell's light background, so re-tone it here */
.docs-panel .acc{margin-top:14px}
.docs-panel .acc .a2{color:var(--ink);border-color:var(--line)}

/* board tab — three static comment rows with a status label */
.docs-board{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:#fff}
.docs-board-row{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:16px 18px;border-top:1px solid var(--line)}
.docs-board-row:first-child{border-top:none}
.docs-board-sel{display:block;font-family:var(--mono);font-size:12.5px;color:var(--grey)}
.docs-board-row p{margin-top:5px;font-size:15px;color:var(--ink);line-height:1.6}
.docs-board-status{flex:none;font-family:var(--sans);font-weight:600;font-size:12.5px;border-radius:6px;padding:4px 10px}
.docs-board-status.is-open{background:var(--red-soft);color:var(--red)}
.docs-board-status.is-fixed{background:#E8F8F1;color:var(--green)}

/* ---- inline code in prose — a quiet neutral chip, not a coloured one ---- */
.docs-section p code,.docs-section li code{font-family:var(--mono);font-size:14px;background:var(--acc-soft);color:var(--ink);padding:2px 6px;border-radius:5px}

/* ---- code block — a command or snippet, own line, can overflow sideways ---- */
.docs-code{background:var(--acc-soft);border:1px solid var(--line);color:var(--ink);border-radius:10px;padding:16px 18px;margin-top:18px;overflow-x:auto}
.docs-code code{display:block;width:max-content;min-width:100%;font-family:var(--mono);font-size:13.5px;line-height:1.75;white-space:pre;background:none;color:inherit;padding:0;border-radius:0}
.docs-code .docs-comment{color:var(--grey)}

/* ---- params table — field / example / source, thin lines, mono first column ---- */
.docs-table-wrap{overflow-x:auto;margin-top:20px}
.docs-table{width:100%;min-width:520px;border-collapse:collapse;font-size:15px}
.docs-table th{text-align:left;font-family:var(--sans);font-weight:600;font-size:13px;color:var(--grey);padding:0 16px 10px 0;border-bottom:1px solid var(--line)}
.docs-table td{padding:13px 16px 13px 0;border-bottom:1px solid var(--line);vertical-align:top;color:var(--ink);line-height:1.6}
.docs-table td:first-child{font-family:var(--mono);font-size:13.5px;white-space:nowrap}
.docs-table td:first-child,.docs-table th:first-child{padding-left:0}
.docs-table tr:last-child td{border-bottom:none}
.docs-table td:nth-child(2){font-family:var(--mono);font-size:13px;color:var(--grey)}

/* ===== scenes — a small staged illustration under each recipe =====
   Every scene is a sequence: elements carry data-at="N" and the player in
   /docs/recipes/ turns them on in order. Rules this shell keeps:
   - only transform and opacity are animated (same paint-cost rule the pin
     overlay follows — an animation that repaints layout costs the reader's
     scroll, and here it would do it seven times per page);
   - nothing plays until the scene is on screen, and each one plays once;
   - prefers-reduced-motion gets the finished state immediately, no timers;
   - every scene is labelled as an illustration. It is not the live product. */

.docs-scene{margin-top:22px}
.docs-scene-stage{position:relative;border:1px solid var(--line);border-radius:10px;background:#fff;padding:24px 22px;overflow:hidden}
.docs-scene [data-at]{opacity:0;transform:translateY(5px);transition:opacity .3s ease,transform .3s ease}
.docs-scene [data-at].is-on{opacity:1;transform:none}
@media(prefers-reduced-motion:reduce){
  .docs-scene [data-at]{transition:none}
}

/* not a flex row: the label is a sentence that may contain a link, and flex
   would turn every text node between the tags into its own item with a gap */
.docs-scene-note{margin-top:10px;font-family:var(--mono);font-size:12.5px;line-height:1.6;color:var(--grey)}
.docs-scene-note a{color:var(--grey);text-decoration:underline;text-underline-offset:3px}
.docs-scene-note a:hover{color:var(--ink)}
.docs-scene-replay{margin-left:10px;font-family:var(--mono);font-size:12.5px;color:var(--grey);background:none;border:0;padding:0;cursor:pointer;text-decoration:underline;text-underline-offset:3px}
.docs-scene-replay:hover{color:var(--ink)}

/* --- scene primitives --- */
.sc-mt{margin-top:16px}
.sc-mb{margin-bottom:9px}
.sc-inline{display:inline-block;margin-bottom:0;vertical-align:middle}
.sc-inline.sc-head{width:180px}
.sc-inline.sc-line{width:220px}
.sc-line{height:9px;border-radius:4px;background:var(--acc-soft);margin-bottom:9px}
.sc-line.w70{width:70%} .sc-line.w45{width:45%} .sc-line.w85{width:85%}
.sc-head{height:13px;width:44%;border-radius:4px;background:var(--line);margin-bottom:14px}
.sc-btn{display:inline-block;font-family:var(--disp);font-weight:600;font-size:13px;color:#fff;background:var(--ink);border-radius:7px;padding:8px 16px}
.sc-anchor{position:relative;display:inline-block}
.sc-pin{position:absolute;top:-9px;right:-12px;width:20px;height:20px;border-radius:50%;background:var(--red);color:#fff;font-family:var(--mono);font-weight:700;font-size:10.5px;display:flex;align-items:center;justify-content:center}
.sc-kv{font-family:var(--mono);font-size:12.5px;line-height:1.85;color:var(--ink)}
.sc-kv b{display:inline-block;min-width:74px;font-weight:400;color:var(--grey)}
.sc-note{font-family:var(--mono);font-size:12.5px;color:var(--grey);margin-top:12px}
.sc-ok{font-family:var(--mono);font-size:12.5px;color:var(--green);margin-top:12px}
.sc-card{border:1px solid var(--line);border-radius:8px;padding:12px 14px;margin-top:12px;background:var(--acc-soft)}
.sc-cols{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.sc-col-head{font-family:var(--mono);font-size:12px;color:var(--grey);margin-bottom:10px;overflow-wrap:anywhere}
.sc-mini{border:1px solid var(--line);border-radius:8px;padding:14px 14px 16px;background:#fff}
.sc-chips{display:flex;gap:7px;flex-wrap:wrap;align-items:center}
.sc-chip{font-family:var(--sans);font-weight:600;font-size:12px;border-radius:6px;padding:4px 10px;background:var(--acc-soft);color:var(--grey)}
.sc-chip.is-red{background:var(--red-soft);color:var(--red)}
.sc-chip.is-navy{background:#E9EDFA;color:#2A3B8F}
.sc-sep{font-family:var(--mono);font-size:12px;color:var(--grey);padding:0 2px}
.sc-rows{display:flex;flex-direction:column;gap:8px}
.sc-row{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid var(--line);border-radius:8px;padding:9px 12px;font-size:14px}
.sc-row .sc-sel{font-family:var(--mono);font-size:12px;color:var(--grey)}
.sc-group{font-family:var(--sans);font-weight:600;font-size:12.5px;color:var(--grey);margin:12px 0 6px}
.sc-group:first-child{margin-top:0}
.sc-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line);padding-bottom:10px;margin-bottom:14px;font-family:var(--mono);font-size:12px;color:var(--grey)}
.sc-lock{font-family:var(--sans);font-weight:600;font-size:12px;color:var(--ink)}

/* walkthrough scene: a ghost cursor travelling to its target */
.sc-frame{position:relative;border:1px solid var(--line);border-radius:8px;background:var(--acc-soft);height:132px;padding:14px}
.sc-target{position:absolute;left:16%;top:56%;font-family:var(--disp);font-weight:600;font-size:12.5px;color:#fff;background:var(--ink);border-radius:6px;padding:6px 12px}
/* The ghost sits at its destination (just off the button) and starts displaced:
   a percentage inside translate() resolves against the element itself — 13px —
   so the travel has to be written as the offset, not as the endpoint. */
.sc-ghost{position:absolute;left:30%;top:66%;width:13px;height:13px;border-radius:50%;background:var(--ink);opacity:0;transform:translate(360px,-78px);transition:transform .8s cubic-bezier(.4,0,.2,1),opacity .3s ease}
.docs-scene.is-playing .sc-ghost{opacity:.85;transform:none}
@media(prefers-reduced-motion:reduce){.sc-ghost{transition:none}}
@media(max-width:700px){
  .sc-ghost{transform:translate(180px,-62px)}
}
.sc-steps{display:flex;gap:6px;margin-top:12px}
.sc-dot{width:6px;height:6px;border-radius:50%;background:var(--line)}
.sc-dot.is-on{background:var(--ink)}
.sc-summary{margin-top:12px;font-size:14px;color:var(--ink);line-height:1.6}
.sc-summary b{font-family:var(--mono);font-size:12px;font-weight:400;color:var(--grey);display:block}

@media(max-width:600px){
  .sc-cols{grid-template-columns:1fr}
}

/* ---- narrow screens: panel collapses into a <details> above content ---- */
@media(max-width:880px){
  .docs-shell{grid-template-columns:1fr;gap:0;padding-top:36px;padding-bottom:80px}
  .docs-nav{padding:0}
  .docs-nav-toggle{display:block;position:static;border:1px solid var(--line);border-radius:10px;padding:14px 16px;margin-bottom:28px}
  .docs-nav-toggle summary{display:block;cursor:pointer;font-family:var(--disp);font-weight:700;font-size:15px;list-style:none}
  .docs-nav-toggle summary::-webkit-details-marker{display:none}
  .docs-nav-toggle summary::after{content:"▾";float:right;color:var(--grey)}
  .docs-nav-toggle[open] summary::after{content:"▴"}
  .docs-nav-toggle .docs-nav{margin-top:18px;gap:22px}
}

/* ---- narrower still: demo board rows stack, status label moves under the text ---- */
@media(max-width:600px){
  .docs-board-row{flex-direction:column;gap:6px}
  .docs-card > div{white-space:normal}
}
