:root {
	--back: #f4f0e8;
	--text: #2b2416;
	--accent: #8b6f47;
	--red: #c41e3a;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	font-family: "Piazzolla", serif;
	font-weight: 600;
	color: var(--text);
	font-size: 1.1rem;
	line-height: 1.4;
	max-width: 1024px;
	background: var(--back);
	margin: 0 auto;
	padding: 0 0.5rem 3rem;
}

header {
	margin: 1em 0;
	border-bottom: 2px solid var(--accent);
	display: flex;
	gap: 3ch;
	font-weight: 800;
	color: var(--accent);
	font-variant: small-caps;
}

header>:first-child {
	flex-grow: 1;
}

main {
	counter-reset: sidenote-counter;
}

main>*+* {
	margin-top: 0.5em;
}

h1,
h2,
h3 {
	clear: both;
	line-height: 1;
	font-weight: 800;
	font-variant: small-caps;
	text-wrap: balance;
	color: var(--accent);
}

h1 {
	margin: 2rem 0 1rem;
	font-size: 2.5rem;
	text-transform: uppercase;
}

h2 {
	font-size: 2rem;
}

h3 {
	font-size: 1.5rem;
}

p {
	text-align: justify;
}

.line {
	display: block;
}

.highlight {
	color: var(--red);
	font-weight: 800;
}

a {
	color: var(--accent);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

.anchor {
	opacity: 0;
}

:hover>.anchor {
	opacity: 1;
}

.sidenote {
	outline-offset: 0.25em;
}

.sidenote>input {
	display: none;
}

.sidenote:before {
	counter-increment: sidenote-counter;
	content: counter(sidenote-counter);
	position: relative;
	font-size: 0.9rem;
	top: -0.5em;
	margin-left: -0.2em;
	margin-right: -0.1em;
}

.sidenote+span:before {
	content: counter(sidenote-counter) ". ";
}

.sidenote:hover:before {
	text-decoration: underline;
	cursor: pointer;
}

.sidenote+span {
	display: none;
	font-size: 0.9rem;
	line-height: 1.2;
}

.sidenote:has(:checked)+span {
	display: block;
	width: 90%;
	margin: 1rem 2.5%;
}


@media (min-width: 760px) {
	main.fullwidth>:not(h1, h2, h3, .works) {
		max-width: 60%;
	}

	main.fullwidth .sidenote+span {
		display: block;
		float: right;
		clear: right;
		margin: 0 -65% 0 0;
		width: 60%;
	}

	main.fullwidth .sidenote:hover:before {
		text-decoration: none;
		cursor: auto;
	}
}

.works {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
	grid-auto-rows: 1fr;
	gap: 20px;
	clear: both;
}

.works>a {
	background: #fafafa;
	border: 1px solid var(--accent);
	border-radius: 0.25rem;
	padding: 1rem;
	color: var(--text);
	transition: all 0.3s ease;
}

.works>a:hover {
	background: var(--back);
	border-color: var(--text);
}
