/* JuL docs: the Macintosh System 1 look of site/index.html (1-bit, one amber accent), tuned for reading. */
:root {
  --ink: #000;
  --paper: #fff;
  --acc: #FFB000;
  --pix: "Jersey 15", "Chicago", "Silkscreen", monospace; /* bitmap face on a 15px grid: crisp at 15/30/45/60px */
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --silk: "Silkscreen", var(--pix);
  --fs: 15px;
  --p-dither: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2' shape-rendering='crispEdges'%3E%3Crect width='2' height='2' fill='%23fff'/%3E%3Crect width='1' height='1' fill='%23000'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%23000'/%3E%3C/svg%3E");
  --p-stripes: repeating-linear-gradient(to bottom, #000 0 1px, #fff 1px 2px);
  --p-hatch: repeating-linear-gradient(135deg, #000 0 1px, #fff 1px 4px);
}

* { box-sizing: border-box; }
html { background: #fff; scroll-padding-top: 48px; }
body {
  margin: 0; color: var(--ink);
  background: var(--p-dither) 0 0 / 2px 2px #fff;
  font: 400 var(--fs)/1.65 var(--mono);
  font-variant-ligatures: none;
}
::selection { background: var(--acc); color: #000; }
a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover, a:focus-visible { background: #000; color: #fff; outline: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.dim { font-style: italic; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 34px; z-index: 200; background: #000; color: #fff; padding: 0 8px; }
* { scrollbar-color: #000 #fff; scrollbar-width: thin; }

/* ── menu bar ── */
.menubar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: stretch;
  height: 26px; padding: 0 8px; background: #fff; border-bottom: 1px solid #000;
  font: 400 20px/1 var(--pix);
}
.menubar a, .menubar button { display: flex; align-items: center; padding: 0 9px; color: #000; text-decoration: none; white-space: nowrap; }
.menubar a:hover, .menubar a:focus-visible, .menubar button:hover, .menubar button:focus-visible { background: #000; color: #fff; }
.menubar .brand { background: var(--acc); padding: 0 8px; margin-right: 6px; }
.menubar .spacer { flex: 1; }
.search { display: flex; align-items: center; gap: 6px; padding-left: 6px; }
.search span { font: 400 11px/1 var(--silk); text-transform: uppercase; }
.search input {
  font: 400 13px/1 var(--mono); width: 22ch; height: 19px; background: #fff; color: #000;
  border: 1px solid #000; border-radius: 0; padding: 0 6px; caret-color: #000;
}
.search input:focus { outline: 2px solid var(--acc); outline-offset: 0; }

/* ── windows (title bar added by docs.js; plain frame without JS) ── */
.win { position: relative; min-width: 0; background: #fff; border: 1px solid #000; box-shadow: 1px 1px 0 #000, 2px 2px 0 #000; }
.win:not(.framed) { padding: 22px 26px; }
.tbar { position: relative; height: 24px; border-bottom: 1px solid #000; background: var(--p-stripes) center / 100% 17px no-repeat #fff; }
.tbar .ttl {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  max-width: calc(100% - 64px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 0 8px; background: #fff; font: 400 20px/1 var(--pix);
}
.tbar .cbox { position: absolute; left: 8px; top: 50%; width: 13px; height: 13px; margin-top: -7px; border: 1px solid #000; background: #fff; box-shadow: 0 0 0 2px #fff; }
.wbody { padding: 22px 26px 26px; min-width: 0; }
.side .wbody { padding: 16px 18px 18px; }

/* ── layout ── */
.layout { max-width: 1320px; margin: 0 auto; padding: 36px 16px 64px; display: grid; grid-template-columns: 30ch minmax(0, 1fr); gap: 28px; align-items: start; }
.side { position: sticky; top: 46px; max-height: calc(100vh - 64px); overflow-y: auto; display: grid; gap: 24px; padding: 0 4px 4px 0; }
.nav-toggle { display: none; font: 400 22px/1 var(--pix); text-align: left; background: #fff; border: 1px solid #000; border-radius: 7px; padding: 6px 14px; box-shadow: 1px 1px 0 #000; }
.nav-h { font: 400 11px/1 var(--silk); text-transform: uppercase; letter-spacing: .04em; margin: 1.3em 0 .5em; }
.nav-h:first-child { margin-top: 0; }
ul.tree { list-style: none; margin: 0; padding: 0; line-height: 1.5; font-size: 14px; }
ul.tree li { display: grid; grid-template-columns: 3ch 1fr; }
ul.tree a { text-decoration: none; }
ul.tree a[aria-current] { background: var(--acc); color: #000; padding: 0 .4ch; }
.toc ul { list-style: none; margin: 0; padding: 0; font-size: 13px; line-height: 1.45; }
.toc li { padding: .12em 0; }
.toc li.l3 { padding-left: 2ch; }
.toc li.l3::before { content: "· "; }
.toc a { text-decoration: none; }
.toc a.on { background: var(--acc); color: #000; }
@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; max-height: none; overflow: visible; padding: 0; }
  .nav-toggle { display: block; justify-self: start; }
  .side .dir, .side .toc { display: none; }
  .side.open .dir { display: block; }
}
@media (max-width: 560px) {
  :root { --fs: 14px; }
  .layout { padding: 22px 10px 48px; }
  .menubar { padding: 0 2px; font-size: 18px; overflow-x: auto; scrollbar-width: none; }
  .menubar a, .menubar button { padding: 0 6px; }
  .menubar .hide-sm { display: none; }
  .search span { display: none; }
  .search input { width: 11ch; }
  .wbody { padding: 18px 14px 20px; }
}

/* ── prose ── */
.prose { max-width: 88ch; }
.prose > :first-child { margin-top: 0; }
.prose h1 { font: 400 60px/.95 var(--pix); margin: .05em 0 .45em; }
.prose h2 { font: 400 45px/1 var(--pix); margin: 1.4em 0 .4em; padding-top: .45em; border-top: 1px solid #000; }
.prose h3 { font: 400 30px/1.05 var(--pix); margin: 1.3em 0 .35em; }
.prose h2 code, .prose h3 code { font: inherit; background: none; border: 0; padding: 0; }
.prose h2 a.dim, .prose h3 a.dim { font-style: normal; opacity: .35; }
@media (max-width: 560px) { .prose h1 { font-size: 45px; } .prose h2 { font-size: 30px; } .prose h3 { font-size: 24px; } }
.prose p, .prose ul, .prose ol, .prose table, .prose pre { margin: 0 0 1em; }
.prose ul { list-style: none; padding: 0; }
.prose ul > li { position: relative; padding-left: 2.4ch; margin-bottom: .35em; }
.prose ul > li::before { content: ""; position: absolute; left: .3ch; top: .62em; width: 6px; height: 6px; background: #000; }
.prose ul > li > p { margin: 0; }
.prose ol { padding-left: 3ch; }
.prose ol > li { margin-bottom: .35em; }
.prose strong { font-weight: 700; }
.prose em { font-style: italic; }
.prose code { font-family: var(--mono); font-size: .92em; background: #f1f1f1; border: 1px solid #d6d6d6; padding: 0 .35ch; }
.prose pre { position: relative; background: #fff; border: 1px solid #000; box-shadow: 2px 2px 0 #000; padding: 14px 16px; overflow-x: auto; line-height: 1.45; }
.prose pre code { background: none; border: 0; padding: 0; font-size: .9em; }
.prose pre .copy {
  position: absolute; top: 6px; right: 6px; font: 400 16px/1 var(--pix); padding: 3px 10px;
  background: #fff; border: 1px solid #000; border-radius: 6px;
}
.prose pre .copy:hover, .prose pre .copy:focus-visible { background: #000; color: #fff; }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; font-variant-numeric: tabular-nums; font-size: .93em; }
.prose th, .prose td { padding: .3em 1.2ch; vertical-align: top; text-align: left; border-bottom: 1px dotted #000; }
.prose th { font: 400 11px/1.3 var(--silk); text-transform: uppercase; letter-spacing: .03em; border-bottom: 2px solid #000; white-space: nowrap; }
.prose th:first-child, .prose td:first-child { padding-left: 0; }
.prose td:first-child code { white-space: nowrap; }
.prose tbody tr:hover { background: #f1f1f1; }
.prose td[align="right"], .prose th[align="right"] { text-align: right; }
.prose img { max-width: 100%; height: auto; }
.prose hr { border: 0; border-top: 1px solid #000; margin: 2em 0; }
.prose blockquote { margin: 0 0 1em; padding: 12px 16px 12px 18px; border: 1px solid #000; border-left: 6px solid var(--acc); background: #fff; }
.prose blockquote > :last-child { margin-bottom: 0; }

/* the docs home: cards as small dialogs */
.prose .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(30ch, 1fr)); gap: 16px; margin: 0 0 1.6em; }
.prose .cards > p { margin: 0; padding: 14px 16px; border: 1px solid #000; box-shadow: 2px 2px 0 #000; background: #fff; }
.prose .cards > p > strong:first-child { display: block; font: 400 30px/1 var(--pix); margin-bottom: .25em; }

.pager { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 2.4em; padding-top: 1em; border-top: 1px solid #000; }
.pager a { font: 400 22px/1 var(--pix); text-decoration: none; border: 1px solid #000; border-radius: 7px; padding: 6px 16px; background: #fff; }
.pager a:hover, .pager a:focus-visible { background: #000; color: #fff; }
.foot { margin-top: 1.4em; font-size: .85em; }

/* ── search ── */
.results { position: fixed; z-index: 60; top: 34px; right: 12px; width: min(76ch, calc(100vw - 24px)); max-height: calc(100vh - 56px); display: flex; flex-direction: column; }
.results[hidden] { display: none; }
.results .wbody { overflow-y: auto; padding: 12px 14px; }
.results ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.results a { display: block; text-decoration: none; padding: 4px 6px; }
.results a .where { font-weight: 700; }
.results a.sel { background: var(--acc); color: #000; }
.results .snip { display: block; font-size: .87em; }
.results mark { background: none; color: inherit; text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  .menubar, .side, .pager, .foot, .tbar { display: none; }
  body { background: #fff; }
  .layout { display: block; }
  .win { border: 0; box-shadow: none; }
}
@media (max-width: 560px) { .prose pre { padding-top: 36px; } }
