/*
 *	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:				#8c8c8c;
	font-family:		"Monogram", monospace;
	font-size:			32px;
	line-height:		1.125;
	-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
 */

/* the name column and how far a groups links step in, the children get the column minus the step
   so every description starts at the same x */
:root
{
	--name:	192px;
	--step:	32px;
}

/* one block as wide as its longest row, centred both ways, svh so the ios bars dont push it off */
main
{
	width:			fit-content;
	max-width:		100%;
	min-height:		100vh;
	min-height:		100svh;
	margin:			0 auto;
	padding:		48px 32px;
	display:		flex;
	flex-direction:	column;
	justify-content:center;
	gap:			32px;
	text-shadow:	0 0 8px black, 0 0 16px black;
}

h1
{
	font-size:		32px;
	font-weight:	normal;
	color:			#d2738a;
}

ul
{
	list-style:	none;
}

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

/* one row per link, name then description, no boxes, the type does the work */
a, .row
{
	position:			relative;
	display:			grid;
	grid-template-columns:	var(--col, var(--name)) 1fr;
	align-items:		baseline;
	text-decoration:	none;
	color:				inherit;
}

.name	{ color: #e8e8e8; }

/* a group header is a label not a link, so its name sits dimmer than the links under it */
.row .name	{ color: #5c5c5c; }
.row .desc	{ color: #5c5c5c; }

/* a third of a line either side of a group, enough to read as one block without stretching the list */
.group
{
	margin:	12px 0;
}

.group ul
{
	padding-left:	var(--step);
	--col:			calc(var(--name) - var(--step));
}

/* the marker lives in the gutter left of the name, absolute so showing it shifts nothing */
a::before
{
	content:	">";
	position:	absolute;
	left:		-32px;
	color:		#d2738a;
	visibility:	hidden;
}

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

/* the marker and the pink are the focus ring */
a:focus-visible
{
	outline:	none;
}

/* phone, a 16px gutter, the description drops to 16px so it still fits on the name line */
@media (max-width: 800px)
{
	:root
	{
		--name:	128px;
		--step:	16px;
	}

	main
	{
		width:		auto;
		padding:	48px 16px;
	}

	.desc		{ font-size: 16px; }
	a::before	{ left: -16px; }
}
