/* Distill-style article layout, after worldmodels.github.io: one narrow serif
   column, figures inline with small grey captions, a full-width interactive
   banner at the top. */
:root { --text: rgba(0,0,0,.8); --muted: rgba(0,0,0,.6); --faint: rgba(0,0,0,.1); --link: #0a6bd6; --coral: #e05a46; --blue: #3a8fe0; --col: 648px; --wide: 984px; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #fff; color: var(--text); font-family: Georgia, "Times New Roman", serif; font-size: 17px; line-height: 1.55; }
a { color: var(--link); text-decoration: none; border-bottom: 1px solid rgba(10,107,214,.3); }
a:hover { border-bottom-color: var(--link); }
h1, h2, h3 { font-family: "Hoefler Text", "Cochin", Georgia, serif; font-weight: 400; color: rgba(0,0,0,.85); margin: 0; }
h1 { font-size: 40px; line-height: 1.1; margin-top: 44px; }
h2 { font-size: 26px; line-height: 1.25; margin: 48px 0 12px; }
h3 { font-size: 20px; line-height: 1.3; margin: 32px 0 8px; }
p { margin: 0 0 18px; }
.subtitle { font-size: 22px; line-height: 1.3; color: var(--muted); margin: 10px 0 0; font-family: "Hoefler Text", "Cochin", Georgia, serif; }
.sans { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.col { max-width: var(--col); margin: 0 auto; padding: 0 24px; }
.wide { max-width: var(--wide); margin: 0 auto; padding: 0 24px; }
.byline { display: flex; flex-wrap: wrap; gap: 4px 36px; margin: 26px 0 0; padding: 16px 0; border-top: 1px solid var(--faint); border-bottom: 1px solid var(--faint); font-size: 12px; line-height: 1.5; color: var(--muted); }
.byline b { display: block; font-weight: 600; color: var(--text); }
.byline a { border: 0; }
.links { font-size: 13px; margin-top: 14px; display: flex; gap: 22px; flex-wrap: wrap; }
.links a { border: 0; }

/* banner: the interactive demo */
.banner { position: relative; background: #111114; color: #e8e6e1; }
.banner canvas { display: block; width: 100%; height: min(78vh, 640px); }
.banner .hint { position: absolute; left: 0; right: 0; top: 14px; text-align: center; font-size: 12px; letter-spacing: .04em; color: rgba(232,230,225,.75); pointer-events: none; }
.banner .hud { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 26px; flex-wrap: wrap; font-size: 12px; color: rgba(232,230,225,.8); pointer-events: none; }
.banner .hud i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: -1px; margin-right: 6px; }
.banner .scroll { position: absolute; right: 18px; bottom: 12px; font-size: 11px; color: rgba(232,230,225,.5); }
@media (max-width: 720px) { .banner .hud { gap: 12px; } .banner .scroll { display: none; } }

/* figures */
figure { margin: 26px 0 30px; }
figure.wide { max-width: var(--wide); margin-left: calc(50% - min(var(--wide), 100vw) / 2 + 24px); margin-right: calc(50% - min(var(--wide), 100vw) / 2 + 24px); }
@media (max-width: 1040px) { figure.wide { margin-left: 0; margin-right: 0; } }
figure img, figure svg, figure video { display: block; width: 100%; height: auto; border-radius: 3px; }
figure.dark img { background: #111; }
figure .row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
figcaption { margin-top: 10px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
figcaption b { color: var(--text); font-weight: 600; }

/* text bits */
.callout { border-left: 3px solid var(--coral); padding: 2px 0 2px 18px; margin: 22px 0; color: var(--text); }
table { width: 100%; border-collapse: collapse; margin: 18px 0 26px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 13.5px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--faint); vertical-align: top; }
th { color: var(--muted); font-weight: 500; }
td b { font-weight: 600; color: var(--text); }
code, pre { font-family: Menlo, Consolas, "Liberation Mono", monospace; font-size: 14px; }
code { background: rgba(0,0,0,.05); padding: 1px 5px; border-radius: 3px; }
pre { background: rgba(0,0,0,.04); padding: 14px 16px; border-radius: 4px; overflow-x: auto; line-height: 1.5; }
pre code { background: none; padding: 0; }
.diagram text { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
hr { border: 0; border-top: 1px solid var(--faint); margin: 48px 0; }
.small { font-size: 14px; color: var(--muted); }
.toc { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 1.9; columns: 2; column-gap: 40px; margin: 8px 0 0; padding-left: 18px; }
.toc a { border: 0; color: var(--text); }
.toc a:hover { color: var(--link); }
@media (max-width: 600px) { .toc { columns: 1; } }
footer.end { margin-top: 64px; padding: 26px 0 48px; border-top: 1px solid var(--faint); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 12.5px; color: var(--muted); }
footer.end a { border: 0; }

/* docs pages share the column */
.topbar { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 12.5px; color: var(--muted); padding: 14px 0; border-bottom: 1px solid var(--faint); display: flex; gap: 20px; flex-wrap: wrap; }
.topbar a { border: 0; color: var(--muted); }
.topbar a:hover { color: var(--link); }
.doc h1 { font-size: 32px; margin: 28px 0 16px; }
.doc h2 { font-size: 24px; }
.doc img { max-width: 100%; display: block; margin: 16px auto; border-radius: 3px; }
.doc table { display: block; overflow-x: auto; }
.doc blockquote { margin: 18px 0; padding: 0 0 0 18px; border-left: 3px solid var(--faint); color: var(--muted); }
.doc li { margin-bottom: 4px; }
