/* biome-ignore lint/style/noExcessiveLinesPerFile: the page intentionally keeps its visual system in one stylesheet */
@font-face {
	font-family: "M PLUS 1p";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("/fonts/mplus-1p-latin-400.woff2") format("woff2");
}

@font-face {
	font-family: "M PLUS 1p";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("/fonts/mplus-1p-latin-700.woff2") format("woff2");
}

:root {
	color-scheme: dark;
	font-family: var(--font-site);
	font-synthesis: none;
	background: rgb(17 16 14);
	color: rgb(245 237 223);
	--font-site: "M PLUS 1p", system-ui, sans-serif;
	--font-dialogue: "Courier New", monospace;
	--page-background: rgb(17 16 14);
	--ink: rgb(245 237 223);
	--muted-ink: rgb(199 188 170);
	--soft-ink: rgb(153 143 128);
	--media-new-bark: rgb(111 156 139);
	--media-rotation: rgb(181 143 103);
	--dialogue-outer: rgb(26 24 21);
	--dialogue-trim: rgb(176 140 92);
	--dialogue-separator: rgb(41 36 31);
	--dialogue-accent: rgb(133 148 158);
	--dialogue-highlight: rgb(214 222 227);
	--dialogue-surface: rgb(247 242 231);
	--dialogue-text: rgb(90 90 82);
	--dialogue-shadow: rgb(173 189 189);
	--focus: rgb(232 201 143);
	--hg-tag: rgb(198 156 94);
	--ss-tag: rgb(151 172 190);
}

* {
	box-sizing: border-box;
}

html {
	background: var(--page-background);
	scroll-behavior: smooth;
}

body {
	margin: 0;
	overflow-x: hidden;
	background: var(--page-background);
}

button,
a {
	font: inherit;
}

h1,
h2,
p,
ul {
	margin: 0;
}

ul {
	padding: 0;
}

.story {
	--breakout-progress: 0;
	--contained-width: min(256px, max(1px, 100vw - 48px));
	--contained-height: calc(var(--contained-width) * 0.75);
	--stage-inset-top: max(
		0px,
		min(
			calc(40svh - var(--contained-height) / 2),
			calc(100svh - var(--contained-height))
		)
	);
	--stage-inset-right: max(0px, calc((100vw - var(--contained-width)) / 2));
	--stage-inset-bottom: max(
		0px,
		calc(100svh - var(--stage-inset-top) - var(--contained-height))
	);
	--stage-inset-left: max(0px, calc((100vw - var(--contained-width)) / 2));
	position: relative;
	background: var(--page-background);
}

.story__visual {
	position: sticky;
	z-index: 0;
	top: 0;
	height: 100svh;
	overflow: hidden;
	pointer-events: none;
	isolation: isolate;
}

.scene-surface,
.device-frame {
	position: absolute;
	top: var(--stage-inset-top);
	right: var(--stage-inset-right);
	bottom: var(--stage-inset-bottom);
	left: var(--stage-inset-left);
}

.scene-surface {
	overflow: hidden;
	background: var(--media-new-bark);
	transition: background-color 160ms ease;
}

.scene-surface[data-media="rotation"] {
	background: var(--media-rotation);
}

.device-frame {
	z-index: 2;
	border: clamp(0.5rem, 1.2vw, 0.85rem) solid rgb(38 35 31);
	outline: 2px solid rgb(119 128 120);
	outline-offset: -0.35rem;
	box-shadow:
		0 1.5rem 3rem rgb(0 0 0 / 38%),
		0 0 0 0.45rem rgb(23 21 19);
	opacity: calc(1 - var(--breakout-progress));
	transition: opacity 120ms linear;
}

.story__beats {
	position: relative;
	z-index: 1;
	margin-top: -100svh;
}

.story__beat {
	display: grid;
	position: relative;
	min-height: 100svh;
	padding: clamp(1.25rem, 4vw, 4rem);
}

.story__beat--intro {
	--intro-offset: clamp(2rem, 8svh, 5rem);
	align-content: start;
	justify-items: center;
	padding-top: var(--intro-offset);
}

.intro-copy {
	display: grid;
	gap: 0.4em;
	position: sticky;
	top: var(--intro-offset);
	align-self: start;
	max-width: min(94vw, 64rem);
	opacity: clamp(0, calc(1 - (var(--breakout-progress) - 0.3) * 4), 1);
	text-align: center;
}

.intro-copy__games {
	display: block;
	color: var(--ink);
	font-family: var(--font-site);
	font-size: clamp(2rem, 3.6vw, 3.25rem);
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0;
	text-shadow: 0 2px 4px rgb(0 0 0 / 40%);
}

.intro-copy__and {
	color: var(--ink);
	font-size: 0.72em;
	font-weight: 400;
	font-style: normal;
	margin-inline: 0.12em;
}

.intro-copy__tagline {
	display: block;
	color: var(--ink);
	font-family: var(--font-site);
	font-size: clamp(1.4rem, 2.7vw, 2.5rem);
	font-style: normal;
	font-weight: 400;
	line-height: 1.15;
	letter-spacing: 0;
	text-shadow: 0 2px 4px rgb(0 0 0 / 40%);
}

.story__breakout-gap {
	height: 35svh;
}

.story__beat--payoff {
	align-items: center;
	justify-items: center;
	padding-bottom: clamp(4rem, 10svh, 8rem);
}

.payoff-copy {
	position: relative;
	z-index: 1;
	max-width: min(94vw, 90rem);
	color: var(--ink);
	font-family: var(--font-site);
	font-size: clamp(1.8rem, 4vw, 3.5rem);
	font-style: normal;
	font-weight: 400;
	letter-spacing: 0;
	line-height: 1.2;
	text-align: center;
	text-shadow: 0 2px 4px rgb(0 0 0 / 40%);
}

.payoff-copy em {
	font-style: italic;
	font-synthesis: style;
}

.game-tag {
	text-decoration: none;
}

.game-tag--hg {
	color: var(--hg-tag);
}

.game-tag--ss {
	color: var(--ss-tag);
}

.final-menu h2 {
	max-width: 20ch;
	color: var(--ink);
	font-family: var(--font-site);
	font-size: clamp(2rem, 4vw, 3.5rem);
	font-style: normal;
	font-weight: 700;
	letter-spacing: 0;
	line-height: 1.1;
	text-shadow: 0 2px 4px rgb(0 0 0 / 40%);
	text-transform: uppercase;
}

.story__dialogue-region {
	--dialogue-height: clamp(9rem, 22svh, 11rem);
	--dialogue-bottom: clamp(1.5rem, 4vw, 2.5rem);
	position: relative;
	min-height: 400svh;
	padding: 0 clamp(1rem, 5vw, 3rem);
	padding-top: 45svh;
	padding-bottom: var(--dialogue-bottom);
}

.dialogue-box {
	position: sticky;
	top: calc(100svh - var(--dialogue-height) - var(--dialogue-bottom));
	width: min(90vw, 42.5rem);
	min-height: var(--dialogue-height);
	margin: 0 auto;
	padding: calc(10px + clamp(0.5rem, 1.4vw, 0.75rem))
		calc(10px + clamp(0.9rem, 2vw, 1.25rem));
	border: 2px solid var(--dialogue-outer);
	border-radius: 6px;
	background: var(--dialogue-surface);
	box-shadow:
		inset 0 0 0 2px var(--dialogue-trim),
		inset 0 0 0 4px var(--dialogue-separator),
		inset 0 0 0 6px var(--dialogue-accent),
		inset 0 0 0 8px var(--dialogue-highlight),
		4px 4px 0 var(--dialogue-outer);
	color: var(--dialogue-text);
}

.dialogue-box__semantic {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.dialogue-box__semantic ul {
	padding: 0;
	list-style: none;
}

.dialogue-box__visual {
	display: flex;
	flex-direction: column;
	gap: 0.4em;
	overflow-wrap: anywhere;
	color: var(--dialogue-text);
	font-family: var(--font-dialogue);
	font-size: clamp(0.95rem, 1.2vw, 1rem);
	font-weight: 700;
	font-style: normal;
	font-kerning: none;
	font-variant-ligatures: none;
	letter-spacing: 0;
	line-height: 1.3;
	text-shadow: 1px 1px 0 var(--dialogue-shadow);
}

.dialogue-box__visual-heading {
	white-space: pre-wrap;
	font-size: clamp(1.05rem, 1.6vw, 1.25rem);
	font-weight: 800;
}

.dialogue-box__visual-body {
	white-space: pre-wrap;
}

.dialogue-box__visual--columns .dialogue-box__visual-body {
	display: grid;
	grid-auto-flow: column;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: repeat(var(--dialogue-list-rows, 1), auto);
	column-gap: 1.25rem;
	row-gap: 0.15em;
}

.dialogue-box__visual-note {
	white-space: pre-wrap;
}

.dialogue-box__visual-note a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.dialogue-box__visual-note a:hover {
	color: var(--dialogue-accent);
}

.final-menu {
	position: relative;
	min-height: 100svh;
	padding: clamp(4rem, 12vw, 9rem) clamp(1.25rem, 7vw, 7rem);
	background: var(--page-background);
}

.final-menu__inner {
	display: grid;
	gap: 1.5rem;
	width: min(100%, 52rem);
	margin: 0 auto;
}

.menu-list {
	display: grid;
	gap: 0.75rem;
	margin-top: 1.5rem;
	list-style: none;
}

.menu-option {
	display: flex;
	align-items: center;
	gap: 1rem;
	width: 100%;
	min-height: 4.5rem;
	padding: 0.85rem 1rem;
	border: 2px solid transparent;
	background: transparent;
	color: var(--ink);
	text-align: left;
	text-decoration: none;
}

.menu-option__cursor {
	flex: 0 0 0;
	width: 0;
	height: 0;
	border-top: 0.4rem solid transparent;
	border-bottom: 0.4rem solid transparent;
	border-left: 0.55rem solid var(--muted-ink);
	transition:
		transform 120ms ease,
		border-left-color 120ms ease;
}

.menu-option__text {
	display: grid;
	gap: 0.25rem;
	font-size: clamp(1.05rem, 2vw, 1.4rem);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.menu-option small {
	color: var(--soft-ink);
	font-size: 0.7em;
	font-weight: 400;
	letter-spacing: 0.12em;
}

.menu-option:disabled {
	cursor: not-allowed;
	opacity: 0.55;
}

.menu-option:not(:disabled):hover,
.menu-option:not(:disabled):focus-visible,
.menu-option:not(:disabled):active {
	border-color: var(--dialogue-accent);
	background: rgb(245 241 231 / 8%);
}

.menu-option:not(:disabled):hover .menu-option__cursor,
.menu-option:not(:disabled):focus-visible .menu-option__cursor,
.menu-option:not(:disabled):active .menu-option__cursor {
	border-left-color: var(--focus);
	transform: translateX(0.35rem);
}

.menu-option:focus-visible {
	outline: 3px solid var(--focus);
	outline-offset: 4px;
}

.disclaimer {
	max-width: 72ch;
	margin-top: 3rem;
	color: var(--soft-ink);
	font-size: 0.9rem;
	font-weight: 400;
	line-height: 1.65;
}

@media (max-width: 600px) {
	.story__beat {
		padding: 1.25rem;
	}

	.intro-copy {
		max-width: 22ch;
	}

	.payoff-copy {
		max-width: 26ch;
	}

	.story__beat--intro {
		--intro-offset: 3rem;
	}

	.story__beat--payoff {
		padding-bottom: 4rem;
	}

	.story__dialogue-region {
		--dialogue-bottom: 1.5rem;
		min-height: 400svh;
		padding-inline: 0.75rem;
		padding-top: 35svh;
	}

	.dialogue-box {
		width: 100%;
		padding: calc(10px + 0.6rem) calc(10px + 0.75rem);
	}

	.dialogue-box__visual {
		font-size: 0.9rem;
		line-height: 1.28;
	}

	.dialogue-box__visual--columns .dialogue-box__visual-body {
		grid-auto-flow: row;
		grid-template-columns: 1fr;
		grid-template-rows: none;
	}

	.menu-option {
		min-height: 4rem;
		padding-inline: 0.5rem;
	}

	.disclaimer {
		margin-top: 2rem;
		font-size: 0.82rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.story__visual {
		position: absolute;
		inset: 0;
		height: 100svh;
	}

	.story__beats {
		margin-top: 0;
	}

	.scene-surface {
		inset: 0;
		background: var(--media-new-bark);
		transition: none;
	}

	.device-frame {
		display: none;
	}

	.intro-copy {
		opacity: 1;
	}

	.menu-option__cursor {
		transition: none;
	}
}
