/*
 *	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:				#d0d0d0;
	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; }
}

/*
 *	content
 */

/* one column wide enough for the longest line plus the gutter, everything in ch so it lines up like a text file */
#index
{
	width:			min(calc(54ch + 32px), 100%);
	min-height:		100vh;
	margin:			0 auto;
	padding:		64px 16px;
	display:		flex;
	flex-direction:	column;
	justify-content:center;
	gap:			40px;
}

h1
{
	padding:		0 1ch;
	font-size:		32px;
	font-weight:	normal;
	color:			#d2738a;
}

ul
{
	list-style:	none;
}

/* the gated rows, safety in case a row ever gets a display of its own */
[hidden]	{ display: none; }

/* name then description, the name column is a fixed number of characters so every description starts on the same x */
a, .head
{
	display:				grid;
	grid-template-columns:	16ch 1fr;
	padding:				0 1ch;
	color:					inherit;
	text-decoration:		none;
}

.desc	{ color: #707070; }

/* a group header is just a label, dimmer than the links so it doesnt read as one */
.head .name	{ color: #a0a0a0; }

/* children step in four characters like code, the name column gives those four back so the descriptions stay put */
li li a
{
	padding-left:			5ch;
	grid-template-columns:	12ch 1fr;
}

/* the cursor line, a full row bar in the one accent */
a:hover, a:focus-visible
{
	background:	#d2738a;
	outline:	none;
}

a:hover span, a:focus-visible span
{
	color: black;
}

/* phone, 29 characters across so the columns narrow and a long description wraps inside its own column. the
   wrapped lines sit tight and the rows get the space between them, so a two line entry still reads as one */
@media (max-width: 800px)
{
	#index		{ padding: 48px 8px; gap: 32px; }

	a, .head
	{
		grid-template-columns:	11ch 1fr;
		padding:				4px 8px;
		line-height:			1;
	}

	li li a
	{
		padding-left:			calc(8px + 2ch);
		grid-template-columns:	9ch 1fr;
	}

	h1	{ padding: 0 8px; }
}
