
* {
	box-sizing: border-box;
}

:root {
    --gap: 4px;
    --padding: 2px;

    --base-color: 242, 238, 227; /* white */
    --level-0: 0;
    --level-1: 0.1;
    --level-2: 0.2;
    --level-3: 0.3;
    --level-4: 0.4;
}

#background {
    position: fixed;
    inset: 0;

    display: grid;
    justify-content: center;
    align-content: center;

    gap: var(--gap);
    padding: var(--padding);
}

.cell {
    border-radius: 2px;
    transition: background-color 0.2s ease;
}

.cell.level-0 {
    background-color: rgba(var(--base-color), var(--level-0));
}
.cell.level-1 {
    background-color: rgba(var(--base-color), var(--level-1));
}
.cell.level-2 {
    background-color: rgba(var(--base-color), var(--level-2));
}
.cell.level-3 {
    background-color: rgba(var(--base-color), var(--level-3));
}
.cell.level-4 {
    background-color: rgba(var(--base-color), var(--level-4));
}

html,
body {
	margin: 0;
	padding: 0;
	min-height: 100%;
	background-color: rgb(255, 254, 251);
	font-family: "Playfair", serif;
	transition: background-color 0.2s ease, color 0.2s ease;
}

hr {
	border: 0;
	border-top: 2px solid #ccc;
}

.project_description.highlight {
	padding-left: calc(1em + 5px);
}

body {
	display: flex;
	flex-direction: column;
	min-height: 100svh;
}

main {
	width: 100%;
	margin-block: auto;
	padding: 2rem 0;
	text-align: center;
}

::selection { background-color: #eeeeee;}

h1 {
	margin: 0;
	display: inline;
}

a, a:visited {
	color: inherit;
	text-decoration: none;
}

.container {
	width: min(60%, 900px);
	margin: 0 auto;
}

@media (max-width: 1000px) {
	.container {
		width: calc(100% - 2rem);
	}

	.project_container ul {
		width: 100%;
		margin: 1em 0 0;
		grid-template-columns: 1fr;
	}

	.project_name,
	.project_description {
		padding-left: 0;
		padding-right: 0;
	}

	.project_description {
		border-left: 0;
		padding-top: 0;
		padding-bottom: 1em;
	}
}

.header_container {
	margin-bottom: 0.25em;
}

.project_container {
	text-align: left;
	margin-bottom: 1em;
	margin-top: 1em;
}

.project {
	display: flex;
	flex-direction: row;
	align-items: center;
	padding-bottom: 0.5em;
	padding-top: 0.5em;
	width: 80%;
}

.project_name {
	font-weight: bold;
	padding-right: 1em;
	white-space: nowrap;
}

.project_description {
	border-left: 2px solid #ccc;
	padding-left: 1em;
	transition: padding-left 0.1s ease;
}

#project_header {
	margin-left: 0.5em;
}

.project_container ul {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr);
	width: 90%;
	margin: 1em 2em 0;
	padding: 0;
	list-style: none;
}

.project_container li,
.project {
	display: contents;
}

.project_name,
.project_description {
	padding-top: 0.5em;
	padding-bottom: 0.5em;
}

.link_separator {
	color: #464646;
}

.link_row {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 1em;
	margin-top: 2em;
	position: relative;
}

.link_icon {
	color: #464646;
	transition: color 0.1s ease, translate 0.1s ease;
	display: flex;
	align-items: center;
}

.link_icon:hover {
	color: #1e1e1e;
	translate: 0 -1px;
	transition: color 0.1s ease, translate 0.1s ease;
}

.formatted_link,
.formatted_link:visited {
	text-decoration: underline;
	text-decoration-color: #a0a0a0;
	text-underline-offset: 4px;
	transition: text-decoration-color 0.1s ease, text-underline-offset 0.1s ease;
}

.formatted_link:hover {
	text-decoration: underline;
	text-decoration-color: #1e1e1e;
	text-underline-offset: 5px;
	transition: text-decoration-color 0.1s ease, text-underline-offset 0.1s ease;
}

.header_row {
	margin-top: 0.2em;
}

button {
	background-color: #464646;
	color: #fff;
	border: none;
	padding: 0.3em 1em;
	border-radius: 4px;
	cursor: pointer;
	transition: background-color 0.1s ease;
	font-family: "Cormorant Garamond", serif;
	font-weight: bold;
}

/* a:not(:has(.link_icon))::after {
		content: "";
		display: inline-block;
		width: 0.75em;
		height: 0.75em;
		margin-left: 0.25em;
		vertical-align: middle;
		background: url("https://www.svgrepo.com/show/510970/external-link.svg") center / contain no-repeat;
} */

.ui_container {
	pointer-events: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1000;
}

#theme_toggle {
	position: fixed;
	top: 1rem;
	right: 1rem;
	z-index: 1001;
	pointer-events: auto;
	/* circle button */
	border-radius: 50%;
	width: 2.3rem;
	height: 2.3rem;
	/* center the svg icon */
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: 0.5rem;
}

.theme_icon {
	display: block;
}

.sun_icon {
	display: none;
}

.date-time {
	text-align: right;
	padding-right: 1em;
}

.vim-container {
	position: fixed;
	left: 1rem;
	bottom: max(1rem, env(safe-area-inset-bottom));
	z-index: 1001;

	display: flex;
	align-items: baseline;
	gap: 0.25rem;

	max-width: calc(100vw - 2rem);
	font-family: monospace;
	font-size: 1rem;
	line-height: 1.2;

	pointer-events: auto;
}

#vim-prompt {
	flex: 0 0 auto;
	font: inherit;
	line-height: inherit;
}

#vim-input {
	flex: 1 1 auto;
	width: min(30rem, calc(100vw - 4rem));
	min-width: 0;

	margin: 0;
	padding: 0;

	border: 0;
	outline: 0;
	background: transparent;
	color: inherit;

	font: inherit;
	line-height: inherit;
	caret-color: currentColor;
}

#vim-input:focus {
	outline: none;
}
