/* Page layout, type and plain elements. */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 16px/1.45 var(--font-body);
	min-height: 100vh;
	overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--focus); text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
	outline: var(--px) solid var(--focus);
	outline-offset: var(--px);
}

h1, h2, h3 {
	font-family: var(--font-pixel);
	font-weight: 400;
	line-height: 1.5;
	letter-spacing: 0.02em;
	margin: 0 0 var(--gap);
}
h1 { font-size: 18px; }
h2 { font-size: 13px; color: var(--gb-foam); }
h3 { font-size: 11px; color: var(--text-dim); }

p { margin: 0 0 var(--gap); }

img.pixel, .pixel img { image-rendering: pixelated; }

/* ---------------------------------------------------------------- shell */

.site-head {
	position: relative;
	z-index: 2;
	background: linear-gradient(180deg, var(--gb-deep), var(--bg));
	border-bottom: var(--px) solid var(--gb-pine);
}
.site-head-inner {
	max-width: var(--max);
	margin: 0 auto;
	padding: 14px 16px 10px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 18px;
}
.brand {
	display: flex;
	align-items: center;
	gap: 12px;
	color: inherit;
}
.brand:hover { text-decoration: none; }
.brand img { width: 36px; height: 36px; image-rendering: pixelated; }
.brand-name {
	font-family: var(--font-pixel);
	font-size: 16px;
	line-height: 1.3;
	background: linear-gradient(180deg, var(--gb-foam) 0%, var(--gb-aqua) 55%, var(--gb-jade) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	text-shadow: none;
}
.brand-name small {
	display: block;
	font-size: 8px;
	letter-spacing: 0.3em;
	color: var(--gb-lilac);
	-webkit-text-fill-color: var(--gb-lilac);
	margin-top: 4px;
}

.doc-strip {
	font-family: var(--font-pixel);
	font-size: 9px;
	color: var(--text-faint);
	display: flex;
	flex-wrap: wrap;
	gap: 6px 10px;
	align-items: center;
}
.doc-strip a { color: var(--gb-mint); }
.doc-strip .sep { color: var(--gb-sea); }

.site-nav {
	max-width: var(--max);
	margin: 0 auto;
	padding: 0 16px 10px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

main {
	position: relative;
	z-index: 1;
	max-width: var(--max);
	margin: 0 auto;
	padding: var(--gap-lg) 16px 48px;
}

.site-foot {
	max-width: var(--max);
	margin: 0 auto;
	padding: 16px;
	color: var(--text-dim);
	font-size: 13px;
	position: relative;
	z-index: 1;
}

/* ---------------------------------------------------------------- forms */

input[type="text"], input[type="search"], input[type="number"], select {
	font: inherit;
	color: var(--text);
	background: var(--bg-2);
	border: var(--px) solid var(--line);
	padding: 6px 8px;
	min-width: 0;
}
input::placeholder { color: var(--text-faint); }

/* ---------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; max-width: 100%; }
table.grid {
	border-collapse: collapse;
	width: 100%;
	font-size: 15px;
}
table.grid th {
	font-family: var(--font-pixel);
	font-size: 9px;
	font-weight: 400;
	text-align: left;
	color: var(--text-dim);
	padding: 8px 8px;
	border-bottom: var(--px) solid var(--line);
	position: sticky;
	top: 0;
	background: var(--panel);
}
table.grid td {
	padding: 5px 8px;
	border-bottom: 1px solid var(--gb-pine);
	vertical-align: middle;
}
table.grid tr:hover td { background: var(--panel-2); }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }

.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.hidden { display: none !important; }

@media (max-width: 640px) {
	body { font-size: 15px; }
	.brand-name { font-size: 13px; }
	h1 { font-size: 15px; }
	main { padding-top: 14px; }
	/* One row of tabs that scrolls sideways, so the page starts on screen. */
	.site-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
	.site-nav::-webkit-scrollbar { display: none; }
	.site-nav .tab { flex: none; }
}

/* ---------------------------------------------------------------- search */

/* The site-wide search: top right of the header, under PRESS START on home. */
.site-search { margin-left: auto; width: min(320px, 100%); }
body[data-page="home"] .site-search { display: none; }
.hs { position: relative; }
.hs-input { width: 100%; padding-right: 30px; border-color: var(--gb-teal); background: rgba(4, 16, 12, 0.85); }
.hs-input:focus { outline: none; border-color: var(--gb-aqua); box-shadow: 0 0 0 var(--px) var(--gb-black); }
.hs-key {
	position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
	font-family: var(--font-pixel); font-size: 8px; color: var(--text-faint);
	border: 1px solid var(--gb-sea); padding: 2px 4px; pointer-events: none;
}
.hs-input:focus + .hs-key { display: none; }
.hs-pop {
	position: absolute; z-index: 20; top: calc(100% + 4px); right: 0; left: 0; min-width: 300px;
	max-height: min(70vh, 520px); overflow-y: auto; text-align: left;
	background: var(--bg-2); border: var(--px) solid var(--gb-emerald);
	box-shadow: inset 0 0 0 var(--px) var(--gb-black), 0 0 0 var(--px) var(--gb-black), 0 8px 24px rgba(0, 0, 0, 0.6);
}
.hs-group { font-family: var(--font-pixel); font-size: 8px; color: var(--gb-lilac); padding: 10px 10px 4px; letter-spacing: 0.1em; }
.hs-item { display: flex; align-items: center; gap: 8px; padding: 5px 10px; color: var(--text); min-height: 34px; }
.hs-item:hover, .hs-item.on { text-decoration: none; background: var(--panel-2); color: var(--gb-foam); }
.hs-item.on { box-shadow: inset var(--px) 0 0 var(--gb-aqua); }
.hs-icon { width: 32px; height: 32px; margin: -4px 0; flex: none; }
.hs-item .type { flex: none; }
.hs-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-sub { flex: none; max-width: 48%; color: var(--text-faint); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-all { display: block; padding: 8px 10px; font-family: var(--font-pixel); font-size: 9px; border-top: var(--px) solid var(--gb-pine); color: var(--gb-mint); }
.hs-all.on, .hs-all:hover { text-decoration: none; background: var(--panel-2); }
.hs-none { padding: 10px; margin: 0; color: var(--text-dim); }
.home-search { width: min(440px, 100%); margin: 22px auto 0; }
.home-search .hs-input { padding: 10px 34px 10px 12px; border-color: var(--gb-lilac); background: rgba(41, 41, 90, 0.6); }
.home-search .hs-input:focus { border-color: var(--gb-aqua); }
.hs-jump { margin-bottom: var(--gap); }
.hs-results .hs-item { border-bottom: 1px solid var(--gb-pine); }
.hs-results .hs-item:last-child { border-bottom: 0; }
@keyframes hs-flash { 0%, 60% { box-shadow: 0 0 0 3px var(--gb-aqua); } 100% { box-shadow: 0 0 0 3px transparent; } }
.hs-flash { animation: hs-flash 1.8s steps(6) 1; }
tr.hs-flash td { background: var(--panel-2); }
@media (prefers-reduced-motion: reduce) { .hs-flash { animation: none; outline: 3px solid var(--gb-aqua); } }
@media (max-width: 640px) {
	.site-search { width: 100%; margin-left: 0; order: 3; }
	.hs-pop { min-width: 0; }
	.hs-key { display: none; }
}
