/*
 * The site's shell: palette, type, nav, and the panel primitives every page
 * uses. Loaded before a page's own stylesheet.
 *
 * The palette is the sixteen mIRC colours, the ones the gallery draws in. UI
 * greys are the only additions, mixed from black so nothing drifts off-hue.
 */

:root {
	color-scheme: dark;

	--black: #000000;
	--white: #ffffff;
	--navy: #00007f;
	--green: #009300;
	--red: #ff0000;
	--maroon: #7f0000;
	--purple: #9c009c;
	--orange: #fc7e00;
	--yellow: #ffff00;
	--lime: #00fc00;
	--teal: #009393;
	--cyan: #00ffff;
	--blue: #0000fc;
	--magenta: #ff00ff;
	--grey: #7f7f7f;
	--silver: #d2d2d2;

	--bg: #0b0b0d;
	--panel: #141419;
	--panel-2: #1c1c23;
	--line: #2e2e38;
	--line-lit: #45455a;
	--ink: #ded9e6;
	--ink-dim: #8e8a9c;

	--accent: var(--orange);
	--accent-ink: #1a0d00;
	--focus: var(--cyan);
	--danger: #ff6b6b;

	--mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
	--sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	--radius: 4px;
	--page: 1240px;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 15px/1.6 var(--sans);
	/* Faint scanline wash, so flat black is not the whole backdrop. */
	background-image: repeating-linear-gradient(
		0deg,
		rgb(255 255 255 / 0.014) 0 1px,
		transparent 1px 3px
	);
}

h1,
h2,
h3 {
	font-family: var(--mono);
	line-height: 1.15;
	margin: 0 0 0.4rem;
	letter-spacing: -0.01em;
}

h1 {
	font-size: 1.5rem;
	text-transform: uppercase;
}

h2 {
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--ink-dim);
}

h3 {
	font-size: 0.95rem;
}

p {
	margin: 0 0 0.6rem;
}

a {
	color: var(--focus);
	text-underline-offset: 2px;
}

code,
kbd {
	font-family: var(--mono);
	font-size: 0.92em;
	padding: 0.05em 0.35em;
	border: 1px solid var(--line);
	border-radius: 3px;
	background: var(--panel-2);
	color: var(--yellow);
	white-space: nowrap;
}

:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 2px;
}

.hint {
	color: var(--ink-dim);
	font-size: 0.84rem;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ---- shell ---- */

.shell {
	border-bottom: 1px solid var(--line);
	background: linear-gradient(180deg, var(--panel) 0%, var(--bg) 100%);
}

.shell > div {
	max-width: var(--page);
	margin: 0 auto;
	padding: 0.7rem 1.25rem;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem 1.4rem;
}

.brand {
	font-family: var(--mono);
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--ink);
	text-decoration: none;
	display: inline-flex;
	align-items: baseline;
	gap: 0.45rem;
}

.brand b {
	color: var(--accent);
}

.brand span {
	font-weight: 400;
	font-size: 0.72rem;
	letter-spacing: 0.16em;
	color: var(--ink-dim);
}

.sitenav {
	display: flex;
	gap: 0.3rem;
	margin-left: auto;
	flex-wrap: wrap;
}

.sitenav a {
	font-family: var(--mono);
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	text-decoration: none;
	color: var(--ink-dim);
	padding: 0.28rem 0.6rem;
	border: 1px solid transparent;
	border-radius: var(--radius);
}

.sitenav a:hover {
	color: var(--ink);
	border-color: var(--line-lit);
}

.sitenav a[aria-current="page"] {
	color: var(--accent-ink);
	background: var(--accent);
	border-color: var(--accent);
}

.page {
	max-width: var(--page);
	margin: 0 auto;
	padding: 1.5rem 1.25rem 4rem;
}

.pagetitle {
	grid-column: 1 / -1;
	margin-bottom: 0.4rem;
}

.pagetitle h1 {
	text-transform: none;
	letter-spacing: -0.02em;
}

.pagetitle .lede {
	margin: 0;
	max-width: 56ch;
	color: var(--ink-dim);
}

/* ---- panels ---- */

.panel {
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--panel);
	padding: 0.9rem 1rem;
}

.panel > h2:first-child,
.panel > h3:first-child {
	margin-top: 0;
}

/* A stamped heading, for the registry's own sections. */
.stamp {
	display: inline-block;
	font-family: var(--mono);
	font-size: 0.68rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--accent);
	border: 1px solid currentColor;
	border-radius: 2px;
	padding: 0.1rem 0.45rem;
	margin-bottom: 0.5rem;
}

/* ---- controls ---- */

button,
input,
textarea,
select {
	font: inherit;
	font-family: var(--mono);
	font-size: 0.85rem;
	color: var(--ink);
	background: var(--panel-2);
	border: 1px solid var(--line-lit);
	border-radius: var(--radius);
	padding: 0.34rem 0.6rem;
}

button {
	cursor: pointer;
}

button:hover:not(:disabled) {
	border-color: var(--accent);
	color: var(--white);
}

button:disabled {
	opacity: 0.45;
	cursor: default;
}

button.primary {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--accent-ink);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

button.primary:hover:not(:disabled) {
	background: var(--yellow);
	border-color: var(--yellow);
	color: var(--accent-ink);
}

button.quiet {
	background: none;
	border-color: var(--line);
	color: var(--ink-dim);
}

/* ---- numbers ---- */

.figure {
	font-family: var(--mono);
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.1;
	color: var(--white);
	font-variant-numeric: tabular-nums;
}

.sub {
	font-size: 0.78rem;
	color: var(--ink-dim);
}
