/*
--------------------------------------------------------------------------------
VARIABLES
--------------------------------------------------------------------------------
 */
:root {
	--font-primary: 'Libre Baskerville', serif;
	--font-secondary: Ultra, sans-serif;

	--color-bone: #f5f4f1;
	--color-stone: #70706E;
	--color-midnight: #262B2E;
	--color-moss: #4D7339;
	--color-corporate: #436E80;
	--color-candy: #9B5068;
	--color-gold: #7A651F;
	--color-lavender: #5f5c78;
	--color-clay: #785142;
	--color-blue: #274878;
	--color-shout: #784271;
	--color-olive: #5D6642;
}

* {
	box-sizing: border-box;
}

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

/*
--------------------------------------------------------------------------------
LAYOUT
--------------------------------------------------------------------------------
 */
.wrapper {
	max-width: 54em;
	margin-left: auto;
	margin-right: auto;
}

.container {
	max-width: 34em;
	margin-left: auto;
	margin-right: auto;
}

.suspense {
	margin-top: 16vh;
	margin-bottom: 16vh;
}

hr {
	border: 0;
	height: 2px;
	background: linear-gradient(to right, rgba(0, 0, 0, 0.2) 50%, transparent 50%) repeat-x left center;
	background-size: 1.5em 1em;
	margin: 4vh 0;
}

/*
--------------------------------------------------------------------------------
TYPOGRAPHY
--------------------------------------------------------------------------------
 */
html {
	font-size: 18px;
}

body {
	font-family: var(--font-primary);
	line-height: 2;
	font-size: 1em;
	background-color: var(--color-bone);
	padding: 4vh 4vw;
	color: #393937;
}

h1 {
	font-family: var(--font-secondary);
	font-weight: normal;
	font-size: 3em;
	line-height: 1;
	letter-spacing: -0.05em;
	text-align: center;
	max-width: 9em;
	margin-left: auto;
	margin-right: auto;
	margin-bottom: 8vh;
}

.lede {
	display: block;
	font-size: 2em;
	line-height: 1.5;
}

.subtle {
	font-size: 0.875em;
	color: var(--color-stone);
}



/*
--------------------------------------------------------------------------------
LINKS
--------------------------------------------------------------------------------
 */
a {
	position: relative;
	white-space: nowrap;
	color: var(--color-moss);
	text-decoration: none;
	transition: 200ms ease;
	border-radius: 0.125em;
	text-shadow: 0.0625em 0.09375em white;
}

a::before {
	content: "";
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	border-radius: 1em;
	border-bottom: 0.25em solid;
	opacity: 0.3;
	transition: inherit;
}

a:hover::before {
	opacity: 1;
	bottom: -0.25em;
	border-bottom-width: 0.125em;
}

a:nth-child(9n + 2) {
	color: var(--color-corporate);
}

a:nth-child(9n + 3) {
	color: var(--color-candy);
}

a:nth-child(9n + 4) {
	color: var(--color-gold);
}

a:nth-child(9n + 5) {
	color: var(--color-lavender);
}

a:nth-child(9n + 6) {
	color: var(--color-clay);
}

a:nth-child(9n + 7) {
	color: var(--color-blue);
}

a:nth-child(9n + 8) {
	color: var(--color-shout);
}

a:nth-child(9n + 9) {
	color: var(--color-olive);
}

/*
--------------------------------------------------------------------------------
BUTTONS
--------------------------------------------------------------------------------
 */
.button {
	cursor: pointer;
	appearance: none;
	font-size: 1.125em;
	line-height: 1;
	font-family: var(--font-secondary);
	background: var(--color-moss);
	color: white;
	border: 1px solid rgba(0, 0, 0, 0.2);
	padding: 0.75em 1.25em;
	transition: 200ms ease;
	border-radius: 0.25em;
	text-shadow: 0.1em 0.1em rgba(0, 0, 0, 0.3);
	box-shadow: inset 0 0 0.5em rgba(0, 0, 0, 0), 0 0.125em var(--color-olive);
}

.button:active {
	transform: translateY(2px);
	box-shadow: inset 0 0 0.5em rgba(0, 0, 0, 0.3), 0 calc(0.125em - 2px) var(--color-olive);
}

/*
--------------------------------------------------------------------------------
GENERATOR
--------------------------------------------------------------------------------
 */
.generator {
	position: relative;
	background: white;
	border-radius: 0.125em;
	border: 0.125em solid rgba(0, 0, 0, 0.2);
	box-shadow: 0.5em 0.5em rgba(0, 0, 0, 0.1);
	margin: 2em 0 4em;
	line-height: 1.4;
}

.generator-display {
	padding: 2em;
}

.generator-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: var(--color-bone);
	padding: 1em 2em;
}

.generator-suggestion {
	position: relative;
	display: block;
	font-size: 3em;
	letter-spacing: -0.05em;
	word-break: break-word;
	line-height: 1;
	font-weight: bold;
}

.generator-suffix {
	display: block;
	font-family: var(--font-secondary);
	font-size: 1.5em;
	opacity: 0.7;
	overflow: hidden;
}

.taken {
	position: relative;
	text-decoration: none;
}

.taken::after {
	content: "Taken";
	font-family: sans-serif;
	text-transform: uppercase;
	position: absolute;
	top: 30%;
	left: 50%;
	padding: 0.25em;
	border-radius: 0.125em;
	line-height: 1;
	white-space: nowrap;
	font-size: 0.2em;
	letter-spacing: 0.05em;
	background: red;
	color: #fff;
	box-shadow: 0 0 0 0.25em white;
	transform: translate(-50%, -50%) rotate(-15deg);
}

.suggestion {
	position: relative;
	display: block;
	transition: 300ms ease;
	transform-origin: bottom left;
}

.suggestion.old {
	position: absolute;
	top: 0;
	left: 0;
	transform: translateY(0.25em);
	opacity: 0;
}

@keyframes suggestionEnter {
	0% {
		opacity: 0;
		transform: translateY(-0.25em);
	}

	100% {
		opacity: 1;
		transform: translateY(0);
	}
}

.suggestion.new {
	z-index: 1;
	animation: suggestionEnter 300ms forwards;
}

/*
--------------------------------------------------------------------------------
SCALE
--------------------------------------------------------------------------------
 */
@media (max-width: 24em) {
	.generator {
		font-size: 0.75em;
	}
}
@media (min-width: 24em) and (max-width: 36em) {
	.generator {
		font-size: 3vw;
	}
}

@media (min-width: 40em) {
	h1 {
		font-size: 5em;
	}
}

@media (min-width: 64em) {
	html {
		font-size: 22px;
	}

}
