@font-face {
	font-family: 'Aspekta';
	src: url('fonts/Aspekta-400.woff2') format('woff2');
	font-weight: 400;
	font-display: swap;
}
@font-face {
	font-family: 'Aspekta';
	src: url('fonts/Aspekta-700.woff2') format('woff2');
	font-weight: 700;
	font-display: swap;
}

:root {
	--night: #0e1a3a;
	--night-deep: #08112a;
	--frost: #e9eefc;
	--mist: #9fb0d9;
	--bulb: #ffc75a;
	--bulb-deep: #e8a52e;
	--holly: #e8344a;
	--line: rgba(159, 176, 217, 0.22);
	color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	min-height: 100vh;
	min-height: 100dvh;
	background: radial-gradient(120% 70% at 50% 0%, #182a5a 0%, var(--night) 55%, var(--night-deep) 100%) fixed;
	background-color: var(--night);
	color: var(--frost);
	font-family: 'Aspekta', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	font-size: 1.0625rem;
	line-height: 1.5;
}

main {
	max-width: 30rem;
	margin: 0 auto;
	padding: max(1rem, env(safe-area-inset-top)) 1rem max(2rem, env(safe-area-inset-bottom));
	text-align: center;
}

/* The house: the one bold thing on the page */
.house { margin: 0 0 1.5rem; }
.house canvas {
	display: block;
	width: 100%;
	height: 12rem;
}
.house figcaption {
	margin-top: 0.5rem;
	font-size: 0.875rem;
	color: var(--mist);
}
body.live .house figcaption::before {
	content: '';
	display: inline-block;
	width: 0.5rem;
	height: 0.5rem;
	margin-right: 0.45rem;
	border-radius: 50%;
	background: var(--holly);
	box-shadow: 0 0 0.6rem var(--holly);
	vertical-align: 0.05em;
}

/* Song */
.song h1 {
	margin: 0;
	font-size: 1.75rem;
	line-height: 1.15;
	font-weight: 700;
	letter-spacing: -0.01em;
	text-wrap: balance;
}
.song p {
	margin: 0.25rem 0 0;
	color: var(--mist);
	min-height: 1.5em;
	text-wrap: balance;
}
.progress {
	height: 2px;
	margin: 1rem auto 0;
	width: 60%;
	background: var(--line);
	border-radius: 1px;
	overflow: hidden;
}
.progress span {
	display: block;
	height: 100%;
	background: var(--bulb);
	transform-origin: left;
	transform: scaleX(0);
}

/* Karaoke: words light up like bulbs as they're sung */
.lyric {
	min-height: 5.6rem;
	margin: 1.5rem 0;
	font-size: 1.75rem;
	line-height: 1.25;
	font-weight: 700;
	letter-spacing: -0.01em;
	text-wrap: balance;
	color: rgba(233, 238, 252, 0.38);
}
.lyric .word { transition: color 120ms linear, text-shadow 120ms linear; }
.lyric .word.sung {
	color: var(--bulb);
	text-shadow: 0 0 0.9rem rgba(255, 199, 90, 0.45);
}

/* Sound */
.listen {
	appearance: none;
	border: 0;
	border-radius: 999px;
	padding: 1rem 3.25rem;
	font: inherit;
	font-size: 1.375rem;
	font-weight: 700;
	color: var(--night-deep);
	background: var(--bulb);
	box-shadow: 0 0 0 0.35rem rgba(255, 199, 90, 0.18), 0 0 2.5rem rgba(255, 199, 90, 0.35);
	cursor: pointer;
}
.listen:active { background: var(--bulb-deep); }

.status { margin: 0 0 1rem; color: var(--frost); }

.slider {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	text-align: left;
	color: var(--mist);
	font-size: 0.9375rem;
}
.slider span { flex: 0 0 auto; min-width: 4.5rem; }
.slider input { flex: 1; accent-color: var(--bulb); min-height: 2.75rem; }

.nudge {
	margin-top: 1rem;
	text-align: left;
	border-top: 1px solid var(--line);
	padding-top: 0.75rem;
	color: var(--mist);
	font-size: 0.9375rem;
}
.nudge summary { cursor: pointer; min-height: 2.75rem; display: flex; align-items: center; }
.nudge p { margin: 0.25rem 0 0.5rem; }
.nudge .slider span { min-width: 11rem; }
.quiet {
	appearance: none;
	background: none;
	border: 1px solid var(--line);
	border-radius: 999px;
	color: var(--frost);
	font: inherit;
	padding: 0.4rem 1rem;
	cursor: pointer;
}

.note {
	margin: 2rem 0 0;
	font-size: 0.875rem;
	color: var(--mist);
}
.offline-note { display: none; }
body.offline .offline-note {
	display: block;
	margin-top: 0.5rem;
	color: var(--bulb);
	font-size: 0.875rem;
}

button:focus-visible, summary:focus-visible, input:focus-visible {
	outline: 2px solid var(--bulb);
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.lyric .word { transition: none; }
}

@media (min-width: 40rem) {
	.song h1, .lyric { font-size: 2.125rem; }
}
