/* Black Autumn: 1438, the modding docs (on top of ../css/site.css). Written by hand in ArtTools/moddocs/site and copied
   into the website by DocKit with the pages it makes. */

@font-face { font-family: "Inter"; src: url("fonts/inter-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Mono"; src: url("fonts/jetbrains-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
/* the site's Fell draws old-style figures, its 0 like an o: in the docs, numbers matter, so digits come from a book face
   with lining figures where the machine has one */
@font-face { font-family: "Digits"; src: local("Palatino Linotype"), local("Palatino"), local("Book Antiqua"), local("Times New Roman"), local("Liberation Serif"); unicode-range: U+0030-0039; }

:root {
  --bar-h: 64px;
  --tree-w: 290px;
  --toc-w: 230px;
  --page-w: 880px;
  --code-bg: #120e0b;
  --bench: #15171a;
  --bench-line: #2a2e34;
  --prose: #ddcba7;
}

html { scroll-padding-top: calc(var(--bar-h) + 18px); scroll-behavior: smooth; }
body.docs { font-family: "Digits", "Fell", Georgia, serif; font-size: 18px; line-height: 1.62; }
body.docs::before { opacity: .035; }

/* ---------------------------------------------------------------- the bar */
.dbar {
  position: sticky; top: 0; z-index: 60; height: var(--bar-h); display: flex; align-items: center; gap: 22px;
  padding: 0 var(--gutter); background: rgba(11, 8, 6, .96); border-bottom: 1px solid rgba(217, 162, 74, .16);
}
.dbar__brand img { width: 112px; image-rendering: pixelated; }
.dbar__docs {
  font-family: "Unicase"; font-weight: 700; font-size: 14px; letter-spacing: .32em; text-transform: uppercase; color: var(--gold-2);
  padding-left: 22px; border-left: 1px solid var(--line); white-space: nowrap;
}
.dbar__docs:hover { color: var(--parchment); }
.dbar__right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.dbar__menu { display: none; width: 38px; height: 38px; position: relative; }
.dbar__menu i { position: absolute; left: 9px; right: 9px; height: 1px; background: var(--parchment); transition: transform .25s; }
.dbar__menu i:first-child { top: 15px; }
.dbar__menu i:last-child { top: 23px; }
.dbar__menu[aria-expanded="true"] i:first-child { transform: translateY(4px) rotate(45deg); }
.dbar__menu[aria-expanded="true"] i:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------------------------------------------------------------- search */
.dsearch { position: relative; flex: 1 1 auto; max-width: 520px; }
.dsearch input {
  width: 100%; height: 40px; padding: 0 40px 0 14px; font: inherit; font-size: 16px; color: var(--parchment);
  background: rgba(30, 21, 15, .7); border: 1px solid rgba(217, 162, 74, .28); border-radius: 0; outline: none;
}
.dsearch input::placeholder { color: var(--muted); font-style: italic; }
.dsearch input:focus { border-color: var(--gold); background: rgba(30, 21, 15, .95); }
.dsearch input::-webkit-search-cancel-button { filter: sepia(1) saturate(3) hue-rotate(-10deg); }
.dsearch kbd {
  position: absolute; right: 10px; top: 10px; font-family: "Mono", monospace; font-size: 12px; line-height: 18px; padding: 0 6px;
  color: var(--muted); border: 1px solid var(--line); pointer-events: none;
}
.dsearch input:focus + kbd, .dsearch input:not(:placeholder-shown) + kbd { display: none; }
.dsearch__hits {
  position: absolute; left: 0; right: 0; top: 46px; max-height: min(70vh, 640px); overflow: auto; z-index: 70;
  background: #140f0b; border: 1px solid rgba(217, 162, 74, .35); box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .85);
}
.dsearch__hits a { display: block; padding: 11px 16px 12px; border-bottom: 1px solid rgba(217, 162, 74, .1); }
.dsearch__hits a:last-child { border-bottom: 0; }
.dsearch__hits a.is-lit, .dsearch__hits a:hover { background: rgba(217, 162, 74, .12); }
.dsearch__hits b { display: block; font-family: "Unicase"; font-weight: 700; font-size: 17px; color: var(--gold-2); line-height: 1.25; }
.dsearch__hits small { display: block; font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.dsearch__hits span { display: block; font-size: 15px; color: #cdb995; line-height: 1.45; margin-top: 3px; }
.dsearch__hits mark { background: rgba(217, 162, 74, .3); color: var(--parchment); padding: 0 1px; }
.dsearch__none { padding: 14px 16px; color: var(--muted); font-style: italic; }

/* ---------------------------------------------------------------- the three columns */
.dlayout {
  display: grid; grid-template-columns: var(--tree-w) minmax(0, 1fr) var(--toc-w); gap: clamp(24px, 3vw, 48px);
  max-width: 1640px; margin: 0 auto; padding: 0 var(--gutter);
}

/* the tree */
.dtree {
  position: sticky; top: var(--bar-h); align-self: start; height: calc(100vh - var(--bar-h)); overflow: auto; padding: 26px 10px 60px 0;
  scrollbar-width: thin; scrollbar-color: #4a3219 transparent;
}
.dtree__group + .dtree__group { margin-top: 22px; }
.dtree__title { font-family: "Unicase"; font-weight: 700; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin: 0 0 6px 12px; }
.dtree ul { list-style: none; }
.dtree a {
  display: flex; align-items: baseline; gap: 8px; padding: 3px 10px 3px 12px; font-size: 16px; line-height: 1.35; color: var(--parchment-2);
  border-left: 2px solid transparent; transition: color .2s, background-color .2s;
}
.dtree a:hover { color: var(--gold-2); background: rgba(217, 162, 74, .06); }
.dtree a[aria-current="page"] { color: var(--gold-2); border-left-color: var(--gold); background: rgba(217, 162, 74, .1); }
.dtree li.is-open > a { color: var(--parchment); }
.dtree ul ul { margin: 2px 0 6px 12px; border-left: 1px solid rgba(217, 162, 74, .14); }
.dtree ul ul a { font-size: 15px; padding: 2px 10px 2px 12px; color: #bfa982; }
.dtree__count { margin-left: auto; font-family: "Mono", monospace; font-size: 11px; color: var(--muted); }

/* the page */
.dmain { min-width: 0; padding: 30px 0 90px; }
.dpage { max-width: var(--page-w); }
.dpage .dcrumb { font-size: 14px; color: var(--muted); margin: 0 0 6px; letter-spacing: .02em; }
.dcrumb a { color: var(--muted); border-bottom: 1px solid transparent; }
.dcrumb a:hover { color: var(--gold-2); border-bottom-color: currentColor; }
.dcrumb i { font-style: normal; margin: 0 8px; opacity: .6; }
.dpage h1 { font-family: "Unicase"; font-weight: 700; font-size: clamp(32px, 3.4vw, 46px); line-height: 1.08; color: var(--parchment); margin-bottom: 18px; }
.dpage h2 {
  font-family: "Unicase"; font-weight: 700; font-size: clamp(23px, 2vw, 28px); line-height: 1.2; color: var(--gold-2);
  margin: 46px 0 12px; padding-top: 22px; border-top: 1px solid rgba(217, 162, 74, .16); position: relative;
}
.dpage h3 { font-family: "Unicase"; font-weight: 700; font-size: 20px; color: var(--parchment); margin: 30px 0 8px; position: relative; }
.dhash { margin-left: 10px; font-size: .7em; color: var(--gold); opacity: 0; transition: opacity .2s; }
.dpage h2:hover .dhash, .dpage h3:hover .dhash { opacity: .7; }
.dpage p { color: var(--prose); margin: 12px 0; }
.dpage > h1 + p, .dpage > .dnodeid + p { font-size: 19.5px; color: #eadbbb; }
.dpage a:not(.dpic__link):not(.drows a) { color: var(--gold-2); border-bottom: 1px solid rgba(240, 201, 122, .35); transition: border-color .2s, color .2s; }
.dpage a:not(.dpic__link):hover { color: var(--parchment); border-bottom-color: var(--parchment); }
.dpage strong { color: #f1e3c4; font-weight: 400; text-shadow: .015em 0 0 currentColor; }
.dpage em { color: #ead8b2; }
.dpage ul, .dpage ol { margin: 12px 0 12px 1.3em; color: var(--prose); }
.dpage li { margin: 5px 0; padding-left: 2px; }
.dpage li::marker { color: var(--gold); }
.dpage li > ul, .dpage li > ol { margin-top: 4px; margin-bottom: 4px; }
.dpage code {
  font-family: "Mono", monospace; font-size: .8em; color: #f0d9a8; background: rgba(217, 162, 74, .1); padding: 1px 5px 2px;
  border: 1px solid rgba(217, 162, 74, .14); white-space: nowrap;
}
.dpage a code { color: inherit; }
.dnodeid { margin: -10px 0 18px !important; }
.dnodeid code { font-size: 14px; }

/* notes */
.dnote { margin: 18px 0; padding: 12px 18px; border-left: 3px solid var(--gold); background: rgba(217, 162, 74, .07); }
.dnote p { margin: 0; color: #e6d5b1; }

/* code */
.dcode { margin: 16px 0 20px; background: var(--code-bg); border: 1px solid rgba(217, 162, 74, .18); }
.dcode__head { display: flex; align-items: center; justify-content: space-between; height: 32px; padding: 0 6px 0 14px; border-bottom: 1px solid rgba(217, 162, 74, .12); }
.dcode__head span { font-family: "Mono", monospace; font-size: 12px; color: var(--muted); text-transform: lowercase; }
.dcode__copy {
  font-family: "Unicase"; font-weight: 700; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold);
  padding: 4px 10px; border: 1px solid transparent;
}
.dcode__copy:hover { border-color: rgba(217, 162, 74, .4); color: var(--gold-2); }
.dcode__copy.is-done { color: #b6c88c; }
.dcode pre { margin: 0; padding: 14px 16px 16px; overflow-x: auto; scrollbar-width: thin; }
.dcode pre code { font-size: 14px; line-height: 1.6; white-space: pre; background: none; border: 0; padding: 0; color: #e3d3b3; }
.jk { color: #e8b866; } .js { color: #bccf8c; } .jn { color: #8cc8d6; } .jb { color: #db8f6c; }

/* tables */
.dtable { margin: 16px 0 22px; overflow-x: auto; }
.dtable table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.5; }
.dtable th {
  text-align: left; font-family: "Unicase"; font-weight: 700; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold);
  padding: 8px 12px; border-bottom: 1px solid rgba(217, 162, 74, .4);
}
.dtable td { padding: 8px 12px; color: var(--prose); border-bottom: 1px solid rgba(217, 162, 74, .12); vertical-align: top; }
.dtable td code { white-space: normal; }
.dtable tr:hover td { background: rgba(217, 162, 74, .04); }

/* what a node is */
.dfacts { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 0; margin: 18px 0 8px; border-top: 1px solid rgba(217, 162, 74, .14); }
.dfacts dt, .dfacts dd { padding: 8px 0; border-bottom: 1px solid rgba(217, 162, 74, .14); }
.dfacts dt { font-family: "Unicase"; font-weight: 700; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); padding-top: 12px; }
.dfacts dd { color: var(--prose); font-size: 17px; }

/* pictures */
.dpic { margin: 22px 0 26px; }
.dpic__link { display: block; outline: 1px solid rgba(217, 162, 74, .22); transition: outline-color .25s; cursor: zoom-in; }
.dpic__link:hover { outline-color: var(--gold); }
.dpic img { width: 100%; height: auto; background: #0e0b09; }
.dpage figcaption { margin-top: 8px; font-size: 15px; font-style: italic; color: var(--muted); line-height: 1.45; }

/* nodes and graphs, drawn the bench's way on its dark ground */
.dnode, .dgraph { margin: 18px 0 22px; }
.dnode { display: inline-block; max-width: 100%; background: var(--bench); border: 1px solid var(--bench-line); padding: 0; overflow-x: auto; }
.dnode svg { display: block; max-width: 100%; height: auto; }
.dgraph__view { background: var(--bench); border: 1px solid var(--bench-line); overflow-x: auto; overflow-y: hidden; cursor: zoom-in; outline: none; transition: border-color .25s; scrollbar-width: thin; scrollbar-color: #3a3f47 var(--bench); }
.dgraph__view:hover, .dgraph__view:focus-visible { border-color: rgba(217, 162, 74, .55); }
.dgraph__view svg { display: block; width: 100%; height: auto; }
.dg text { font-family: "Inter", "Segoe UI", system-ui, sans-serif; }
.dg .dg-s { font-weight: 600; }
.dg .dg-m { font-family: "Mono", monospace; }

/* pins, coloured and shaped as on the bench */
.dpins { list-style: none; margin: 14px 0 20px !important; border: 1px solid var(--bench-line); background: #1a1c20; }
.dpin { margin: 0 !important; padding: 10px 16px 11px 16px !important; border-bottom: 1px solid #262a30; font-family: "Inter", sans-serif; font-size: 14px; line-height: 1.5; color: #c9ccd2; }
.dpin:last-child { border-bottom: 0; }
.dpin::marker { content: none; }
.dpin__side { display: inline-block; width: 30px; font-family: "Mono", monospace; font-size: 11px; color: #6c727b; text-transform: uppercase; }
.dpin__mark { display: inline-block; width: 12px; height: 12px; margin: 0 9px -1px 0; background: var(--k); }
.dpin__mark--circle { border-radius: 50%; box-shadow: 0 0 0 2px rgba(0, 0, 0, .5); }
.dpin__mark--diamond { width: 10px; height: 10px; transform: rotate(45deg); margin: 0 10px 0 1px; background: transparent; box-shadow: inset 0 0 0 2px var(--k); }
.dpin__mark--arrow { width: 11px; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.dpin__mark--grid {
  background: linear-gradient(var(--k) 0 0) 0 0 / 3px 3px, linear-gradient(var(--k) 0 0) 4.5px 0 / 3px 3px, linear-gradient(var(--k) 0 0) 9px 0 / 3px 3px,
              linear-gradient(var(--k) 0 0) 0 4.5px / 3px 3px, linear-gradient(var(--k) 0 0) 4.5px 4.5px / 3px 3px, linear-gradient(var(--k) 0 0) 9px 4.5px / 3px 3px,
              linear-gradient(var(--k) 0 0) 0 9px / 3px 3px, linear-gradient(var(--k) 0 0) 4.5px 9px / 3px 3px, linear-gradient(var(--k) 0 0) 9px 9px / 3px 3px;
  background-repeat: no-repeat;
}
.dpin b { font-weight: 600; color: #eceef1; }
.dpin code { margin-left: 8px; font-size: 12px !important; color: #8a909a !important; background: none !important; border: 0 !important; padding: 0 !important; }
.dpin__kind { float: right; margin-left: 16px; color: var(--k); font-size: 13px; }
.dpin p { margin: 3px 0 0 30px !important; color: #a9aeb6 !important; font-size: 14px !important; }
.dpin .dpin__default { color: #7c828b !important; }

/* lists of pages */
.drows { list-style: none; margin: 14px 0 22px !important; border-top: 1px solid rgba(217, 162, 74, .14); }
.drows li { margin: 0 !important; padding: 0 !important; }
.drows li::marker { content: none; }
.drows a, .drows li > span {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 10px 12px; border-bottom: 1px solid rgba(217, 162, 74, .14);
  color: var(--prose); transition: background-color .2s;
}
.drows a:hover { background: rgba(217, 162, 74, .07); }
.drows b { font-weight: 400; color: var(--gold-2); font-size: 18px; }
.drows a:hover b { color: var(--parchment); }
.drows code { justify-self: end; align-self: center; font-size: 12px !important; color: var(--muted) !important; background: none !important; border: 0 !important; }
.drows__about { grid-column: 1 / -1; font-size: 15.5px; color: #c4af89; line-height: 1.45; }

/* back and next */
.dfoot { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 60px; padding-top: 24px; border-top: 1px solid rgba(217, 162, 74, .16); }
.dfoot a { display: block; padding: 14px 18px; border: 1px solid rgba(217, 162, 74, .2); color: var(--gold-2) !important; font-size: 18px; transition: border-color .2s, background-color .2s; }
.dfoot a:hover { border-color: var(--gold); background: rgba(217, 162, 74, .06); }
.dfoot small { display: block; font-family: "Unicase"; font-weight: 700; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.dfoot__next { grid-column: 2; text-align: right; }

/* on this page */
.dtoc { position: sticky; top: var(--bar-h); align-self: start; max-height: calc(100vh - var(--bar-h)); overflow: auto; padding: 34px 0 40px; }
.dtoc__title { font-family: "Unicase"; font-weight: 700; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.dtoc ul { list-style: none; border-left: 1px solid rgba(217, 162, 74, .16); }
.dtoc a { display: block; padding: 3px 0 3px 12px; margin-left: -1px; font-size: 15px; line-height: 1.35; color: var(--muted); border-left: 1px solid transparent; }
.dtoc a:hover { color: var(--gold-2); }
.dtoc a.is-here { color: var(--gold-2); border-left-color: var(--gold); }

/* a picture or a graph seen whole */
.dzoom { position: fixed; inset: 0; z-index: 95; background: rgba(8, 6, 4, .94); display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.dzoom[hidden] { display: none; }
.dzoom img { max-width: 100%; max-height: calc(100vh - 80px); width: auto; height: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }
.dzoom__graph { width: 100%; height: 100%; overflow: auto; background: var(--bench); border: 1px solid var(--bench-line); cursor: grab; }
.dzoom__graph svg { display: block; width: auto !important; height: auto; max-width: none; max-height: none; min-width: 0 !important; margin: auto; }
.dzoom__cap { margin-top: 12px; color: var(--muted); font-style: italic; }

/* ---------------------------------------------------------------- narrower */
@media (max-width: 1240px) {
  .dlayout { grid-template-columns: var(--tree-w) minmax(0, 1fr); }
  .dtoc { display: none; }
}
@media (max-width: 900px) {
  :root { --bar-h: 58px; }
  .dbar { gap: 12px; }
  .dbar__menu { display: block; }
  .dbar__docs, .dbar__right .btn--line { display: none; }
  .dbar__brand img { width: 86px; }
  .dlayout { grid-template-columns: minmax(0, 1fr); }
  .dtree {
    position: fixed; left: 0; top: var(--bar-h); bottom: 0; width: min(340px, 86vw); height: auto; z-index: 55; padding: 20px 14px 60px 10px;
    background: #0f0b08; border-right: 1px solid var(--line); transform: translateX(-102%); transition: transform .3s var(--ease);
  }
  body.tree-open .dtree { transform: none; box-shadow: 30px 0 60px rgba(0, 0, 0, .6); }
  .dfacts { grid-template-columns: minmax(0, 1fr); }
  .dfacts dt { border-bottom: 0; padding-bottom: 0; }
}
@media (max-width: 560px) {
  .dbar__right .btn--gold { display: none; }
  body.docs { font-size: 17px; }
  .dpin__kind { float: none; display: block; margin: 2px 0 0 30px; }
}
