@font-face {
	font-family: 'Terminus';
	src: url('/assets/fonts/terminus-webfont.woff2') format('woff2');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

:root {
	/* Theme colors */
	/* Only used as fallback, will be overwritten (consider editing these values in /src/scripts/modules/theme.js) */
	--main-color: #c0c0c0;
	--main-color-40: #c0c0c066;
	--main-color-20: #c0c0c033;
	--bg-color: 12, 12, 12; /* example: rgba(var(--bg-color), 0.5) to use the background-color with 50% opacity */
	--bg-opacity: 0.15;
	--selection: #4a4a4a;

	/* other */
	--warning-color: rgb(240, 86, 86);
	--info-color: #ffffff;

	--noise-opacity: 0.65;
	--background-video-opacity: 0.275;
	--grunge-overlay-opacity: 0.9;

	--tab-background-blur: 4px;

	font-size: 10px;
}

html {
	background: black;
	overflow-x: hidden;
}

body {
	color: var(--main-color);
	background:
		radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 50%, rgba(var(--bg-color), 0.2) 250%),
		rgba(var(--bg-color), var(--bg-opacity));

	margin: 0;
	height: 100vh;
	width: 100vw;

	overflow-y: auto;
	scroll-behavior: smooth;

	font-family: 'Terminus', 'Courier New', monospace;
}

/* BACKGROUND AND OVERLAYS */
#rain-vid,
#noise-overlay,
#grunge-overlay {
	position: fixed;
	overflow: hidden;

	top: 0;
	left: 0;
	bottom: 0;
	right: 0;

	height: 100vh;
	width: 100vw;

	pointer-events: none;

	z-index: 10;

	display: none; /* Hide background videos by default, will be overwritten in effects.css if effects are not disabled */
}

#rain-vid {
	opacity: var(--background-video-opacity);
	object-fit: cover;
	z-index: -1;
}

#grunge-overlay {
	z-index: 9998;
	background: url('/assets/images/grunge.jpg');
	background-size: cover;
	mix-blend-mode: color-dodge;
	opacity: var(--grunge-overlay-opacity);
}

@keyframes noise {
	0% {
		background: url('/assets/images/noise-textures/noisy-texture-200x200-1.png');
	}
	25% {
		background: url('/assets/images/noise-textures/noisy-texture-200x200-2.png');
	}
	50% {
		background: url('/assets/images/noise-textures/noisy-texture-200x200-3.png');
	}
	75% {
		background: url('/assets/images/noise-textures/noisy-texture-200x200-4.png');
	}
}

#noise-overlay {
	background-blend-mode: multiply;
	background: url('/assets/images/noise-textures/noisy-texture-200x200-1.png');
	filter: contrast(1.5) brightness(0.4) hue-rotate(90deg);
	opacity: var(--noise-opacity);

	mask-image: radial-gradient(circle, rgba(0, 0, 0, 1) 30%, rgba(0, 0, 0, 0) 150%);
	mask-size: cover;
	mask-position: center;

	animation: noise 0.3s steps(4) infinite;
}

.snowflake {
	position: fixed;
	animation-timing-function: linear;
	z-index: -1;
	background: white;
	border-radius: 50%;
	pointer-events: none;
	filter: blur(1px);
}

@keyframes snowflake-fall {
	0% {
		transform: translateY(-15vh);
	}
	100% {
		transform: translateY(125vh);
	}
}

@keyframes snowflake-fall-horizontal-1 {
	0% {
		transform: translateX(0) translateY(-15vh);
	}
	100% {
		transform: translateX(20vw) translateY(125vh);
	}
}

@keyframes snowflake-fall-horizontal-2 {
	0% {
		transform: translateX(0) translateY(-15vh);
	}
	100% {
		transform: translateX(-20vw) translateY(125vh);
	}
}

/* global styles | general */

::selection {
	background-color: var(--selection);
}

a {
	color: var(--main-color);
	text-decoration: underline;
}

a:hover {
	background-color: var(--main-color);
	cursor: pointer;
	color: rgba(24, 45, 75, 0.616);

	transition:
		box-shadow 0.1s,
		background-color 0s,
		color 0s;

	text-decoration: none;
}

pre,
p,
li,
h1,
h2,
h3,
h4,
td {
	margin: 0;
	font-weight: normal;
}

h4 {
	font-size: 1em;
}

p em {
	opacity: 0.7;
}

i {
	margin-right: 0.75em;
	vertical-align: middle;
}

summary {
	-webkit-user-select: none; /* Safari */
	user-select: none;
	outline: 1px solid var(--main-color);
	padding-left: 0.5em;
}

summary h2 {
	display: inline;
}

summary::marker {
	font-size: 1.5em;
}

summary:hover {
	cursor: pointer;
	background-color: var(--main-color);
	color: rgba(24, 45, 75, 0.616);
}

details[open] summary {
	margin-bottom: 0.5em;
}

details[open] summary:not(:hover) {
	background: linear-gradient(90deg, transparent -15%, rgba(var(--bg-color), 0.3) 65%);
}

#canvas {
	font-size: 1.75em;
	padding: 1.8em;
}

#top-right-ui {
	position: fixed;
	top: 1.2em;
	right: 1.2em;
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 0.75em;
	padding: 0.35em 0.6em;
	border: 1px solid var(--main-color);
	background: rgba(var(--bg-color), 0.55);
	backdrop-filter: blur(4px);
	font-size: 1.1em;
}

/* Terminal-style hamburger: visible only on mobile, left side inside top-right box */
.mobile-menu-btn {
	display: none;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 3px;
	width: 1.75em;
	height: 1.75em;
	padding: 0.2em;
	border: 1px solid var(--main-color);
	background: transparent;
	color: var(--main-color);
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s;
}

.mobile-menu-btn:hover {
	background-color: var(--main-color);
	color: rgba(0, 0, 0, 0.75);
}

.mobile-menu-btn__line {
	display: block;
	width: 100%;
	height: 2px;
	background-color: currentColor;
}

@media screen and (max-width: 45em) {
	.mobile-menu-btn {
		display: flex;
	}
}

@media screen and (min-width: 45.001em) {
	.mobile-menu-btn {
		display: none !important;
	}
}

/* Mobile nav overlay and panel (same styles as nav-tabs / top-right box) */
#mobile-nav-overlay {
	position: fixed;
	inset: 0;
	z-index: 25;
	visibility: hidden;
	opacity: 0;
	transition: visibility 0.2s, opacity 0.2s;
}

body.mobile-nav-open #mobile-nav-overlay {
	visibility: visible;
	opacity: 1;
}

#mobile-nav-overlay::before {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
}

#mobile-nav-panel {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	padding: 2em 1.25em;
	border: none;
	border-right: 1px solid var(--main-color);
	background: rgba(var(--bg-color), 0.98);
	backdrop-filter: blur(var(--tab-background-blur));
	box-shadow: none;
	transform: translateX(-100%);
	transition: transform 0.25s ease-out;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
}

body.mobile-nav-open #mobile-nav-panel {
	transform: translateX(0);
}

.mobile-nav-panel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
	margin-bottom: 1.25em;
	flex: 0 0 auto;
}

.mobile-nav-panel__title {
	margin: 0;
	font-size: 1em;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--main-color);
	opacity: 0.9;
}

.mobile-nav-panel__beta {
	display: inline-block;
	margin-left: 0.4em;
	padding: 0.1em 0.35em;
	font-size: 0.7em;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	border: 1px solid var(--main-color);
	background: rgba(var(--main-color), 0.08);
	opacity: 1;
}

.mobile-nav-panel__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2em;
	height: 2em;
	padding: 0;
	border: 1px solid var(--main-color);
	background: transparent;
	color: var(--main-color);
	font-size: 1.5em;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s;
	flex-shrink: 0;
}

.mobile-nav-panel__close:hover {
	background-color: var(--main-color);
	color: rgba(0, 0, 0, 0.75);
}

#mobile-nav-panel ul {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.75em;
	flex: 0 0 auto;
}

#mobile-nav-panel .mobile-nav-link {
	display: block;
	padding: 0.65em 0.6em;
	font-size: 1.25em;
	border: 1px solid var(--main-color);
	background: transparent;
	color: var(--main-color);
	text-decoration: none;
	transition: background-color 0.15s, color 0.15s;
}

#mobile-nav-panel .mobile-nav-link:hover {
	background-color: var(--main-color);
	color: rgba(0, 0, 0, 0.75);
}

#mobile-nav-panel .mobile-nav-link.tab-active {
	background-color: var(--main-color);
	color: rgba(24, 45, 75, 0.616);
	text-decoration: none;
}

.mobile-nav-panel__footer {
	margin-top: auto;
	padding-top: 2em;
	display: flex;
	justify-content: center;
	align-items: flex-end;
}

.mobile-nav-panel__logo {
	max-width: 120px;
	height: auto;
	opacity: 0.85;
}

#top-left-ui {
	position: fixed;
	top: 1.2em;
	left: 1.2em;
	z-index: 20;
	font-size: 1.1em;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	pointer-events: none;
}

.top-left-ui__season {
	display: none;
}

.top-left-ui__beta {
	display: inline-block;
	margin-left: 0;
	padding: 0.1em 0.35em;
	font-size: 0.7em;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	border: 1px solid var(--main-color);
	background: rgba(var(--main-color), 0.08);
}

@media (min-width: 45em) {
	.top-left-ui__season {
		display: inline;
	}
	.top-left-ui__beta {
		margin-left: 0.4em;
	}
}

#terminal-prompt {
	position: fixed;
	left: 1.2em;
	bottom: 1.2em;
	z-index: 20;
	font-size: 1.1em;
	letter-spacing: 0.06em;
	pointer-events: none;
}

.terminal-cursor {
	text-decoration: underline;
	animation: cursor-pulse 1.2s steps(1) infinite;
}

@keyframes cursor-pulse {
	0%,
	49% {
		opacity: 1;
	}
	50%,
	100% {
		opacity: 0;
	}
}

#terminal-clock {
	letter-spacing: 0.08em;
}

/* Boot sequence: only visible when .boot-show (first visit) */
.boot-show #boot-sequence {
	display: flex !important;
	visibility: visible !important; /* override body.no-fouc so boot shows immediately */
	position: fixed;
	inset: 0;
	z-index: 999;
	align-items: center;
	justify-content: center;
	background: rgba(var(--bg-color), 0.98);
	pointer-events: none;
	animation: boot-sequence-fade 3s ease forwards;
}

.boot-frame {
	text-align: center;
	padding: 1em 2em;
	border: none;
	background: transparent;
}

.boot-logo {
	width: min(70vw, 520px);
	height: auto;
	display: block;
	filter: brightness(1.05) contrast(1.05);
	margin-bottom: 0.6em;
	animation: boot-logo-out 3s ease forwards;
}

.boot-terminal {
	opacity: 0;
	animation: boot-terminal-in 3s ease forwards;
}

.boot-terminal p {
	margin: 0.2em 0;
}

@keyframes boot-sequence-fade {
	0%,
	85% {
		opacity: 1;
		visibility: visible;
	}
	100% {
		opacity: 0;
		visibility: hidden;
	}
}

@keyframes boot-logo-out {
	0%,
	35% {
		opacity: 1;
	}
	55%,
	100% {
		opacity: 0;
	}
}

@keyframes boot-terminal-in {
	0%,
	35% {
		opacity: 0;
	}
	55%,
	85% {
		opacity: 1;
	}
	100% {
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.boot-show #boot-sequence {
		animation: none;
		opacity: 0;
		visibility: hidden;
	}
}

#toggle-effects a {
	padding: 0 0.3em;
	border: 1px solid var(--main-color);
	text-decoration: none;
}

#toggle-effects a:hover {
	background-color: var(--main-color);
	color: rgba(0, 0, 0, 0.65);
}

.tag-list {
	display: flex;
	gap: 0.5em;
	margin: 0.5em 0;
}

hr.dotted {
	border: none;
	border-top: 1px dotted var(--main-color);
	height: 1px;
	width: 100%;
}

.tooltip {
	position: absolute;
	background-color: rgba(var(--bg-color), 0.45);
	color: var(--main-color);
	padding: 5px 10px;
	border: 1px solid var(--main-color);
	font-size: 14px;
	pointer-events: none;
	white-space: nowrap;
}

/* ASCII AND INTRODUCTION */
#sub-title {
	font-size: 1em;
}

/* NAV BAR USED FOR TAB PAGES */
nav ul {
	list-style-type: none;
	display: flex;
	padding: 0;
	gap: 2.5em;
}

nav ul li a {
	padding: 0.2em 0.3em;
}

.tab-active {
	background-color: var(--main-color);
	color: rgba(24, 45, 75, 0.616);
	text-decoration: none;
}

/* PRINT ANIMATION WHEN CHANGING TABS AND ON PAGE LOAD */
.fade-in {
	opacity: 0;
}

.fade-in.visible:not(em) {
	opacity: 1;
	transform: translateY(0);
}

.fade-in.visible em {
	opacity: 0.7;
	transform: translateY(0);
}

@keyframes fade-in-anim {
	0% {
		opacity: 0.75;
		transform: scale(0.985) rotateX(-15deg);
	}
	35% {
		opacity: 0.8;
	}

	100% {
		opacity: 1;
		transform: scale(1) rotateX(0);
	}
}

.fade-in-anim:not(em) {
	animation: fade-in-anim 0.5s ease-out;
}

/* TABS */
.tabs:not(:target):not(.default-tab) {
	display: none;
}

.tabs {
	border: solid var(--main-color);
	padding: 1.5em;
	backdrop-filter: blur(var(--tab-background-blur));
	background: linear-gradient(45deg, rgba(var(--bg-color), 0.05) 70%, rgba(var(--bg-color), 0.2) 110%);
}

/* HOME TAB */
#welcome-title {
	background: linear-gradient(90deg, transparent -15%, rgba(var(--bg-color), 0.3) 65%);
	outline: 1px solid var(--main-color);
	margin-bottom: 0.5em;
	padding-left: 0.25em;
}

#update-list em::after {
	content: '\A';
	white-space: pre;
}

#update-list p:not(:last-child) {
	margin-bottom: 0.75em;
}

/* RESPONSIVENESS */
@media screen and (max-width: 45em) {
	.no-mobile {
		display: none;
	}
	nav ul {
		gap: 0.25em;
		width: 100%;
		padding: 0.25em 0;
		display: flex;
		justify-content: space-between;
	}
	#rain-vid {
		object-fit: fill;
	}
	body {
		padding-bottom: env(safe-area-inset-bottom);
	}

	/* grid system */
	.row {
		display: block;
	}
	.row img {
		width: 100%;
	}

	/* pictures tab */
	.img-desc {
		filter: opacity(100%);
		left: 100%;
		padding: 0 0.5em;
		align-items: start;
	}
	.img-desc:hover {
		background: none;
	}
	.row-photography {
		flex-direction: column;
		display: flex;
		gap: 0;
	}
	.img-container {
		width: 50%;
	}

	/* about tab */
	.contact-link {
		margin-top: 0.5em;
	}
	.contact-link {
		margin-bottom: 0.75em;
	}
	.contact-link a {
		padding: 0.25em 0 0.25em 0;
	}
}

@media screen and (max-width: 1050px) {
	#canvas {
		padding: 0.5em;
	}
	.tabs {
		padding: 0.75em;
	}
}

@media screen and (min-width: 1600px) {
	/* Prevent the images from getting too big on wide screens */
	.row img {
		max-width: 800px;
	}
	.row {
		justify-content: left;
	}
}

@media (hover: none) {
	summary:hover {
		background-color: transparent;
		color: var(--main-color);
	}
}

/* To comply with outlinenone.com */
:focus {
	outline: 2px solid var(--main-color);
	color: var(--main-color);
	background: rgba(var(--bg-color), 0.3);

	text-decoration: none;
}
