@import url('https://fonts.googleapis.com/css2?family=Slabo+27px&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300&display=swap');

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: "Montserrat";
	color: #333;
	background-color: #eee;
}

h1, h2 {
	font-family: "Slabo 27px";
	letter-spacing: 4px;
}
h1 {
	font-size: 3em;
}

header {
	padding: 2rem;
	background-color: black;
	color: white;
	overflow: auto;
	display: grid;
	align-items: end;
	box-sizing: border-box;
}


header p, header h1 {
	margin: 1rem 0;
}

nav#menu {
	position: fixed;
	left: 0;
	top: 0;
	width: 100%;
	height: 100vh;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-end;
	gap: 0.5em;
	padding-right: 1em;
	box-sizing: border-box;
	background-color: black;
	z-index: 1;
	transform: translateX(100vw);
	transition: 0.6s;
}

nav#menu.open {
	transform: none;
}

nav#menu a {
	padding: 0.25em 0.5em;
	color: white;
	text-decoration: none;
	font-size: 1.6em;
	border-right: 2px solid white;
	transition: 0.3s;
}

@media screen and (hover: hover) {
	nav#menu a:hover {
		transform: scale(1.1);
	}
}

button#toggler {
	position: fixed;
	right: 0.5em;
	top: 0.5em;
	display: flex;
	flex-direction: column;
	gap: 0.25em;
	font-size: 1.5em;
	padding: 0.5em;
	background: hsla(0, 0%, 100%, 0.25);
	border: none;
	z-index: 2;
}
button#toggler span {
	width: 1em;
	height: 0.1em;
	background: black;
	display: block;
}

h2 {
	margin-top: 0;
}
h2 a {
	color: inherit;
}
p {
	max-width: 60ch;
	line-height: 1.5em;
}
main {
	display: grid;
	grid-template-columns: 1fr;

	/* gap: 1rem; */
	/* align-items: center; */
	box-sizing: border-box;
	width: 100%;
}

section {
	display: grid;
	align-items: center;
	gap: 2rem;
	padding: 2rem;
	width: 100%;
	box-sizing: border-box;
}
section:nth-of-type(odd) {
	background-color: white;
}
section:nth-of-type(even) {
	background-color: #333;
	color: #eee;
}

canvas {
	background-color: black;
	width: 800px;
	max-width: 100%;
	border-radius: 50%;
	box-shadow: 0 0 5px 2px #444;
}
.description {
	justify-self: start;
}
.description p {
	max-width: 40ch;
}

.control {
	display: grid;
	grid-template-columns: max-content auto;
	justify-content: end;
	margin-bottom: 0.25em;
	border-radius: 2px;
	font-size: 0.8em;
	column-gap: 1em;
}

footer {
	padding: 2em;
}

footer a#totop {
	position: fixed;
	bottom: 2em;
	right: 2em;
	padding: 0.5em 1em;
	border-radius: 2em;
	background-color: hsl(0, 0%, 40%);
	color: white;
	text-decoration: none;
	opacity: 0.7;
	transition: 0.3s;
}
footer a#totop:hover {
	opacity: 1;
}
footer a#totop.hidden {
	opacity: 0;
	transform: translateX(calc(100% + 2em));
}


@media screen and (min-width: 400px) {
	.control {
		font-size: 1em;
	}
}
@media screen and (min-width: 570px) {
	section {
		grid-template-columns: max-content 1fr;
		place-items: end;
	}
	canvas {
		max-width: 40vw;
	}

	button#toggler {
		display: none;
	}

	nav#menu {
		position: static;
		flex-direction: row;
		justify-content: flex-end;
		height: auto;
		transform: none;
		gap: 1em;
		font-size: 0.6em;
		font-weight: bold;
	}

	nav#menu a {
		border: none;
		padding: 1em 0.25em;
	}

}
@media screen and (min-width: 800px) {
	header {
		grid-template-columns: minmax(max-content, 1fr) 2fr;
		gap: 1rem;
	}
	h1 {
		font-size: 4em;
		align-self: end;
	}
	main {
		font-size: 1.2em;
	}

	nav#menu {
		font-size: 0.8em;
	}
	header {
		background-image: url(tree.png);
		background-attachment: local;
		background-size: 200px;
		background-position: left 3em bottom 6em;
		background-repeat: no-repeat;
	}

}
@media screen and (min-width: 1150px) {
	h2 {
		font-size: 2em;
	}
	p {
		font-size: 1.4em;
	}
	header {
		gap: 2em;
		padding: 12em 6em;
	}
	section {
		padding: 6em;
	}
	nav#menu {
		font-size: 1em;
		gap: 2em;
	}
	header, section {
		background-image: url(snowflake.png);
		background-size: contain;
		background-repeat: no-repeat;
		background-attachment: fixed;
		background-position: right;
	}
	header {
		background-image: url(tree.png), url(snowflake.png);
		background-attachment: local, fixed;
		background-size: 300px, contain;
		background-position: left 3em bottom 15em, right;
	}

}
