/* Brass Docs: Create: Computing Ages documentation.
   Brass casing and andesite from Create, pixel textures and text shadows from Minecraft, phosphor screens from old
   computers. Code blocks keep the colours of the in-game editor. */

:root {
	--bg: #141518;
	--grid: rgba(255, 255, 255, .022);
	--surface: #1b1c21;
	--surface-2: #212329;
	--surface-3: #2a2d34;
	--line: #33363e;
	--line-strong: #474b55;
	--text: #e9e3d5;
	--text-dim: #c3bcac;
	--muted: #928b7e;
	--brass: #e2aa3a;
	--brass-hi: #f7d06b;
	--brass-lo: #9a6a1a;
	--brass-ink: #241806;
	--copper: #dd7c4c;
	--link: #f3c759;
	--link-hover: #ffe08f;
	--shadow: rgba(0, 0, 0, .45);
	--title-shadow: #3d2a08;
	--inline-code-bg: #262830;
	--inline-code-text: #f0d7a0;
	--tooltip-bg: #13071c;
	--tooltip-border-a: #5a1fd1;
	--tooltip-border-b: #2c0e6b;
	--editor-bg: #1e1e1e;
	--editor-bar: #2b2b2c;
	--editor-text: #d4d4d4;
	--sidebar-w: 280px;
	--toc-w: 230px;
	--top-h: 60px;
	--content-w: 860px;
	--radius: 3px;
	--font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-pixel: "Pixelify Sans", var(--font-body);
	--font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
	--font-screen: "VT323", var(--font-mono);
	color-scheme: dark;
}

:root[data-theme="light"] {
	--bg: #ede6d6;
	--grid: rgba(80, 60, 20, .05);
	--surface: #fbf7ee;
	--surface-2: #f4eee1;
	--surface-3: #e9e1cf;
	--line: #d9cfb9;
	--line-strong: #c2b597;
	--text: #2b241b;
	--text-dim: #4b4234;
	--muted: #776c5a;
	--brass: #b07b16;
	--brass-hi: #d69d2c;
	--brass-lo: #7b520c;
	--brass-ink: #fff8e6;
	--copper: #b4552a;
	--link: #8c5a06;
	--link-hover: #5f3c00;
	--shadow: rgba(60, 40, 10, .18);
	--title-shadow: #e2cf9e;
	--inline-code-bg: #efe5cf;
	--inline-code-text: #6d3f00;
	color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
/* the pixel font draws "fi" as one odd glyph, and code must show what is typed */
html { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }

html { scroll-padding-top: calc(var(--top-h) + 16px); -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background-color: var(--bg);
	background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
	background-size: 32px 32px;
	color: var(--text);
	font: 16px/1.68 var(--font-body);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }

/* animated textures (fluids) are a column of frames: show the first one */
img.tex { image-rendering: pixelated; image-rendering: crisp-edges; width: 20px; height: 20px; flex: none; object-fit: cover; object-position: top; }
img.tex.big { width: 64px; height: 64px; }

code, kbd, pre { font-family: var(--font-mono); }
:not(pre) > code {
	font-size: .86em;
	background: var(--inline-code-bg);
	color: var(--inline-code-text);
	padding: .1em .34em;
	border-radius: var(--radius);
	white-space: nowrap;
}
a > code, a.sym code { color: var(--link); box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--link) 40%, transparent); }
a.sym { text-decoration: none; }
a.sym:hover code { background: color-mix(in srgb, var(--link) 18%, var(--inline-code-bg)); }

kbd {
	font-size: .78em;
	padding: .1em .45em;
	background: var(--surface-3);
	color: var(--text);
	border: 1px solid var(--line-strong);
	border-bottom-width: 3px;
	border-radius: var(--radius);
	white-space: nowrap;
}

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--brass); color: var(--brass-ink); padding: 8px 12px; }
.skip:focus { left: 8px; }

.muted { color: var(--muted); }

/* ------------------------------------------------------------------------------------------------ top bar */

.topbar {
	position: sticky;
	top: 0;
	z-index: 30;
	height: var(--top-h);
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 0 18px;
	background: linear-gradient(#25272d, #1b1d22);
	border-bottom: 3px solid var(--brass);
	box-shadow: 0 3px 0 var(--brass-lo), 0 8px 18px rgba(0, 0, 0, .35);
	color: #efe7d4;
}
:root[data-theme="light"] .topbar { background: linear-gradient(#3a3226, #2b241a); }

.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; position: relative; }
.brand .cog { width: 30px; height: 30px; color: var(--brass-hi); position: absolute; left: -6px; top: -6px; opacity: 0; }
.brand-logo { width: 40px; height: 40px; position: relative; transition: transform .6s ease; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .5)); }
.brand:hover .brand-logo { transform: rotate(-360deg); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-mod { font-size: 12px; color: #b8ad95; white-space: nowrap; }
.brand-site { font-family: var(--font-pixel); font-size: 21px; font-weight: 600; color: #f7d06b; text-shadow: 2px 2px 0 #4a3209; white-space: nowrap; }

.search-btn {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 10px;
	width: min(360px, 38vw);
	height: 38px;
	padding: 0 10px;
	background: #121317;
	color: #a49b88;
	border: 2px solid #3d3f46;
	box-shadow: inset 2px 2px 0 rgba(0, 0, 0, .5);
	border-radius: var(--radius);
	font: inherit;
	font-size: 14px;
	cursor: pointer;
}
.search-btn:hover { border-color: var(--brass); color: #e9e3d5; }
.search-btn svg { width: 16px; height: 16px; flex: none; }
.search-btn kbd { margin-left: auto; background: #24262b; color: #c9c0ad; border-color: #45474e; }

.top-actions { display: flex; align-items: center; gap: 8px; }
.lang-switch, .theme-btn {
	display: flex;
	align-items: center;
	height: 38px;
	background: #2b2d33;
	border: 2px solid #46484f;
	border-radius: var(--radius);
	box-shadow: inset -2px -2px 0 rgba(0, 0, 0, .35), inset 2px 2px 0 rgba(255, 255, 255, .07);
	color: #d9d0bc;
	text-decoration: none;
	font-family: var(--font-pixel);
	cursor: pointer;
}
.lang-switch span { padding: 0 9px; font-size: 15px; }
.lang-switch span.on { background: var(--brass); color: #241806; align-self: stretch; display: flex; align-items: center; }
.lang-switch:hover, .theme-btn:hover { border-color: var(--brass); color: #fff; }
.theme-btn { width: 38px; justify-content: center; padding: 0; }
.theme-btn svg { width: 18px; height: 18px; }

.menu-btn { display: none; width: 38px; height: 38px; padding: 9px 8px; background: #2b2d33; border: 2px solid #46484f; border-radius: var(--radius); cursor: pointer; flex-direction: column; justify-content: space-between; }
.menu-btn span { display: block; height: 3px; background: #e2d6bb; }

/* ------------------------------------------------------------------------------------------------ layout */

.layout {
	flex: 1;
	display: grid;
	grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
	width: 100%;
	max-width: 1560px;
	margin: 0 auto;
}
body.home .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }

.sidebar {
	position: sticky;
	top: calc(var(--top-h) + 3px);
	height: calc(100vh - var(--top-h) - 3px);
	overflow-y: auto;
	padding: 22px 12px 40px 18px;
	border-right: 2px solid var(--line);
	background: color-mix(in srgb, var(--surface) 70%, transparent);
	scrollbar-width: thin;
	scrollbar-color: var(--line-strong) transparent;
}
.nav-group { margin-bottom: 20px; }
.nav-title {
	font-family: var(--font-pixel);
	font-size: 14px;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--brass);
	margin: 0 0 6px 6px;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 4px 8px;
	border-left: 3px solid transparent;
	color: var(--text-dim);
	text-decoration: none;
	font-size: 14.5px;
	line-height: 1.35;
	border-radius: 0 var(--radius) var(--radius) 0;
}
.sidebar li a code { background: none; border: 0; padding: 0; color: inherit; font-size: 13.5px; }
.sidebar li a:hover { color: var(--text); background: var(--surface-2); }
.sidebar li a.current { color: var(--text); background: var(--surface-3); border-left-color: var(--brass); font-weight: 600; }
.sidebar .tex { width: 18px; height: 18px; }
.tex-dot { width: 18px; height: 18px; flex: none; display: grid; place-items: center; }
.tex-dot::before { content: ""; width: 6px; height: 6px; background: var(--line-strong); }
.current .tex-dot::before { background: var(--brass); }

.main { min-width: 0; padding: 34px 44px 60px; }
.page { max-width: var(--content-w); margin: 0 auto; }

.toc {
	position: sticky;
	top: calc(var(--top-h) + 3px);
	height: calc(100vh - var(--top-h) - 3px);
	overflow-y: auto;
	padding: 34px 16px 40px 8px;
	font-size: 13.5px;
	scrollbar-width: thin;
}
.toc-title { font-family: var(--font-pixel); text-transform: uppercase; letter-spacing: .04em; color: var(--brass); margin-bottom: 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc li a { display: block; padding: 3px 10px; color: var(--muted); text-decoration: none; margin-left: -2px; border-left: 2px solid transparent; line-height: 1.35; }
.toc li.lvl-3 a { padding-left: 22px; }
.toc li a code { background: none; border: 0; padding: 0; color: inherit; font-size: 12.5px; white-space: normal; word-break: break-all; }
.toc li a:hover { color: var(--text); }
.toc li a.active { color: var(--link); border-left-color: var(--brass); }

/* ------------------------------------------------------------------------------------------------ page text */

.page-head { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 2px dashed var(--line); }
.crumb { font-family: var(--font-pixel); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-size: 14px; }
h1, h2, h3, h4 { line-height: 1.25; scroll-margin-top: calc(var(--top-h) + 16px); position: relative; }
h1 {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 4px 0 10px;
	font-family: var(--font-pixel);
	font-weight: 600;
	font-size: clamp(30px, 4vw, 42px);
	color: var(--brass-hi);
	text-shadow: 3px 3px 0 var(--title-shadow);
}
:root[data-theme="light"] h1 { color: var(--brass-lo); }
h1 code { font-family: var(--font-pixel); background: none; border: 0; padding: 0; color: inherit; font-size: 1em; white-space: normal; }
.page-icon { width: 44px; height: 44px; filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, .35)); }
.lead { font-size: 1.12em; color: var(--text-dim); margin: 0; }
.page-badges { margin-top: 12px; }

.page h2 {
	font-family: var(--font-pixel);
	font-weight: 600;
	font-size: 28px;
	margin: 48px 0 14px;
	padding-bottom: 6px;
	color: var(--text);
	border-bottom: 2px solid var(--line);
	text-shadow: 2px 2px 0 var(--shadow);
}
.page h2::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 64px; height: 2px; background: var(--brass); }
.page h3 { font-size: 20px; margin: 30px 0 10px; }
.page h4 { font-size: 17px; margin: 22px 0 8px; color: var(--text-dim); }
.anchor { position: absolute; left: -22px; color: var(--muted); text-decoration: none; opacity: 0; font-family: var(--font-mono); font-weight: 400; text-shadow: none; }
h1:hover .anchor, h2:hover .anchor, h3:hover .anchor, h4:hover .anchor { opacity: 1; }

.page p, .page li { color: var(--text); }
.page ul, .page ol { padding-left: 1.4em; }
.page li { margin: 4px 0; }
.page li::marker { color: var(--brass); }
.page ul > li { list-style: square; }
.page hr { border: 0; height: 2px; background: repeating-linear-gradient(90deg, var(--line) 0 8px, transparent 8px 14px); margin: 36px 0; }
.page img:not(.tex) { max-width: 100%; image-rendering: pixelated; }
.page blockquote { margin: 16px 0; padding: 2px 18px; border-left: 4px solid var(--line-strong); color: var(--text-dim); }
strong { color: var(--text); }

.table-wrap { overflow-x: auto; margin: 18px 0; border: 2px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { background: var(--surface-3); font-family: var(--font-pixel); font-weight: 500; font-size: 15px; letter-spacing: .02em; color: var(--text); }
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
tbody tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }

/* ------------------------------------------------------------------------------------------------ callouts */

.callout {
	margin: 20px 0;
	padding: 12px 16px 4px;
	background: var(--surface-2);
	border: 2px solid var(--line);
	border-left: 6px solid var(--c);
	border-radius: var(--radius);
	--c: #5fa8e0;
}
.callout.tip { --c: #6cc24a; }
.callout.warning { --c: #e8a33a; }
.callout.important { --c: #b07cf0; }
.callout-title { display: flex; align-items: center; gap: 8px; font-family: var(--font-pixel); font-size: 17px; color: var(--c); margin-bottom: 4px; }
.callout-icon { width: 14px; height: 14px; background: var(--c); box-shadow: 3px 3px 0 color-mix(in srgb, var(--c) 40%, black); flex: none; }
.callout > p:last-child, .callout > ul:last-child { margin-bottom: 12px; }
.callout .code { margin-bottom: 12px; }

/* ------------------------------------------------------------------------------------------------ code and screens */

.code { margin: 18px 0; border: 2px solid #0c0c0d; border-radius: var(--radius); overflow: hidden; background: var(--editor-bg); box-shadow: 4px 4px 0 var(--shadow); }
.code-bar { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 4px 12px; background: var(--editor-bar); border-bottom: 1px solid #3c3c3c; }
.code-title { font-family: var(--font-pixel); font-size: 14px; color: #c9c2b2; display: flex; align-items: center; gap: 8px; }
.code-title::before { content: ""; width: 8px; height: 8px; background: var(--brass); box-shadow: 0 0 0 2px #3b2a0b; }
.copy {
	font: 13px var(--font-pixel);
	color: #d4d4d4;
	background: #3a3a3c;
	border: 1px solid #555;
	border-bottom-width: 3px;
	border-radius: var(--radius);
	padding: 2px 10px;
	cursor: pointer;
}
.copy:hover { background: #4a4a4d; color: #fff; }
.copy.done { background: #2f6b2f; border-color: #3f8a3f; }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 14px; line-height: 1.55; color: var(--editor-text); tab-size: 2; }
.code pre.long { max-height: 640px; overflow-y: auto; }
.code.plain pre { color: var(--editor-text); }
pre code { font-family: inherit; }
.brass .k { color: #c586c0; }
.brass .c { color: #569cd6; }
.brass .s { color: #ce9178; }
.brass .n { color: #b5cea8; }
.brass .m { color: #6a9955; font-style: italic; }
.brass .l { color: #4ec9b0; }
.brass .f { color: #dcdcaa; }

.screen { position: relative; background: #111111; border-top: 2px solid #0c0c0d; }
.code > .screen:first-child { border-top: 0; }
.screen-bar { font: 13px var(--font-pixel); color: #8f8f8f; background: #202020; padding: 3px 12px; letter-spacing: .04em; text-transform: uppercase; }
.code .screen pre, .screen pre {
	margin: 0;
	padding: 12px 16px 14px;
	font: 21px/1.12 var(--font-screen);
	color: #f0f0f0;
	overflow-x: auto;
	white-space: pre;
}
.screen pre::after { content: ""; position: absolute; inset: 24px 0 0; pointer-events: none; background: repeating-linear-gradient(transparent 0 2px, rgba(0, 0, 0, .18) 2px 3px); }
.screen .prompt { color: #dede6c; }
.screen.screen-green pre { color: #39ff6a; background: #061208; text-shadow: 0 0 6px rgba(57, 255, 106, .55); }
.screen-green .prompt { color: #39ff6a; }
.screen.screen-amber pre { color: #ffb21f; background: #140c02; text-shadow: 0 0 6px rgba(255, 178, 31, .5); }
.screen-amber .prompt { color: #ffb21f; }
.screen.screen-paper pre { color: #2a2420; background: #f0e9d2; text-shadow: none; }
.screen-paper pre::after { display: none; }
.screen-paper .prompt { color: #2a2420; }
.screen-render img { display: block; width: 100%; max-width: 768px; height: auto; margin: 0 auto; image-rendering: pixelated; background: #111; }
.toc a code, .sidebar a code { box-shadow: none !important; }
.swatch { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -.17em; background: var(--sw); border: 2px solid rgba(0, 0, 0, .55); box-shadow: inset -2px -2px 0 rgba(0, 0, 0, .25), inset 2px 2px 0 rgba(255, 255, 255, .25); margin-right: 2px; }

/* ------------------------------------------------------------------------------------------------ functions */

.fn-index { margin: 26px 0 8px; border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.fn-index-title { font-family: var(--font-pixel); font-size: 16px; padding: 7px 14px; background: var(--surface-3); color: var(--brass-hi); border-bottom: 2px solid var(--line); }
:root[data-theme="light"] .fn-index-title { color: var(--brass-lo); }
.fn-index table { font-size: 14px; }
.fn-index td { padding: 6px 14px; }
.fn-index td:first-child { width: 1%; white-space: nowrap; }
.fn-index td:first-child a { text-decoration: none; }

.fn {
	position: relative;
	margin: 26px 0;
	background: var(--surface);
	border: 2px solid var(--line);
	border-radius: var(--radius);
	box-shadow: 4px 4px 0 var(--shadow);
	scroll-margin-top: calc(var(--top-h) + 16px);
}
.fn::before, .fn::after {
	/* the rivets of a brass casing */
	content: "";
	position: absolute;
	top: 7px;
	width: 6px;
	height: 6px;
	background: var(--brass);
	box-shadow: inset -2px -2px 0 var(--brass-lo);
}
.fn::before { left: 7px; }
.fn::after { right: 7px; }
.fn:target { border-color: var(--brass); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brass) 35%, transparent), 4px 4px 0 var(--shadow); }
.fn-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	padding: 12px 22px 11px;
	background: linear-gradient(var(--surface-3), var(--surface-2));
	border-bottom: 2px solid var(--line);
}
.fn-anchor { color: var(--muted); text-decoration: none; font-family: var(--font-mono); margin-left: -6px; }
.fn-anchor:hover { color: var(--brass); }
.fn-sig { margin: 0; font-size: 17px; font-weight: 400; flex: 1 1 auto; min-width: 0; }
.fn-sig code { background: none; border: 0; padding: 0; white-space: normal; color: var(--text); font-size: 1em; }
.fn-name { color: var(--brass-hi); font-weight: 700; }
:root[data-theme="light"] .fn-name { color: var(--brass-lo); }
.fn-sig .paren { color: var(--muted); }
.fn-sig .sig-params { color: #9cdcfe; }
:root[data-theme="light"] .fn-sig .sig-params { color: #1d5f8a; }
.fn-sig .opt { color: var(--muted); }
.fn-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fn-body { padding: 4px 22px 8px; }
.fn-body > p:first-child { font-size: 1.04em; }
.method .fn-name { color: #8fd4ff; }
:root[data-theme="light"] .method .fn-name { color: #155a85; }

.returns { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }

.type { font-family: var(--font-mono); font-size: 12.5px; padding: 1px 6px; border-radius: var(--radius); background: var(--surface-3); color: var(--text-dim); border: 1px solid var(--line); }
.type-number { color: #b5cea8; }
.type-string { color: #ce9178; }
.type-boolean, .type-nil { color: #569cd6; }
.type-table { color: #4ec9b0; }
.type-function { color: #dcdcaa; }
:root[data-theme="light"] .type-number { color: #3d6b2e; }
:root[data-theme="light"] .type-string { color: #9a4520; }
:root[data-theme="light"] .type-boolean, :root[data-theme="light"] .type-nil { color: #1f5ea8; }
:root[data-theme="light"] .type-table { color: #11766a; }
:root[data-theme="light"] .type-function { color: #7a6a0e; }
.type-or { color: var(--muted); margin: 0 2px; }

/* parameters in a Minecraft item tooltip */
.params {
	margin: 14px 0;
	padding: 10px 14px;
	background: var(--tooltip-bg);
	border: 2px solid transparent;
	border-radius: var(--radius);
	background-image: linear-gradient(var(--tooltip-bg), var(--tooltip-bg)), linear-gradient(180deg, var(--tooltip-border-a), var(--tooltip-border-b));
	background-origin: border-box;
	background-clip: padding-box, border-box;
	box-shadow: 0 0 0 2px #0a030f;
	color: #ece6f4;
}
.params-title { font-family: var(--font-pixel); font-size: 14px; color: #c9b6ff; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.params dl + .params-title { margin-top: 10px; padding-top: 8px; border-top: 1px dashed #3b2459; }
.params dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; align-items: baseline; }
.params dt { white-space: nowrap; }
.params dd { margin: 0; color: #d9d1e6; }
.params dt code { background: none; border: 0; padding: 0; color: #ffe08f; font-size: 14px; font-weight: 700; }
.params dt code.opt { color: #bfb3cf; font-weight: 400; }
.params dd code { background: #241433; border-color: #3b2459; color: #f3e3b6; }
/* the tooltip stays dark in both themes */
:root .params .type { background: #22122f; border-color: #3b2459; color: #d9d1e6; }
:root[data-theme] .params .type-number { color: #b5cea8; }
:root[data-theme] .params .type-string { color: #ce9178; }
:root[data-theme] .params .type-boolean, :root[data-theme] .params .type-nil { color: #6cb2ff; }
:root[data-theme] .params .type-table { color: #4ec9b0; }
:root[data-theme] .params .type-function { color: #dcdcaa; }
.params .optional { font-size: 12px; color: #9d8fb3; font-style: italic; }
.params a { color: #ffd76a; }

.see-also { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.see-also > span { font-family: var(--font-pixel); text-transform: uppercase; letter-spacing: .04em; margin-right: 4px; }
.see-also a { text-decoration: none; }

/* badges look like little pixel labels */
.badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font: 13px/1 var(--font-pixel);
	padding: 4px 7px 3px;
	border: 2px solid var(--line-strong);
	background: var(--surface-3);
	color: var(--text-dim);
	border-radius: var(--radius);
	white-space: nowrap;
	box-shadow: 2px 2px 0 var(--shadow);
}
.tier-all { border-color: #7f8487; color: #c8ccce; background: #2c2f33; }
.tier-gfx { border-color: #2f9e4f; color: #6dff96; background: #0d2414; }
.tier-net { border-color: #c8861c; color: #ffc65a; background: #2a1c06; }
.tier-wireless { border-color: #3d79c9; color: #9cc8ff; background: #0f1d33; }
.tier-aeronautics { border-color: #2aa1a6; color: #86f0f2; background: #0b2729; }
.badge.yields { border-color: #8b5bd0; color: #d6bbff; background: #211333; }
.badge.cost { border-color: #b8653a; color: #ffb48a; background: #2c160b; }
.badge.value { border-color: #4d86c4; color: #a9d2ff; background: #10203a; }
:root[data-theme="light"] .tier-all { color: #3c4144; background: #e3e5e6; border-color: #9aa0a3; }
:root[data-theme="light"] .tier-gfx { color: #145c27; background: #dcf3e1; }
:root[data-theme="light"] .tier-net { color: #6e4405; background: #f8e7c4; }
:root[data-theme="light"] .tier-wireless { color: #1b4a8a; background: #dde9fa; }
:root[data-theme="light"] .tier-aeronautics { color: #0d5f63; background: #d6f3f3; }
:root[data-theme="light"] .badge.yields { color: #4e2b86; background: #ebe0fb; }
:root[data-theme="light"] .badge.cost { color: #7a3510; background: #f8e1d3; }
:root[data-theme="light"] .badge.value { color: #1d4f86; background: #dfeafa; }

/* ------------------------------------------------------------------------------------------------ cards */

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 18px 0; }
.card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 14px 14px 12px;
	background: var(--surface);
	border: 2px solid var(--line);
	border-radius: var(--radius);
	box-shadow: 4px 4px 0 var(--shadow);
	color: var(--text);
	text-decoration: none;
	transition: transform .12s ease, border-color .12s ease;
}
.card:hover { transform: translate(-2px, -2px); border-color: var(--brass); box-shadow: 6px 6px 0 var(--shadow); color: var(--text); }
.card .tex { width: 32px; height: 32px; }
.card-title { font-family: var(--font-pixel); font-size: 19px; color: var(--brass-hi); }
:root[data-theme="light"] .card-title { color: var(--brass-lo); }
.card-title code { font-family: var(--font-pixel); background: none; border: 0; padding: 0; color: inherit; font-size: 1em; }
.card-text { font-size: 14px; color: var(--text-dim); line-height: 1.45; }
.card .badge { position: absolute; top: 12px; right: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); font-size: 14.5px; box-shadow: 3px 3px 0 var(--shadow); }
.chip:hover { border-color: var(--brass); color: var(--text); }

.pager { max-width: var(--content-w); margin: 54px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pager a { display: flex; flex-direction: column; padding: 12px 16px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); font-weight: 600; box-shadow: 4px 4px 0 var(--shadow); }
.pager a span { font-family: var(--font-pixel); font-weight: 400; font-size: 14px; color: var(--muted); text-transform: uppercase; }
.pager a.next { text-align: right; grid-column: 2; }
.pager a:hover { border-color: var(--brass); }

.example-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }

.not-found { text-align: center; padding: 40px 0; }

/* ------------------------------------------------------------------------------------------------ home */

.home-main { padding-top: 26px; }
.hero {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	gap: 36px;
	align-items: center;
	max-width: 1180px;
	margin: 0 auto 30px;
	padding: 34px 36px;
	background: linear-gradient(135deg, color-mix(in srgb, var(--surface-3) 85%, transparent), color-mix(in srgb, var(--surface) 90%, transparent));
	border: 2px solid var(--line);
	border-top: 4px solid var(--brass);
	border-radius: var(--radius);
	box-shadow: 6px 6px 0 var(--shadow);
	position: relative;
}
.hero::before, .hero::after { content: ""; position: absolute; top: 10px; width: 8px; height: 8px; background: var(--brass); box-shadow: inset -2px -2px 0 var(--brass-lo); }
.hero::before { left: 10px; }
.hero::after { right: 10px; }
.hero-logo { width: 96px; height: 96px; display: block; margin-bottom: 14px; filter: drop-shadow(4px 4px 0 var(--shadow)); }
.kicker { font-family: var(--font-pixel); text-transform: uppercase; letter-spacing: .06em; color: var(--copper); }
.hero h1 { font-size: clamp(32px, 3.6vw, 46px); margin: 8px 0 14px; display: block; }
.hero .lead { font-size: 1.15em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.btn {
	display: inline-flex;
	align-items: center;
	padding: 9px 16px;
	font-family: var(--font-pixel);
	font-size: 17px;
	color: var(--text);
	text-decoration: none;
	background: var(--surface-3);
	border: 2px solid #0c0c0d;
	border-radius: var(--radius);
	box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .14), inset -2px -3px 0 rgba(0, 0, 0, .35);
	text-shadow: 2px 2px 0 rgba(0, 0, 0, .35);
}
.btn:hover { color: #fff; background: #4b5059; }
:root[data-theme="light"] .btn:hover { color: var(--text); background: #ddd2bb; }
.btn-brass { background: var(--brass); color: #241806; text-shadow: 1px 1px 0 rgba(255, 255, 255, .35); }
.btn-brass:hover { background: var(--brass-hi); color: #241806; }

.monitor { width: min(100%, 470px); margin-left: auto; }
.monitor-screen {
	padding: 22px;
	background: #d8ccb0;
	border-radius: 6px 6px 2px 2px;
	box-shadow: inset -6px -6px 0 #b5a684, inset 6px 6px 0 #ece3cd, 6px 6px 0 var(--shadow);
}
.monitor-screen pre {
	margin: 0;
	min-height: 220px;
	padding: 14px 16px;
	background: #111;
	border: 4px solid #3d382c;
	font: 21px/1.15 var(--font-screen);
	color: #f0f0f0;
	white-space: pre;
	position: relative;
	overflow: hidden;
}
.monitor-screen pre::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(transparent 0 2px, rgba(0, 0, 0, .2) 2px 3px); pointer-events: none; }
.t-y { color: #dede6c; } .t-w { color: #f0f0f0; } .t-g { color: #999; } .t-p { color: #f0f0f0; }
.cursor { animation: blink 1s steps(1) infinite; color: #f0f0f0; }
@keyframes blink { 50% { opacity: 0; } }
.monitor-base { width: 46%; height: 18px; margin: 0 auto; background: #c7b998; box-shadow: inset -4px -4px 0 #a99a76, 6px 6px 0 var(--shadow); }

.home-section { max-width: 1180px; margin: 40px auto 0; }
.home-section h2 { font-family: var(--font-pixel); font-size: 30px; margin: 0 0 6px; color: var(--text); text-shadow: 2px 2px 0 var(--shadow); }
.home-section > p { margin-top: 0; }

.paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin-top: 14px; }
.path { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: var(--surface); border: 2px solid var(--line); border-left: 6px solid var(--brass); border-radius: var(--radius); text-decoration: none; color: var(--text); box-shadow: 4px 4px 0 var(--shadow); }
.path:hover { border-color: var(--brass); color: var(--text); transform: translate(-2px, -2px); }
.path .tex { width: 36px; height: 36px; }
.path strong { display: block; font-family: var(--font-pixel); font-size: 19px; font-weight: 500; color: var(--brass-hi); }
:root[data-theme="light"] .path strong { color: var(--brass-lo); }
.path span span { font-size: 14px; color: var(--text-dim); line-height: 1.45; }

.computers { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
@media (max-width: 1240px) { .computers { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.page .computers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) { .computers, .page .computers { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.computer { padding: 12px 10px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: 4px 4px 0 var(--shadow); text-align: center; }
.computer .tex.big { margin: 4px auto 8px; display: block; filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, .4)); }
.computer-name { font-family: var(--font-pixel); font-size: 18px; color: var(--brass-hi); line-height: 1.2; }
:root[data-theme="light"] .computer-name { color: var(--brass-lo); }
.computer-age { font-size: 13px; color: var(--copper); margin-bottom: 8px; }
.computer dl { margin: 0; text-align: left; font-size: 13.5px; line-height: 1.35; }
.computer dt { color: var(--muted); font-family: var(--font-pixel); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line); }
.computer dt:first-child { margin-top: 4px; }
.computer dd { margin: 2px 0 0; color: var(--text-dim); }

/* ------------------------------------------------------------------------------------------------ search */

.search-dialog { position: fixed; inset: 0; z-index: 60; background: rgba(5, 4, 8, .62); display: flex; justify-content: center; align-items: flex-start; padding: 9vh 16px 16px; }
.search-dialog[hidden] { display: none; }
.search-box {
	width: min(680px, 100%);
	max-height: 76vh;
	display: flex;
	flex-direction: column;
	background: var(--tooltip-bg);
	border: 3px solid transparent;
	background-image: linear-gradient(var(--tooltip-bg), var(--tooltip-bg)), linear-gradient(180deg, var(--tooltip-border-a), var(--tooltip-border-b));
	background-origin: border-box;
	background-clip: padding-box, border-box;
	box-shadow: 0 0 0 3px #08020c, 0 20px 60px rgba(0, 0, 0, .6);
	border-radius: var(--radius);
	color: #ece6f4;
}
.search-input-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 2px solid #2c1645; }
.search-input-row svg { width: 18px; height: 18px; color: #c9b6ff; flex: none; }
.search-input-row input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: #fff; font: 18px var(--font-body); }
.search-input-row kbd, .search-foot kbd { background: #221233; color: #d8cbee; border-color: #43296a; }
.search-results { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.search-results li a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 8px 10px; border-radius: var(--radius); color: #ece6f4; text-decoration: none; border: 2px solid transparent; }
.search-results li a .r-title { font-family: var(--font-mono); font-size: 14.5px; color: #ffe08f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results li a .r-title.text { font-family: var(--font-body); color: #fff; font-weight: 600; }
.search-results li a .r-kind { font: 12px var(--font-pixel); color: #b49ae6; text-transform: uppercase; align-self: center; }
.search-results li a .r-sub { grid-column: 1 / -1; font-size: 13px; color: #b9aecb; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results li a mark { background: none; color: #fff; text-decoration: underline; text-decoration-color: #c9b6ff; }
.search-results li.sel a, .search-results li a:hover { background: #24123a; border-color: #5a1fd1; }
.search-results .empty { padding: 18px; color: #b9aecb; text-align: center; }
.search-foot { padding: 8px 14px; border-top: 2px solid #2c1645; font-size: 12.5px; color: #a495bd; display: flex; gap: 6px; align-items: center; }

/* ------------------------------------------------------------------------------------------------ footer */

.footer { margin-top: 40px; border-top: 3px solid var(--brass); box-shadow: 0 -3px 0 var(--brass-lo); background: var(--surface); }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 22px 24px 30px; display: flex; gap: 16px; align-items: center; font-size: 14px; }
.footer-logo { width: 48px; height: 48px; }
.legal { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------------------------------------------ small screens */

@media (max-width: 1280px) {
	.layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
	.toc { display: none; }
}

@media (max-width: 960px) {
	:root { --top-h: 56px; }
	.layout, body.home .layout { grid-template-columns: minmax(0, 1fr); }
	.menu-btn { display: flex; }
	.sidebar {
		position: fixed;
		top: calc(var(--top-h) + 3px);
		left: 0;
		z-index: 40;
		width: min(320px, 86vw);
		background: var(--surface);
		transform: translateX(-105%);
		transition: transform .2s ease;
		box-shadow: 8px 0 30px rgba(0, 0, 0, .45);
	}
	body.nav-open .sidebar { transform: none; }
	body.nav-open::after { content: ""; position: fixed; inset: 0; top: calc(var(--top-h) + 3px); background: rgba(0, 0, 0, .45); z-index: 35; }
	.main { padding: 24px 18px 50px; }
	.brand-mod { display: none; }
	.search-btn { width: auto; margin-left: auto; }
	.search-btn .search-label, .search-btn kbd { display: none; }
	.hero { grid-template-columns: 1fr; padding: 26px 20px; }
	.monitor { margin: 0 auto; }
	.anchor { display: none; }
}

@media (max-width: 560px) {
	.topbar { gap: 8px; padding: 0 10px; }
	.brand-site { font-size: 18px; }
	.brand-logo { width: 34px; height: 34px; }
	.fn-head { padding: 12px 16px; }
	.fn-body { padding: 2px 16px 8px; }
	.params dl { grid-template-columns: 1fr; gap: 2px; }
	.params dd { margin-bottom: 8px; }
	.pager { grid-template-columns: 1fr; }
	.pager a.next { grid-column: 1; }
	.code pre { font-size: 13px; }
	.code .screen pre { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
	.topbar, .sidebar, .toc, .pager, .footer, .copy { display: none !important; }
	.layout { display: block; }
	body { background: #fff; color: #000; }
}
