/* The Godot shell: a full-window canvas under the boot loader, the welcome dialog, the tour bar, and the resume hint. */

/* MARK: Page */
html, body {
	height: 100%;
	overflow: hidden;
	background: var(--ink);
}

#canvas {
	position: fixed;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	outline: none;
}

/* MARK: Overlays */
.overlay {
	position: fixed;
	inset: 0;
	z-index: 10;
}

/* Ids outrank `[hidden]`, so every toggled element restates it */
#boot[hidden], #welcome[hidden], #overlay[hidden], #throbber[hidden], #resume[hidden], #tourBar[hidden], #tourStop[hidden] { display: none; }

#boot {
	overflow: auto;
	transition: opacity .6s steps(6);
}

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

#boot a { color: var(--t-cyan); }

/* A pending tag's dots, uncovered one at a time by a cover sliding off them */
/* WARN: Animate only the cover's transform; the compositor keeps that moving while the engine blocks the page, and nothing else would. */
.pending {
	position: relative;
	display: inline-block;
	overflow: hidden;
	vertical-align: top;
}

.pending::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--t-bg);
	will-change: transform;
	animation: pending .75s steps(5) infinite;
}

@keyframes pending { to { transform: translateX(125%); } }

@media (prefers-reduced-motion: reduce) {
	.pending::after { display: none; }
}

#welcome, #overlay {
	display: grid;
	place-items: center;
	padding: 16px;
	overflow: auto;
	background: rgba(29, 30, 27, .35);
}

/* The museum out of focus behind the welcome dialog, the attract tour still gliding through it, and behind the resume hint */
#welcome, #resume {
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

/* MARK: Throbber */
/* The crosshair's white dot with its ink outline, opened into a spinning ring in the same place */
#throbber {
	position: fixed;
	left: 50%;
	top: 50%;
	width: 10px;
	height: 10px;
	margin: -8px 0 0 -8px;
	border: 3px solid #fff;
	border-top-color: transparent;
	border-radius: 50%;
	box-shadow: 0 0 0 1.5px var(--ink), inset 0 0 0 1.5px var(--ink);
	z-index: 10;
	pointer-events: none;
	animation: throb .7s linear infinite;
}

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

/* MARK: Tour bar */
/* A slim panel along the bottom, its stripe in the accent like a panel's bar */
#tourBar {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%);
	z-index: 10;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
	width: min(720px, calc(100% - 32px));
	padding: 10px 12px 10px 0;
	border-bottom-width: 8px;
}

#tourBar .stripe {
	align-self: stretch;
	width: 14px;
	margin: -10px 0;
	background: var(--accent);
	border-right: 3px solid var(--ink);
}

/* The caption wraps to two lines before it is cut */
.tour-caption {
	flex: 1 1 240px;
	min-width: 0;
	font-family: var(--serif);
	font-weight: 700;
	text-transform: uppercase;
}

.tour-label {
	font-family: var(--sans);
	font-weight: 800;
	font-size: 11px;
	letter-spacing: .2em;
	color: var(--accent);
}

#tourTitle {
	font-size: 15px;
	letter-spacing: .12em;
	line-height: 1.3;
	overflow: hidden;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
}

.tour-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

/* The pace keeps one width as it reads 1x, 2x, or 4x */
#tourPace { min-width: 3.5em; justify-content: center; }

/* MARK: Resume hint */
/* The museum out of focus behind a centered tag, letting the press through to the canvas */
#resume {
	position: fixed;
	inset: 0;
	z-index: 10;
	display: grid;
	place-items: center;
	padding: 16px;
	pointer-events: none;
}

#resume .tag-line {
	font-family: var(--sans);
	font-weight: 800;
	letter-spacing: .14em;
	text-transform: uppercase;
	font-size: 13px;
	background: var(--ink);
	color: var(--marble);
	padding: 8px 14px 7px;
	pointer-events: none;
}

/* MARK: Map */
/* The map never scrolls; its frame pans and zooms the plan instead, sized to leave room for the panel's chrome in the window */
.map-body { max-height: none; overflow: hidden; }

.map-view {
	position: relative;
	height: clamp(200px, calc(100vh - 240px), 560px);
	border: 3px solid var(--ink);
	background: var(--marble);
	overflow: hidden;
	touch-action: none;
	cursor: grab;
}

.map-view:active { cursor: grabbing; }

.map-view svg {
	display: block;
	width: 100%;
	height: 100%;
	user-select: none;
}

.map-view text { pointer-events: none; }

.map-view .travel { cursor: pointer; }

.map-view .travel:hover { fill: var(--accent); }

.map-controls {
	position: absolute;
	top: 10px;
	right: 10px;
	display: flex;
	gap: 6px;
}

.map-controls .btn { padding: 6px 12px 5px; min-width: 40px; }

/* The visitor's mark, pointing the way they face */
.map-view .here {
	fill: var(--accent);
	stroke: var(--ink);
	stroke-width: .3;
	pointer-events: none;
}
