/* Resets */

* {
	box-sizing: border-box;
	position: relative;
}

html,
body {
	height: 100%;
}

body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
		Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

h1,
h2,
h3,
h4 {
	margin: 0;
}

/* Remove default padding */
ul[class],
ul[id],
ol[class],
ol[id] {
	padding: 0;
}

/* Remove list styles on ul, ol elements with a class attribute */
ul[class],
ul[id],
ol[class],
ol[id] {
	list-style: none;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
	text-decoration-skip-ink: auto;
}

a {
	color: inherit;
}

/* CSS Vars */

:root {
	--about-bg-color: lightblue;
	--about-fg-color: #222;
	--project-bg-color: lightgreen;
	--project-fg-color: #222;
	--code-bg-color: rgba(0, 0, 0, 0.2);
	--table-secondary-bg-color: rgba(0, 0, 0, 0.1);
}

/* Base Styling */

.main-container {
	background: var(--about-bg-color);
	color: var(--about-fg-color);
	height: 100%;
	overflow-y: scroll;
}

[role='switch'] {
	background: transparent;
	border: 1px solid;
	padding: 5px 2px;
	border-radius: 3px;
	font-size: 1rem;
}

[role='switch']>span {
	padding: 3px;
	border-radius: 3px;
}

h1 {
	font-size: 3rem;
}

.tile {
	display: inline-block;
	border: 1px solid;
	border-radius: 3px;
	padding: 12px;
	width: 100%;
}

.tile+.tile {
	margin-top: 8px;
}

.tile>.title {
	display: inline-flex;
	align-items: center;
	background: var(--about-fg-color);
	color: var(--about-bg-color);
	padding: 2px 10px;
	border-bottom-right-radius: 2px;
	top: -12px;
	left: -12px;
}

.tile>.meta {
	font-size: 0.8rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 12px;
}

@media (min-width: 640px) {
	.tile {
		margin: 8px;
	}
}

/* Toggle */
#dark-mode-toggle {
	position: absolute;
	top: 30px;
	right: 64px;
	transform: translate(50%, -50%);
	z-index: 1;
	cursor: pointer;
}

#dark-mode-toggle[aria-checked='true'] {
	color: white;
	--border-color: white;
}

#dark-mode-toggle[aria-checked='true'] :last-child {
	background: #fff;
	color: #222;
}

#dark-mode-toggle[aria-checked='false'] {
	color: #222;
	--border-color: #222;
}

#dark-mode-toggle[aria-checked='false'] :first-child {
	background: #222;
	color: #fff;
}

#dark-mode-toggle[aria-checked='true']+.main-container {
	--about-bg-color: #223;
	--about-fg-color: lightblue;
	--project-bg-color: #232;
	--project-fg-color: lightgreen;
	--code-bg-color: rgba(255, 255, 255, 0.2);
	--table-secondary-bg-color: rgba(255, 255, 255, 0.1);
}

/* Utility Classes */

.block {
	display: block;
}

.flex {
	display: flex;
}

.inline-flex {
	display: inline-flex;
}

.mw-80ch {
	max-width: 80ch;
}

.mw-64ch {
	max-width: 64ch;
}

.mx-auto {
	margin-left: auto;
	margin-right: auto;
}

.mt-64 {
	margin-top: 64px;
}

.mt-48 {
	margin-top: 48px;
}

.mt-8 {
	margin-top: 8px;
}

.ml-8 {
	margin-left: 8px;
}

.ml-12 {
	margin-left: 12px;
}

.p-12 {
	padding: 12px;
}

.nowrap {
	white-space: nowrap;
}

.center-contents {
	display: flex;
	justify-content: center;
	align-items: center;
}

/* entire container, keeps perspective */
.flip-container {
	perspective: 1000px;
}

/* flip the pane when hovered */
.flip-container:hover .flipper,
.flip-container.hover .flipper {
	transform: rotateY(180deg);
}

/* flip speed goes here */
.flipper {
	transition: 0.6s;
	transform-style: preserve-3d;

	position: relative;
}

/* hide back of pane during swap */
.flipper .front,
.flipper .back {
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;

	position: absolute;
	top: 0;
	left: 0;
}

/* back, initially hidden pane */
.flipper .back {
	transform: translateZ(-1px) rotateY(180deg);
}

.focus-animated-border:focus {
	width: max-content;
	border: none;
	background: linear-gradient(90deg,
			var(--border-color, #222) 50%,
			transparent 50%),
		linear-gradient(90deg, var(--border-color, #222) 50%, transparent 50%),
		linear-gradient(0deg, var(--border-color, #222) 50%, transparent 50%),
		linear-gradient(0deg, var(--border-color, #222) 50%, transparent 50%);
	background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
	background-size: 15px 4px, 15px 4px, 4px 15px, 4px 15px;
	padding: 10px;
	animation: border-animation 4s infinite linear;
}

@keyframes border-animation {
	0% {
		background-position: 0 0, 100% 100%, 0 100%, 100% 0;
	}

	100% {
		background-position: 100% 0, 0 100%, 0 0, 100% 100%;
	}
}
