:root {
	--font-system: 'Iowan Old Style', 'Palatino Linotype', 'URW Palladio L', P052, serif;
	--font-system-code: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;

	--background-white: #fffff8;
	--background-dark: #151515;
	--main-color: #2a6657;
	--max-width: 100ch;
}

::-webkit-selection {
	background-color: var(--main-color);
	color: #000;
	text-shadow: none;
}

::-moz-selection {
	background-color: var(--main-color);
	color: #000;
	text-shadow: none;
}

::selection {
	background-color: var(--main-color);
	color: #000;
	text-shadow: none;
}

html {
	font-size: 20px;
	width: 100%;
}

body {
	font-family: var(--font-system);
	line-height: 1.5;
	color: #111;
	background-color: var(--background-white);
	margin: 0 auto;
	padding: 0 2rem;

	max-width: var(--max-width);
	/*counter-reset: sidenote-counter;*/
}

main {
	hyphens: auto;
}

@media only screen and (max-width: var(--max-width)) {
	body {
		padding: 0 1.5rem;
	}
	main {
		max-width: 65ch;
	}
}

@media (max-width: 768px) {
	body {
		padding: 0 1rem;
	}
	main {
		max-width: 100%;
	}
}

@media (prefers-color-scheme: dark) {
	body {
		background-color: var(--background-dark);
		color: #ddd;
	}
}

.menu {
	margin: 1em 0 0 0;
	padding: 0;
}
.menu li {
	list-style-type: none;
	display: inline;
	color: #ccc;
}
.menu li:not(:first-child):before {
	padding: 0.5em;
	content: " | ";
	color: #ccc;
}

a {
	color: var(--main-color);
	text-decoration: none;
	font-weight: 500;
}

a:hover {
	text-decoration: underline;
}

h1 {
	font-size: 48px;
	margin-bottom: 8px;
}
h2 {
	font-size: 32px;
	margin-bottom: 4px;
}
h3 {
	font-size: 24px;
	margin-bottom: 4px;
}

footer {
	margin: 1em 0 0;
	padding: 1em 0 2em 0;
	text-align: left;
	/*color: #ccc;*/
	font-size: 16px;
}

main p {
	text-align: justify;
	text-justify: inter-word;
	word-wrap: inter-word;
	overflow-wrap: inter-word;
	-webkit-hyphens: auto;
	-moz-hyphens: auto;
	hyphens: auto;
}

:not(pre) > code {
	font-family: var(--font-system-code);
	font-size: 0.75em;
	padding: 0.15em 0.35em;
	border-radius: 4px;
	border: 1px solid #ccc;
	background-color: #f7f7f7;
	color: #333;
	word-break: break-word;
}

@media (prefers-color-scheme: dark) {
	:not(pre) > code {
		border-color: #444;
		background-color: #222;
		color: #eee;
	}
}

pre {
	margin: 1.25em 0;
	padding: 0;
	overflow-x: auto;
	border-radius: 6px;
	border: 1px solid #333;
}

pre code.hljs {
	display: block;
	padding: 1em 1.25em;
	border-radius: 6px;
	font-family: var(--font-system-code);
	font-size: 0.85em;
	line-height: 1.5;
	tab-size: 4;
}

.bigger {
	font-size: 25px;
}

main ul, main ol {
	margin-bottom: 1em;
}
main ul ul, main ol ol,
main ul ol, main ol ul {
	margin-bottom: 0;
}
ul, ol {
	margin-left: 1.5em;
	padding: 0;
}

ul.posts {
	margin-left: 0em;
}
ul.posts li {
	list-style-type: none;
	margin-bottom: 0.5em;
}
ul.posts li p {
	margin: 0;
}
ul.posts .date {
	color: #666;
}
ul.posts .description, ul.posts .date {
	font-size: 16px;
}

@media (prefers-color-scheme: dark) {
	ul.posts .description {
		color: #aaa;
	}
}

img, video {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 2rem auto;
}

article img {
	cursor: zoom-in;
}

/* The hidden overlay */
.lightbox {
	display: none;
	position: fixed;
	z-index: 9999;
	left: 0; top: 0;
	width: 100vw; height: 100vh;
	background-color: rgba(0, 0, 0, 0.85);
	cursor: zoom-out;
}

.lightbox img {
	position: absolute;
	top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	max-width: 90vw;
	max-height: 90vh;
	box-shadow: 0 4px 20px rgba(0,0,0,0.5);
	margin: 0;
}

article table {
	margin: 1.5rem auto;
	width: fit-content;
	max-width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
	text-align: left;
	display: block;
	overflow-x: auto;
	white-space: nowrap;
}

article th {
	font-weight: 600;
	padding: 0.6em 1em;
	border-bottom: 2px solid #ccc;
	background-color: #f7f7f7;
	color: #111;
}

article td {
	padding: 0.6em 1em;
	border-bottom: 1px solid #e0e0e0;
	color: #333;
}

article tbody tr:nth-child(even) {
	background-color: #fafafa;
}

article tbody tr:hover {
	background-color: #f1f1f1;
}

@media (prefers-color-scheme: dark) {
	article th {
		background-color: #222;
		border-bottom-color: #444;
		color: #fff;
	}

	article td {
		border-bottom-color: #333;
		color: #e0e0e0;
	}

	article tbody tr:nth-child(even) {
		background-color: #181818;
	}

	article tbody tr:hover {
		background-color: #252525;
	}
}

blockquote {
	margin: 1.5rem 0;
	padding: 0.8rem 1.25rem;
	border-left: 4px solid #666;
	border-radius: 0 6px 6px 0;
	background-color: #f8fafc;
	color: #475569;
	font-style: italic;
}

blockquote p {
	margin: 0.5rem 0;
}

blockquote p:first-child {
	margin-top: 0;
}

blockquote p:last-child {
	margin-bottom: 0;
}

blockquote cite {
	display: block;
	margin-top: 0.5rem;
	font-size: 0.85em;
	font-style: normal;
	font-weight: 500;
	color: #64748b;
	text-align: right;
}

blockquote cite::before {
	content: "— ";
}

@media (prefers-color-scheme: dark) {
	blockquote {
		border-left-color: #888;
		background-color: #242424;
		color: #ccc;
	}

	blockquote cite {
		color: #999;
	}
}

.screenshots {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-around;
}

.screenshots img {
	width: 18rem;
	height: auto;
	object-fit: scale-down;
}

.project-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 2rem;
	margin: 2rem 0;
}

.project-card {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	border-radius: 8px;
	overflow: hidden;
	background-color: #f7f7f7;
	border: 3px solid #e0e0e0;
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.project-card:hover {
	text-decoration: none;
	transform: translateY(-4px);
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
	border-color: var(--main-color);
}

.project-card img {
	margin: 0;
	width: 100%;
	height: auto;
	object-fit: cover;
	border-bottom: 1px solid #e0e0e0;
	display: block;
}

.project-info {
	padding: 1.25rem;
}

.project-info h3 {
	margin: 0 0 0.5rem 0;
	color: #111;
	font-size: 1.25rem;
}

.project-info p {
	margin: 0;
	color: #555;
	font-size: 0.95rem;
	line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
	.project-card {
		background-color: #242424;
		border-color: #333;
	}
	.project-card:hover {
		box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
	}
	.project-card img {
		border-bottom-color: #333;
		background-color: #1a1a1a;
	}
	.project-info h3 {
		color: #eee;
	}
	.project-info p {
		color: #aaa;
	}
}

.project-details {
	display: flex;
	align-items: center;
}

svg {
	margin-right: 0.5rem;
}

.video {
	width: 100%;
	max-width: 100%;
	aspect-ratio: 16 / 9;
	height: auto;
	margin: 2rem 0;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	display: block;
}

.gbt2 {
	width: 100%;
	max-width: 100%;
	margin: 0 0 0.5em;
	padding: 0;
}

.gbt2 tr {
	line-height: 1.2;
	vertical-align: top;
}

.gbt2 tr td:first-child {
	text-align: right;
	padding-right: 0.75em;
	white-space: nowrap;
	width: 1%;
}

.gbt2 tr td:last-child {
	overflow-wrap: anywhere;
	word-break: break-word;
}

ul.skills {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 0.5rem 1rem;
	margin: 0;
	padding-left: 1.5rem;
}

ul.skills li {
	margin-bottom: 0;
}

article h1 a, article h2 a, article h3 a {
	color: #333;
}
article h1 a:hover, article h2 a:hover, article h3 a:hover {
  color: var(--main-color);
}
@media (prefers-color-scheme: dark) {
  article h1 a, article h2 a, article h3 a {
    color: #ddd;
  }
}

article h1 a:hover:before, article h2 a:hover:before, article h3 a:hover:before {
	content: '§ ';
	margin-left: -0.5em;
	display:inline;
}
