/* RTFM — terminal variant (always dark, like a terminal) */

:root {
	--bg: #0d110e;
	--panel: #121813;
	--fg: #c5d0c5;
	--bright: #eef5ee;
	--dim: #7d8b7e;
	--line: #223024;
	--green: #7ee787;
	--amber: #e3b341;

	--mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

	--wrap: 88ch;
	--gutter: clamp(1rem, 4vw, 2.5rem);
	--indent: 7ch;

	color-scheme: dark;
}

@media (max-width: 40rem) {
	:root {
		--indent: 2ch;
	}
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font: 400 0.975rem/1.7 var(--mono);
	-webkit-font-smoothing: antialiased;
}

::selection {
	background: var(--green);
	color: var(--bg);
}

a {
	color: var(--bright);
	text-decoration-color: var(--dim);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.25em;
}

a:hover {
	color: var(--green);
	text-decoration-color: var(--green);
}

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

p,
ul,
ol,
dl,
dd {
	margin: 0;
}

h1,
h2,
h3 {
	margin: 0;
	font: inherit;
}

.wrap {
	max-width: var(--wrap);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.skip {
	position: absolute;
	left: -9999px;
	top: 0.5rem;
	z-index: 10;
	padding: 0.25rem 0.75rem;
	background: var(--green);
	color: var(--bg);
}

.skip:focus {
	left: var(--gutter);
}

/* Header: prompt-style brand + nav as paths */

.site-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 2rem;
	padding-block: 1.25rem;
	border-bottom: 1px solid var(--line);
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.6ch;
	font-weight: 700;
	font-size: 1.15rem;
	color: var(--bright);
	text-decoration: none;
}

.brand .chev {
	color: var(--green);
}

.cursor {
	display: inline-block;
	width: 0.6em;
	height: 1.1em;
	margin-left: 0.1ch;
	background: var(--green);
	animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
	50% {
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cursor {
		animation: none;
	}
}

.nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 2ch;
}

.nav a {
	color: var(--dim);
	text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
	color: var(--green);
}

/* Command line + man page running head */

.cmd {
	margin-top: 2.5rem;
	color: var(--bright);
}

.prompt {
	color: var(--green);
}

.man-head,
.man-foot {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.25rem 2ch;
	color: var(--dim);
}

.man-head {
	margin-top: 1.25rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px dashed var(--line);
}

/* Second language part of a bilingual page */
.man-head.part {
	margin-top: 4rem;
}

@media (max-width: 40rem) {
	.man-head span:nth-child(2) {
		display: none;
	}
}

/* Hero */

.hero {
	padding-block: clamp(2rem, 7vw, 4rem) 1rem;
}

.hero h1 {
	max-width: 24ch;
	font-size: clamp(1.65rem, 5vw, 2.75rem);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.02em;
	color: var(--bright);
	text-wrap: balance;
}

.hero p {
	max-width: 62ch;
	margin-top: 1.5rem;
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.5ch;
	margin-top: 2rem;
}

.btn {
	display: inline-flex;
	align-items: center;
	min-height: 2.75rem;
	padding: 0.4rem 1.5ch;
	border: 1px solid var(--green);
	color: var(--green);
	text-decoration: none;
}

.btn::before {
	content: "[ ";
	white-space: pre;
}

.btn::after {
	content: " ]";
	white-space: pre;
}

.btn:hover {
	background: var(--green);
	color: var(--bg);
}

.btn-ghost {
	border-color: var(--line);
	color: var(--bright);
}

/* Man page sections: bold uppercase heading, indented body */

.man-section {
	margin-top: 3rem;
}

.man-section > h2 {
	font-weight: 700;
	color: var(--bright);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.man-section > h2 .flag {
	margin-left: 1ch;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
	color: var(--dim);
}

.body {
	padding-left: var(--indent);
	margin-top: 0.75rem;
}

.body > * + * {
	margin-top: 1rem;
}

.body p {
	max-width: 66ch;
}

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

/* Synopsis */

.synopsis {
	color: var(--bright);
}

.synopsis span {
	white-space: nowrap;
}

.synopsis .opt {
	color: var(--green);
}

/* Definition lists: term on its own line, description indented */

.defs {
	display: grid;
	gap: 1.25rem;
}

.defs dt {
	font-weight: 700;
	color: var(--bright);
}

.defs dt .flag {
	color: var(--green);
	font-weight: 500;
}

.defs dt .flag + .label {
	margin-left: 1ch;
}

.defs dd {
	max-width: 62ch;
	padding-left: 4ch;
}

/* Numbered steps */

.steps {
	display: grid;
	gap: 1rem;
	padding: 0;
	list-style: none;
	counter-reset: step;
}

.steps li {
	display: grid;
	grid-template-columns: 4ch minmax(0, 1fr);
	counter-increment: step;
}

.steps li::before {
	content: counter(step) ".";
	color: var(--green);
}

.steps b {
	color: var(--bright);
}

/* Bullets */

.bullets {
	display: grid;
	gap: 0.35rem;
	max-width: 66ch;
	padding: 0;
	list-style: none;
}

.bullets li {
	display: grid;
	grid-template-columns: 3ch minmax(0, 1fr);
}

.bullets li::before {
	content: "-";
	color: var(--green);
}

/* Contact */

.contact-mail {
	display: inline-block;
	font-size: clamp(1.15rem, 4.5vw, 1.75rem);
	font-weight: 700;
	color: var(--green);
	overflow-wrap: anywhere;
}

/* 404 */

.error {
	color: var(--amber);
}

/* Footer */

.site-footer {
	margin-top: 4rem;
	padding-block: 1.25rem 2rem;
	border-top: 1px dashed var(--line);
}

.footer-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 2ch;
	margin-bottom: 1rem;
}

.footer-nav a {
	color: var(--dim);
	text-decoration: none;
}

.footer-nav a:hover {
	color: var(--green);
}
