@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@300;400;700&display=swap');

* {
	box-sizing: border-box;
	padding: 0;
	margin: 0;
}

:root {
	--black-hsl-values: 0, 0%, 8%;
	--white-hsl-values: 0, 0%, 98%;

	--white: hsl(var(--white-hsl-values));
	--black: hsl(var(--black-hsl-values));
	--hero-bg: hsl(0, 0%, 93%);
	--triangle-yellow: hsl(43, 100%, 48%);
	--body-font: 'Poppins', sans-serif;
	--heading-font: 'Roboto Slab', serif;
}

body {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	max-width: 100vw;
	background-color: var(--white);
	color: var(--black);
	font-family: var(--body-font);
	overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--heading-font);
}

main {
	text-align: center;
}

main p {
	margin: 1em auto;
	max-width: 800px;
	font-weight: 300;
}

.hero {
	background-color: var(--hero-bg);
	height: 60vh;
	width: 100vw;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	position: relative;
	margin-bottom: 3em;
	overflow: hidden;
}

.hero h1 {
	text-align: center;
	line-height: 0.9135894389035309829083482308572830458239049823482930584938575384358904583098539405098385085436743875620359784795279839898523498435977953947825987938475987345292378598534928797829em;
}

.hero h1:hover {
	transition: all 0.2s;
	transform: scale(1.2);
	cursor: pointer;
}

.hero h1:not(span) {
	font-size: 4em;
}

.hero h1 span {
	font-size: 0.7em;
	display: block;
}

.hero small {
	position: absolute;
	bottom: 5%;
	font-size: 1em;
	font-style: italic;
}

.hero small a {
	color: var(---black);
	text-decoration: underline;
}

.hero small a:hover {
	color: #d10909;
	text-decoration: overline;
}

.hero small a:visited:hover {
	color: var(--triangle-yellow);
	font-weight: bold;
}

@media screen and (min-width: 1200px) {
	.hero {
		height: 75vh;
	}

	.hero h1:not(span) {
		font-size: 7em;
		text-align: center;
	}

	.hero small {
		font-size: 1.75em;
		bottom: 3%;
	}
}

.hero .nerd {
	filter: drop-shadow(0 0 10px var(--black));
	animation: shake 2s ease-in-out alternate infinite;
	font-size: 5rem;
	margin: 0.5em 0;
	width: 100px;
	height: 100px;
	transition: 0.2s;
}

.hero .nerd:hover {
	animation: none;
	cursor: pointer;
	animation: rotateEmoji 1s ease-in-out alternate infinite;
}

@keyframes rotateEmoji {
	0% {
		transform: rotate(0deg) scale(0.5);
	}

	50% {
		transform: rotate(180deg) scale(1.5);
	}

	100% {
		transform: rotate(360deg) scale(2.5);
	}
}

.hero .nerd:hover:after {
	content: '💩';
	opacity: 0;
	animation: fadeIn 0.5s linear alternate infinite;
	animation-delay: 1s;
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.triangle {
	display: none;
}

.toothbrush {
	display: none;
}

/* Show toothbrush and triangle on screens > 768px */
@media screen and (min-width: 768px) {
	.hero h1 {
		text-align: left;
	}

	.square {
		position: absolute;
		display: block;
		width: 40em;
		height: 40em;
		transform: rotate(45deg);
		border-radius: 10em;
		right: -25em;
		background: var(--triangle-yellow);
		animation: scaleSquare 10s infinite;
	}

	.square:hover {
		transition: 0.5s;
		cursor: pointer;
		animation-duration: 2s;
	}

	@keyframes scaleSquare {
		0% {
			transform: rotate(45deg);
		}

		25% {
			transform: rotate(90deg);
		}

		50% {
			transform: rotate(135deg);
		}
		75% {
			transform: rotate(180deg);
		}

		100% {
			transform: rotate(225deg);
		}
	}

	.ripple {
		position: absolute;
		display: block;
		width: 650px;
		height: 650px;
		transform: rotate(45deg);
		border-radius: 10em;
		left: -10%;
		z-index: -1;
		top: 0;
		background: var(--triangle-yellow);
	}

	.toothbrush {
		display: block;
		position: absolute;
		width: auto;
		height: 90%;
		bottom: 0;
		right: 15%;
		filter: drop-shadow(5px 1px 20px hsla(var(--black-hsl-values), 0.6));
		transition: 0.2s;
	}

	.toothbrush:hover {
		animation: 5ms toothShake infinite;
		cursor: pointer;
	}

	@keyframes toothShake {
		0%,
		20%,
		40%,
		60%,
		80%,
		100% {
			margin-left: 2px;
			transform: rotate(2deg);
		}

		10%,
		30%,
		40%,
		50%,
		70%,
		90% {
			margin-right: 2px;
			transform: rotate(-2deg);
		}
	}
}

@keyframes shake {
	0% {
		transform: translateY(-10px);
		filter: drop-shadow(0 0 15px black);
	}
	100% {
		transform: translateY(0px);
		filter: drop-shadow(0 0 -10px black);
	}
}

/* ************************** */
/*         Main content 	  */
/* ************************** */

main section {
	/* padding: 1.3em; */
	padding: 0.5em;
}

main section figure {
	margin: 2em 0;
}

main section figure img {
	width: 50%;
	max-width: 700px;
}

main section img:nth-child(1) {
	border-radius: 100px;
}

main section img:nth-child(2) {
	border-radius: 50px;
	width: 40%;
	max-width: 50%;
}

main section img:nth-child(4) {
	width: 40%;
}

main section figure figcaption {
	font-size: 0.9rem;
}

/* ************************** */
/*         Footer		 	  */
/* ************************** */

footer {
	background-color: var(--hero-bg);
	text-align: center;
	padding: 1em;
}

/* ************************** */
/*         Sources page 	  */
/* ************************** */

.sources-container {
	width: 100%;
	background-color: #ededed;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 3rem 0;
}

.sources-header {
	display: flex;
	align-items: center;
	flex-direction: column;
	padding-bottom: 3rem;
	border-bottom: 1px solid rgba(20, 20, 20, 0.25);
}

.sources-header h1 {
	font-family: Roboto Slab;
	font-size: 4rem;
	font-style: normal;
	font-weight: 700;
	text-align: left;
	padding-bottom: 2rem;
}

.sources-header p {
	padding: 0 1rem;
	font-weight: 300;
	max-width: 40rem;
}

.sources-container section {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	padding: 3rem 1rem;
}

.sources-container section article {
	max-width: 40rem;
	padding: 2rem;
	background-color: #fafafa;
	box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
	margin: 1rem;
	text-align: center;
	transition: 0.2s;
}

.sources-container section article:hover,
.sources-container section article:focus {
	transition: all 0.2s ease-in;
	transform: scale(1.025);
	box-shadow: 0px 6px 6px rgba(0, 0, 0, 0.25);
	cursor: pointer;
}

.sources-container section article h5 {
	font-family: Roboto Slab;
	font-size: 1.8rem;
	font-weight: 700;
	padding-bottom: 1rem;
	color: var(--black);
}

.sources-container section article .description {
	font-family: Roboto Slab;
	font-size: 1.2rem;
	font-weight: 300;
	padding-bottom: 1rem;
	color: var(--black);
}

.sources-container section article .reference {
	font-family: Roboto Slab;
	font-size: 0.9rem;
	font-weight: 300;
	padding-bottom: 1rem;
	color: var(--black);
}

.sources-container section a {
	color: var(--black);
	text-decoration: none;
}

@media (max-width: 550px) {
	.sources-container section {
		grid-template-columns: 1fr;
	}
}
