/*
 * Copyright (c) 2025 Jose G Perez Taveras <josegpt27@gmail.com>
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

*,
*::before,
*::after {
	box-sizing: inherit;
	margin: 0;
	padding: 0;
	border-radius: 0;
	-webkit-tap-highlight-color: transparent;
}

html {
	box-sizing: border-box;
	scroll-behavior: smooth;
}

:root {
	--pri: white;
	--sec: black;
	--acc: red;
}

@media only screen and (prefers-color-scheme: dark) {
	*,
	*::before,
	*::after {
		color-scheme: dark;
	}

	:root {
		--pri: black;
		--sec: white;
	}
}

body {
	background-color: var(--pri);
	color: var(--sec);
	font-family: monospace;
	line-height: 1.6;
	max-width: 72ch;
	padding: 1rem;
	margin-inline: auto;
	text-transform: lowercase;
	display: flex;
	flex-direction: column;
	min-height: 100vh;

	& > * {
		margin-block: 1rem;
	}

	& > :first-child:not(main) {
		margin-top: 0;
	}

	& > :last-child:not(main) {
		margin-bottom: 0;
	}

	& > main {
		flex: 1;
	}
}

::selection {
	background-color: var(--sec);
	color: var(--pri);
}

#logo {
	display: block;
	margin: 1rem auto;
	height: 3rem;
	width: 2.5rem;
}

a {
	color: inherit;
	font-weight: 500;
	text-decoration: none;

	&:hover {
		text-decoration: underline;
	}
}

img {
	height: 100%;
	width: 100%;
}

ul {
	list-style: square inside;

	& ol,
	& ul {
		margin-inline: 2rem;
	}
}

ol {
	list-style: square inside;

	& ol,
	& ul {
		margin-inline: 2rem;
	}
}

hr {
	border: none;
	border-top: .3rem double var(--acc);
	overflow: visible;
}

details > * {
	padding-block: .4rem;
}

summary {
	cursor: pointer;
	font-weight: 500;
	user-select: none;
}

fieldset {
	border: none;
	border-top: .3rem double var(--acc);

	& legend {
		padding-right: 1rem;
		font-weight: 500;
	}
}

label {
	cursor: pointer;
	display: block;
}

input,
select,
textarea {
	background-color: transparent;
	border: .175rem solid var(--acc);
	font-size: inherit;
	font-family: inherit;
	padding: .525rem .825rem;
	width: 100%;
}

input[type=radio],
input[type=checkbox] {
	width: auto;
}

button,
input[type=reset],
input[type=button],
input[type=submit] {
	background-color: transparent;
	border: .3rem double var(--sec);
	cursor: pointer;
	font-family: inherit;
	font-weight: 500;
	line-height: 1;
	letter-spacing: .175rem;
	padding-block: .725rem;
	text-align: center;
}

table {
	border-collpase: collpase;
	border-spacing: 0;
	width: 100%;

	& thead {
		border-bottom: .1rem solid var(--sec);
	}

	& th {
		font-weight: 500;
	}

	& th,
	& td {
		padding-block: .4rem;
		text-align: left;

		&:last-child {
			text-align:  right;
		}
	}
}

.cluster {
	justify-content: flex-start;
	align-items: flex-start;
	flex-wrap: wrap;
	gap: 1rem;

	&[data-justify=space-between] {
		justify-content: space-between;
	}

	&[data-justify=center] {
		justify-content: center;
	}

	&[data-align=center] {
		align-items: center;
	}
}

.stack,
.cluster {
	display: flex;
}

.stack {
	flex-direction: column;

	& > * + * {
		margin-block-start: 1rem;
	}
}
