* {
	overscroll-behavior: contain;
}

html {
	font-family: sans-serif;
}

html, body {
	margin: 0;
	padding: 0;
	min-height: 100vh;
	box-sizing: border-box;
}
body {
	background: #333;
	color: #fff;
	padding: 0 2rem 2rem 2rem;
	transition: background-color 0.7s;
	display: flex;
	flex-direction: column;
	overflow-y: scroll;
}
body.music {
	padding-bottom: 5rem;
}

body.software, body.software header { background-color: hsl(195deg, 66%, 17%); }
body.music, body.music header { background-color: hsl(265deg, 66%, 22%); }
body.photos, body.photos header { background-color: hsl(265deg, 0%, 18%); }

header {
	margin: 0 -2rem;
	padding: 2rem 2rem 3rem 2rem;
	overflow: hidden;
	position: sticky;
	top: 0;
	z-index: 10;
	-webkit-mask-image: linear-gradient(to top, #0000, #fffc, #ffff);
	transition: background-color 0.7s;
	display: flex;
	align-items: center;
	gap: 2rem;
}

a {
	color: inherit;
}

header nav {
	margin: 0;
	padding: 0;
	display: flex;
	gap: 0.5rem;
	flex-grow: 1;
	font-size: min(1rem, 3.4vw);
}

header nav a {
	display: block;
	flex-grow: 1;
	text-align: center;
	line-height: 1.5;
	padding: 0.5em 0;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color 0.1s;
	border-radius: 0.5rem;
	cursor: pointer;
}
header nav a:hover {
	background: #fff1;
}
header nav a.active {
	background: #fff2;
}

body.software header nav a { color: hsl(195deg, 100%, 75%); }
body.music header nav a { color: hsl(265deg, 100%, 75%); }
body.photos header nav a { color: hsl(265deg, 0%, 75%); }

header a#me {
	height: 2.3rem;
	width: 2.3rem;
	border-radius: 100%;
	display: block;
	background-image: url('../assets/me.webp');
	background-repeat: no-repeat;
	background-position: center;
	background-size: cover;
	color: transparent;
	transition: filter 0.2s, opacity 0.7s, margin 0.7s;
}
header a#me:not(:hover) {
	filter: saturate(0);
}

body.home header a#me {
	opacity: 0;
	margin-left: -3.5rem;
	pointer-events: none;
}

article {
	margin: 0;
	padding: 0;
	transition: opacity 0.5s;
	opacity: 0;
	display: none;
	flex-direction: column;
	flex-grow: 1;
	align-items: center;
}
article.active {
	opacity: 1;
}
article.empty {
	justify-content: center;
}

article nav {
	margin: 0 0 2rem 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.7rem;
	top: 6.5rem;
}
@media (min-width: 47rem) and (min-height: 25rem) {
	article nav {
		position: sticky;
		z-index: 100;
	}
}

article nav button {
	background: #0008;
	color: #fff;
	appearance: none;
	border: none;
	outline: none;
	padding: 0.3em 0.6em;
	border-radius: 0.5rem;
	font-size: 0.9rem;
	transition: background-color 0.1s, color 0.1s;
}
article nav button::before {
	content: '#';
	opacity: 0.5;
}
article nav button:hover {
	background: #333f;
}
article nav button.on {
	background: #fffc;
	color: #000;
}

main {
	margin: 0;
	padding: 0;
	flex-grow: 1;
	display: flex;
}

ul.gallery {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
}
@media (max-width: 767px) {
	ul.gallery:not(.software) {
		margin: 0 -2rem;
	}
}

ul.gallery li {
	width: 20vw;
	height: 20vw;
	margin: 2vw 0;
	cursor: pointer;
	transition: filter 0.2s;
	border-radius: 0.5rem;
	overflow: hidden;
	background-color: #181818;
}
ul.gallery.music li {
	position: relative;
}
ul.gallery.software li {
	width: 25vw;
	height: 25vw;
}
@media (max-width: 767px) {
	ul.gallery:not(.software) li {
		border-radius: 0;
		width: calc(50% - 1px);
		height: 50vw;
		margin: 1px 0;
	}
	ul.gallery.software li {
		width: 40vw;
		height: 40vw;
		margin: 3.5vw 0;
	}
}
@media (max-width: 550px) {
	ul.gallery.software li {
		width: 100%;
		height: 79vw;
		margin: 7vw 0;
	}
}
@media (min-width: 1350px) {
	ul.gallery:not(.software) li {
		width: 17vw;
		height: 17vw;
		margin: 1.5vw 0;
	}
	ul.gallery.software li {
		width: 20vw;
		height: 20vw;
	}
}
ul.gallery li:hover {
	filter: brightness(1.5);
}
ul.gallery li.dummy {
	background: pink;
	height: 0;
	visibility: hidden;
	margin-top: 0;
	margin-bottom: 0;
}
ul.gallery li:not(.show):not(.dummy) {
	display: none;
}

ul.gallery li img, ul.gallery li video {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

ul.gallery.software li {
	background-color: transparent;
	border-radius: 0;
}
ul.gallery.software li img {
	display: block;
	object-fit: initial;
	width: 100%;
	height: auto;
	aspect-ratio: 1.42; /* not all images are exactly this, but it's not really visible and better than having text non-aligned */
	border-radius: 0.1rem;
}
ul.gallery.software li.landscape img {
	aspect-ratio: 1.7;
}

ul.gallery.software li p {
	margin: 0.7em 0 0 0;
	line-height: 1.3;
}
ul.gallery.software li p small {
	display: block;
	opacity: 0.5;
}

ul.gallery li.portrait {
	display: flex;
}

ul.gallery li.portrait img {
	height: 100%;
	width: auto;
	aspect-ratio: 0.5;
}

ul.gallery li.portrait p {
	margin: 0 0 0 0.7em;
}

ul.gallery.music li p {
	position: absolute;
	left: 0;
	text-align: center;
	width: 100%;
	font-size: 90%;
	text-transform: lowercase;
	opacity: 0.5;
	box-sizing: border-box;
	padding: 0 1em;
}
ul.gallery.music li p.instinctive { top: 48%; font-family: 'Courier New', 'Courier', monospace; font-weight: bold; }
ul.gallery.music li p.natural-born-chiller { top: 60%; font-style: italic; }
ul.gallery.music li p.pulse { top: 48%; font-size: 100%; font-weight: bold; letter-spacing: 0.2em; }
ul.gallery.music li p.timestyle { top: 50%; font-size: 115%; font-weight: bold; opacity: 1; }

::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-thumb {
  background: #fff3;
}

::-webkit-scrollbar-track {
  background: #0005;
}

#view-photo {
	position: fixed;
	inset: 0;
	z-index: 200;
	padding: 7vmin;
	transition: opacity 0.5s, visibility 0.5s, transform 0.5s;
	background: #222c;
	backdrop-filter: blur(10px);
	cursor: pointer;
}
@media (max-width: 767px) {
	#view-photo {
		padding: 0;
	}
}
#view-photo:not(.show) {
	opacity: 0;
	visibility: hidden;
	transform: scale3d(0.8, 0.8, 1);
}

#view-photo * {
	width: 100%;
	height: 100%;
	object-fit: contain;
	filter: drop-shadow(0 0 2rem #000);
}
@media (max-width: 767px) {
	#view-photo * {
		filter: none;
	}
}

#view-photo::after {
	content: '✕';
	position: fixed;
	top: 1.5rem;
	right: 1.5rem;
	font-size: 1.5rem;
	line-height: 1;
}

body > footer {
	margin: 2rem 0 0 0;
	display: flex;
	opacity: 0.3;
	font-size: 90%;
	letter-spacing: 0.1em;
	font-family: monospace;
	justify-content: center;
	text-align: center;
}

article > footer {
	margin: 2rem 0 0 0;
	opacity: 0.5;
	font-size: 0.8rem;
	text-align: center;
}
article.no-objects > footer span:not(.no-objects) {
	display: none;
}

article:not(.no-objects) span.no-objects {
	display: none;
}

audio {
	position: fixed;
	bottom: 0.5rem;
	left: 0.5rem;
	width: calc(100% - 2 * 0.5rem);
	color-scheme: dark;
	height: 2.5rem;
	transition: transform 0.3s;
}
article:not(.active) audio {
	transform: translateY(105%);
}

article#home a {
	display: block;
	width: min(20vmin, 256px);
	aspect-ratio: 1;
	border-radius: 100%;
	overflow: hidden;
	opacity: 0.8;
	box-shadow: 0 0 2rem 0 #fff3;
}

article#home img {
	margin: 0;
	width: 100%;
	height: 100%;
	border: none;
	object-fit: cover;
	display: block;
	filter: saturate(0);
}

article#home h2 {
	font-weight: normal;
	font-style: normal;
	font-size: 0.9rem;
	color: #888;
	margin: 2em 0 0 0;
	padding: 0;
	text-transform: lowercase;
	letter-spacing: 0.1em;
	text-align: center;
}