/* From site/style.css, copied at build time. */
@font-face {
  font-family: "Obel Mono";
  src: url("fonts/obel-mono.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/plex-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Ghost Mark";
  src: url("fonts/ghost-mark.woff2") format("woff2");
  unicode-range: U+15E3;
  font-display: block;
}

:root {
  color-scheme: dark;
  --ground: #0b0b0b;
  --surface: #161616;
  --surface-hi: #212121;
  --line: #2a2a2a;
  --ink: #ffffff;
  --ink-body: #c9c9c9;
  --ink-2: #8a8a8a;
  --dot: #6e6e6e;           /* idle island dots and ticks; 3.5:1 on the surface */
  --violet: #7457e0;        /* lines, dots, bars, filled buttons; never small text */
  --violet-deep: #2a1b4e;   /* fills, selection */
  --violet-ink: #a593f2;    /* text and links on dark */
  --bar: #626262;           /* chart bars that lose, unheard sound; 3.2:1 on the ground */
  --st-idle: #808080;       /* Claude Code's 256-color status codes */
  --st-run: #bcbcbc;
  --st-amber: #ffaf00;
  --st-red: #ff5f5f;
  --st-violet: #875fff;     /* the status line's "rescue" */
  --term-line: #7d7d7d;     /* the rule a terminal card is drawn with */
  --pro-wash: #14101f;      /* the Pro column: the deep violet, thinned on the ground */
  --pro-line: #2f2843;      /* a hairline on that wash */
  --ghost-mask: #eef1ff;    /* the mark's mask, for its blinking lids */
  --gutter: clamp(20px, 4vw, 56px);
  --sec-pad: clamp(3.4rem, 7vw, 6rem);
  --out: cubic-bezier(0.16, 1, 0.3, 1);      /* arrivals */
  --io: cubic-bezier(0.65, 0, 0.35, 1);      /* travel that stays on screen */
  --spring: cubic-bezier(0.34, 1.5, 0.5, 1); /* the island and a press, nothing else */
  --flow: 0.9rem;           /* space between blocks of copy */
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "Obel Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* The docs: the landing page's tokens and type (above), set for long reading. */
:root {
  --measure: 44rem;
  --side: 14.5rem;
  --toc: 15rem;
  --code: "Ghost Mark", var(--mono);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  scrollbar-color: var(--dot) var(--ground);
  accent-color: var(--violet);
}
::selection { background: var(--violet-deep); color: var(--ink); }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink-body);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
a { color: var(--violet-ink); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--violet-ink); outline-offset: 3px; border-radius: 4px; }
code, pre, kbd { font-family: var(--code); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -100px; z-index: 10;
  padding: 0.6rem 1rem; background: var(--violet); color: var(--ink); border-radius: 999px;
  font: 400 0.9rem/1 var(--mono); text-decoration: none;
}
.skip:focus { top: 12px; }

/* Header: the landing's lockup at half its unit, then the way back to the site. */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: 1320px; margin: 0 auto; padding: 1rem var(--gutter) 0.9rem;
  border-bottom: 1px solid var(--line);
}
.brand { --u: 2px; display: flex; align-items: flex-end; gap: calc(3 * var(--u)); color: var(--ink); text-decoration: none; }
.g { display: block; flex: none; width: calc(16 * var(--u)); height: calc(16 * var(--u)); }
.g img { display: block; width: 100%; height: 100%; }
.wordmark { width: calc(34 * var(--u)); height: calc(9 * var(--u)); margin-bottom: calc(-2 * var(--u)); }
.wm-ink { fill: var(--ink); }
.wm-zero { fill: var(--violet); }
.docs-tag { margin: 0 0 calc(-0.5 * var(--u)) 0.35rem; font: 400 0.84rem/1 var(--mono); color: var(--ink-2); }
.brand:hover .docs-tag { color: var(--ink); }
.site-nav { display: flex; gap: clamp(1rem, 2.4vw, 1.9rem); font: 400 0.84rem/1.2 var(--mono); }
.site-nav a { padding: 0.8rem 0; color: var(--ink-2); text-decoration: none; }
.site-nav a:hover { color: var(--ink); }

/* Three columns on wide screens: pages, the page, its headings. */
.shell { max-width: 1320px; margin: 0 auto; padding-inline: var(--gutter); }
.main { min-width: 0; padding-block: 1.6rem 3rem; outline: none; }
.pages-d, .toc-d { display: none; }

.nav-k { margin: 0 0 0.35rem; font: 400 0.76rem/1.3 var(--mono); color: var(--ink-2); }
.pages ul, .toc-d ul, .toc-m ul { list-style: none; margin: 0; padding: 0; }
.pages ul + .nav-k { margin-top: 1.3rem; }
.pages a {
  position: relative; display: block; padding: 0.42rem 0 0.42rem 0.9rem;
  color: var(--ink-2); text-decoration: none; font-size: 0.95rem; line-height: 1.35;
  border-left: 1px solid var(--line);
}
.pages a:hover { color: var(--ink); }
.pages a[aria-current="page"] { color: var(--ink); }
.pages a[aria-current="page"]::before { content: ""; position: absolute; left: -1px; top: 0; bottom: 0; width: 2px; background: var(--violet); }
.ver { margin: 1.6rem 0 0; font: 400 0.76rem/1.3 var(--mono); color: var(--ink-2); }

/* Narrow screens: the pages behind one disclosure. */
.pages-m { margin-top: 0.9rem; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.pages-m summary, .toc-m summary {
  display: flex; align-items: center; gap: 0.6rem; min-height: 44px; padding: 0 1rem;
  cursor: pointer; list-style: none; font: 400 0.88rem/1.2 var(--mono); color: var(--ink);
}
.pages-m summary::-webkit-details-marker, .toc-m summary::-webkit-details-marker { display: none; }
.pages-m summary::after, .toc-m summary::after {
  content: ""; width: 7px; height: 7px; margin-left: auto; margin-top: -3px;
  border-right: 1.5px solid var(--ink-2); border-bottom: 1.5px solid var(--ink-2); rotate: 45deg;
}
.pages-m[open] summary::after, .toc-m[open] summary::after { rotate: 225deg; margin-top: 3px; }
.pm-k { color: var(--ink-2); }
.pm-here { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pages-m > .nav-k, .pages-m > ul { margin-inline: 1rem; }
.pages-m > .nav-k:first-of-type { margin-top: 0.4rem; }
.pages-m > ul:last-child { margin-bottom: 1rem; }

/* The page */
.doc { max-width: var(--measure); }
.doc > * + * { margin-top: 1rem; }
.doc h1, .doc h2, .doc h3, .doc h4 { position: relative; font-family: var(--mono); font-weight: 700; color: var(--ink); text-wrap: balance; scroll-margin-top: 1.2rem; }
.doc h1 { margin: 0.6rem 0 0; font-size: clamp(2rem, 7vw, 2.9rem); line-height: 1.06; letter-spacing: -0.035em; }
.doc h1 + p { margin-top: 1.1rem; }
.doc h2 { margin-top: 3rem; padding-top: 1.3rem; border-top: 1px solid var(--line); font-size: clamp(1.4rem, 1vw + 1.1rem, 1.75rem); line-height: 1.15; letter-spacing: -0.025em; }
/* The frameless grid: a hairline with a 24 px violet start. */
.doc h2::before { content: ""; position: absolute; top: -1px; left: 0; width: 24px; height: 1px; background: var(--violet); }
.doc h3 { margin-top: 2.1rem; font-size: 1.12rem; line-height: 1.3; letter-spacing: -0.01em; }
.doc h4 { margin-top: 1.6rem; font-size: 1rem; }
.doc h2 + *, .doc h3 + *, .doc h4 + * { margin-top: 0.75rem; }
.hl { margin-left: 0.45em; color: var(--dot); font-weight: 400; text-decoration: none; opacity: 0; }
.doc :is(h2, h3, h4):hover .hl { opacity: 1; }
.hl:hover { color: var(--violet-ink); }
.doc p, .doc li { text-wrap: pretty; }
.doc p, .doc ul, .doc ol, .doc pre, .doc blockquote { margin-bottom: 0; }
.doc strong { color: var(--ink); font-weight: 400; }
.doc em { font-style: italic; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin-block: 2rem; }
.doc blockquote { margin-inline: 0; padding-left: 1rem; border-left: 2px solid var(--violet-deep); color: var(--ink-2); }

.doc ul, .doc ol { padding-left: 1.35rem; }
.doc li + li, .doc li > * + * { margin-top: 0.45rem; }
.doc li > p { margin: 0; }
.doc li > p + p, .doc li > .code, .doc li > ul, .doc li > ol { margin-top: 0.6rem; }
.doc ul > li::marker { color: var(--dot); }
.doc ol > li::marker { color: var(--ink-2); font: 400 0.92em var(--mono); }

/* The overview opens like the landing: a large first line. */
.home h1 { font-size: clamp(2.6rem, 11vw, 3.6rem); }
.home h1 + p { font-size: 1.18rem; line-height: 1.52; color: var(--ink); }

/* Code: inline in ink, blocks on the landing's surface with a copy button. */
.doc :not(pre) > code {
  padding: 0.08em 0.32em; font-size: 0.86em; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 3px;
  overflow-wrap: break-word; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.doc a code { color: inherit; }
.code { position: relative; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
.code-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 2.25rem; padding: 0 0.4rem 0 1rem; border-bottom: 1px solid var(--line);
}
.code-lang { font: 400 0.76rem/1 var(--mono); color: var(--ink-2); }
.code pre {
  margin: 0; padding: 0.85rem 1rem; overflow-x: auto;
  font-size: 0.84rem; line-height: 1.6; color: var(--ink); tab-size: 4;
}
.code pre:focus-visible { outline-offset: -2px; }
/* A block with no language has no bar; its button sits at the end of the first line. */
.code.bare { display: flex; align-items: flex-start; }
.code.bare pre {
  flex: 1; min-width: 0; padding-right: 0.6rem;
  /* A line too long for the box scrolls sideways and fades out before the button. */
  -webkit-mask-image: linear-gradient(to left, transparent 0, #000 14px);
  mask-image: linear-gradient(to left, transparent 0, #000 14px);
}
.code.bare .copy-btn { margin: 0.55rem 0.4rem 0 0; }
.copy-btn {
  position: relative; flex: none; min-width: 4.2rem; padding: 0.3rem 0.8rem;
  background: none; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px;
  font: 400 0.76rem/1.2 var(--mono); cursor: pointer;
}
.copy-btn:hover { color: var(--ink); border-color: var(--violet); }
.copy-btn.done { color: var(--ink); background: var(--violet); border-color: var(--violet); }
.copy-btn::after { content: ""; position: absolute; inset: -6px -4px; }  /* a 44 px touch target */

/* Tables scroll inside their own box on narrow screens; the page never does. */
.table-wrap { max-width: 100%; overflow-x: auto; border-top: 1px solid var(--line); position: relative; }
.table-wrap::before { content: ""; position: absolute; top: -1px; left: 0; width: 24px; height: 1px; background: var(--violet); }
.table-wrap:focus-visible { outline-offset: 2px; }
.doc table { border-collapse: collapse; width: 100%; font-size: 0.92rem; line-height: 1.5; }
.doc th, .doc td { padding: 0.55rem 1.1rem 0.55rem 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.doc th:last-child, .doc td:last-child { padding-right: 0; }
.doc th { font: 400 0.8rem/1.35 var(--mono); color: var(--ink-2); white-space: nowrap; }
.doc td { min-width: 6.5rem; }
.doc td:first-child { min-width: 0; }
.doc .al-r { text-align: right; }
.doc .al-c { text-align: center; }

/* On this page */
.toc-m { margin-top: 1.4rem; border: 1px solid var(--line); border-radius: 4px; }
.toc-m nav { padding: 0 1rem 0.9rem; }
.toc-m a, .toc-d a { display: block; padding: 0.3rem 0; color: var(--ink-2); text-decoration: none; font-size: 0.9rem; line-height: 1.35; }
.toc-m ul ul, .toc-d ul ul { padding-left: 0.9rem; }
.toc-m ul ul a, .toc-d ul ul a { font-size: 0.86rem; }
.toc-m a:hover, .toc-d a:hover, .toc-d a.here { color: var(--ink); }
.toc-d a.here { color: var(--violet-ink); }
.toc-m code, .toc-d code { font-size: 0.92em; }

/* Previous and next, and where the page comes from */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: var(--measure); margin-top: 3.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.pager a { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.4rem 0; font: 400 1rem/1.3 var(--mono); color: var(--ink); text-decoration: none; }
.pager a:hover { color: var(--violet-ink); }
.pager .next { grid-column: 2; text-align: right; }
.pg-k { font-size: 0.76rem; color: var(--ink-2); }
.src { max-width: var(--measure); margin-top: 1.4rem; font-size: 0.86rem; color: var(--ink-2); }
.src code { font-size: 0.92em; }

/* Footer, as on the landing */
.site-foot {
  display: flex; gap: 1.2rem; align-items: flex-start;
  max-width: 1320px; margin: 0 auto; padding: 2.4rem var(--gutter) 3rem;
  border-top: 1px solid var(--line); color: var(--ink-2); font-size: 0.92rem;
}
.site-foot p { margin: 0; }
.site-foot p + p { margin-top: 0.4rem; }
.site-foot .small { font-size: 0.82rem; max-width: 40rem; }
.foot-g { flex: none; width: 32px; height: 32px; }

@media (max-width: 480px) {
  body { font-size: 1rem; line-height: 1.6; }
  .top { padding-block: 0.8rem 0.7rem; }
  .main { padding-top: 1.1rem; }
  .doc h2 { margin-top: 2.4rem; }
  .code pre { padding: 0.75rem 0.8rem; font-size: 0.78rem; }
  .code-bar { padding-left: 0.8rem; }
  .doc table { font-size: 0.86rem; }
  .home h1 + p { font-size: 1.05rem; }
}

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); column-gap: clamp(2rem, 4vw, 4rem); }
  .pages-m { display: none; }
  .pages-d { display: block; position: sticky; top: 0; max-height: 100vh; overflow-y: auto; padding-block: 2.2rem 2rem; scrollbar-width: thin; }
  .main { padding-top: 2.2rem; }
}

@media (min-width: 1240px) {
  .shell { grid-template-columns: var(--side) minmax(0, 1fr) var(--toc); }
  .toc-m { display: none; }
  .toc-d { display: block; position: sticky; top: 0; max-height: 100vh; overflow-y: auto; padding-block: 2.2rem 2rem; scrollbar-width: thin; }
  .toc-d > nav > ul { border-left: 1px solid var(--line); padding-left: 0.9rem; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  a, .copy-btn, .hl { transition: color 0.2s var(--out), background 0.2s var(--out), border-color 0.2s var(--out), opacity 0.2s var(--out); }
  .copy-btn { transition: scale 0.35s var(--spring), color 0.2s var(--out), background 0.2s var(--out), border-color 0.2s var(--out); }
  .copy-btn:active { scale: 0.965; }
  .pages-m summary::after, .toc-m summary::after { transition: rotate 0.25s var(--out), margin 0.25s var(--out); }
}

@media (forced-colors: active) {
  .pages a[aria-current="page"]::before, .doc h2::before, .table-wrap::before { background: CanvasText; }
}

@media print {
  .top, .pages, .toc-d, .toc-m, .pager, .site-foot, .copy-btn { display: none; }
  .shell { display: block; }
}
