:root {
  color-scheme: light dark;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --ink: #1d232b;
  --muted: #56606d;
  --line: #dcdfe3;
  --accent: #1f5bd8;
  --code-bg: #eef0f3;
  --out-bg: #14181d;
  --out-ink: #d8dee6;
  --mark: #e5484d;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121418;
    --surface: #1a1d22;
    --ink: #e6e8eb;
    --muted: #a3abb5;
    --line: #2d323a;
    --accent: #7aa7ff;
    --code-bg: #242830;
    --out-bg: #0b0d10;
    --out-ink: #d8dee6;
  }
}
:root[data-theme="dark"] {
  --bg: #121418;
  --surface: #1a1d22;
  --ink: #e6e8eb;
  --muted: #a3abb5;
  --line: #2d323a;
  --accent: #7aa7ff;
  --code-bg: #242830;
  --out-bg: #0b0d10;
  --out-ink: #d8dee6;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
code { font: 0.9em/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; }
pre code { background: none; padding: 0; }

.bar { display: flex; gap: 12px; align-items: baseline; max-width: 1080px; margin: 0 auto; padding: 16px; border-bottom: 1px solid var(--line); }
.bar a { font-weight: 700; text-decoration: none; color: var(--ink); }
.bar span { color: var(--muted); }

main { max-width: 1080px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { margin: 0.2em 0 0.4em; font-size: clamp(28px, 4vw, 40px); line-height: 1.15; }
h2 { margin: 1.8em 0 0.5em; font-size: 20px; }
/* Generated tiles (scripts/readme-art.mjs): a filled square reads on both themes, so no filter. */
img.icon { display: inline-block; vertical-align: -0.35em; margin-right: 4px; }
h2 img.icon { vertical-align: -0.3em; margin-right: 8px; }
.lead { max-width: 70ch; font-size: 18px; color: var(--muted); }
.command { margin: 0; }
.command code { font-size: 14px; color: var(--accent); }
.links { color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }

pre { overflow-x: auto; margin: 0.5em 0; padding: 14px 16px; border-radius: 8px; }
/* Wrapped, not scrolled: on a phone a one-line command was cut at the edge ("…demos/integ"), and a
   command is the one thing on the page a reader copies. Long paths break anywhere, spaces first. */
pre.cmd { background: var(--code-bg); font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
pre.output { max-height: 36em; background: var(--out-bg); color: var(--out-ink); font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.exit { margin: 1em 0 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
details summary { cursor: pointer; margin-top: 1em; }

.figures { display: grid; gap: 20px; margin-top: 24px; }
figure { margin: 0; }
figure img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
figcaption { margin-top: 6px; font-size: 14px; color: var(--muted); }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }

.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 15px; }
.pager a:last-child { text-align: right; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.card a { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); text-decoration: none; }
.card a:hover, .card a:focus-visible { border-color: var(--accent); }
.card img { width: 100%; height: 160px; object-fit: cover; object-position: top left; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.card .command code { font-size: 13px; color: var(--accent); }
.card strong { font-size: 16px; line-height: 1.35; }
.more { margin-top: 40px; color: var(--muted); }

.foot { max-width: 1080px; margin: 0 auto; padding: 16px 16px 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
