/* Inspired by https://contrast-ratio.com */

* {
	box-sizing: border-box;
}

:root {
	font-size: 150%;
	line-height: 1.3;
}

button {
	font-size: 80%;
	padding-block: 0.4em;
	padding-inline: 0.6em;
	white-space: nowrap;
}

html,
body {
	margin: 0;
	padding: 0;
}

.checkered {
	background: linear-gradient(45deg, currentColor 25%, transparent 25%, transparent 75%, currentColor 75%, currentColor),
		linear-gradient(45deg, currentColor 25%, transparent 25%, transparent 75%, currentColor 75%, currentColor) 0.5rem 0.5rem;
	background-color: #eee;
	background-size: 1rem 1rem;
}

body {
	min-block-size: 100vb;
	padding-block: 2em;
	padding-inline: 1em;
}

#form {
	display: flex;
	gap: 0.5em;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
}

#form label span {
	display: inline-block;
	margin-inline: 0.8rem;
	padding-block: 0.1em;
	padding-inline: 0.4em;
	white-space: nowrap;
	background-color: #666;
	color: #fff;
	font-size: 70%;
	font-weight: bold;
}

#form input {
	display: block;
	inline-size: 22ch;  /* to fit rgba(255,255,255,0.5) */
	margin-block-start: -1px;
	padding-block: 0.2em;
	padding-inline: 0.5ch;
	font-family: monospace;
	font-size: 150%;
	text-align: inherit;
	box-shadow: 0.05em 0.1em 0.2em rgba(0,0,0,.4) inset;
	background: #eee;
	color: #000;
	border-radius: 0.3em;
}

#form label + label {
	order: 2;
}

#display {
	max-inline-size: 30em;
	margin-inline: auto;
}

#display a {
	color: inherit;
}

#output {
	display: block;
	text-align: center;
	margin-block-end: 1em;
}

.gradient {
	display: flex;
	block-size: 5em;
	inline-size: 5em;
	justify-content: center;
	align-items: center;
	text-align: center;
	border-radius: 50%;
	margin-inline: auto;
	margin-block-end: 0.5em;
	padding: 0.5em;
	box-shadow: 0 0.1em 0.2em rgba(0,0,0,.4);
	background-color: #888;
	color: #fff;
	text-shadow: 0 -0.06em .05em rgba(0,0,0,.5);
	font-weight: bold;
}

.description {
	display: inline-block;
	padding-block: 0.3em;
	padding-inline: 0.8em;
	border-radius: 0.3em;
	background-color: #eee;
	color: #000;
	box-shadow: 0 0.1em 0.2em rgba(0,0,0,.4);
}

@media (min-width: 70em) {
	#form {
		flex-direction: row;
	}
	#form button {
		margin-block-start: 1.2rem;
	}
}
