/* IBM Plex Mono, self-hosted (SIL OFL 1.1 — see assets/fonts/OFL.txt) */
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400;
  font-display: swap; src: url("fonts/plex-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600;
  font-display: swap; src: url("fonts/plex-mono-600.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 700;
  font-display: swap; src: url("fonts/plex-mono-700.woff2") format("woff2");
}

:root {
  /* warm paper light theme */
  --bg: #fcf9f6;
  --fg: #26201d;
  --muted: #6f6560;
  --accent: #0969da;
  --code-bg: #f4efe9;
  --border: #e3dad2;
  --card: #f6f1ea;
  /* rouge syntax tokens */
  --tok-kw: #cf222e;
  --tok-str: #0a3069;
  --tok-com: #8a7f78;
  --tok-fn: #8250df;
  --tok-var: #953800;
  --tok-num: #0550ae;
  --tok-ins: #1a7f37;
  --tok-ins-bg: #dafbe1;
  --tok-del: #cf222e;
  --tok-del-bg: #ffebe9;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --fg: #e6edf3;
    --muted: #8b949e;
    --accent: #58a6ff;
    --code-bg: #161b22;
    --border: #30363d;
    --card: #161b22;
    --tok-kw: #ff7b72;
    --tok-str: #a5d6ff;
    --tok-com: #8b949e;
    --tok-fn: #d2a8ff;
    --tok-var: #ffa657;
    --tok-num: #79c0ff;
    --tok-ins: #3fb950;
    --tok-ins-bg: rgba(46, 160, 67, 0.15);
    --tok-del: #f85149;
    --tok-del-bg: rgba(248, 81, 73, 0.15);
  }
}

* { box-sizing: border-box; }
:root { --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.65;
  font-size: 1.02rem;
}
main { max-width: 820px; margin: 0 auto; padding: 0 1.25rem 5rem; }
a { color: var(--accent); }
code { font-family: var(--mono); }
p code, li code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.88em; }
pre {
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.1rem 1.2rem; overflow-x: auto; font-size: 0.88rem; line-height: 1.6;
  font-family: var(--mono);
}
pre code { background: none; padding: 0; }
.comment { color: var(--tok-com); font-style: italic; }
h1, h2, h3 { font-family: var(--mono); letter-spacing: -0.01em; }
h2 { margin-top: 3.75rem; margin-bottom: 1rem; font-size: 1.65rem; font-weight: 700; line-height: 1.25; }
h3 { font-size: 1.15rem; }

/* top nav */
nav.top {
  max-width: 820px; margin: 0 auto; padding: 1.2rem 1.25rem;
  display: flex; gap: 1.4rem; align-items: baseline; font-family: var(--mono);
}
nav.top a { text-decoration: none; font-weight: 600; color: var(--muted); font-size: 0.95rem; }
nav.top a:hover { color: var(--accent); }
nav.top a.brand { color: var(--fg); font-size: 1.1rem; font-weight: 700; }
nav.top .spacer { flex: 1; }

/* hero */
header.hero { text-align: center; padding: 4.5rem 1rem 2.5rem; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 3.4rem); margin: 0 0 0.75rem; font-weight: 700; }
.hero h1 code { background: none; }
.hero p.tagline {
  font-size: 1.3rem; color: var(--muted); margin: 0 auto 1.75rem; max-width: 30em;
  line-height: 1.5;
}
.hero .install-line {
  display: inline-block; margin: 0 auto 1.75rem; padding: 0.65rem 1.1rem;
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px;
  font-family: var(--mono); font-size: 0.95rem;
}
.cta { display: inline-flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }
.cta a {
  display: inline-block; padding: 0.65rem 1.3rem; border-radius: 10px;
  text-decoration: none; font-weight: 600; border: 1px solid var(--border);
  color: var(--fg); font-family: var(--mono); font-size: 0.92rem;
}
.cta a.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

/* feature cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; padding: 0; list-style: none; }
.cards li { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1.05rem 1.15rem; }
.cards li strong { display: block; margin-bottom: 0.2rem; font-family: var(--mono); font-size: 0.95rem; }
.cards li span { color: var(--muted); font-size: 0.94rem; }

/* terminal block */
.term { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin: 1.4rem 0; }
.term-bar { display: flex; gap: 6px; padding: 0.6rem 0.95rem; background: var(--card); border-bottom: 1px solid var(--border); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--border); }
.term pre { border: 0; border-radius: 0; margin: 0; }

/* hint callouts: blockquote + {: .hint} (or .hint-agent) in kramdown */
blockquote.hint, blockquote.hint-agent {
  margin: 1.4rem 0; padding: 0.9rem 1.1rem; border-radius: 10px;
  background: var(--card); border: 1px solid var(--border);
  border-left: 4px solid var(--accent); color: var(--fg);
}
blockquote.hint p, blockquote.hint-agent p { margin: 0; }
blockquote.hint-agent p + p { margin-top: 0.5rem; }
blockquote.hint-agent::before {
  content: "FOR AGENTS"; display: block; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.09em; color: var(--accent); margin-bottom: 0.3rem;
  font-family: var(--mono);
}

/* rouge syntax highlighting (kramdown fenced code with a language tag) */
div.highlighter-rouge { position: relative; }
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cp { color: var(--tok-com); font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kc, .highlight .kp,
.highlight .kr, .highlight .kt, .highlight .ow { color: var(--tok-kw); }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sh,
.highlight .si, .highlight .sx, .highlight .sr, .highlight .ss { color: var(--tok-str); }
.highlight .se { color: var(--tok-var); }
.highlight .nb, .highlight .bp, .highlight .no { color: var(--tok-num); }
.highlight .nf, .highlight .fm, .highlight .nc, .highlight .nn { color: var(--tok-fn); }
.highlight .nv, .highlight .vi, .highlight .vg, .highlight .vc, .highlight .na,
.highlight .nt { color: var(--tok-var); }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .mo { color: var(--tok-num); }
.highlight .gi { color: var(--tok-ins); background: var(--tok-ins-bg); }
.highlight .gd { color: var(--tok-del); background: var(--tok-del-bg); }
.highlight .gh, .highlight .gu { color: var(--tok-fn); font-weight: 600; }
.highlight .err { color: inherit; background: none; }

/* copy button on code blocks */
.copy-btn {
  position: absolute; top: 0.5rem; right: 0.5rem; padding: 0.25rem 0.6rem;
  font-size: 0.72rem; font-family: var(--mono); cursor: pointer;
  color: var(--muted); background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; opacity: 0; transition: opacity 0.15s;
}
div.highlighter-rouge:hover .copy-btn, .term:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--accent); }

/* blog */
figure.cover { margin: 1.75rem 0; }
figure.cover img {
  display: block; width: 100%; border: 1px solid var(--border);
  border-radius: 12px; background: #fff; padding: 1rem 0;
}
ul.post-list img.thumb {
  display: block; width: 100%; max-height: 180px; object-fit: cover;
  border: 1px solid var(--border); border-radius: 10px; background: var(--card);
  margin-bottom: 0.4rem;
}
article header h1 { font-size: clamp(1.7rem, 4.5vw, 2.3rem); margin-bottom: 0.35rem; font-weight: 700; line-height: 1.25; }
.post-meta { color: var(--muted); font-size: 0.88rem; font-family: var(--mono); }
ul.post-list { list-style: none; padding: 0; display: grid; gap: 1.3rem; }
ul.post-list h3 { margin: 0 0 0.1rem; font-size: 1.15rem; }
ul.post-list a { text-decoration: none; }
ul.post-list p { margin: 0.25rem 0 0; color: var(--muted); }

/* command index on the generated reference page */
p.cmd-index { display: flex; flex-wrap: wrap; gap: 0.35rem 0.5rem; margin: 1.25rem 0 2rem; }
p.cmd-index a { text-decoration: none; }
p.cmd-index code { background: var(--card); border: 1px solid var(--border); }
.docs-anchor {
  text-decoration: none; color: var(--muted); opacity: 0;
  margin-left: 0.4rem; font-weight: 400; transition: opacity 0.12s;
}
h2:hover .docs-anchor, h3:hover .docs-anchor, h4:hover .docs-anchor,
.docs-anchor:focus { opacity: 1; }
.docs-anchor:hover { color: var(--accent); }
h2[id], h3[id], h4[id] { scroll-margin-top: 1.5rem; }

aside.related { margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
aside.related h2 { margin-top: 0; font-size: 1.15rem; }
aside.related ul { list-style: none; padding: 0; display: grid; gap: 0.9rem; }
aside.related a { text-decoration: none; font-weight: 600; }
aside.related span { display: block; color: var(--muted); font-size: 0.94rem; margin-top: 0.15rem; }

footer {
  text-align: center; color: var(--muted); padding: 2.25rem 1rem;
  border-top: 1px solid var(--border); font-size: 0.88rem; margin-top: 3.5rem;
  font-family: var(--mono);
}
footer a { color: var(--accent); text-decoration: none; }
