/* Spline It: the website. Easy's colours, from the game's tokens.uss and accent-rating.uss (dr--0). */

@font-face {
	font-family: "Nunito";
	src: url("../assets/fonts/Nunito.ttf") format("truetype");
	font-weight: 200 1000;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Nunito";
	src: url("../assets/fonts/Nunito-BlackItalic.ttf") format("truetype");
	font-weight: 900;
	font-style: italic;
	font-display: block;
}

@font-face {
	font-family: "Nunito Black";
	src: url("../assets/fonts/Nunito-Black.ttf") format("truetype");
	font-weight: 900;
	font-style: normal;
	font-display: swap;
}

:root {
	color-scheme: dark;
	--accent: rgb(90, 202, 255);          /* --color-accent, Easy */
	--accent-deep: rgb(50, 111, 140);     /* --color-accent-deep, Easy */
	--accent-glow: rgba(90, 202, 255, 0.33);
	--on-accent: rgb(20, 32, 41);         /* --color-on-accent, Easy */
	--light: #fff;
	--light-deep: rgb(140, 140, 140);     /* the logo's white letters, their "sombra color" */
	--text: rgb(243, 221, 220);           /* --color-text */
	--text-muted: rgba(243, 221, 220, 0.62);
	--bg-tint: rgb(29, 90, 120);          /* what the grey grid is multiplied with */
	--bg-dark: rgb(6, 16, 23);
	--panel: rgba(8, 20, 28, 0.72);
	--gutter: 16px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
	min-height: 100vh;
	min-height: 100svh;
	background: var(--bg-dark);
	color: var(--text);
	font-family: "Nunito", system-ui, "Noto Sans CJK SC", "Microsoft YaHei", "Yu Gothic", "Malgun Gothic", sans-serif;
	font-weight: 600;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

a { color: inherit; }

/* ---------------------------------------------------------------
 * Background: the game's bg_grid, tinted Easy, drifting up and to the left very slowly.
 * --------------------------------------------------------------- */
.bg {
	position: fixed;
	inset: 0;
	overflow: hidden;
	background: var(--bg-tint);
	z-index: -3;
}

.bg__grid {
	--tile: 840px;
	position: absolute;
	left: 0;
	top: 0;
	width: calc(100% + var(--tile));
	height: calc(100% + var(--tile));
	background-color: var(--bg-tint);
	background-image: url("../assets/img/bg_grid.png");
	background-size: var(--tile) var(--tile);
	background-blend-mode: multiply;
	animation: grid-drift 240s linear infinite;
	will-change: transform;
}

@keyframes grid-drift {
	from { transform: translate3d(0, 0, 0); }
	to { transform: translate3d(calc(-1 * var(--tile)), calc(-1 * var(--tile)), 0); }
}

/* A darker vignette that leads the eye to the middle. */
.vignette {
	position: fixed;
	inset: 0;
	z-index: -2;
	pointer-events: none;
	background:
		radial-gradient(ellipse 62% 58% at 50% 44%, rgba(4, 12, 18, 0) 0%, rgba(4, 12, 18, 0.25) 45%, rgba(4, 12, 18, 0.78) 82%, rgba(3, 8, 12, 0.95) 100%),
		linear-gradient(to bottom, rgba(3, 8, 12, 0.35), rgba(3, 8, 12, 0) 22%, rgba(3, 8, 12, 0) 70%, rgba(3, 8, 12, 0.55));
}

#stage {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: -1;
	pointer-events: none;
}

/* ---------------------------------------------------------------
 * Layout
 * --------------------------------------------------------------- */
.landing {
	display: grid;
	grid-template-rows: 1fr auto auto;
	padding: 0 var(--gutter);
}

.hero {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: clamp(28px, 5vh, 56px);
	/* Leaves the rail its band at the bottom of the screen. */
	padding: 14vh 0 max(140px, 19vh);
}

/* ---------------------------------------------------------------
 * Logo: as in the game. Black Italic, tilted up, a "sombra color" behind every letter, and a soft wave
 * running through the letters (landing.js moves each wrap, so both copies travel together).
 * --------------------------------------------------------------- */
.logo {
	--size: clamp(64px, 13.5vw, 196px);
	margin: 0;
	display: flex;
	align-items: flex-end;
	/* As in the game: the word break is 41px at 196px, the letters overlap by 4px (main-menu.uss). */
	gap: calc(var(--size) * 0.209);
	font-family: "Nunito", sans-serif;
	font-style: italic;
	font-weight: 900;
	font-size: var(--size);
	line-height: 1;
	rotate: -2.5deg;
	user-select: none;
}

.logo__word {
	display: flex;
	align-items: flex-end;
	gap: calc(var(--size) * -0.0204);
	--letter: var(--light);
	--letter-deep: var(--light-deep);
}

.logo__word--accent {
	--letter: var(--accent);
	--letter-deep: var(--accent-deep);
}

.logo__wrap {
	position: relative;
	display: inline-block;
	transform-origin: 50% 100%;
	will-change: transform;
	isolation: isolate;
}

.logo__letter {
	display: block;
	color: var(--letter);
	-webkit-text-stroke: calc(var(--size) * 0.04) var(--letter);
	paint-order: stroke fill;
}

/* The same letter again behind, in the deeper shade, offset down and to the right. Not a filter. */
.logo__letter--shadow {
	position: absolute;
	left: 0;
	top: 0;
	z-index: -1;
	color: var(--letter-deep);
	-webkit-text-stroke-color: var(--letter-deep);
	transform: translate(0.056em, 0.056em);
}

/* ---------------------------------------------------------------
 * Play: a pill in the accent with a "sombra color" (the same pill in the deep shade, offset down and to the
 * right). Pressing it sinks the pill onto its shadow.
 * --------------------------------------------------------------- */
.play {
	--h: clamp(56px, 7.5vh, 72px);
	--drop: clamp(5px, 0.8vh, 7px);
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 14px;
	height: var(--h);
	padding: 0 38px 0 8px;
	border-radius: 999px;
	background: var(--accent);
	color: var(--on-accent);
	text-decoration: none;
	box-shadow: var(--drop) var(--drop) 0 var(--accent-deep), 0 10px 44px var(--accent-glow);
	transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, background-color 0.15s;
	-webkit-tap-highlight-color: transparent;
}

.play:hover, .play:focus-visible {
	background: rgb(122, 213, 255);
	box-shadow: var(--drop) var(--drop) 0 var(--accent-deep), 0 12px 56px rgba(90, 202, 255, 0.5);
	outline: none;
}

.play:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }

/* Sunk: the pill moves onto its shadow, which disappears under it. */
.play:active, .play.is-pressed {
	transform: translate(var(--drop), var(--drop));
	box-shadow: 0 0 0 var(--accent-deep), 0 4px 24px var(--accent-glow);
	transition-duration: 0.05s;
}

.play__chip {
	display: grid;
	place-items: center;
	width: calc(var(--h) - 16px);
	height: calc(var(--h) - 16px);
	border-radius: 999px;
	background: var(--on-accent);
}

.play__chip svg { width: 52%; height: 52%; fill: var(--accent); }

.play__label {
	display: block;
	font-style: italic;
	font-weight: 900;
	font-size: clamp(26px, 3.4vh, 34px);
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

/* ---------------------------------------------------------------
 * The two links, and the legal lines
 * --------------------------------------------------------------- */
.links {
	display: flex;
	justify-content: center;
	gap: 14px;
	padding-bottom: 14px;
}

.pill {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: 46px;
	padding: 0 22px 0 18px;
	border-radius: 999px;
	background: var(--panel);
	border: 2px solid rgba(90, 202, 255, 0.45);
	color: var(--light);
	text-decoration: none;
	font-style: italic;
	font-weight: 900;
	font-size: 18px;
	transition: transform 0.16s cubic-bezier(.2, .9, .3, 1.4), border-color 0.16s, background-color 0.16s;
}

.pill svg { width: 22px; height: 22px; color: var(--accent); }

.pill:hover, .pill:focus-visible {
	transform: scale(1.05);
	border-color: var(--accent);
	background: rgba(14, 38, 52, 0.9);
	outline: none;
}

.pill:active { transform: scale(0.97); }

.legal {
	padding: 4px 0 max(14px, env(safe-area-inset-bottom));
	text-align: center;
	font-size: 13px;
	color: var(--text-muted);
}

.legal__line {
	margin: 4px 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	column-gap: 12px;
	row-gap: 2px;
}

.legal a { color: var(--accent); text-decoration: none; }
.legal a:hover { text-decoration: underline; }

/* The project's separator: a slanted hairline, never a dot or a dash. */
.sep {
	display: inline-block;
	width: 2px;
	height: 0.75em;
	border-radius: 1px;
	background: currentColor;
	opacity: 0.45;
	transform: rotate(15deg);
}

@media (max-width: 560px) {
	.hero { padding-bottom: max(150px, 24vh); }
	.play { padding-right: 28px; }
	.pill { height: 42px; font-size: 16px; padding: 0 18px 0 14px; }
}

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

/* The logo as the boot intro shows it: letters in one line and the banner's spline round them (js/banner.js). */
.banner {
	margin: 0;
	width: min(92vw, 880px);
	line-height: 0;
	user-select: none;
}

.banner canvas { display: block; width: 100%; height: auto; aspect-ratio: 1220 / 380; }
.banner--kit { width: min(92vw, 760px); }


/* The language menu, top right: a pill with a globe that opens a small panel of pills, in the site's type. */
.langmenu {
	position: fixed;
	top: 16px;
	right: 16px;
	z-index: 3;
}

.langmenu__button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 44px;
	padding: 0 14px 0 14px;
	border-radius: 999px;
	border: 2px solid rgba(90, 202, 255, 0.45);
	background: var(--panel);
	color: var(--light);
	font: inherit;
	font-style: italic;
	font-weight: 900;
	font-size: 16px;
	cursor: pointer;
	transition: border-color 0.16s, background-color 0.16s, transform 0.16s cubic-bezier(.2, .9, .3, 1.4);
}

.langmenu__button:hover, .langmenu__button:focus-visible, .is-open .langmenu__button {
	border-color: var(--accent);
	background: rgba(14, 38, 52, 0.92);
	outline: none;
}

.langmenu__button:active { transform: scale(0.97); }
.langmenu__globe, .langmenu__chevron { width: 20px; height: 20px; flex: none; color: var(--accent); }
.langmenu__chevron { width: 16px; height: 16px; transition: transform 0.2s ease-out; }
.is-open .langmenu__chevron { transform: rotate(180deg); }

/* CJK has no italic: draw it upright. */
.langmenu__current[lang="zh"], .langmenu__current[lang="ja"], .langmenu__current[lang="ko"],
.langmenu__list [lang="zh"], .langmenu__list [lang="ja"], .langmenu__list [lang="ko"] { font-style: normal; font-weight: 800; }

.langmenu__list {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	min-width: 100%;
	margin: 0;
	padding: 6px;
	list-style: none;
	border-radius: 22px;
	background: rgba(7, 18, 26, 0.96);
	border: 2px solid rgba(90, 202, 255, 0.45);
	/* "Sombra color": the panel's shadow is the deep accent, offset down and to the right. */
	box-shadow: 5px 5px 0 var(--accent-deep);
	opacity: 0;
	transform: translateY(-6px) scale(0.96);
	transform-origin: top right;
	pointer-events: none;
	visibility: hidden;
	transition: opacity 0.14s ease-out, transform 0.18s cubic-bezier(.2, .9, .3, 1.3), visibility 0s 0.18s;
	outline: none;
}

.is-open .langmenu__list {
	opacity: 1;
	transform: none;
	pointer-events: auto;
	visibility: visible;
	transition-delay: 0s;
}

.langmenu__list li {
	padding: 9px 18px;
	border-radius: 999px;
	color: var(--text);
	font-style: italic;
	font-weight: 900;
	font-size: 16px;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.1s, color 0.1s;
}

.langmenu__list li.is-active { background: rgba(90, 202, 255, 0.2); color: var(--light); }

.langmenu__list li[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }

/* CJK has no italic: draw the page's text upright in those languages. */
html:lang(zh) body *, html:lang(ja) body *, html:lang(ko) body * { font-style: normal; }

/* Text for screen readers and search engines, not drawn. */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}
