/*
 *	style.css | Finn Le Var
 */

*
{
	margin:		0;
	padding:	0;
	box-sizing:	border-box;
}

/* monogram extended, a pixel font, self hosted so the page makes no outside requests
   it is drawn on a 16px grid so every size here is a multiple of 16 to stay crisp */
@font-face
{
	font-family:	"Monogram";
	src:			url(fonts/monogram-extended.ttf) format("truetype");
	font-display:	swap;
}

html, body
{
	min-height:	100%;
}

body
{
	background-color:	black;
	color:				#a0a0a0;
	font-family:		"Monogram", monospace;
	font-size:			32px;
	line-height:		1.25;
	-webkit-font-smoothing:	none;
}

/*
 *	background
 */

/* sits behind everything and never scrolls */
#bg
{
	position:	fixed;
	inset:		0;
	z-index:	-1;
}

.layer
{
	position:			absolute;
	inset:				0;
	image-rendering:	pixelated;
}

/* each layer drifts twice as fast as the one behind it, so we get parallax */
.bg01 { background-image: url(img/bg01.png); animation: drift_y 120s infinite linear, sway_x 60s infinite ease-in-out; }
.bg02 { background-image: url(img/bg02.png); animation: drift_y 60s infinite linear, sway_x 30s infinite ease-in-out; }
.bg03 { background-image: url(img/bg03.png); animation: drift_y 30s infinite linear, sway_x 15s infinite ease-in-out; }

/* darkens the edges so the text in the middle stays readable */
.vignette
{
	background: radial-gradient(circle, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 1) 100%);
}

/* scrolls exactly two tiles so the loop has no seam */
@keyframes drift_y
{
	0%		{ background-position-y: 1024px;	}
	100%	{ background-position-y: -1024px;	}
}

@keyframes sway_x
{
	0%		{ background-position-x: 0px;	}
	50%		{ background-position-x: 50px;	}
	100%	{ background-position-x: 0px;	}
}

/* just in case someone has motion turned off */
@media (prefers-reduced-motion: reduce)
{
	.layer { animation: none; }
}

/*
 *	panel
 */

main
{
	min-height:		100vh;
	padding:		32px 16px;
	display:		flex;
	align-items:	center;
	justify-content:center;
}

/* only as wide as the longest row, see through enough that the stars still pass behind */
.panel
{
	width:		max-content;
	max-width:	100%;
	border:		2px solid #303030;
	background:	rgba(0, 0, 0, 0.6);
}

/* the title strip, like the bar on a terminal window */
h1
{
	padding:		4px 16px;
	border-bottom:	2px solid #303030;
	font-size:		32px;
	font-weight:	normal;
	color:			#707070;
	background:		rgba(48, 48, 48, 0.3);
}

nav
{
	padding:	8px 0;
}

ul
{
	list-style:	none;
}

/* the gated lis keep their default display so hidden works anyway, this is just the safety */
[hidden]	{ display: none; }

/*
 *	rows
 */

/* name then description, the name column is fixed so every description starts at the same x,
   it fits the longest name plus the tree step in front of it, see .panel ul ul below. one 32px line a row
   keeps a long archive inside one screen */
a, .row
{
	display:				grid;
	grid-template-columns:	160px 1fr;
	padding:				0 16px;
	line-height:			32px;
	color:					#707070;
	text-decoration:		none;
}

.name	{ color: #c8c8c8; }

/* a group header isnt a link, so it reads quieter than one */
.row .name	{ color: #707070; }
.row .desc	{ color: #505050; }

/* the one accent, a pink name and a bar down the left edge */
a:hover, a:focus-visible
{
	box-shadow:	inset 2px 0 0 #d2738a;
	background:	rgba(210, 115, 138, 0.1);
	outline:	none;
}

a:hover .name, a:focus-visible .name
{
	color: #d2738a;
}

/* keyboard focus gets the whole box too, so it shows without a mouse */
a:focus-visible
{
	box-shadow:	inset 0 0 0 2px #d2738a;
}

/*
 *	tree
 */

/* monogram has no box drawing glyphs, so the ├ and └ are 2px rules a step lighter than the borders,
   the child names step in 32px to make room and the column above takes up the slack */
.panel ul ul li
{
	position:	relative;
}

.panel ul ul .name
{
	padding-left:	32px;
}

/* the trunk runs the full row, the last child stops it at the stub so it reads as └ */
.panel ul ul li::before,
.panel ul ul li::after
{
	content:		"";
	position:		absolute;
	left:			22px;
	pointer-events:	none;
}

.panel ul ul li::before
{
	top:			0;
	bottom:			0;
	border-left:	2px solid #404040;
}

.panel ul ul li:last-child::before
{
	bottom:	auto;
	height:	16px;
}

/* the stub sits on the middle of the first line, not the row, so a wrapped description doesnt drag it down */
.panel ul ul li::after
{
	top:		15px;
	width:		16px;
	border-top:	2px solid #404040;
}

/* phone, same two columns, a long description wraps inside its own column so they all still start at
   one x, the rows get some air so a wrapped line doesnt read as the next row */
@media (max-width: 800px)
{
	main	{ padding: 16px; }
	.panel	{ width: 100%; }

	a, .row
	{
		grid-template-columns:	120px 1fr;
		gap:					0 16px;
		padding:				6px 8px;
	}

	.panel ul ul .name	{ padding-left: 24px; }

	.panel ul ul li::before,
	.panel ul ul li::after
	{
		left:	12px;
	}

	.panel ul ul li:last-child::before	{ height: 22px; }
	.panel ul ul li::after				{ top: 21px; width: 8px; }
}
