/* Design tokens: the DEBUG MODE palette of the channel. Every colour below is one of these. */
:root {
	--bg: #090C18;
	--surface: rgba(236, 240, 250, 0.035);
	--surface-hover: rgba(62, 230, 255, 0.07);
	--line: rgba(236, 240, 250, 0.09);
	--text: #ECF0FA;
	--muted: #6E7A96;
	--text-soft: #C3CDE4;
	--cyan: #3EE6FF;
	--pink: #FF3EA5;
	--glow-cyan: rgba(62, 230, 255, 0.16);
	--glow-pink: rgba(255, 62, 165, 0.11);

	--font-display: "Unbounded", system-ui, sans-serif;
	--font-mono: "JetBrains Mono", ui-monospace, monospace;

	--radius: 18px;
	--page-width: 440px;
	--gutter: 20px;
	--hero-photo-max: 480px;
	--hero-photo: min(100vw, var(--hero-photo-max));
	/* Where the header text starts, as a share of the photo height: the text sits on its faded lower part. */
	--hero-text-start: 0.62;
	--text-shadow: 0 2px 18px rgba(9, 12, 24, 0.9);
	--glyph-opacity: 0.14;
	--glyph-scale: 1;
	--ease: cubic-bezier(0.2, 0.8, 0.2, 1);
	--enter: 0.7s;
	--stagger: 0.06s;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	min-height: 100svh;
	background:
		radial-gradient(60rem 40rem at 10% -10%, var(--glow-cyan), transparent 60%),
		radial-gradient(50rem 40rem at 110% 110%, var(--glow-pink), transparent 60%),
		var(--bg);
	background-attachment: fixed;
	color: var(--text);
	font-family: var(--font-display);
	-webkit-font-smoothing: antialiased;
	overflow-x: clip;
}

.page {
	width: 100%;
	max-width: var(--page-width);
	margin: 0 auto;
	padding: env(safe-area-inset-top) var(--gutter) calc(40px + env(safe-area-inset-bottom));
	display: flex;
	flex-direction: column;
	min-height: 100svh;
}

/* Ambient layer: a few outline glyphs drifting back and forth, behind everything, never in the way. */
.ambient {
	position: fixed;
	inset: 0;
	z-index: -1;
	overflow: hidden;
	pointer-events: none;
}

.glyph {
	position: absolute;
	width: calc(var(--size) * var(--glyph-scale));
	height: calc(var(--size) * var(--glyph-scale));
	background: var(--tint, var(--cyan));
	-webkit-mask: var(--icon) center / contain no-repeat;
	mask: var(--icon) center / contain no-repeat;
	opacity: var(--glyph-opacity);
	animation:
		glyph-in 2.4s var(--ease) both,
		drift var(--duration) ease-in-out var(--delay, 0s) infinite alternate;
}

.glyph-code { --icon: url("/img/ambient/code.svg"); --size: 44px; --duration: 18s; --dx: 34px; --dy: 46px; top: 9%; left: 6%; }
.glyph-gamepad { --icon: url("/img/ambient/gamepad.svg"); --size: 54px; --duration: 22s; --dx: -40px; --dy: 38px; --tint: var(--pink); top: 21%; right: 7%; }
.glyph-neural { --icon: url("/img/ambient/neural.svg"); --size: 50px; --duration: 24s; --dx: 42px; --dy: -44px; --delay: -9s; top: 47%; left: 4%; }
.glyph-chip { --icon: url("/img/ambient/chip.svg"); --size: 40px; --duration: 19s; --dx: -30px; --dy: -42px; --delay: -5s; top: 66%; right: 6%; }
.glyph-terminal { --icon: url("/img/ambient/terminal.svg"); --size: 42px; --duration: 21s; --dx: 36px; --dy: -34px; --tint: var(--pink); --delay: -14s; top: 84%; left: 11%; }
.glyph-mesh { --icon: url("/img/ambient/mesh.svg"); --size: 34px; --duration: 23s; --dx: -32px; --dy: 40px; --delay: -20s; top: 37%; right: 17%; }
.glyph-spark { --icon: url("/img/ambient/spark.svg"); --size: 30px; --duration: 16s; --dx: 26px; --dy: 32px; --delay: -7s; top: 4%; right: 26%; }
.glyph-braces { --icon: url("/img/ambient/braces.svg"); --size: 34px; --duration: 20s; --dx: 30px; --dy: -38px; --tint: var(--pink); --delay: -17s; top: 76%; left: 27%; }

.hero {
	position: relative;
	isolation: isolate;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding-top: calc(var(--hero-photo) * var(--hero-text-start));
	margin-bottom: 28px;
}

/* The photo is a backdrop behind the header: centred on the viewport, dissolving downwards and to the sides.
   Its lower part runs on under the first buttons, which blur it through their glass. */
.hero-photo {
	position: absolute;
	z-index: -1;
	top: 0;
	left: 50%;
	width: var(--hero-photo);
	height: auto;
	aspect-ratio: 1;
	translate: -50% 0;
	object-fit: cover;
	-webkit-mask-image:
		linear-gradient(to bottom, #000 28%, transparent 100%),
		linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
	-webkit-mask-composite: source-in;
	mask-image:
		linear-gradient(to bottom, #000 28%, transparent 100%),
		linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
	mask-composite: intersect;
	animation: settle 1.6s var(--ease) both;
}

.hero-text {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-shadow: var(--text-shadow);
}

.kicker {
	margin: 0 0 10px;
	font-family: var(--font-mono);
	font-size: 12px;
	letter-spacing: 0.04em;
	color: var(--cyan);
}

.name {
	margin: 0;
	font-size: 24px;
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.15;
}

.tagline {
	margin: 8px 0 0;
	max-width: 40ch;
	text-wrap: balance;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.55;
	color: var(--text-soft);
}

.links {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.link {
	display: flex;
	align-items: center;
	gap: 16px;
	min-height: 68px;
	padding: 12px 18px 12px 12px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	color: inherit;
	text-decoration: none;
	transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.link:hover,
.link:focus-visible {
	border-color: var(--cyan);
	background: var(--surface-hover);
	transform: translateY(-1px);
	outline: none;
}

.link:active { transform: scale(0.99); }

.link-icon {
	flex: none;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: var(--surface);
	position: relative;
}

/* The icon file is a plain path; the mask lets it take the text colour and the hover accent. */
.link-icon::after {
	content: "";
	position: absolute;
	inset: 12px;
	background: var(--text);
	-webkit-mask: var(--icon) center / contain no-repeat;
	mask: var(--icon) center / contain no-repeat;
	transition: background-color 0.25s var(--ease);
}

.link:hover .link-icon::after,
.link:focus-visible .link-icon::after { background: var(--cyan); }

.link-text {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.link-title {
	font-size: 15px;
	font-weight: 500;
}

.link-caption {
	font-family: var(--font-mono);
	font-size: 12px;
	color: var(--muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.link-arrow {
	font-family: var(--font-mono);
	color: var(--muted);
	transition: color 0.25s var(--ease), transform 0.25s var(--ease);
}

.link:hover .link-arrow,
.link:focus-visible .link-arrow {
	color: var(--cyan);
	transform: translate(2px, -2px);
}

.foot {
	margin-top: auto;
	padding-top: 40px;
	text-align: center;
	font-family: var(--font-mono);
	font-size: 11px;
	color: var(--muted);
}

.page-error {
	justify-content: center;
	text-align: center;
	align-items: center;
}

.link-back {
	margin-top: 32px;
	min-width: 240px;
	padding-left: 18px;
}

/* Entrance: the header and each button rise in turn. */
.hero, .link, .foot {
	animation: rise var(--enter) var(--ease) both;
}

.link:nth-child(1) { animation-delay: calc(var(--stagger) * 2); }
.link:nth-child(2) { animation-delay: calc(var(--stagger) * 3); }
.link:nth-child(3) { animation-delay: calc(var(--stagger) * 4); }
.link:nth-child(4) { animation-delay: calc(var(--stagger) * 5); }
.link:nth-child(n + 5) { animation-delay: calc(var(--stagger) * 6); }
.foot { animation-delay: calc(var(--stagger) * 7); }

@keyframes drift {
	from { translate: 0 0; rotate: -10deg; }
	to { translate: var(--dx) var(--dy); rotate: 10deg; }
}

@keyframes glyph-in {
	from { opacity: 0; }
}

@keyframes settle {
	from { scale: 1.06; }
	to { scale: 1; }
}

@keyframes rise {
	/* translate, not transform: the hover lift uses transform and must not be pinned by the fill mode. */
	from { opacity: 0; translate: 0 10px; }
	to { opacity: 1; translate: none; }
}

/* Phones: smaller and fewer glyphs, kept off the narrow column's centre. */
@media (max-width: 600px) {
	:root {
		--glyph-scale: 0.6;
		--glyph-opacity: 0.22;
	}

	.glyph-mesh, .glyph-braces, .glyph-spark { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.hero, .link, .foot, .hero-photo, .glyph { animation: none; }
	.link, .link-arrow { transition: none; }
}
