@import url("/css/chroma.css");

/* bark: https://github.com/if-not-nil/bark */
@font-face {
	font-family: "Noto Sans Mono";
	src: url("/fonts/noto-sans-mono-v32-latin-regular.woff2") format("woff2");
	font-style: normal;
	font-weight: 400;
	font-display: swap;
}

@font-face {
	font-family: "Noto Sans Mono";
	src: url("/fonts/noto-sans-mono-v32-latin-600.woff2") format("woff2");
	font-style: normal;
	font-weight: 600;
	font-display: swap;
}

@font-face {
	font-family: "Noto Sans Mono";
	src: url("/fonts/noto-sans-mono-v32-latin-700.woff2") format("woff2");
	font-style: normal;
	font-weight: 700;
	font-display: swap;
}

:root {
	color-scheme: dark;
	--base00: #101010;
	--base01: #202020;
	--base02: #2b2b2b;
	--base03: #505050;
	--base04: #b0b0b0;
	--base05: #d0d0d0;
	--base06: #e0e0e0;
	--base07: #fafafa;
	--base08: #ab4642;
	--base09: #dc9656;
	--base0A: #f7ca88;
	--base0B: #a1b56c;
	--base0C: #86c1b9;
	--base0D: #7cafc2;
	--base0E: #ba8baf;
	--base0F: #a16946;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--base00); scroll-behavior: smooth; }
body {
	margin: 0;
	padding-bottom: 2em;
	background: var(--base00);
	color: var(--base05);
	font-family: "Noto Sans Mono", Menlo, Consolas, monospace;
	font-size: 16px;
	line-height: 1.6;
}
::selection { color: var(--base07); background: var(--base03); }
a { color: var(--base0D); text-decoration: underline dashed; text-decoration-color: var(--base03); text-underline-offset: 2px; }
a:hover { color: var(--base0C); text-decoration-color: currentColor; }
a:focus-visible { outline: 1px dashed var(--base0A); outline-offset: 2px; }
b, strong { color: var(--base06); }
code, kbd, samp { color: var(--base0B); font-weight: 700; }
pre { margin: 0 0 1.6em; padding: .8em 2ch; overflow-x: auto; border: 1px solid var(--base02); background: var(--base01); color: var(--base05); font-size: .85em; line-height: 1.5; scrollbar-color: var(--base03) transparent; scrollbar-width: thin; }
pre code { font-weight: 400; }
blockquote { margin: 0 0 1.6em; padding-left: 2ch; border-left: 1px dashed var(--base03); color: var(--base04); }
hr { margin: 0 0 1.6em; border: 0; border-top: 1px dashed var(--base03); }
table { border-collapse: collapse; }
th, td { padding: .45em 1ch; border-bottom: 1px solid var(--base02); text-align: left; }
th { color: var(--base06); }

/* 80-column terminal layout, based on hachem.wtf's man(1) page */
#page { max-width: 80ch; margin: 0 auto; padding: 2.4em 2ch 1em; }
.prompt { margin: 0 0 1.6em; color: var(--base04); }
.prompt a { color: inherit; text-decoration: none; }
.prompt a:hover { color: var(--base06); text-decoration: underline dashed; }
.prompt b { color: var(--base06); font-weight: 400; }
.man pre.try, pre.try { margin: 0 0 1.6em; padding: 0; border: 0; background: none; color: var(--base04); font-size: .85em; }
.th, .tf { display: flex; justify-content: space-between; gap: 2ch; white-space: nowrap; color: var(--base04); }
.th { margin-bottom: 1.6em; }
.tf { margin: 1.6em 0; }
.th a { color: var(--base05); text-decoration: none; }
.th a:hover { text-decoration: underline dashed; }
.man { padding-left: 7ch; overflow-wrap: break-word; }
.man h1, .man h2, .man h3 { color: var(--base06); font-size: 1em; font-weight: 700; line-height: inherit; scroll-margin-top: 1.6em; }
.man h1, .man h2 { margin: 1.6em 0 0 -7ch; color: var(--base0A); text-transform: uppercase; }
.man h1:first-child, .man h2:first-child { margin-top: 0; }
.man h3 { margin: 1.6em 0 0 -4ch; }
.man p, .man ul, .man ol, .man pre, .man blockquote { margin: 0 0 1.6em; }
.man code { color: var(--base0B); font-weight: 700; }
.man pre code { font-weight: 400; }
.man ul, .man ol { padding-left: 2ch; }
.man ol { padding-left: 3ch; }
.man ul { list-style: none; }
.man ul > li { position: relative; }
.man ul > li::before { position: absolute; left: -2ch; color: var(--base04); content: "-"; }
.man li > p { margin-bottom: .8em; }
.man ul.whatis { display: grid; grid-template-columns: max-content auto; gap: .55em 2ch; padding: 0; }
.man ul.whatis li { display: contents; }
.man ul.whatis li::before { content: none; }
.man ul.whatis b { align-self: start; }
.man ul.whatis span::before { color: var(--base04); content: "- "; }
.man time { color: var(--base04); }
.synopsis { padding-left: calc(var(--hang) * 1ch); text-indent: calc(var(--hang) * -1ch); }
.synopsis span { display: inline-block; max-width: 100%; overflow-wrap: anywhere; color: var(--base04); text-indent: 0; }
.synopsis span a { color: var(--base0D); font-weight: 700; text-decoration: none; }
.synopsis span a:hover { text-decoration: underline dashed; }
.man .article-title { margin: 0; color: var(--base06); font-size: 1.35em; text-transform: none; }
.man .article-meta { margin: .4em 0 1.6em; color: var(--base04); font-size: .85em; }
.man .article-content h1, .man .article-content h2, .man .article-content h3, .man .article-content h4 { margin: 1.6em 0 .6em; color: var(--base0A); text-transform: none; }
.man .article-content h1 { font-size: 1.15em; }
.man .article-content h2 { font-size: 1em; }
.man .article-content h3 { margin-left: -4ch; font-size: 1em; }
.man .article-content h4 { font-size: .95em; }
.man .article-content p, .man .article-content li { overflow-wrap: anywhere; }
.man .article-content img { max-width: 100%; height: auto; }
.man .comments-link { display: inline-block; margin-bottom: 1.6em; }
.man .nextprev { display: flex; justify-content: space-between; gap: 2ch; margin-bottom: 1.6em; font-size: .85em; }
.man .nextprev > span { flex: 1; }
.man .nextart { text-align: right; }
.man .taglist { margin: 1.6em 0; color: var(--base04); }
.man .wiki-nav { margin: 0 0 1.6em; color: var(--base04); font-size: .85em; }

@media (max-width: 40em) {
	#page { max-width: 80ch; margin: 0 auto; padding: 2.4em 2ch 1em; }
	.man { margin-left: 2ch; }
	.man h1, .man h2 { margin-left: -2ch; }
	.man h3, .man .article-content h3 { margin-left: -1ch; }
	.man pre { font-size: .8em; }
	.th > span:last-child, .th a span, .tf > span:first-child { display: none; }
	.synopsis { --hang: 2 !important; }
	.man ul.whatis { grid-template-columns: 1fr; gap: 0; }
	.man ul.whatis span { margin: 0 0 .6em 2ch; }
	.man ul.whatis span::before { content: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
