:root {
	--border: 1px solid #0005;

	--bg-header: #fff;
	--bg-primary: #1e5aeb;
	--bg-secondary: #a0beeb;

	--text-primary: #000;
	--text-secondary: #333;
	--text-tertiary: #555;

	--font-sm: 0.825rem;
	--font-md: 1rem;
	--font-lg: 2rem;
	--font-xl: 3rem;

	--font-serif: "Times New Roman", Times, serif;
	--font-sans: Arial, Helvetica, sans-serif;
}

:where(*, *::after, *::before) {
	box-sizing: border-box;
	padding: 0;
	margin: 0;
	font-family: var(--font-sans);
	font-size: var(--font-md);
	color: var(--text-primary);
}

h1 {
	font-size: var(--font-xl);
}

body.down > header.scroll {
	top: 0;
}

body.down > header.static {
	transform: translateY(-100%);
}

header.static {
	background: var(--bg-header);
	transform: translateY(0);
	transition: transform 0.3s;

	& > hgroup {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		border-bottom: var(--border);

		& > p {
			padding: 0.5rem 0;
		}
	}

	& > nav {
		display: flex;
		align-items: center;
		padding: 0.5rem;
		border-bottom: var(--border);

		& > h2 {
			font-family: var(--font-serif);
			font-size: var(--font-lg);
			display: none;
		}

		& > ul {
			flex: 1;
			list-style-type: none;
			display: flex;
			justify-content: center;

			& > li:not(:last-child) {
				border-right: var(--border);
				margin-right: 1rem;
				padding-right: 1rem;
			}

			& > li > a {
				text-decoration: none;
			}
		}
	}
}

header.scroll {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	padding: 0.5rem 1rem;
	border-bottom: var(--border);
	position: fixed;
	top: -100%;
	left: 0;
	right: 0;
	z-index: 999;
	background: var(--bg-header);
	transition: top 0.3s;

	& > h2 {
		font-size: var(--font-lg);
	}

	& > p {
		text-align: center;
	}

	& > button {
		justify-self: end;
		border: none;
		background: var(--bg-secondary);
		padding: 0.5rem;
		border-radius: 0.5rem;
		cursor: pointer;
		transition: background 0.5s ease, color 0.5s ease;

		&:hover {
			background: var(--bg-primary);
			color: white;
		}
	}
}

.small {
	font-size: var(--font-sm);
	color: var(--text-secondary);

	& > i {
		font-size: inherit;
	}
}

.serif {
	font-family: var(--font-serif);
}

main {
	margin: 2rem auto;
	max-width: 45rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;

	& > h2 {
		font-size: var(--font-lg);
	}

	& > div.data {
		display: flex;
		gap: 1rem;

		& > img {
			height: 2lh;
			width: 2lh;
			object-fit: cover;
			border-radius: 50%;
		}

		& > div > p {
			color: var(--text-secondary);
			margin: 0;

			& > a {
				color: var(--bg-primary);
				text-decoration: none;
				font-weight: 600;

				&:hover {
					text-decoration: underline;
				}
			}
		}

		& > div > p:last-child { /* Shut up I'm under time pressure */
			color: var(--text-tertiary);
		}
	}

	& > ul {
		list-style-type: none;
		display: flex;
		gap: 0.5rem;

		& > li {
			background: var(--bg-secondary);
			border-radius: 1rem;
			padding: 0.5rem;
			cursor: pointer;
			transition: background 0.3s ease, color 0.3s ease;

			&:hover {
				background: var(--bg-primary);
				color: white;
				text-decoration: underline;
			}
		}
	}

	& p {
		margin-bottom: 1lh;
	}
}

blockquote {
	margin: 1.5rem 0;
	padding: 0.5rem 0 0.5rem 1.5rem;
	border-left: 0.5rem solid var(--bg-secondary);
	font-style: italic;
	color: var(--text-secondary);

	&::before {
		content: "“";
	}

	&::after {
		content: "”";
	}
}

button.top {
	display: none;
	position: fixed;
	bottom: 1rem;
	right: 1rem;
	border-radius: 50%;
	background: var(--bg-primary);
	color: white;
	cursor: pointer;
	width: 3rem;
	height: 3rem;
	font-weight: bold;
	border: none;
}

body.down > button.top {
	display: block;
}
