:root {
	/* The grid unit. Both the CSS grid lines and field.js read this, so they always line up. */
	--cell: 40px;

	--bg: #0d0f14;
	--fg: #e8eaf0;
	--muted: #7d8598;
	--accent: #e0466a;
	--grid: #171b23;

	--mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

@media (max-width: 640px) {
	:root { --cell: 32px; }
}

* { box-sizing: border-box; }

html, body {
	height: 100%;
	margin: 0;
}

body {
	background: var(--bg);
	color: var(--fg);
	font: 400 16px/1.6 var(--mono);
	-webkit-font-smoothing: antialiased;
}

/* Two fixed layers: the grid and its cascade, then a vignette that keeps text legible.
   The grid lines are drawn on the canvas, not in CSS, so they share one origin with the
   cells — a CSS gradient anchors horizontal lines to the bottom edge and drifts out of
   phase with the cells on any viewport height that is not a whole number of cells. */

#field,
.vignette {
	position: fixed;
	inset: 0;
	pointer-events: none;
}

#field {
	z-index: 1;
	width: 100%;
	height: 100%;
}

.vignette {
	z-index: 2;
	background: radial-gradient(ellipse 42% 30% at 50% 46%,
		rgba(13, 15, 20, 0.86) 0%,
		rgba(13, 15, 20, 0.55) 46%,
		rgba(13, 15, 20, 0) 80%);
}

/* A tall narrow screen puts far more of the content outside a wide, shallow ellipse. */
@media (max-width: 640px) {
	.vignette {
		background: radial-gradient(ellipse 82% 28% at 50% 48%,
			rgba(13, 15, 20, 0.9) 0%,
			rgba(13, 15, 20, 0.62) 48%,
			rgba(13, 15, 20, 0) 82%);
	}
}

main {
	position: relative;
	z-index: 3;
	display: grid;
	place-items: center;
	min-height: 100%;
	padding: 6vmin;
	text-align: center;
}

.inner {
	max-width: 34rem;
}

.mark {
	display: block;
	width: 4rem;
	height: 4rem;
	margin: 0 auto 2rem;
	background: var(--accent);
	animation: drift 6s ease-in-out infinite;
}

@keyframes drift {
	0%, 100% { transform: translateY(0) rotate(0deg); }
	50% { transform: translateY(-10px) rotate(90deg); }
}

h1 {
	margin: 0 0 1rem;
	font-size: clamp(1.75rem, 7vw, 2.75rem);
	font-weight: 600;
	letter-spacing: -0.02em;
}

.lede {
	margin: 0;
	color: var(--muted);
	text-wrap: balance;
}

.games {
	margin: 2.5rem 0 0;
	color: var(--muted);
	font-size: 0.8125rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.games span {
	color: var(--fg);
}

footer {
	margin-top: 3rem;
	font-size: 0.8125rem;
	color: var(--muted);
}

a {
	color: var(--fg);
	text-decoration-color: var(--accent);
	text-underline-offset: 3px;
}

a:hover {
	text-decoration-color: var(--fg);
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
	.mark { animation: none; }
}
