:root {
	--accent-colour: #7e74fa; /* #bb3436, #7e74fa, #ff4f3a, #b070a4 */
	--background: #0f0f0f;
	--accent-background: #161616;
	--alpha-accent-background: #161616f0;
	--border: #242424;
	--kantighet: 6px;
}

body {
	background-color: var(--background);
	color: #fff;
	font-family: Ubuntu, Roboto, sans-serif;
	margin: 0;
	padding: 0;
	overflow: hidden;
	display: flex;
	flex-direction: row;
	height: 100vh;
	font-size: 12pt;
}

.content {
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	min-height: 0px;
	margin: 20px;
	margin-left: 10px;
	border-radius: var(--kantighet);
	box-shadow: 0px 0px 20px 1px #000000;
	background-color: var(--alpha-accent-background);
	border: 2px solid var(--border);
	flex-grow: 1; /* in case there are not enough repos */
}

h1 {
	font-size: 1.5em;
	padding: 12px 0 12px 0;
}

h2 { font-size: 1.3rem }

h1, h2 {
	font-weight: normal;
	margin: 0;
}

hr {
	border: 0;
	border-top: 1px solid grey;
	margin: 15px;
}

header {
	border-top: 2px solid #fff;
}

a {
	text-decoration: none;
	color: var(--accent-colour);
}

a:hover {
	text-decoration: underline;
}

nav a {
	background-color: #202020;
	padding: 10px;
	max-width: 80%;
	margin: 0 auto;
	border-radius: var(--kantighet);
	transition: border-color .05s ease-out;
	border: 2px solid rgba(255, 255, 255, 0.1);
	color: white;
	display: flex;
	justify-content: center;
	font-size: 1.05em;
}

nav a:hover {
	text-decoration: none;
	border-color: var(--accent-colour);
}

/* section stuff */
section, aside {
	padding: 0 20px 0 20px;
}

.darkersection {
	background-color: #0f0f0fc0;
	padding-bottom: 8px; /* otherwise the footer eats into it? :HUHTao: */
}

.growsmost {
	flex-grow: 1;
}

.title { display: flex; }

.line {
	border-top: 2px solid var(--accent-colour);
	margin-top: 25px;
	margin-left: 20px;
	flex-grow: 1;
}

.left-side {
	display: none;
}

/* hero thing */
.home {
	min-width: 250px;
	max-width: 300px;
	width: 100%; /* take up all the space allowed */
	background-color: var(--alpha-accent-background);
	border: 2px solid var(--border);
	border-radius: var(--kantighet);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	margin: 20px;
	margin-right: 10px;
	box-shadow: 0px 0px 20px 1px #000000;
}

.aboutme p {
	margin-top: 0;
}

.home img {
	display: block;
	width: 128px;
	height: 128px;
	margin: 0 auto;
	border: 2px solid var(--accent-colour);
	border-radius: var(--kantighet);
}

.bottomnote {
	text-align: center;
	color: grey;
	user-select: none;
	-webkit-user-select: none;
}

/* project section */
.CSS:hover			{ color: #563d7c; border-bottom: 2px solid #563d7c }
.Go:hover 			{ color: #00add8; border-bottom: 2px solid #00add8 }
.HTML:hover 		{ color: #e34c26; border-bottom: 2px solid #e34c26 }
.Java:hover 		{ color: #b07219; border-bottom: 2px solid #b07219 }
.JavaScript:hover 	{ color: #f1e05a; border-bottom: 2px solid #f1e05a }
.Python:hover		{ color: #3572a5; border-bottom: 2px solid #3572a5 }
.Ruby:hover 		{ color: #701516; border-bottom: 2px solid #701516 }
.Rust:hover 		{ color: #dea584; border-bottom: 2px solid #dea584 }
.Shell:hover 		{ color: #89e051; border-bottom: 2px solid #89e051 }
.Swift:hover 		{ color: #f05138; border-bottom: 2px solid #f05138 }

.projects {
	display: flex;
	align-content: center;
	justify-content: center;
	flex-wrap: wrap;
	text-align: center;
}

.project {
	border: 2px solid var(--border);
	transition: .15s box-shadow ease-out, .15s color ease-out, .15s border ease-out, .15s border-bottom ease-out;
	width: 300px;
	display: flex;
	flex-direction: column;
	margin: 8px;
	background-color: #0f0f0fc0;
	border-radius: var(--kantighet);
}

.project:hover {
	border-left: 2px solid #303030;
	border-top: 2px solid #303030;
	border-right: 2px solid #303030;
	box-shadow: 0px 0px 9px 3px rgba(0,0,0,0.51);
}

.project h2 {
	border-bottom: 2px solid var(--border);
	margin: 0 24px 0 24px;
	padding: 16px 0 12px 0;
}

.project h2 a {
	color: #fff;
	text-decoration: none;
	transition: color .1s;
}

.project h2 a:hover { /* language colour on hover */
	color: inherit;
}

.project p {
	padding: 0 8px 0 8px;
	color: #fff;
}

.project img {
	max-width: 80%;
	margin: 0 auto;
	margin-bottom: 8px;
	height: auto;
	border-radius: 0.5vmin; /* todo: replace */
	box-shadow: 0px 0px 9px 3px rgba(0, 0, 0, 0.1);
}

.imagecontainer {
	flex-grow: 1;
	display: flex;
	align-items: center;
}

.project span {
	margin-bottom: 12px;
}

.blogpostpreview {
	display: flex;
	background-color: #161616;
	border-radius: var(--kantighet);
	border: 2px solid #262626;
	transition: .05s border ease-out;
	margin: 0 auto;
	margin-bottom: 12px;
	max-width: 800px;
}

.blogpostpreview:hover {
	border: 2px solid var(--accent-colour);
}

.blogpostpreview p {
	padding: 0 12px 0 12px;
	margin: 0;
}

.blogpostpreview a, .postdate {
	line-height: 40px;
}

.forcesingleline {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	color: var(--accent-colour);
}

.postdate {
	background-color: #262626;
	white-space: nowrap; /* stop long titles from breaking the date */
	border-top-left-radius: 4px; /* ??? */
	border-bottom-left-radius: 4px;
}

footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	color: grey;
	flex-wrap: wrap;
	padding: 16px;
}

footer p {
	margin: 0;
	line-height: 20px; /* required for kaomoji:hover to not jump */
}

#kao:before { content: attr(before); }
#kao:hover:before { content: "☆⌒(> _ <)"; }

/* scrollbar */
.content::-webkit-scrollbar {
	width: 12px;
}

.content::-webkit-scrollbar-track {
	border-top-right-radius: calc(var(--kantighet) - 2px);
	border-bottom-right-radius: calc(var(--kantighet) - 2px);
	background-color: rgba(255, 255, 255, 0.1);
}

.content::-webkit-scrollbar-thumb {
	background-color: #666;
	border-radius: 30px;
	border: 3px solid transparent;
	background-clip: content-box;
	transition: background-color .15s ease-in;
}

.content::-webkit-scrollbar-thumb:hover {
	background-color: #888;
}

/* mobile */
@media screen and (max-width: 700px), (max-height: 599px) {
	body {
		flex-direction: column;
		overflow: auto;
		height: 100%;
	}
	.home {
		background-color: var(--background);
		border: none;
		flex-direction: row;
		align-items: flex-end;
		box-shadow: none;
		margin: 0 auto;
	}
	.bottomnote {
		display: none;
	}
	.content {
		background-color: var(--accent-background);
		overflow: hidden;
		margin: 0;
	}
	.left-side {
		display: block;
	}
	.title h1 {
		margin: 0 10px 0 10px;
	}
	.line {
		margin: 25px 12px 25px 12px;
	}
}

/* light theme */
@media (prefers-color-scheme: light) {
	:root {
		--accent-colour: #6339cb;
		--alpha-accent-background: #fffffff0;
		--border: #dadada;
	}

	body, nav a {
		color: #000;
	}

	.darkersection, .project {
		background-color: #f5f5f5a0;
	}

	.content, .home {
		box-shadow: 0px 0px 9px 3px rgba(0, 0, 0, 0.3);
	}

	.project:hover {
		box-shadow: 0px 0px 9px 3px rgba(0, 0, 0, 0.1);
		border-left: 2px solid #e0e0e0;
		border-top: 2px solid #e0e0e0;
		border-right: 2px solid #e0e0e0;
	}

	.project p, .project h2 a {
		color: #000;
	}

	.blogpostpreview, nav a {
		background-color: #fff;
		border: 2px solid rgba(0, 0, 0, 0.16);
	}

	.postdate {
		background-color: #f3f3f3;
	}

	body:before {
		filter: blur(8px) brightness(3.0) !important;
	}
}

@media screen and (min-width: 701px) and (min-height: 599px) { /* don't put a background on mobile */
	body:before {
		height: 100%;
		content: "";
		position: fixed;
		left: 0;
		right: 0;
		z-index: -1;
		background-image: url("assets/bg.jpg");
		background-repeat: no-repeat;
		background-size: cover;
		background-position: center;
		filter: blur(8px) hue-rotate(-10deg);
	}
}

@media screen and (max-height: 737px) {
	.bottomnote { display: none; }
}

@media screen and (prefers-color-scheme: light) {
	@media screen and (max-width: 700px), (max-height: 599px) {
		:root { --background: #f1f1f1; --accent-background: #fff } /* only light background on light theme mobile page.. D: */
		.content { box-shadow: 0 0 20px 1px #999 }
		.home { box-shadow: none; }
	}
}
