:root {
	--ink: #232033;
	--paper: #f4efe3;
	--paper-2: #e9e1cd;
	--orange: #ff4f00;
	--egyptian: #1034a6;
	--gold: #ffd700;
	--sky: #9cc3df;
	--sign: Futura, Jost, "Century Gothic", "Trebuchet MS", sans-serif;
	--ui: B612, "Helvetica Neue", Arial, sans-serif;
	--mono: "B612 Mono", Menlo, monospace;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	height: 100%;
	overflow: hidden;
	background: var(--sky);
	color: var(--ink);
	font-family: var(--ui);
	-webkit-font-smoothing: antialiased;
	overscroll-behavior: none;
}

canvas {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	touch-action: none;
}

button,
input {
	font: inherit;
	color: inherit;
}

.plate,
.search,
.rooms,
.zoom,
.card {
	position: fixed;
	z-index: 2;
}

.plate {
	top: 16px;
	left: 16px;
	background: var(--paper);
	border: 2px solid var(--ink);
	border-radius: 4px;
	padding: 8px 11px 9px;
	box-shadow: 3px 3px 0 rgb(35 32 51 / 0.85);
	max-width: min(262px, calc(100vw - 32px));
}

.back {
	display: inline-block;
	margin-bottom: 8px;
	padding: 5px 9px 4px;
	background: var(--paper);
	border: 1.5px solid var(--ink);
	border-radius: 3px;
	font-family: var(--sign);
	font-weight: 700;
	font-size: 10.5px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ink);
	text-decoration: none;
}

.back:hover {
	background: var(--ink);
	color: var(--paper);
}

.back[hidden] {
	display: none;
}

.wordmark {
	all: unset;
	cursor: pointer;
	font-family: var(--sign);
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 0.2em;
	line-height: 1;
	color: var(--egyptian);
	display: block;
}

.wordmark::after {
	content: "";
	display: block;
	height: 2px;
	margin-top: 5px;
	background: linear-gradient(
		90deg,
		var(--orange) 0 60%,
		var(--gold) 60% 80%,
		var(--egyptian) 80%
	);
}

.nameline {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
}

.help {
	flex: none;
	width: 18px;
	height: 18px;
	margin-top: -2px;
	padding: 0;
	border: 1.5px solid var(--ink);
	border-radius: 50%;
	background: var(--paper);
	font-family: var(--sign);
	font-weight: 700;
	font-size: 11px;
	line-height: 1;
	cursor: pointer;
}

.help:hover {
	background: var(--ink);
	color: var(--paper);
}

.welcome {
	width: min(420px, calc(100vw - 32px));
	padding: 22px 24px 20px;
	background: var(--paper);
	color: var(--ink);
	border: 2px solid var(--ink);
	border-radius: 6px;
	box-shadow: 6px 6px 0 rgb(35 32 51 / 0.85);
}

.welcome::backdrop {
	background: rgb(35 32 51 / 0.35);
}

.welcome h2 {
	margin: 0 0 10px;
	font-family: var(--sign);
	font-weight: 700;
	font-size: 22px;
	line-height: 1.15;
	color: var(--egyptian);
}

.welcome h2::after {
	content: "";
	display: block;
	width: 120px;
	height: 3px;
	margin-top: 8px;
	background: linear-gradient(
		90deg,
		var(--orange) 0 60%,
		var(--gold) 60% 80%,
		var(--egyptian) 80%
	);
}

.welcome p {
	margin: 0 0 10px;
	font-size: 14px;
	line-height: 1.5;
}

.welcome .how {
	color: #5d5a6b;
	font-size: 13px;
}

.welcome-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 16px;
}

.tour {
	margin: 0;
	background: var(--orange);
	color: var(--paper);
	border: 2px solid var(--ink);
	border-radius: 3px;
	padding: 4px 8px 3px;
	font-family: var(--sign);
	font-weight: 700;
	font-size: 10px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	cursor: pointer;
}

.actions {
	margin-top: 7px;
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.tour.alt {
	background: var(--paper);
	color: var(--ink);
}

.tour:active {
	transform: translate(1px, 1px);
}

.tour:focus-visible,
.help:focus-visible {
	outline: 2px solid var(--egyptian);
	outline-offset: 2px;
}

.welcome:focus {
	outline: none;
}

.welcome-actions .tour {
	font-size: 12px;
	padding: 7px 12px 6px;
}

.search {
	top: 16px;
	right: 16px;
	width: min(320px, calc(100vw - 32px));
}

.search input {
	width: 100%;
	background: var(--paper);
	border: 2px solid var(--ink);
	border-radius: 4px;
	padding: 9px 36px 9px 12px;
	box-shadow: 4px 4px 0 rgb(35 32 51 / 0.85);
	outline: none;
	font-size: 14px;
}

.search input:focus {
	border-color: var(--egyptian);
}

.search kbd {
	position: absolute;
	right: 10px;
	top: 9px;
	font-family: var(--mono);
	font-size: 12px;
	border: 1px solid #8a8696;
	border-radius: 3px;
	padding: 0 5px;
	color: #6b6878;
	pointer-events: none;
}

.search ol,
.rooms ol {
	list-style: none;
	margin: 8px 0 0;
	padding: 4px;
	background: var(--paper);
	border: 2px solid var(--ink);
	border-radius: 4px;
	box-shadow: 4px 4px 0 rgb(35 32 51 / 0.85);
	max-height: min(60vh, 460px);
	overflow-y: auto;
}

.search li button,
.rooms li button {
	all: unset;
	box-sizing: border-box;
	display: block;
	width: 100%;
	padding: 7px 9px;
	border-radius: 3px;
	cursor: pointer;
	font-size: 13px;
	line-height: 1.3;
}

.search li button small,
.rooms li button small {
	display: block;
	font-family: var(--mono);
	font-size: 10.5px;
	color: #6b6878;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.search li button:hover,
.search li button[aria-selected="true"],
.rooms li button:hover {
	background: var(--paper-2);
}

.rooms {
	left: 16px;
	bottom: 16px;
	display: flex;
	flex-direction: column-reverse;
	align-items: flex-start;
}

.rooms ol {
	margin: 0 0 8px;
	min-width: 250px;
}

.rooms > button,
.zoom button {
	background: var(--paper);
	border: 2px solid var(--ink);
	border-radius: 4px;
	box-shadow: 4px 4px 0 rgb(35 32 51 / 0.85);
	cursor: pointer;
}

.rooms > button {
	font-family: var(--sign);
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	font-size: 13px;
	padding: 9px 14px;
}

.rooms > button[aria-expanded="true"] {
	background: var(--ink);
	color: var(--paper);
}

.zoom {
	right: 16px;
	bottom: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.zoom button {
	width: 40px;
	height: 40px;
	font-size: 22px;
	line-height: 1;
	font-family: var(--mono);
}

.rooms > button:active,
.zoom button:active {
	transform: translate(2px, 2px);
	box-shadow: 2px 2px 0 rgb(35 32 51 / 0.85);
}

.card {
	width: min(340px, calc(100vw - 32px));
	background: var(--paper);
	border: 2px solid var(--ink);
	border-radius: 4px;
	box-shadow: 5px 5px 0 rgb(35 32 51 / 0.85);
	padding: 14px 16px 15px;
}

.card .where {
	margin: 0 0 4px;
	font-family: var(--mono);
	font-size: 10.5px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--orange);
}

.card h2 {
	margin: 0 28px 6px 0;
	font-family: var(--sign);
	font-size: 20px;
	line-height: 1.15;
	font-weight: 700;
	color: var(--egyptian);
}

.card p {
	margin: 0;
	font-size: 13.5px;
	line-height: 1.5;
}

.card a {
	display: inline-block;
	margin-top: 10px;
	font-size: 13px;
	color: var(--ink);
	text-decoration-color: var(--orange);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

.card a[hidden] {
	display: none;
}

.card-tour {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 14px;
	padding-top: 10px;
	border-top: 1.5px dashed #b9b2a3;
}

.card-tour[hidden] {
	display: none;
}

.card-tour .step {
	margin-right: auto;
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.06em;
	color: #6b6878;
}

.card-tour button {
	background: var(--paper);
	color: var(--ink);
	border: 1.5px solid var(--ink);
	border-radius: 3px;
	padding: 5px 9px 4px;
	font-family: var(--sign);
	font-weight: 700;
	font-size: 10.5px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	cursor: pointer;
}

.card-tour button.primary {
	background: var(--orange);
	color: var(--paper);
}

.card-tour button:disabled {
	opacity: 0.35;
	cursor: default;
}

.card .close {
	all: unset;
	position: absolute;
	top: 8px;
	right: 10px;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 2px 4px;
}

.loading {
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
	background: var(--sky);
	z-index: 5;
	transition: opacity 0.4s;
}

.spinner {
	width: 34px;
	height: 34px;
	border: 4px solid rgb(244 239 227 / 0.6);
	border-top-color: var(--orange);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.loading.done {
	opacity: 0;
	pointer-events: none;
}

body.shot .plate,
body.shot .search,
body.shot .rooms,
body.shot .zoom,
body.shot .loading {
	display: none;
}

@media (max-width: 640px) {
	.plate {
		max-width: min(280px, calc(100vw - 32px));
	}

	.search {
		top: auto;
		bottom: 16px;
		left: 76px;
		right: 68px;
		width: auto;
	}

	.search ol {
		position: absolute;
		bottom: 52px;
		left: 0;
		right: 0;
	}

	.search kbd {
		display: none;
	}

	.rooms > button {
		width: 52px;
		padding: 9px 0;
		font-size: 0;
	}

	.rooms > button::before {
		content: "☰";
		font-size: 18px;
	}

	.zoom button {
		width: 40px;
		height: 40px;
	}

	.zoom {
		bottom: 16px;
	}

	.zoom #zoom-out {
		display: none;
	}

	.card {
		left: 16px;
		right: 16px;
		top: auto;
		bottom: 76px;
		width: auto;
	}
}
