:root {
	--background:  #eee;
	--text-background:  #fff;
	--text-foreground:  #000;
	color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
	:root {
		--background: #000;
		--text-background: #333;
		--text-foreground: white;
	}

	a {
		color: #66a8ff;
	}

	#header-stars {
		filter: grayscale() brightness(0.2);
	}

	#header-hill {
		filter: grayscale() brightness(0.5);
	}

	#header-jelmer {
		filter: grayscale() brightness(0.4);
	}

	#header-name {
		z-index: 1;
	}

	#header::after {
		content: '';
		position: absolute;
		bottom: 0;
		left: 0;
		right: 0;
		top: 0;
		background: linear-gradient(0deg, rgb(0, 0, 0), rgba(0, 0, 0, 0), rgba(0, 0, 0, 0));
		background: radial-gradient(ellipse at top, transparent, black);
	}
}

* {
	box-sizing: border-box;
}

html, body {
	margin: 0;
	font: 16px/24px 'Arvo', serif;
	background: var(--background);
	color: var(--text-foreground);
}

figure img,
figure video {
	width: 100%;
}

li {
	margin: 0.5em 0;
}

.publication-title {
	font-style: italic;
}

/* Header */

#header {
	position: absolute;
	left: 0;
	right: 0;
	height: 50vw;
	overflow: hidden;
	background-color: black;
}

#content {
	position: absolute;
	left: 0;
	right: 0;
	top: 25vw;
	overflow: hidden;
}

#header > * {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
}

#header-stars {
	background: hsl(210, 60%, 35%);
	left: 0;
	right: 0;
	bottom: 0;
}

#canvasdots {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
}

/*#header-clouds video {
	top: 0;
	bottom: auto;
	width: 100%;
	height: auto;
	display: block;
	opacity: 0;
	transition: opacity ease-in 1s;
}*/

#header-name {
	top: 10vw;
	width: 100%;
	max-width: 1000px;
	padding: 0 50px;
	margin: 0 auto;
}

@media (prefers-reduced-motion: no-preference) {
	#header-clouds video.playing {
		opacity: 1;
	}

	#header-jelmer {
		transform: translateY(calc(var(--window-scroll-pos) * 10vw));
	}

	#header-name {
		transform: translateY(calc(var(--window-scroll-pos) * 13vw));
	}

	#header-hill {
		transform: translateY(calc(var(--window-scroll-pos) * 15vw));
	}

	#header-clouds {
		transform: translateY(calc(var(--window-scroll-pos) * 25vw));
	}
}

/* Content */

#content > footer {
	text-align: center;
	font-size: 0.8em;
	color: #999;
}

#content > footer a {
	color: inherit;
}

#content > section {
	max-width: 900px;
	margin: 50px auto;
}

.text-section {
	padding: 50px;
	background: var(--text-background);
	box-shadow:  10px 10px 0 rgba(0, 0, 0, 0.2);
}

.text-section + .text-section {
	margin-top: 50px;
}

#content > section > h1 {
	color: white;
	text-shadow: 5px 5px 0 rgba(0, 0, 0, 0.3);
	font: 75px/1em 'Lato', sans-serif;
	font-variant: all-petite-caps;
	margin: 1em 0 0.5em 0;
}

#contact .text-section {
	text-align: center;
}

.carrousel {
	display: flex;
	position: relative;
	--current-index: 0;
	--drag-offset: 0;
}

.carrousel > section {
	box-sizing: border-box;
	max-width: 100%;
	background: var(--text-background);
	box-shadow:  10px 10px 0 rgba(0, 0, 0, 0.2);
	flex: 0 0 100%;
	margin-right: 50px;
	padding: 50px;
	transform: translateX(calc(var(--current-index) * -100% + var(--current-index) * -50px + var(--drag-offset) * 1px));
}

.carrousel.is-dragging {
	-webkit-user-select: none;
	user-select: none;
}

@media (prefers-reduced-motion: no-preference) {
	.carrousel:not(.is-dragging) > section {
		transition:
			transform ease-out 300ms,
			opacity ease-out 300ms,
			box-shadow ease-out 300ms;
	}
}

.carrousel > section:not(.active) {
	opacity: 0.2;
	box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.0);
	pointer-events: none;
}

.carrousel .dots {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	text-align: center;
}

.carrousel .dots .dot {
	display: inline-block;
	width: 10px;
	height: 10px;
	margin: 0 4px;
	background: #777;
}

.carrousel .dots .dot.active {
	background: var(--text-foreground);
}

.carrousel .prev-slide-btn,
.carrousel .next-slide-btn {
	position: absolute;
	top: 0;
	bottom: 0;
	height: 50px;
	width: 50px;
	margin: auto 0;
	background: rgba(0, 0, 0, 0.3);
	z-index: 10;
	border: 0;
	overflow: hidden;
	text-indent: 50px;
	cursor: pointer;
}

.carrousel .prev-slide-btn::before,
.carrousel .next-slide-btn::before {
	position: absolute;
    top: 15px;
    content: '';
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    box-sizing: border-box;
    width: 0;
    height: 0;
}

.carrousel .prev-slide-btn {
	left: -65px;
}

.carrousel .next-slide-btn {
	right: -65px;
}

.carrousel .prev-slide-btn::before {
	border-right: 15px solid white;
	left: 15px;
}

.carrousel .next-slide-btn::before {
	border-left: 15px solid white;
	right: 15px;
}

/* Move focus outline to the slide */

.carrousel:focus {
	outline: none;
}

.carrousel:focus > .active {
	outline: auto;
}

/* Projects */

.carrousel > section.project figure {
	width: 100%;
	max-width: 100%;
	margin: 0;
	line-height: 0;
}

@media (min-width: 600px) {
	.carrousel > section.project {
		padding: 50px 50px 50px 50%;
	}

	.carrousel > section.project figure {
		max-width: calc(100% - 50px);
		margin: 0 50px 0 -100%;
		float: left;
	}

	.carrousel > section.project > h1:nth-of-type(1) {
		margin-top: 0;
	}
}

.screenshot {
	border: 5px solid #eee;
	border-top: 25px solid #eee;
	border-radius: 4px;
	position: relative;
}

.screenshot::before {
	content: '···';
	position: absolute;
	top: -24px;
	left: 0;
	color: #999;
	font-size: 48px;
	line-height: 24px;
	letter-spacing: -5px;
}

.screenshot > figcaption {
    position: absolute;
    font-size: 10px;
    background: white;
    display: inline-block;
    top: -20px;
    left: 0;
    right: 0;
    text-align: center;
    line-height: 16px;
    margin: 0 80px;
    border-radius: 2px;
    color: #777;
    font-family: sans-serif;
}

.screenshot > figcaption a {
	color: inherit;
	text-decoration: none;
}

/* Panable screenshot */

.full-page-screenshot {
	position: relative;
	overflow: hidden;
	width: 100%;
	overflow: hidden;
	padding-top: 67.5%;
}

.full-page-screenshot > * {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: auto;
	transform: translateY(calc((1.0 - var(--scroll-pos)) * -100%));
}

.screenshot .full-page-screenshot::after {
	content: '';
	position: absolute;
	top: 0;
	right: 1px;
	width: 4px;
	height: 10%;
	background: rgba(0, 0, 0, 0.4);
	border-radius: 2px;
	transform: translateY(calc((1.0 - var(--scroll-pos)) * 900%));
}

/* Slide show */

figure .carrousel {
	display: block;
}

figure .carrousel > img,
figure .carrousel > video,
figure .carrousel > .full-page-screenshot {
	display: none;
}

figure .carrousel > .active {
	display: block;
}

figure .carrousel > .prev-slide-btn,
figure .carrousel > .next-slide-btn {
	width: 25px;
	height: 10px;
	top: auto;
	bottom: -24px;
	text-indent: 0;
	font: 6px/8px sans-serif;
	color: white;
	text-align: center;
	padding: 0;
	display: none;
}

figure .carrousel > .prev-slide-btn {
	left: 0;
}

figure .carrousel > .next-slide-btn {
	right: 0;
}

figure .carrousel > .prev-slide-btn::before,
figure .carrousel > .next-slide-btn::before {
	content: none;
}

figure .carrousel > .dots {
	bottom: -24px;
}
