/*
	The front page. It opens on a video of the city at dusk, drawn from the site's own map, with the promise set large over it and example statuses standing on the skyline like signposts.
	Below it: a live example of the map, how the product works, the intents, what a person controls, and the way in.
	All values come from tokens.css. The markers in the example and in the small pictures are the product's own, from pins.css.
*/

.home-page {
	/* How tall the example map is. */
	--scene-height: clamp(380px, 62vh, 600px);
	/* How wide the page's text runs. */
	--band-width: 74rem;
	/* The space at the page's sides. */
	--gutter: clamp(20px, 4.4vw, 64px);
}

/* On this page the header floats over the video as a pane of navy glass, and the page begins beneath it. */
.home-page .site-header {
	position: absolute;
	top: var(--space-4);
	right: var(--space-4);
	left: var(--space-4);
	height: 58px;
	padding-right: 9px;
	border-radius: 12px;
	background: rgb(20 33 61 / 0.62);
	box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.1);
	-webkit-backdrop-filter: blur(14px) saturate(1.3);
	backdrop-filter: blur(14px) saturate(1.3);
}

/* A one-off notice, such as the one shown after logging out, floats beneath the header in the same way. */
.home-page .notice-bar {
	position: absolute;
	top: 86px;
	right: var(--space-4);
	left: var(--space-4);
	z-index: 9;
	border: 0;
	border-radius: 12px;
	box-shadow: var(--shadow-float);
}

.home-page .account-links > a:not(.plate-link) {
	color: rgb(255 255 255 / 0.88);
}

.home-page .account-links > a:not(.plate-link):hover {
	color: var(--color-surface);
}

/* The opening: video, words, and the example statuses. */

.hero {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: max(100vh, 640px);
	min-height: max(100svh, 640px);
	overflow: hidden;
	background: var(--color-night);
	color: var(--color-surface);
}

.hero-footage {
	position: absolute;
	inset: 0;
}

/* The video always covers the opening, keeping its top edge, where the sky and the skyline are. hero.js relies on this when it works out where a place in the video falls on the page. */
.hero-video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 0;
	filter: saturate(1.12) contrast(1.04);
}

/* The grade: warm light where the sun has gone down, and navy gathering where the words sit so that they can be read over any frame. */
.hero-footage::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		radial-gradient(60% 26% at 58% 15%, rgb(255 196 0 / 0.2), transparent 70%),
		linear-gradient(180deg, rgb(12 22 48 / 0.5) 0%, transparent 16%, transparent 46%, rgb(12 22 48 / 0.8) 74%, var(--color-night) 100%),
		linear-gradient(90deg, rgb(12 22 48 / 0.7) 0%, transparent 55%);
}

.hero-words {
	position: relative;
	z-index: 2;
	width: 100%;
	padding: 0 var(--gutter) clamp(64px, 10vh, 96px);
}

.hero h1 {
	margin-left: -0.05em;
	font-size: clamp(3.5rem, 8.8vw, 8.25rem);
	font-weight: 900;
	letter-spacing: -0.035em;
	line-height: 0.9;
	text-wrap: balance;
}

.hero-lead {
	max-width: 30em;
	margin-top: 26px;
	color: rgb(255 255 255 / 0.88);
	font-size: clamp(1.0625rem, 1.3vw, 1.25rem);
	line-height: 1.5;
}

.hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3);
	margin-top: 30px;
}

/* On navy, the focus ring is yellow so that it can be seen. */
.hero :focus-visible,
.band-ink :focus-visible,
.site-footer :focus-visible {
	outline-color: var(--color-signal);
}

/* Along the bottom edge: the control that stops the video, and what the picture is. */
.hero-foot {
	position: absolute;
	right: var(--gutter);
	bottom: var(--space-4);
	left: var(--gutter);
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-4);
	color: rgb(255 255 255 / 0.66);
	font-size: 0.78125rem;
}

.hero-foot p {
	margin-left: auto;
	text-align: right;
}

.hero-toggle {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	min-height: 32px;
	padding: 0;
	border: 0;
	background: none;
	color: rgb(255 255 255 / 0.84);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.hero-toggle:hover {
	color: var(--color-surface);
}

/* Two bars while the video plays, a triangle while it is stopped. */
.hero-toggle::before {
	content: "";
	box-sizing: content-box;
	width: 3px;
	height: 10px;
	margin-bottom: 2px;
	border-right: 3px solid currentColor;
	border-left: 3px solid currentColor;
}

.hero-toggle[aria-pressed="true"]::before {
	width: 0;
	height: 0;
	border: 0;
	border-top: 5px solid transparent;
	border-bottom: 5px solid transparent;
	border-left: 9px solid currentColor;
}

/*
	The example statuses. Each is a point on the ground, a post rising from it, and a plate at the top of the post, like a street sign.
	Without the script each sits where its place is in the still picture, by its --x and --y, which are percentages of the opening. With it, hero.js moves each one with the video and sets --shift to keep a plate near the edge on the page.
*/
.callouts {
	position: absolute;
	inset: 0;
	z-index: 1;
	margin: 0;
	padding: 0;
	list-style: none;
	pointer-events: none;
}

.callout {
	position: absolute;
	top: calc(var(--y) * 1%);
	left: calc(var(--x) * 1%);
}

.callouts.is-tracked .callout {
	top: 0;
	left: 0;
	will-change: transform;
}

.callout.is-out {
	visibility: hidden;
}

.callout::before {
	content: "";
	position: absolute;
	top: -5px;
	left: -5px;
	width: 10px;
	height: 10px;
	border-radius: var(--radius-round);
	background: var(--intent-color);
	box-shadow: 0 0 0 4px rgb(255 255 255 / 0.22), 0 0 22px 6px var(--intent-color);
}

.callout-stem {
	position: absolute;
	bottom: 0;
	left: -1px;
	width: 2px;
	height: var(--stem);
	background: linear-gradient(180deg, var(--color-surface), rgb(255 255 255 / 0.5));
	transform-origin: bottom;
	animation: callout-rise 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
	animation-delay: var(--delay);
}

.callout-plate {
	position: absolute;
	bottom: var(--stem);
	left: calc(-1px + var(--shift, 0px));
	display: flex;
	align-items: center;
	gap: 9px;
	height: 38px;
	padding: 1px 12px 0 8px;
	border-radius: 6px;
	background: var(--color-surface);
	color: var(--color-ink);
	box-shadow: 0 10px 30px rgb(5 10 30 / 0.5);
	font-size: var(--font-size-body);
	white-space: nowrap;
	animation: callout-post 500ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
	animation-delay: calc(var(--delay) + 420ms);
}

.callout-plate .roundel {
	width: 22px;
	height: 22px;
	font-size: 0.75rem;
}

.callout-plate b {
	font-weight: 700;
}

.callout-what {
	color: var(--color-ink-soft);
}

.callout-plate i {
	margin-left: 2px;
	padding-left: 10px;
	border-left: 1px solid var(--color-line);
	font-style: normal;
	font-weight: 700;
}

/* One of the examples is there only for a narrow screen, where the others fall outside the picture. */
.callout-narrow {
	display: none;
}

@keyframes callout-rise {
	from {
		transform: scaleY(0);
	}
}

@keyframes callout-post {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
}

/* The bands below the opening. */

.band {
	padding: clamp(64px, 9vw, 120px) var(--gutter);
}

.band-surface {
	background: var(--color-surface);
}

.band-ink {
	background: var(--color-ink);
	color: var(--color-surface);
}

.band-inner {
	max-width: var(--band-width);
	margin: 0 auto;
}

.band h2 {
	font-size: clamp(2rem, 4vw, 3.25rem);
	letter-spacing: -0.025em;
	line-height: 1;
}

.band h3 {
	font-size: var(--font-size-title);
	letter-spacing: -0.015em;
}

.band-lead {
	max-width: 36rem;
	margin-top: var(--space-4);
	color: var(--color-ink-soft);
	font-size: 1.125rem;
}

/* The live example: a real map on a plate, with a strip above it saying what it is and the key to its markers beneath. */

.scene {
	position: relative;
	margin-top: var(--space-6);
	border-radius: 12px;
	background: var(--color-surface);
	box-shadow: var(--shadow-float);
	overflow: hidden;
}

.scene-frame {
	position: relative;
	height: var(--scene-height);
	border-top: 1px solid var(--color-line);
	border-bottom: 1px solid var(--color-line);
}

/* Says that the scene is an example, and holds the button that stops and starts it. */
.scene-label {
	padding: var(--space-3) var(--space-4) 10px;
	border-left: 6px solid var(--color-signal);
	font-size: var(--font-size-small);
}

.scene-label .link-button {
	margin-left: var(--space-2);
	font-weight: 800;
	text-decoration: underline;
}

/* The key to the letters and colours on the markers. */
.scene-key {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-2) var(--space-5);
	padding: var(--space-3) var(--space-4);
}

.scene-key p {
	font-weight: 800;
}

.scene-key ul {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2) var(--space-5);
	margin: 0;
	padding: 0;
	list-style: none;
}

.scene-key li {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	font-weight: 600;
}

.scene-key .roundel {
	width: 24px;
	height: 24px;
	font-size: 0.75rem;
}

/* A status's caption, shown beside its marker. It never takes the pointer, so it cannot get between the visitor and the marker they are pointing at. */
.scene-caption,
.scene-caption .maplibregl-popup-content {
	pointer-events: none;
}

.scene-caption .maplibregl-popup-content {
	padding: var(--space-3);
	border-radius: var(--radius-plate);
	box-shadow: var(--shadow-float);
	font-family: var(--font-family);
}

.caption {
	display: grid;
	gap: var(--space-1);
	color: var(--color-ink);
	font-size: var(--font-size-small);
	line-height: 1.35;
}

.caption-who {
	display: flex;
	align-items: center;
	gap: 6px;
}

.caption-who .roundel {
	width: 20px;
	height: 20px;
	font-size: 0.6875rem;
}

.caption-name {
	font-size: var(--font-size-body);
	font-weight: 800;
	overflow-wrap: anywhere;
}

.caption-time {
	margin-left: auto;
	padding-left: var(--space-3);
	color: var(--color-ink-soft);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.caption-body {
	font-size: var(--font-size-body);
}

.caption-place {
	color: var(--color-ink-soft);
}

/* The scene as a plain list, for a browser that cannot draw the map. */
.scene-without-map .scene-frame {
	height: 120px;
}

.scene-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: var(--space-3);
	margin: 0;
	padding: var(--space-4);
	list-style: none;
}

.scene-list-item {
	padding: var(--space-3);
	border-left: 6px solid var(--intent-color);
	border-radius: var(--radius-plate);
	background: var(--color-surface);
}

/* How it works: three stops on one line. The line runs down the page on a narrow screen and across it on a wide one, and ends at the last stop, which is in yellow: it is where the person themselves arrives. */
.route {
	position: relative;
	display: grid;
	margin: var(--space-7) 0 0;
	padding: 0;
	list-style: none;
	counter-reset: stop;
}

.route li {
	position: relative;
	padding: 0 0 var(--space-6) 48px;
	counter-increment: stop;
}

.route li:last-child {
	padding-bottom: 0;
}

/* The stop. */
.route li::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	z-index: 1;
	width: 28px;
	height: 28px;
	border: 6px solid var(--color-ink);
	border-radius: var(--radius-round);
	background: var(--color-surface);
}

.route li:last-child::before {
	background: var(--color-signal);
}

/* The line from this stop to the next. */
.route li::after {
	content: "";
	position: absolute;
	top: 14px;
	bottom: -14px;
	left: 11px;
	width: 6px;
	background: var(--color-ink);
}

.route li:last-child::after {
	display: none;
}

.route-number {
	display: block;
	margin-bottom: var(--space-1);
	color: var(--color-ink-soft);
	font-size: var(--font-size-small);
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.route h3 {
	font-size: 1.5rem;
	line-height: 1.15;
}

.route p {
	max-width: 30em;
	margin-top: 10px;
	color: var(--color-ink-soft);
	font-size: 1rem;
}

/* The intents, set out like the key to a transit map: each line's sign, its name, and where it goes. */
.lines-layout {
	display: grid;
	gap: var(--space-6);
}

.lines {
	display: grid;
	margin: 0;
	padding: 0;
	list-style: none;
}

.lines li {
	position: relative;
	display: grid;
	grid-template-columns: 44px minmax(0, 1fr);
	align-items: center;
	gap: 2px 18px;
	padding: 20px 0;
	border-top: 1px solid var(--color-line);
}

.lines li:last-child {
	border-bottom: 1px solid var(--color-line);
}

/* A faint stretch of the intent's line runs through its sign. */
.lines li::before {
	content: "";
	position: absolute;
	top: -1px;
	bottom: -1px;
	left: 16.5px;
	width: 3px;
	background: var(--intent-color);
	opacity: 0.28;
}

.lines .roundel {
	position: relative;
	grid-row: span 2;
	width: 36px;
	height: 36px;
	font-size: var(--font-size-lead);
}

.lines h3 {
	font-size: 1.1875rem;
	letter-spacing: -0.01em;
}

.lines p {
	grid-column: 2;
	color: var(--color-ink-soft);
}

/* The three things a person controls, each with a small picture made from the product's own markers. */
.controls {
	display: grid;
	gap: var(--space-6);
	margin: var(--space-6) 0 0;
	padding: 0;
	list-style: none;
}

.controls p {
	margin-top: var(--space-2);
	color: var(--color-ink-soft);
	font-size: var(--font-size-lead);
}

.control-figure {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-5);
	height: 148px;
	margin-bottom: var(--space-4);
	border: 1px solid var(--color-line);
	border-radius: var(--radius-plate);
	background: var(--color-surface);
}

/* The markers in these pictures stand still and are not for pressing. */
.control-figure .pin-sign {
	flex: none;
	box-shadow: 0 1px 4px rgb(20 33 61 / 0.25);
}

.control-note {
	color: var(--color-ink);
	font-size: var(--font-size-small);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.control-pair {
	display: grid;
	gap: var(--space-3);
}

.control-match {
	display: grid;
	grid-template-columns: auto 40px auto auto;
	align-items: center;
}

.control-match .control-note {
	margin-left: var(--space-3);
}

.control-link {
	height: 4px;
	background: var(--color-ink);
}

/* Two people who chose different things are not joined. */
.control-match.is-apart .control-link {
	height: 0;
	margin: 0 6px;
	border-top: 4px dotted var(--color-line);
	background: none;
}

.control-match.is-apart .control-note {
	color: var(--color-ink-soft);
}

.control-place {
	display: grid;
	justify-items: center;
	gap: var(--space-2);
}

.control-spot {
	display: grid;
	justify-items: center;
	height: 84px;
	align-content: center;
}

.control-area {
	display: grid;
	place-items: center;
	width: 84px;
	height: 84px;
	border: 1.5px dashed var(--intent-color);
	border-radius: var(--radius-round);
	background: color-mix(in srgb, var(--intent-color) 20%, transparent);
}

/* The way in, at the end of the page. */
.closing .band-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--space-6);
}

.closing h2 {
	font-size: clamp(2.5rem, 6.4vw, 5.5rem);
	font-weight: 900;
	letter-spacing: -0.035em;
	line-height: 0.92;
}

.closing-apps {
	margin-top: var(--space-4);
	color: rgb(255 255 255 / 0.72);
}

.closing-apps .link-button {
	color: var(--color-surface);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.site-footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-3) var(--space-6);
	padding: 22px var(--gutter);
	border-top: 1px solid rgb(255 255 255 / 0.12);
	background: var(--color-ink);
	color: rgb(255 255 255 / 0.66);
	font-size: var(--font-size-small);
}

.site-footer-name {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--color-surface);
	font-size: var(--font-size-body);
	font-weight: 800;
}

.site-footer nav {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2) var(--space-5);
}

.site-footer nav a,
.site-footer nav .link-button {
	font-weight: 600;
	text-decoration: none;
}

.site-footer nav a:hover,
.site-footer nav .link-button:hover,
.site-footer-credit a:hover {
	color: var(--color-surface);
	text-decoration: underline;
}

.site-footer-credit {
	margin-left: auto;
}

@media (min-width: 800px) {
	.route {
		grid-template-columns: repeat(3, 1fr);
	}

	.route li,
	.route li:last-child {
		padding: 48px 40px 0 0;
	}

	.route li::after {
		top: 11px;
		right: -14px;
		bottom: auto;
		left: 14px;
		width: auto;
		height: 6px;
	}

	.lines-layout {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		gap: clamp(32px, 6vw, 96px);
		align-items: start;
	}

	.lines li {
		grid-template-columns: 44px minmax(0, 13em) minmax(0, 1fr);
	}

	.lines .roundel {
		grid-row: auto;
	}

	.lines p {
		grid-column: auto;
	}

	.controls {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* A narrow screen: the header keeps only the way in, the examples lose their middle part so that a plate fits, and the picture's own caption gives way to the control that stops the video. */
@media (max-width: 699px) {
	.home-page .site-header {
		top: 10px;
		right: 10px;
		left: 10px;
		height: 52px;
	}

	.header-extra {
		display: none !important;
	}

	.hero h1 {
		font-size: clamp(3.4rem, 19vw, 5rem);
	}

	.hero-lead {
		margin-top: 18px;
	}

	.hero-actions .button {
		flex: 1;
	}

	.callout-what,
	.callout-wide {
		display: none;
	}

	.callout-narrow {
		display: block;
	}

	.hero-foot p {
		max-width: 16em;
	}

	.site-footer-credit {
		margin-left: 0;
	}
}
