/*
	The Meridian's landing page and its 404 (D243) — one stylesheet for the two static pages under
	`apps/player-web/public/meridian/`, which the host router serves at meridian-accretion.orpheusquest.com's ROOT and
	at any path that misses there. The game itself is the app, at `/play`.

	EVERY URL IN THESE PAGES IS ABSOLUTE. The router serves the landing at `/` with the address unchanged (D201) and the
	404 at whatever path missed (D214), so a relative `meridian.css` would resolve against `/` or `/a/b/` and miss. The
	suite (`apps/player-web/src/__tests__/meridian-landing.test.ts`) holds every page to it.

	THE PALETTE IS THE PLATES' OWN, AND NOTHING ELSE (the-meridian.md §7.1): the deep blue-black ground, the cool white
	and warm gray of the hull, cyan running lights, and amber readouts as an accent only. The hero carries the
	mother-of-pearl; the type never does.

	THE TYPE IS THE GAME'S READOUT VOICE. The title is set as the shell's title-screen wordmark is (IBM Plex Mono,
	uppercase, tracked out), the system line as its typed status is, and the prose in the shell's terminal face — the
	Meridian wears the shell's default theme, whose world voice IS the terminal face, so the page reads as the first
	screen of the game rather than a brochure about it. No webfont is fetched: the shell does not self-host a monospace
	face either, so the two resolve to the same face on the same machine.

	CONTRAST, MEASURED (2026-10-10; the method and the script are in docs/operations/2026-10-10-lyra-to-calder-d243.md
	§1.3). Every text token on its ACTUAL backdrop. Over the hero, that is the brightest pixel of the rendered
	picture-under-scrim inside each line box of the token's text, with every glyph made transparent, at fourteen windows
	from 320×568 to 2560×1440, portrait and landscape, both pages. On the plain ground it is the gradient's lighter end.

	  token                where                                    worst    at
	  --ink     #d9dde3    the title, over the hero                 8.20     768×1024
	  --ink     #d9dde3    the two paragraphs, over the hero        8.35     414×896
	  --ink     #d9dde3    the three facts, over the hero           5.81     320×568 (lowest on the page)
	  --cyan    #5fd4e8    the system line, over the hero           8.17     360×640 (the 404's; the landing's 8.84)
	  --ink     #d9dde3    the 404's way home, over the hero        7.97     667×375
	  --ground-deep #05080f the door's label, on its cyan fill       11.52    (the fill is the backdrop, always)
	  --ink-dim #8a9099    the small print, on the plain ground     5.82     (#0b1220, the lighter end)
	  --amber   #f0a840    the focus ring, on its own ground band   9.90     (see `a:focus-visible`)

	Every one is past 4.5 (3.0 for the ring). --ink-dim never sits on the picture: over the hero it could not be
	promised at any scrim that still shows the ship, so the small print lives below it, on the plain ground.
*/

:root {
	/* The ground, deep to less deep (the plates' shadows). The page runs from the one to the other, top to foot. */
	--ground-deep: #05080f;
	--ground: #0b1220;
	/* The hull's cool white, for every word over the picture; its warm gray only on the plain ground. */
	--ink: #d9dde3;
	--ink-dim: #8a9099;
	/* The running lights: the system channel's color (§7.1), the status line and the one button. */
	--cyan: #5fd4e8;
	/*
		The amber readouts, sparingly — two places only: the ticks before the three facts (decoration, no contrast owed)
		and the keyboard's focus ring, which must stand apart from a cyan button it surrounds (3.0:1 is the bar for a
		focus indicator; amber reads 9.90 on the ground and 1.16 against the cyan, so the ring is drawn on a band of
		ground of its own and never against the button's fill — see `a:focus-visible`).
	*/
	--amber: #f0a840;
	/* The scrim's color is the ground's, never black: the shadows of the plates, so the picture darkens into its own sky. */
	--scrim-core: rgb(5 8 15 / 84%);
	--scrim-shoulder: rgb(5 8 15 / 76%);
	--scrim-edge: rgb(5 8 15 / 30%);
	/* The shell's two monospace stacks (apps/player-web/src/styles.css): the title-screen wordmark's, and the terminal's. */
	--font-wordmark: 'IBM Plex Mono', ui-monospace, monospace;
	--font-readout: 'Berkeley Mono', 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
	/* The page's side gutter: 16px at a phone's narrowest, more as the room allows, never under the notch. */
	--gutter: clamp(1rem, 4vw, 2.5rem);
	/*
		The room kept BELOW the words, where the picture's subject shows unobstructed. The hero was composed for a title
		over its quiet upper half and center (the-meridian.md §7.2's prompt), with the ship meeting the structure in the
		lower center — so the words sit high, and this is the part of the picture they leave alone.
	*/
	--subject-room: clamp(9rem, 30svh, 20rem);
	color-scheme: dark;
}

* {
	box-sizing: border-box;
}

html {
	/* The deep end of the ground, so an overscroll above the page shows the sky rather than white. */
	background: var(--ground-deep);
}

body {
	margin: 0;
	min-height: 100vh;
	min-height: 100dvh;
	background: linear-gradient(to bottom, var(--ground-deep), var(--ground));
	color: var(--ink);
	font-family: var(--font-readout);
	font-size: clamp(0.9375rem, 0.9rem + 0.2vw, 1.0625rem);
	line-height: 1.6;
	/* A long word never pushes the page sideways at 320px; it breaks instead. */
	overflow-wrap: break-word;
}

/* ---- the stage: the picture, its scrim, and the words over it ------------------------------------------------- */

/*
	The stage is at least the window's height and grows with the words: on a phone the words are taller than half the
	window, and the subject room below them is added rather than taken out of them, so the page scrolls to the ship
	instead of printing over it. `overflow: clip` keeps the cover-scaled picture from ever widening the page.
*/
.stage {
	position: relative;
	isolation: isolate;
	display: flex;
	flex-direction: column;
	align-items: center;
	min-height: 100vh;
	min-height: 100svh;
	padding: calc(max(var(--gutter), env(safe-area-inset-top)) + clamp(1.25rem, 7vh, 5rem))
		max(var(--gutter), env(safe-area-inset-right)) var(--subject-room) max(var(--gutter), env(safe-area-inset-left));
	overflow: clip;
}

/*
	The hero, as decoration: the words carry every meaning, so the picture has an empty alt and sits behind them.
	`cover` fills any shape of window. Which part survives the crop is the point (§7.2): the meeting of the ship and
	the structure, the ring and the growth are all inside the picture's central third of its width, so a portrait
	phone — which shows about the middle quarter of the width — keeps all three with the default horizontal centring.
	When a very wide window crops the height instead, 72% holds the crop low, on the subject, and gives up empty sky.
*/
.stage__picture {
	position: absolute;
	z-index: -2;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 72%;
}

/*
	The scrim (§7.2: as the shell's title screen has, darkest at the center where the words sit). Its center is the
	words' center, a third of the way down the stage, not the stage's middle; it holds 84–76% through the block of
	type and eases to 30% at the edges, so the picture reads as a place and not a tint. The second layer melts the
	stage's foot into the ground below it, so the small print's plain ground has no seam above it.
*/
.stage__scrim {
	position: absolute;
	z-index: -1;
	inset: 0;
	background:
		radial-gradient(
			ellipse 90% 72% at 50% 36%,
			var(--scrim-core) 0%,
			var(--scrim-shoulder) 55%,
			var(--scrim-edge) 100%
		),
		linear-gradient(to bottom, transparent 86%, var(--ground) 100%);
}

/* ---- the words ------------------------------------------------------------------------------------------------ */

.landing {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	max-width: 40rem;
	text-align: center;
}

/* The title-screen wordmark's own setting (styles.css, `.player-shell__title .player-shell__wordmark`). */
.landing__title {
	margin: 0;
	font-family: var(--font-wordmark);
	font-size: clamp(1.6rem, 5.2vw, 3.4rem);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: 0.2em;
	/* The tracking hangs past the last letter; giving it back keeps the title optically centered. */
	margin-right: -0.2em;
	text-transform: uppercase;
	text-wrap: balance;
}

/* The system channel, as the title screen's typed status is set: small, uppercase, tracked, in the running lights. */
.landing__status {
	margin: 1rem 0 0;
	color: var(--cyan);
	font-size: 0.8125rem;
	line-height: 1.5;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	text-wrap: balance;
}

.landing__prose {
	margin: 2rem 0 0;
	max-width: 36rem;
	text-align: left;
}

.landing__prose p {
	margin: 0;
}

/* The 404's one sentence is a line, not a paragraph, and centers with the title above it. */
.landing__prose--line {
	text-align: center;
}

.landing__prose p + p {
	margin-top: 1rem;
}

/*
	The three facts, as a readout's short list. `role="list"` is in the markup because Safari drops a list's
	semantics once its markers are gone; the ticks are amber and decoration only.
*/
.landing__facts {
	margin: 1.75rem 0 0;
	padding: 0;
	max-width: 36rem;
	width: 100%;
	list-style: none;
	font-size: 0.875rem;
	text-align: left;
}

.landing__facts li {
	position: relative;
	padding-left: 1.5em;
}

.landing__facts li + li {
	margin-top: 0.4rem;
}

.landing__facts li::before {
	content: '';
	position: absolute;
	top: 0.72em;
	left: 0.25em;
	width: 0.55em;
	height: 2px;
	background: var(--amber);
}

/*
	The one door. Filled with the running lights so its label measures against its own fill (10.9) and never against
	the picture; a thumb-sized target. No transition — the page has no motion at all, so `prefers-reduced-motion` has
	nothing to take away.
*/
.landing__wake {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 3rem;
	margin-top: 2.25rem;
	padding: 0.75rem 1.75rem;
	border: 1px solid var(--cyan);
	border-radius: 2px;
	background: var(--cyan);
	color: var(--ground-deep);
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-decoration: none;
	text-transform: uppercase;
}

.landing__wake:hover {
	background: var(--ink);
	border-color: var(--ink);
}

/*
	The keyboard's ring, every link's: amber, 3px outside the link, ON A BAND OF GROUND. Over the picture the backdrop
	beside a ring is whatever the crop puts there, and measured bare (the ring's own pixels, every viewport above) it
	fell to 3.0:1 at worst — the bar exactly, no margin. So the ring carries its own ground, as the island's two-tone
	ring does: the shadow fills 0–7px around the link with the deep ground and the outline is drawn over it at 3–5px,
	so the amber meets the ground on both sides (9.90) whatever the picture does, and the gap keeps it off the cyan.
*/
a:focus-visible {
	outline: 2px solid var(--amber);
	outline-offset: 3px;
	box-shadow: 0 0 0 7px var(--ground-deep);
}

/* The 404's way home, beside the door: a plain link in the hull's white, underlined because it is one. */
.landing__home {
	margin-top: 1.25rem;
	color: var(--ink);
	font-size: 0.8125rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-underline-offset: 0.3em;
}

/* ---- the small print, on the plain ground ---------------------------------------------------------------------- */

/*
	Below the picture, on the ground and nowhere else: --ink-dim measures 5.69 here and could not be promised over the
	hero (see the note at the top). The engine credit is the shell's (`EngineCreditComponent`): the mark and the name,
	small and uppercase, and — like the shell's — not a link.
*/
.colophon {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.85rem;
	padding: 1.5rem max(var(--gutter), env(safe-area-inset-right)) max(2rem, env(safe-area-inset-bottom))
		max(var(--gutter), env(safe-area-inset-left));
	color: var(--ink-dim);
	font-size: 0.75rem;
	line-height: 1.5;
	text-align: center;
}

.colophon p {
	margin: 0;
	max-width: 36rem;
}

.colophon__credit {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	letter-spacing: 0.15em;
	text-transform: uppercase;
}

.colophon__credit img {
	width: auto;
	height: 1.4rem;
}

/* ---- a short, wide window -------------------------------------------------------------------------------------- */

/*
	A phone held sideways (or a laptop window dragged short) has room for neither the subject nor all the words in one
	screen. The words come first and the subject room shrinks to a band, so the page is no longer than it must be and
	the door is one short scroll away rather than a picture's height away.
*/
@media (orientation: landscape) and (max-height: 540px) {
	:root {
		--subject-room: 6rem;
	}

	.stage {
		padding-top: max(var(--gutter), env(safe-area-inset-top));
	}

	.landing__prose {
		margin-top: 1.25rem;
	}

	.landing__facts {
		margin-top: 1.25rem;
	}

	.landing__wake {
		margin-top: 1.5rem;
	}
}
