/* The landing page on tui.css: a dashboard of panes in the style of
   fastfetch, btop and k9s. */

.dashboard {
	display: grid;
	gap: 2rem 1rem;
	padding-block: 2rem 3rem;
}

.dashboard > * {
	min-width: 0;
}

@media (min-width: 64rem) {
	.dashboard {
		grid-template-columns: repeat(12, minmax(0, 1fr));
	}

	.about {
		grid-column: span 5;
	}

	.fetch {
		grid-column: span 7;
	}

	.projects {
		grid-column: 1 / -1;
	}

	#libmc,
	#side {
		grid-column: span 6;
	}
}

/* [1] about */

.about {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 1.25rem;
}

.about h1 {
	font-size: clamp(1.75rem, 4vw, 2.5rem);
	line-height: 1.15;
	font-weight: 800;
	letter-spacing: -0.02em;
}

.about em {
	font-style: normal;
	color: var(--accent);
}

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

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

/* The fastfetch pane: a prompt, the logo beside key: value lines and the
   colour palette, then a fresh prompt. */

.prompt-line {
	font-size: 0.875rem;
}

.prompt {
	color: var(--accent);
	font-weight: 700;
}

.fetch-body {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem 2rem;
	margin-block: 1rem;
}

/* Each word of the logo is 36 columns at most; the font shrinks so it still
   fits inside a pane on a phone. */
.logo {
	font-size: min(0.8125rem, calc((100vw - 4.5rem) / 22));
	line-height: 1.2;
	font-weight: 700;
}

.logo pre:first-child {
	color: var(--green);
}

.logo pre:last-child {
	color: var(--cyan);
}

.info {
	font-size: 0.875rem;
}

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

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

.info dl div {
	display: flex;
	flex-wrap: wrap;
	column-gap: 1ch;
}

.info dt {
	color: var(--accent);
	font-weight: 700;
}

.info dt::after {
	content: ":";
}

.palette {
	display: flex;
	margin-top: 0.75rem;
}

.palette span {
	width: 3ch;
	height: 1.25em;
}

.palette span:nth-child(1) { background: var(--foreground); }
.palette span:nth-child(2) { background: var(--red); }
.palette span:nth-child(3) { background: var(--green); }
.palette span:nth-child(4) { background: var(--yellow); }
.palette span:nth-child(5) { background: var(--blue); }
.palette span:nth-child(6) { background: var(--magenta); }
.palette span:nth-child(7) { background: var(--cyan); }
.palette span:nth-child(8) { background: var(--muted); }

/* Rows like k9s and btop's process lists: the row under the pointer or
   holding focus gets the selection bar and a marker. */

.rows-head {
	display: none;
	margin-top: 1rem;
	padding-inline: 1ch;
	color: var(--cyan);
	font-weight: 700;
}

.rows-head span:first-child {
	padding-left: 2ch;
}

.rows {
	margin-top: 1rem;
}

.rows li {
	position: relative;
	display: grid;
	gap: 0.25rem;
	padding: 0.625rem 1ch;
	border-top: 1px dashed var(--border);
}

.rows li:hover,
.rows li:focus-within {
	background: var(--selection);
}

.rows h3 {
	font-size: 1rem;
	font-weight: 700;
	color: var(--accent);
}

.rows h3::before {
	content: "›" / "";
	display: inline-block;
	width: 2ch;
	visibility: hidden;
}

.rows li:hover h3::before,
.rows li:focus-within h3::before {
	visibility: visible;
}

.rows h3 a {
	text-decoration: none;
}

/* The project name's link covers the whole row. */
.rows h3 a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.rows p,
.rows code {
	padding-left: 2ch;
}

.rows code {
	color: var(--muted);
	overflow-wrap: anywhere;
}

.rows code::before {
	content: "$ " / "";
	color: var(--accent);
}

@media (min-width: 48rem) {
	.rows-head,
	.projects .rows li {
		display: grid;
		grid-template-columns: 10ch minmax(0, 1fr) 32ch;
		gap: 2ch;
		align-items: baseline;
	}

	.projects .rows li {
		border-top: 0;
	}

	.projects .rows p,
	.projects .rows code {
		padding-left: 0;
	}
}

.keys {
	margin-top: 1rem;
	color: var(--muted);
	font-size: 0.875rem;
}

.keys kbd {
	padding-inline: 0.5ch;
	border: 1px solid var(--border);
	border-radius: 0.25rem;
	color: var(--foreground);
}

@media (hover: none) {
	.keys {
		display: none;
	}
}

/* [3] libmc, as the tree command would list it. */

.tree-root {
	margin-top: 1rem;
	font-weight: 700;
	color: var(--blue);
}

.tree li {
	position: relative;
	padding-left: 4ch;
}

.tree li::before {
	content: "";
	position: absolute;
	top: 0;
	left: 1ch;
	width: 2ch;
	height: 0.8em;
	border-left: 1px solid var(--muted);
	border-bottom: 1px solid var(--muted);
}

.tree li:not(:last-child)::after {
	content: "";
	position: absolute;
	top: 0.8em;
	bottom: 0;
	left: 1ch;
	border-left: 1px solid var(--muted);
}
