/* ============================================
   STARDUST LABS: LANDING PAGE
   The page is a guitar. Six strings divide it, and the STRDST pick
   (drawn by scripts/landing.js on the #stage canvas) plays each one as
   the reader scrolls. This file must give a complete page with no
   script and with reduced motion, so every animated state has a static
   default here, and motion is added only under .js / .rv-on / .gl.
   ============================================ */

:root {
	--ink: #050508;
	--ink-2: #0b0b12;
	--paper: #f4efe6;
	--soft: rgba(244, 239, 230, 0.76);
	--muted: rgba(244, 239, 230, 0.56);
	--faint: rgba(244, 239, 230, 0.13);
	--gold: #f5a623;
	--gold-hi: #ffd166;
	--steel: #cdd1d9;
	--bronze: #cf9b5c;

	--font-display: 'Outfit', system-ui, -apple-system, sans-serif;
	--font-serif: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
	--font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;

	--ease: cubic-bezier(0.16, 1, 0.3, 1);
	--gutter: clamp(1.25rem, 5vw, 3rem);
	--nav-h: 4rem;
	/* The top inset of the screen (viewport-fit=cover). It is more than zero
	   on a phone that lies on its side. The top bar is taller by that much. */
	--safe-top: env(safe-area-inset-top, 0px);
	--nav-full: calc(var(--nav-h) + var(--safe-top));
	/* The height of the box that holds the live phone while it is pinned: the
	   screen under the nav. svh, so a phone's URL bar cannot cover the caption. */
	--pin-h: calc(100vh - var(--nav-full));
}

@supports (height: 100svh) {
	:root {
		--pin-h: calc(100svh - var(--nav-full));
	}
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	background: var(--ink);
	color-scheme: dark;
	-webkit-text-size-adjust: 100%;
	overflow-x: clip;
}

body {
	margin: 0;
	min-height: 100vh;
	background: var(--ink);
	color: var(--paper);
	font-family: var(--font-body);
	font-size: 1rem;
	line-height: 1.6;
	overflow-x: clip;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p,
ol,
ul,
figure {
	margin: 0;
	padding: 0;
}

img,
svg {
	display: block;
}

a {
	color: inherit;
}

:focus-visible {
	outline: 2px solid var(--gold-hi);
	outline-offset: 4px;
	border-radius: 4px;
}

/* Room light: two fixed, static washes. They never animate. */
body::before {
	content: '';
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background:
		radial-gradient(95% 55% at 84% 16%, rgba(245, 166, 35, 0.075), transparent 66%),
		radial-gradient(90% 55% at -10% 105%, rgba(86, 104, 178, 0.13), transparent 60%);
}

/* Film grain. One static tile, no blend mode, so it costs one layer.

   It is UNDER the top bar (z-index 5 against the bar's 10), and that matters.
   Safari on iOS 26 and later shows the page, blurred, behind the clock, unless
   a solid bar is stuck to the top of the screen: then it carries the colour of
   that bar up under the clock. Safari takes the top-most layer at the top edge
   for that bar. With the grain above the bar it found the grain, which has no
   colour, and the words of the page showed behind the clock. Keep every fixed
   layer under the bar. */
body::after {
	content: '';
	position: fixed;
	inset: 0;
	z-index: 5;
	pointer-events: none;
	opacity: 0.055;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

.skip-link {
	position: absolute;
	left: 1rem;
	top: -4rem;
	z-index: 40;
	padding: 0.6rem 1rem;
	background: var(--gold-hi);
	color: #1a1205;
	font: 600 0.9rem var(--font-display);
	border-radius: 8px;
	text-decoration: none;
}

.skip-link:focus {
	top: 0.75rem;
}

.wrap {
	width: 100%;
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 max(var(--gutter), env(safe-area-inset-right, 0px)) 0
		max(var(--gutter), env(safe-area-inset-left, 0px));
}

/* --- The stage --- */

/* 100lvh, not 100vh or inset:0: on a phone the URL bar hides during a scroll,
   and a canvas that follows it must reallocate its buffer in the middle of the
   scroll, which shows as a stutter. */
.stage {
	position: fixed;
	left: 0;
	top: 0;
	width: 100vw;
	height: 100vh;
	height: 100lvh;
	z-index: 1;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.7s ease;
}

.gl .stage {
	opacity: 1;
}

/* --- Nav --- */

.site-nav {
	position: sticky;
	top: 0;
	z-index: 10;
	/* With viewport-fit=cover a phone on its side puts the page under its
	   cut-out; the bar then keeps its own content clear of the top inset. (This
	   is not what hides the page behind the clock in iOS Safari: see the note
	   at body::after.) */
	padding-top: env(safe-area-inset-top, 0px);
	transition: background-color 0.2s ease;
}

/* The bar is clear over the hero and solid once the page moves. There is no
   backdrop blur: a blur over a canvas that redraws each frame is a cost a
   phone feels. The colour is on the bar itself and it is fully solid, and the
   bar is the top-most layer at the top edge: iOS Safari then carries this
   colour up behind the clock, and the page does not show there. */
.site-nav.is-scrolled,
html:not(.js) .site-nav {
	background-color: var(--ink);
}

.site-nav::before {
	content: '';
	position: absolute;
	inset: 0;
	border-bottom: 1px solid var(--faint);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.site-nav.is-scrolled::before,
html:not(.js) .site-nav::before {
	opacity: 1;
}

.nav-inner {
	position: relative;
}

.nav-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: var(--nav-h);
}

.nav-brand {
	display: inline-flex;
	align-items: center;
	gap: 0.7rem;
	text-decoration: none;
}

.nav-logo {
	width: 30px;
	height: 30px;
	transition: transform 0.5s var(--ease);
}

.nav-brand:hover .nav-logo {
	transform: rotate(72deg);
}

.nav-wordmark,
.footer-brand-name,
.brand-name {
	font-family: var(--font-display);
	font-weight: 700;
	text-transform: uppercase;
}

.nav-wordmark {
	font-size: 0.8rem;
	letter-spacing: 0.26em;
	color: var(--paper);
}

.nav-links {
	display: flex;
	align-items: center;
	gap: clamp(1rem, 3vw, 1.75rem);
}

.nav-link {
	font: 500 0.92rem var(--font-display);
	color: var(--soft);
	text-decoration: none;
	padding: 0.5rem 0;
	transition: color 0.25s ease;
}

.nav-link:hover {
	color: var(--paper);
}

.nav-link-cta {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	color: var(--gold-hi);
}

.nav-link-cta:hover {
	color: #ffe29a;
}

.nav-link-cta svg,
.btn-primary svg {
	width: 1.05em;
	height: 1.05em;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform 0.35s var(--ease);
}

.nav-link-cta:hover svg,
.btn-primary:hover svg {
	transform: translateX(3px);
}

.nav-sound {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.4rem 0.7rem 0.4rem 0.55rem;
	font: 500 0.8rem var(--font-display);
	letter-spacing: 0.04em;
	color: var(--muted);
	background: none;
	border: 1px solid var(--faint);
	border-radius: 999px;
	cursor: pointer;
	transition:
		color 0.25s ease,
		border-color 0.25s ease;
}

.nav-sound[hidden] {
	display: none;
}

.nav-sound:hover {
	color: var(--paper);
	border-color: rgba(244, 239, 230, 0.3);
}

.nav-sound svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.nav-sound .wave-on {
	display: none;
}

.nav-sound[aria-pressed='true'] {
	color: var(--gold-hi);
	border-color: rgba(255, 209, 102, 0.45);
}

.nav-sound[aria-pressed='true'] .wave-on {
	display: inline;
}

.nav-sound[aria-pressed='true'] .wave-off {
	display: none;
}

/* --- Hero --- */

.hero {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: center;
	/* Shorter than the screen on purpose: the low E string shows at the bottom
	   edge, so the first screen already says that there is something to play. */
	min-height: calc(100vh - var(--nav-full) - 5.5rem);
	min-height: calc(100svh - var(--nav-full) - 5.5rem);
	padding: 0.5rem 0 3.25rem;
}

.hero-grid {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.pick-slot {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
}

.hero-pick {
	height: clamp(200px, 35vh, 310px);
	height: clamp(200px, 35svh, 310px);
	margin-bottom: 1.5rem;
}

/* With the live pick up, a sideways drag on its slot turns it. pan-y keeps
   the page scroll for the up-and-down part of the same gesture. */
.gl .pick-slot {
	touch-action: pan-y;
	cursor: grab;
}

.gl .pick-slot:active {
	cursor: grabbing;
}

/* A warm pool of light behind the pick. Static. */
.pick-slot::before {
	content: '';
	position: absolute;
	left: 50%;
	top: 50%;
	width: min(150%, 760px);
	aspect-ratio: 1;
	transform: translate(-50%, -50%);
	background: radial-gradient(
		closest-side,
		rgba(255, 209, 102, 0.1),
		rgba(245, 166, 35, 0.035) 45%,
		transparent 70%
	);
	pointer-events: none;
}

/* The still pick is the whole fallback: no script, reduced motion, no WebGL,
   or a GPU too slow to draw the live one. With the live pick up, it steps back. */
.pick-still {
	position: relative;
	height: 100%;
	width: auto;
	max-width: 100%;
	object-fit: contain;
	transition: opacity 0.5s ease;
}

/* The hero still is the studio's star, a little smaller than its slot. */
.hero-logo {
	height: 84%;
}

.hero-logo.loaded,
.pick-still.loaded {
	filter: drop-shadow(0 28px 44px rgba(0, 0, 0, 0.55));
}

.js .pick-still {
	opacity: 0;
}

.js.no-gl .pick-still {
	opacity: 1;
}

.brand-name {
	font-size: clamp(0.98rem, 1.5vw, 1.12rem);
	letter-spacing: 0.34em;
	/* The tracking adds a gap after the last letter; pull the centre back. */
	margin-right: -0.34em;
	line-height: 1;
	color: var(--steel);
	background: linear-gradient(180deg, #ffffff 10%, #a9aebb 95%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

.hero-slogan {
	margin-top: 1.15rem;
	font-family: var(--font-serif);
	font-style: italic;
	font-weight: 380;
	font-size: min(12.6vw, 6rem);
	line-height: 1;
	letter-spacing: -0.025em;
	color: var(--paper);
	text-wrap: balance;
}

/* Each word sits in a clip box so it can rise into place. The padding keeps
   the italic overhang and the descenders inside the box. */
.hero-slogan .w {
	display: inline-block;
	overflow: hidden;
	padding: 0.08em 0.09em 0.2em 0.02em;
	margin: -0.08em -0.03em -0.2em -0.02em;
	vertical-align: bottom;
}

.hero-slogan .w > span {
	display: inline-block;
}

.hero-sub {
	max-width: 31em;
	margin-top: 1.4rem;
	font-size: clamp(1rem, 1.25vw, 1.12rem);
	line-height: 1.65;
	color: var(--soft);
}

.hero-sub a {
	color: var(--paper);
	text-decoration: underline;
	text-decoration-color: rgba(245, 166, 35, 0.7);
	text-decoration-thickness: 1.5px;
	text-underline-offset: 0.22em;
	transition: color 0.25s ease;
}

.hero-sub a:hover {
	color: var(--gold-hi);
}

.hero-cta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.6rem 1.6rem;
	margin-top: 1.9rem;
}

.btn-primary {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.95rem 1.5rem 0.95rem 1.65rem;
	font: 600 1rem var(--font-display);
	letter-spacing: 0.01em;
	color: #1a1205;
	text-decoration: none;
	background: linear-gradient(180deg, #ffdb7d 0%, #f5a623 100%);
	border-radius: 999px;
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.55),
		0 10px 30px -10px rgba(245, 166, 35, 0.55);
	transition:
		transform 0.35s var(--ease),
		box-shadow 0.35s var(--ease);
}

.btn-primary:hover {
	transform: translateY(-2px);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.6),
		0 16px 36px -10px rgba(245, 166, 35, 0.7);
}

.btn-primary:active {
	transform: translateY(0);
}

.btn-quiet {
	padding: 0.6rem 0.1rem;
	font: 500 0.98rem var(--font-display);
	color: var(--soft);
	text-decoration: underline;
	text-decoration-color: var(--faint);
	text-underline-offset: 0.3em;
	transition:
		color 0.25s ease,
		text-decoration-color 0.25s ease;
}

.btn-quiet:hover {
	color: var(--paper);
	text-decoration-color: var(--gold);
}

/* The cue promises that the scroll plays something, so it shows only when it does. */
.scroll-cue {
	display: none;
}

.js .scroll-cue {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0.4rem;
	display: flex;
	justify-content: center;
	font: 600 0.68rem var(--font-display);
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--muted);
}

.scroll-cue span {
	margin-right: -0.3em;
}

.js .scroll-cue.is-scrolled {
	animation: cue-out 0.5s ease forwards;
}

@keyframes cue-out {
	to {
		opacity: 0;
	}
}

/* --- Strings --- */

/* The strings sit under the stage canvas (z-index 0 against its 1), so the
   pick passes in front of the string that it plays. */
.string {
	position: relative;
	z-index: 0;
	/* Short by default. The zone grows only when the live pick is there to use it. */
	height: 150px;
	--sw: 2;
	--tone: var(--steel);
}

.string svg {
	position: absolute;
	left: 0;
	/* Below the middle: the pick waits above its string, and needs the room. */
	top: 64%;
	width: 100%;
	height: 160px;
	margin-top: -80px;
	overflow: visible;
}

.string path {
	fill: none;
	vector-effect: non-scaling-stroke;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.string-line {
	stroke: var(--tone);
	stroke-width: var(--sw);
	opacity: 0.82;
}

.string-glow {
	stroke: var(--gold-hi);
	stroke-width: calc(var(--sw) * 5 + 4px);
	opacity: 0;
}

.string-name {
	position: absolute;
	left: max(var(--gutter), calc((100vw - 1180px) / 2 + var(--gutter)));
	top: calc(64% - 2rem);
	font: 600 0.72rem var(--font-display);
	letter-spacing: 0.08em;
	color: var(--muted);
}

/* Wound strings (E, A, D) are bronze and heavy; plain strings (G, B, e) are steel. */
.string[data-string='0'] {
	--sw: 3.4;
	--tone: var(--bronze);
	/* The first string shows under the hero, so its line sits high in its zone. */
	height: 170px;
}

.string[data-string='0'] svg {
	top: 76px;
}

/* The note name is CSS content, so the text mirror of the page does not
   carry six stray letters. */
.string-name::before {
	content: attr(data-note);
}

.string[data-string='0'] .string-name {
	top: calc(76px - 2rem);
}

.string[data-string='1'] {
	--sw: 2.8;
	--tone: var(--bronze);
}

.string[data-string='2'] {
	--sw: 2.2;
	--tone: var(--bronze);
}

.string[data-string='3'] {
	--sw: 1.7;
}

.string[data-string='4'] {
	--sw: 1.3;
}

.string[data-string='5'] {
	--sw: 1;
}

.js:not(.no-gl) .string {
	height: clamp(200px, 31vh, 270px);
}

.js:not(.no-gl) .string[data-string='0'] {
	height: 210px;
}

/* --- Meet STRDST --- */

.meet,
.scene-copy,
.finale {
	position: relative;
	z-index: 2;
}

/* The scene itself is not a layer. Its words sit above the stage canvas, and
   its phone slot sits under the canvas, so the 3D phone is in front of the
   pool of light and of the caption that it leaves behind. */
.scene {
	position: relative;
}

.meet {
	padding: clamp(1.5rem, 6vh, 4rem) 0;
}

.eyebrow,
.scene-num {
	font: 600 0.76rem var(--font-display);
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: var(--gold);
}

.meet-title {
	margin-top: 0.9rem;
	font: 700 clamp(3rem, 12.5vw, 7.25rem) / 0.95 var(--font-display);
	letter-spacing: -0.03em;
}

.meet-lead {
	max-width: 21em;
	margin-top: 1.5rem;
	font-family: var(--font-serif);
	font-style: italic;
	font-weight: 360;
	font-size: clamp(1.45rem, 5.6vw, 2.5rem);
	line-height: 1.24;
	letter-spacing: -0.012em;
	color: var(--soft);
}

/* --- Scenes --- */

.scene {
	padding: clamp(1.5rem, 5vh, 3.5rem) 0;
}

.scene-grid {
	display: grid;
	gap: 2.5rem;
}

.scene-title {
	margin: 0.7rem 0 1rem;
	font: 700 clamp(2rem, 7.6vw, 3.5rem) / 1.04 var(--font-display);
	letter-spacing: -0.022em;
}

.scene-desc {
	max-width: 30em;
	font-size: clamp(1.02rem, 1.25vw, 1.12rem);
	line-height: 1.7;
	color: var(--soft);
}

/* --- The app, on a phone --- */

/* The real screens of STRDST. Each one is a plain <img> in a plain figure,
   so these rules alone give a whole page: a drawn phone for every screen, in
   a column on a phone and in a row on a wide screen. That is what a reader
   gets with no script, with reduced motion, or on a GPU that is too slow.

   When the live stage is up (.js, and not .no-gl), the same boxes become the
   slot of the 3D phone that scripts/landing.js draws on the #stage canvas:
   the zone grows tall, its inner box sticks under the nav, the drawn phones
   go clear (they still hold the slot, and their <img> elements are the
   textures), and the scroll moves the 3D phone from screen to screen.

   The numbers below are the proportions of the 3D phone (see PHONE in
   landing.js), so the drawn phone and the live one have one footprint. */
.shots {
	position: relative;
	min-width: 0;
}

.shots-pin {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3.25rem;
}

.shot {
	--pw: min(68vw, 290px);
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 0;
}

.shot-frame {
	position: relative;
	flex: none;
	width: var(--pw);
	aspect-ratio: 960 / 2014.4;
	padding: calc(var(--pw) * 0.01875);
	border: calc(var(--pw) * 0.0135) solid transparent;
	border-radius: 15.6% / 7.45%;
	/* Black glass inside a steel rim. */
	background:
		linear-gradient(#050506, #050506) padding-box,
		linear-gradient(
				128deg,
				#f4f5f8 0%,
				#8a8e99 22%,
				#d5d8df 46%,
				#5f636d 70%,
				#b4b8c2 100%
			)
			border-box;
	box-shadow:
		0 0 110px -30px rgba(255, 209, 102, 0.2),
		0 44px 70px -34px rgba(0, 0, 0, 0.9);
	transform-style: preserve-3d;
	transform: perspective(1100px) rotateY(15deg) rotateX(3deg);
}

.shot:nth-child(even) .shot-frame {
	transform: perspective(1100px) rotateY(-15deg) rotateX(3deg);
}

/* The far edge of the body: a second plate a little behind the first, so the
   turned phone shows a side. */
.shot-frame::before {
	content: '';
	position: absolute;
	inset: calc(var(--pw) * -0.0135);
	border-radius: inherit;
	background: linear-gradient(100deg, #8d919b, #3c3f47 40%, #a5a9b3);
	transform: translateZ(-11px);
}

/* The camera cut-out. */
.shot-frame::after {
	content: '';
	position: absolute;
	left: 50%;
	top: calc(var(--pw) * 0.0457);
	width: calc(var(--pw) * 0.281);
	height: calc(var(--pw) * 0.0833);
	margin-left: calc(var(--pw) * -0.1405);
	border-radius: 999px;
	background: #000;
}

.shot-frame img {
	position: relative;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 13.25% / 6.1%;
	background: #0b0b12;
}

/* A tablet. The same steel and the same glass, in the proportions of the 3D
   tablet (see DEVICES.tablet in landing.js): a thin even border, no cut-out,
   one small camera in the border. */
.shot[data-device='tablet'] {
	--tw: min(92vw, 520px);
}

.shot[data-device='tablet'] .shot-frame {
	width: var(--tw);
	aspect-ratio: 2800 / 1994.6;
	padding: calc(var(--tw) * 0.03214);
	border-width: calc(var(--tw) * 0.005);
	border-radius: 7.14% / 10.03%;
	transform: perspective(1500px) rotateY(-9deg) rotateX(3deg);
}

.shot[data-device='tablet'] .shot-frame::before {
	inset: calc(var(--tw) * -0.005);
	transform: translateZ(-8px);
}

.shot[data-device='tablet'] .shot-frame::after {
	top: calc(var(--tw) * 0.0118);
	width: calc(var(--tw) * 0.0086);
	height: calc(var(--tw) * 0.0086);
	margin-left: calc(var(--tw) * -0.0043);
	background: #10121c;
}

.shot[data-device='tablet'] .shot-frame img {
	border-radius: 3.7% / 5.37%;
}

.shot figcaption {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.3rem;
	margin-top: 1.5rem;
	text-align: center;
}

.shot figcaption b {
	font: 600 0.72rem var(--font-display);
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--gold-hi);
	/* The tracking adds a gap after the last letter; pull the centre back. */
	margin-right: -0.22em;
}

.shot figcaption span {
	max-width: 22em;
	font-size: 0.98rem;
	line-height: 1.45;
	color: var(--soft);
}

.shots-dots {
	display: none;
}

/* The pedal. With no live stage it is a line drawing, plainly an
   illustration, under the pages. Its two buttons belong to the live pedal
   only, so they do not show here. */
.pedal {
	flex: 0 0 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.9rem;
	text-align: center;
}

.pedal-art {
	width: min(60vw, 230px);
	height: auto;
	overflow: visible;
}

.pedal-art path,
.pedal-art circle {
	fill: none;
	stroke: var(--steel);
	stroke-width: 1.5;
	stroke-linejoin: round;
}

.pedal-art .pedal-base {
	fill: rgba(255, 255, 255, 0.03);
}

.pedal-art .pedal-padshape {
	fill: rgba(255, 255, 255, 0.05);
}

.pedal-art .pedal-mark {
	fill: var(--muted);
	stroke: none;
}

.pedal-art .pedal-light {
	fill: var(--gold-hi);
	stroke: none;
}

.pedal-note {
	max-width: 22em;
	font-size: 0.86rem;
	line-height: 1.45;
	color: var(--muted);
}

.pedal-pad {
	display: none;
}

/* The live pedal is in the canvas. The buttons lie over its two pads (the
   script places them), clear, so a tap, a click, Enter and Space all press
   the pad. */
.js:not(.no-gl) .pedal {
	position: absolute;
	inset: 0;
	display: block;
	pointer-events: none;
}

.js:not(.no-gl) .pedal-art,
.js:not(.no-gl) .pedal-note {
	display: none;
}

.gl .pedal-pad {
	position: absolute;
	display: block;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 12px;
	cursor: pointer;
	pointer-events: auto;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}

/* The focus ring of a pad. The button is a clear box, and the pedal is drawn
   on the stage canvas above it, so the outline of the button is hidden where
   the pedal is. One ring element (made by the script) stands above the canvas
   and takes the box of the button that has the keyboard focus. It is under
   the top bar, as every fixed layer is (see body::after). The outline stays
   as a fallback; where both show, they are the same line. */
.gl .pedal-pad:focus-visible {
	outline: 2px solid var(--gold-hi);
	outline-offset: 2px;
	border-radius: 12px;
}

.pedal-ring {
	position: fixed;
	left: 0;
	top: 0;
	z-index: 3;
	box-sizing: border-box;
	border: 2px solid var(--gold-hi);
	border-radius: 14px;
	pointer-events: none;
	opacity: 0;
}

.pedal-ring.is-on {
	opacity: 1;
}

/* The live devices. Every figure of a zone lies in the same cell of the
   pinned box: its slot in the upper row, its caption in the lower row, so
   the captions of a zone share one place whatever the shape of the device. */
.js:not(.no-gl) .shots {
	--ph: min(calc(var(--pin-h) - 9rem), 660px);
	height: calc(var(--pin-h) + var(--run, 25) * 1vh);
}

.js:not(.no-gl) .shots-pin {
	position: sticky;
	top: var(--nav-full);
	display: grid;
	grid-template: minmax(0, 1fr) / minmax(0, 1fr);
	align-items: stretch;
	justify-items: stretch;
	height: var(--pin-h);
	gap: 0;
}

.js:not(.no-gl) .shot {
	--pw: calc(var(--ph) * 0.47657);
	grid-area: 1 / 1;
	display: grid;
	/* One column as wide as the figure, so a device that is wider than its
	   column stands in the middle of it and comes out on both sides. */
	grid-template: minmax(0, 1fr) auto / minmax(0, 1fr);
	justify-items: center;
	align-items: center;
	/* Room for the dots under the caption. */
	padding: 0.75rem 0 2.4rem;
}

.js:not(.no-gl) .shot[data-device='tablet'] {
	/* A tablet lies on its side, so the width of the page is its limit. It may
	   be wider than its column. */
	--tw: min(calc(100vw - 1.5rem), calc(var(--ph) * 1.25));
}

.js:not(.no-gl) .shot-frame {
	opacity: 0;
	transform: none;
}

/* The live device takes the capture from the file, so the browser has no
   need to decode this copy and keep it in memory. */
.js:not(.no-gl) .shot-frame img {
	visibility: hidden;
}

.js:not(.no-gl) .shot figcaption {
	/* Room for two lines of text, so every figure of a zone has one height. */
	min-height: 4.4rem;
	margin-top: 0.6rem;
	opacity: 0;
	transform: translateY(8px);
	transition:
		opacity 0.3s ease,
		transform 0.5s var(--ease);
}

.js:not(.no-gl) .shot.is-on figcaption {
	opacity: 1;
	transform: none;
	transition-delay: 0.12s;
}

/* The still. While the page carries a zone in or out, the reader sees a
   picture of its devices, which the browser moves with the page at the full
   rate of the screen. The live devices take its place while the box is
   pinned (see "stills" in landing.js). */
.shots-still {
	display: none;
}

.js:not(.no-gl) .shots-still {
	position: absolute;
	display: block;
	visibility: hidden;
	pointer-events: none;
}

.js:not(.no-gl) .shots-still.is-on {
	visibility: visible;
}

.gl .shots-pin {
	touch-action: pan-y;
}

.gl .shot.is-on .shot-frame {
	cursor: grab;
}

/* With the live device up, a drag on the slot turns it. The clear image in
   the slot must not start a drag of its own, or a long-press menu. */
.gl .shot-frame img {
	-webkit-user-drag: none;
	-webkit-touch-callout: none;
	user-select: none;
}

.js:not(.no-gl) .shots-dots {
	grid-area: 1 / 1;
	align-self: end;
	justify-self: center;
	display: flex;
	gap: 0.15rem;
	margin-bottom: 0.4rem;
}

.shots-dots button {
	display: grid;
	place-items: center;
	width: 1.75rem;
	height: 1.75rem;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
}

.shots-dots button::before {
	content: '';
	width: 6px;
	height: 6px;
	border-radius: 999px;
	background: rgba(244, 239, 230, 0.3);
	transition:
		width 0.4s var(--ease),
		background-color 0.3s ease;
}

.shots-dots button:hover::before {
	background: rgba(244, 239, 230, 0.6);
}

.shots-dots button[aria-current='true']::before {
	width: 18px;
	background: var(--gold-hi);
}

/* --- Finale --- */

.finale {
	/* The top padding is a runway: the star lifts out of the pick over this scroll. */
	padding: 14vh 0 clamp(3rem, 7vh, 6rem);
}

.finale-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.finale-pick {
	height: clamp(180px, 29vh, 400px);
	height: clamp(180px, 29svh, 400px);
	margin-bottom: 1.75rem;
}

.finale-title {
	font-family: var(--font-serif);
	font-style: italic;
	font-weight: 380;
	font-size: clamp(2.5rem, 10.4vw, 5.25rem);
	line-height: 1.02;
	letter-spacing: -0.025em;
}

.finale-sub {
	max-width: 27em;
	margin-top: 1.4rem;
	font-size: clamp(1.02rem, 1.25vw, 1.12rem);
	line-height: 1.65;
	color: var(--soft);
}

/* --- Footer --- */

.site-footer {
	position: relative;
	z-index: 2;
	border-top: 1px solid var(--faint);
	padding: 1.75rem 0 2.25rem;
}

.footer-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 1.5rem;
}

.footer-brand {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	text-decoration: none;
}

.footer-logo {
	width: 24px;
	height: 24px;
}

.footer-brand-name {
	font-size: 0.74rem;
	letter-spacing: 0.26em;
	color: var(--soft);
}

.footer-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1.5rem;
	font: 500 0.88rem var(--font-display);
	color: var(--muted);
}

.footer-links a {
	color: var(--soft);
	text-decoration: none;
	padding: 0.4rem 0;
	transition: color 0.25s ease;
}

.footer-links a:hover {
	color: var(--gold-hi);
}

/* --- Wide screens --- */

@media (max-width: 719px) {
	.nav-wordmark,
	.nav-sound-label {
		display: none;
	}

	.nav-sound {
		padding: 0.45rem;
	}
}

/* A phone with its browser bars showing has about 660px of height. Give some
   of the pick back, so the call to action and the scroll cue stay on the first screen. */
@media (max-width: 719px) and (max-height: 720px) {
	.hero {
		padding-bottom: 2.75rem;
	}

	.hero-pick {
		height: clamp(170px, 29vh, 230px);
		height: clamp(170px, 29svh, 230px);
		margin-bottom: 1.1rem;
	}

	.hero-sub {
		margin-top: 1.1rem;
	}

	.hero-cta {
		margin-top: 1.4rem;
	}
}

@media (min-width: 900px) {
	.hero {
		padding-bottom: 4rem;
	}

	.hero-grid {
		display: grid;
		grid-template-columns: minmax(0, 1.22fr) minmax(0, 0.78fr);
		align-items: center;
		gap: 2rem;
		text-align: left;
	}

	.hero-copy {
		order: 1;
	}

	.hero-pick {
		order: 2;
		height: min(64vh, 600px);
		margin-bottom: 0;
	}

	.brand-name {
		margin-right: 0;
	}

	.hero-slogan {
		margin-top: 1.5rem;
		font-size: min(6.5vw, 6.1rem);
	}

	.hero-cta {
		justify-content: flex-start;
		margin-top: 2.4rem;
	}

	.js .scroll-cue {
		justify-content: flex-start;
		padding-left: max(var(--gutter), calc((100vw - 1180px) / 2 + var(--gutter)));
	}

	.scene-grid {
		grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
		align-items: center;
		gap: clamp(3rem, 7vw, 6.5rem);
	}

	.scene.flip .scene-copy {
		order: 2;
	}

	.meet-title {
		margin-top: 1.1rem;
	}

	.shots-pin {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: center;
		align-items: flex-start;
		gap: 2.75rem clamp(1.5rem, 3.5vw, 3rem);
	}

	/* A figure is as wide as its device, so its caption wraps under it, and
	   a zone with many screens stands in rows of two. */
	.shot {
		--pw: min(19vw, 236px);
		flex: none;
		width: var(--pw);
	}

	.shot[data-device='tablet'] {
		width: var(--tw);
	}

	.js:not(.no-gl) .shot {
		width: auto;
	}

	.shot:only-child {
		--pw: min(23vw, 290px);
	}

	/* Three screens or more: smaller, so two stand in a row. */
	.shot:first-child:nth-last-child(n + 3),
	.shot:first-child:nth-last-child(n + 3) ~ .shot {
		--pw: min(14vw, 190px);
	}

	/* The words stay beside a tall column of screens. */
	.scene-copy {
		position: sticky;
		top: calc(var(--nav-full) + 16vh);
		align-self: start;
	}

	/* The live phone holds its place while its screens change, and so do the
	   words next to it. */
	.js:not(.no-gl) .scene-grid {
		align-items: start;
	}

	.js:not(.no-gl) .scene-copy {
		position: sticky;
		top: var(--nav-full);
		display: flex;
		flex-direction: column;
		justify-content: center;
		min-height: var(--pin-h);
	}

	.js:not(.no-gl) .shots {
		--ph: min(calc(var(--pin-h) - 8.5rem), 700px);
	}

	.js:not(.no-gl) .shot[data-device='tablet'] {
		--tw: min(47vw, 680px, calc(var(--ph) * 1.3));
	}

	/* The scene of the tablet and the pedal breaks the even grid: a wide
	   screen has no close look, so the tablet must be large enough to read
	   the chords as it stands. Its words take a narrower column, and the
	   tablet may be wider than its own column. */
	.js:not(.no-gl) .scene-notes .scene-grid {
		grid-template-columns: minmax(0, 3.5fr) minmax(0, 7.5fr);
		gap: clamp(2rem, 4vw, 4rem);
	}

	.js:not(.no-gl) .shots[data-pedal] .shot[data-device='tablet'] {
		--tw: min(60vw, 880px, calc(var(--ph) * 1.25));
	}

	/* On a window that is wider than the page column, the zone of the tablet
	   also takes a part of the free margin on its right (96px at most). Then
	   the tablet comes out of its column by less than the gap, and it does
	   not cover the words beside it. */
	.js:not(.no-gl) .scene-notes .shots {
		margin-right: calc(-1 * clamp(0px, (100vw - 1180px) / 2, 96px));
	}

	/* The drawn tablet and the drawn phone stand in one row. */
	.shot[data-device='tablet'] {
		--tw: min(23vw, 310px);
	}

	.shot[data-device='tablet'] ~ .shot {
		--pw: min(11vw, 150px);
	}

	.js:not(.no-gl) .string {
		height: clamp(200px, 30vh, 280px);
	}

	.finale-pick {
		height: clamp(260px, 40vh, 420px);
		height: clamp(260px, 40svh, 420px);
		margin-bottom: 2.25rem;
	}
}

/* --- Motion. Everything below adds movement to a page that is already whole. --- */

@media (prefers-reduced-motion: no-preference) {
	/* The hero writes itself in on load. These are CSS animations with a visible
	   end state, so they need the .js class only to avoid a flash with no script. */
	.js .brand-name,
	.js .hero-sub,
	.js .hero-cta,
	.js .scroll-cue,
	.js .site-nav {
		animation: rise-in 1s var(--ease) both;
	}

	.js .site-nav {
		animation-name: fade-in;
		animation-delay: 0.1s;
	}

	.js .brand-name {
		animation-delay: 0.25s;
	}

	.js .hero-slogan .w > span {
		animation: word-up 1.05s var(--ease) both;
		animation-delay: calc(0.42s + var(--i, 0) * 0.085s);
	}

	.hero-slogan .w:nth-child(2) > span {
		--i: 1;
	}

	.hero-slogan .w:nth-child(3) > span {
		--i: 2;
	}

	.hero-slogan .w:nth-child(4) > span {
		--i: 3;
	}

	.hero-slogan .w:nth-child(5) > span {
		--i: 4;
	}

	.js .hero-sub {
		animation-delay: 1.05s;
	}

	.js .hero-cta {
		animation-delay: 1.2s;
	}

	.js .scroll-cue {
		animation-name: fade-in;
		animation-delay: 2.2s;
	}

	.scroll-cue span {
		animation: cue 2.6s ease-in-out 3s infinite;
	}

	/* With no live pick, the still one floats a little. */
	.js.no-gl .pick-still {
		animation: bob 7s ease-in-out infinite;
	}

	/* And so do the drawn phones. */
	.js.no-gl .shot-frame {
		animation: shot-float 8s ease-in-out infinite;
	}

	.js.no-gl .shot:nth-child(even) .shot-frame {
		animation-delay: -4s;
	}

	/* Scroll reveals. .rv-on is set by landing.js itself, so a page whose
	   script did not load keeps every line visible. */
	.rv-on .rv {
		opacity: 0;
		transform: translateY(26px);
		transition:
			opacity 0.8s var(--ease),
			transform 0.8s var(--ease);
		transition-delay: calc(var(--d, 0) * 70ms);
	}

	.rv-on .rv.in {
		opacity: 1;
		transform: none;
	}

	.rv-snap .rv {
		transition: none;
	}
}

@keyframes rise-in {
	from {
		opacity: 0;
		transform: translateY(18px);
	}
}

@keyframes fade-in {
	from {
		opacity: 0;
	}
}

@keyframes word-up {
	from {
		transform: translateY(118%) rotate(4deg);
	}
}

@keyframes cue {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0.45;
	}
}

@keyframes shot-float {
	0%,
	100% {
		translate: 0 0;
	}
	50% {
		translate: 0 -9px;
	}
}

@keyframes bob {
	0%,
	100% {
		transform: translateY(0) rotate(-1deg);
	}
	50% {
		transform: translateY(-10px) rotate(1deg);
	}
}

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

	.stage,
	.js .scroll-cue {
		display: none;
	}

	.js .pick-still {
		opacity: 1;
	}
}
