/* The user docs: the app's riso inks on black stock, set for reading. Bricolage Grotesque for headings and UI,
   a comfortable body size, DM Mono for keys and numbers. */
@font-face { font-family: 'Bricolage Grotesque'; src: url('../fonts/BricolageGrotesque-Latin.woff2') format('woff2'); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: 'DM Mono'; src: url('../fonts/DMMono-Regular-Latin.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'DM Mono'; src: url('../fonts/DMMono-Medium-Latin.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --pink: #FF48B0; --aqua: #5EC8E5; --sun: #FFB511; --white: #F2ECE1; --lime: #A8DB3C; --violet: #9D7AD2;
  --bg0: #0C0B0D; --bg1: #121014; --bg2: #17151A; --bg3: #1F1C22; --bg4: #2A262D;
  --text: #F2ECE1; --dim: #CFC8C0; --faint: #A59FA8; --line: #3A353C;
  --ui: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --num: 'DM Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --top: 52px; --side: 256px; --onpage: 220px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 16px); }
body { margin: 0; background: var(--bg1); color: var(--text); font: 400 16px/1.6 var(--ui); -webkit-font-smoothing: antialiased; }
a { color: var(--aqua); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--aqua); outline-offset: 2px; }
::selection { background: rgba(255, 72, 176, 0.35); }

/* top bar */
.top { position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 10; display: flex; align-items: center; gap: 16px;
  padding: 0 16px; background: var(--bg2); border-bottom: 1px solid var(--white); }
.brand { font: 800 20px/1 var(--ui); font-stretch: 75%; letter-spacing: 0.02em; text-transform: uppercase; color: var(--pink); white-space: nowrap; }
.brand span { color: var(--white); margin-left: 6px; font-weight: 500; }
.brand:hover { text-decoration: none; }
.menu { display: none; background: none; border: 1px solid var(--line); color: var(--text); width: 36px; height: 36px; font-size: 18px; cursor: pointer; }
.search { position: relative; flex: 1; min-width: 120px; max-width: 520px; margin-left: 16px; }
.search input { width: 100%; height: 36px; padding: 0 36px 0 12px; background: var(--bg1); border: 1px solid var(--line); color: var(--text); font: 400 15px var(--ui); border-radius: 0; }
.search input:focus { border-color: var(--aqua); outline: none; }
.search .hint { position: absolute; right: 10px; top: 8px; }
.results { position: absolute; top: 40px; left: 0; right: 0; max-height: min(70vh, 560px); overflow: auto; background: var(--bg2); border: 1px solid var(--white); box-shadow: 6px 6px 0 rgba(255, 72, 176, 0.35); }
.results a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 14px; color: var(--text); border-bottom: 1px solid var(--line); }
.results a:hover, .results a.on { background: var(--bg4); text-decoration: none; }
.results strong { font-weight: 700; }
.results .where { grid-column: 1 / -1; font: 400 12px var(--num); color: var(--faint); }
.results .snip { grid-column: 1 / -1; font-size: 14px; color: var(--dim); }
.results mark { background: none; color: var(--pink); }
.results .empty { padding: 12px 14px; margin: 0; color: var(--faint); }
.platform { display: flex; border: 1px solid var(--line); }
.platform button { background: none; border: 0; color: var(--faint); padding: 6px 10px; font: 500 13px var(--ui); cursor: pointer; }
.platform button.on { background: var(--white); color: var(--bg1); }
.open { margin-left: auto; background: var(--pink); color: var(--bg1); padding: 8px 14px; font: 700 14px var(--ui); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.open:hover { text-decoration: none; background: var(--white); }

/* three columns */
.frame { display: grid; grid-template-columns: var(--side) minmax(0, 1fr) var(--onpage); padding-top: var(--top); min-height: 100vh; }
.side { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow: auto; padding: 20px 12px 40px 16px; border-right: 1px solid var(--line); background: var(--bg1); }
.side .sec { margin-bottom: 18px; }
.side h2 { margin: 0 0 6px; font: 700 12px var(--ui); text-transform: uppercase; letter-spacing: 0.08em; color: var(--sun); }
.side ul { list-style: none; margin: 0; padding: 0; }
.side a { display: block; padding: 4px 10px; color: var(--dim); font-size: 15px; border-left: 2px solid transparent; }
.side a:hover { color: var(--text); text-decoration: none; background: var(--bg2); }
.side a.on { color: var(--text); border-left-color: var(--pink); background: var(--bg3); font-weight: 600; }
main { padding: 32px 48px 80px; min-width: 0; }
article { max-width: 760px; }
.onpage { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow: auto; padding: 28px 16px; font-size: 14px; }
.onpage h2 { margin: 0 0 8px; font: 700 12px var(--ui); text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); }
.onpage ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.onpage li a { display: block; padding: 3px 10px; color: var(--faint); margin-left: -1px; border-left: 1px solid transparent; }
.onpage li.l3 a { padding-left: 22px; font-size: 13px; }
.onpage a.on { color: var(--text); border-left-color: var(--aqua); }

/* the page */
.crumbs { margin: 0 0 4px; font: 500 13px var(--num); color: var(--sun); text-transform: uppercase; letter-spacing: 0.06em; }
article h1 { margin: 0 0 16px; font: 800 44px/1.05 var(--ui); font-stretch: 75%; text-transform: uppercase; letter-spacing: 0.01em; color: var(--white);
  text-shadow: 3px 2px 0 rgba(255, 72, 176, 0.55); }
article h2 { margin: 44px 0 12px; font: 700 26px/1.2 var(--ui); font-stretch: 85%; padding-top: 12px; border-top: 1px solid var(--white); }
article h3 { margin: 28px 0 8px; font: 700 19px/1.3 var(--ui); }
article h4 { margin: 20px 0 6px; font: 700 16px var(--ui); color: var(--dim); }
article h2, article h3 { position: relative; }
.anchor { position: absolute; left: -22px; color: var(--line); opacity: 0; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor { opacity: 1; }
.anchor:hover { color: var(--pink); text-decoration: none; }
article p, article li { color: var(--dim); }
article > p:first-of-type { font-size: 18px; color: var(--text); }
article strong { color: var(--text); font-weight: 650; }
article ul, article ol { padding-left: 24px; }
article li { margin: 4px 0; }
article li::marker { color: var(--pink); }
article ol li::marker { font: 500 14px var(--num); }
code { font: 400 0.88em var(--num); background: var(--bg3); padding: 1px 5px; color: var(--text); }
pre { background: var(--bg2); border: 1px solid var(--line); padding: 14px 16px; overflow: auto; }
pre code { background: none; padding: 0; }
.crumb { color: var(--faint); margin: 0 2px; }
.keys { display: inline-flex; gap: 3px; vertical-align: 1px; white-space: nowrap; }
kbd { display: inline-block; min-width: 1.6em; padding: 0 5px; text-align: center; font: 500 12px/20px var(--num); color: var(--text);
  background: var(--bg3); border: 1px solid var(--line); border-bottom-width: 2px; }
.search .hint { min-width: 0; color: var(--faint); }
.keys.none, .none { font: 400 12px var(--num); color: var(--faint); }
.or { font-size: 12px; color: var(--faint); margin: 0 2px; }
.table { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th { text-align: left; font: 700 12px var(--ui); text-transform: uppercase; letter-spacing: 0.06em; color: var(--sun); background: var(--bg2); }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td { color: var(--dim); }
td:first-child { color: var(--text); }
.callout { margin: 18px 0; padding: 12px 16px; border: 1px solid var(--line); border-left: 4px solid var(--aqua); background: var(--bg2); color: var(--dim); }
.callout .label { color: var(--aqua); text-transform: uppercase; font-size: 13px; letter-spacing: 0.06em; margin-right: 4px; }
.callout.tip { border-left-color: var(--lime); } .callout.tip .label { color: var(--lime); }
.callout.careful { border-left-color: var(--sun); } .callout.careful .label { color: var(--sun); }
figure { margin: 20px 0 24px; }
figure img { display: block; max-width: 100%; max-height: 640px; width: auto; height: auto; border: 1px solid var(--white); box-shadow: 5px 5px 0 rgba(255, 72, 176, 0.35); background: var(--bg0); }
figcaption { margin-top: 8px; font-size: 14px; color: var(--faint); }

/* generated pages */
.kind { font: 500 13px var(--num); color: var(--sun); text-transform: uppercase; letter-spacing: 0.06em; margin-top: -8px; }
.filter input { width: 100%; max-width: 360px; height: 36px; padding: 0 12px; background: var(--bg2); border: 1px solid var(--line); color: var(--text); font: 400 15px var(--ui); }
.filter input:focus { border-color: var(--aqua); outline: none; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 12px 0 20px; }
.card { display: block; padding: 12px 14px; background: var(--bg2); border: 1px solid var(--line); color: var(--dim); font-size: 14px; line-height: 1.45; }
.card strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 2px; }
.card:hover { border-color: var(--pink); text-decoration: none; }
details { border: 1px solid var(--line); margin: 8px 0; background: var(--bg1); }
summary { cursor: pointer; padding: 10px 14px; font-weight: 650; color: var(--text); }
summary span { font: 400 12px var(--num); color: var(--faint); margin-left: 6px; }
details .table { margin: 0; border: 0; border-top: 1px solid var(--line); }

/* previous / next */
.pager { max-width: 760px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; }
.pager a { display: block; padding: 14px 16px; border: 1px solid var(--line); color: var(--text); font-weight: 650; }
.pager a span { display: block; font: 400 12px var(--num); color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; }
.pager a.next { text-align: right; grid-column: 2; }
.pager a:hover { border-color: var(--pink); text-decoration: none; }

/* narrower screens: the contents list goes, then the sidebar becomes a drawer */
@media (max-width: 1180px) { .frame { grid-template-columns: var(--side) minmax(0, 1fr); } .onpage { display: none; } }
@media (max-width: 860px) {
  .frame { grid-template-columns: minmax(0, 1fr); }
  .menu { display: block; }
  .side { position: fixed; top: var(--top); left: 0; width: min(300px, 85vw); z-index: 9; transform: translateX(-100%); transition: transform 0.15s; border-right: 1px solid var(--white); }
  body.menu-open .side { transform: none; }
  main { padding: 24px 16px 64px; }
  .platform, .search .hint { display: none; }
  .search { margin-left: 0; }
  .open { padding: 8px 10px; font-size: 12px; }
  article h1 { font-size: 34px; }
  .anchor { display: none; }
}
@media (max-width: 480px) { .top { gap: 8px; padding: 0 10px; } .brand span, .open span { display: none; } .pager { grid-template-columns: 1fr; } .pager a.next { grid-column: 1; } }
