:root {
	--color-text: rgb(255, 255, 255);
	--color-link: hsl(0, 0%, 0%);
	--color-link-hover-text: hsl(0, 0%, 0%);
	--color-link-hover-bg: hsl(0, 0%, 0%);
	--color-bg: hsl(207 89% 68%);
	--inline-spacing: 1rem;
	--block-spacing: 2rem;
	--container-background: #fff;
}

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

html,
body {
	min-height: 100vh;
}

body {
	background: var(--color-bg);
	color: var(--color-text);
	display: grid;
	font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
	font-size: 20px;
	gap: 10vh;
	grid-template-rows: auto 1fr auto;
	line-height: 1.5;

	@media( max-width: 768px) {
		font-size: 18px;
	}
}

.container {
	margin-inline: auto;
	width: 50vw;

	@media (max-width: 768px) {
		width: 90vw;
	}
}

a {
	text-decoration: 1px underline solid var(--color-link-hover-text);
	color: var(--color-link);

	&:hover,
	&:focus {
		outline: 2px solid var(--color-link-hover-text);
		color: var(--color-link-hover-text);
		background: var(--color-bg);
		text-decoration-color: var(--color-link-hover-text);
	}
}

header {
	color: #000;

	@media (min-width: 768px) {
		.container {
			display: grid;
			grid-template-columns: auto 1fr;
		}
	}

	h1,
	p {
		font-size: 2em;
		font-weight: 600;
	}

	@media (max-width: 650px) {
		h1 {
			text-align: center;
		}
	}
}

nav {

	ul {
		display: flex;
		height: 100%;
		justify-content: end;
		list-style-type: none;
		gap: 1rem;

		@media (max-width: 650px) {
			margin-top: 1rem;
			justify-content: center;
		}

		/* This is super messy. I'm sorry. */
		li {
			align-items: center;
			background: var(--container-background);
			border-right-width: 1.5px;
			border: 3px solid #000;
			border-top: none;
			display: flex;

			@media (max-width: 650px) {
				border-top: 3px solid #000;
			}

			&:has(a:hover),
			&:has(a:focus) {
				background: none;
				border-color: var(--color-bg);
			}

			&:has([aria-current]) {
				background: var(--color-bg);
			}
		}

		a {
			padding: 0.5rem 1rem;
		}
	}
}

main {
	background: var(--container-background);
	color: #000;
	padding: var(--block-spacing);
	border-radius: 25px;
	border: 7px solid #000;

	& > :first-child {
		margin-top: 0;
	}
}

i.icon {
	font-style: normal;
}

h2,
h3,
h4,
h5,
h6 {
	margin-block-start: var(--block-spacing);
}

h2 {
	border-bottom: 2px solid var(--color-text);
}

footer {
	background: #105D6D;
	padding-block: 0.5rem;
}

footer {
	background: #105D6D;
	color: #fff;
	margin-top: 3rem;
	padding: 0.5rem;


	.container {
		align-items: baseline;
		display: flex;
		gap: 1rem;
		flex-direction: column;

		@media (min-width: 650px) {
			gap: 0;
			align-items: center;
			flex-direction: row;
			justify-content: space-between;
		}
	}


	.footer-links {
		display: flex;
		flex-direction: column;
		list-style: none;

		@media (min-width: 650px) {
			flex-direction: row;
		}

		@media (max-width: 400px) {
			gap: 1.5rem;
		}

		a {
			color: #fff;
			padding: 0.5rem;
			text-decoration-color: #fff;

			&:first-of-type {
				padding-left: 0;
			}

			&:hover,
			&:focus {
				background: rgba(255, 255, 255, 0.1);
				outline: 1px solid #fff;
				text-decoration: none;
			}
		}
	}
}