body {
	margin: 0;
	overflow: hidden;
	font-family: 'DM Sans', sans-serif;
	background: black;
	color: white;
}

canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;
}


/* UI Panels */
.ui-top-left,
.ui-top-right {
	/* Persistent header: sits above onboarding (30) and camera-error (25)
	   overlays so the logo + About link are always reachable. The About
	   modal (40) and processing overlay (35) still cover the header when
	   they're active. */
	position: fixed;
	z-index: 32;
	padding: 12px;
	font-weight: 400;
}

.ui-bottom {
	position: fixed;
	z-index: 10;
	padding: 12px;
	font-weight: 400;
}

.ui-top-left {
	top: 0;
	left: 0;
	font-size: 18px;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.7);
}

.ui-top-left-link {
	color: white;
	text-decoration: none;
	cursor: pointer;
	background: transparent;
	border: none;
	font: inherit;
	padding: 0;
}

.ui-top-left-link:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ui-top-left-link:focus {
	outline: 2px solid white;
	outline-offset: 2px;
}

.ui-top-right {
	top: 0;
	right: 0;
	font-size: 16px;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.7);
}

.ui-top-right a {
	text-decoration: underline;
	text-underline-offset: 3px;
	color: white;
}

.ui-top-right a:focus {
	outline: 2px solid white;
	outline-offset: 2px;
}

.ui-bottom {
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	justify-content: center;
	align-items: baseline;
}

/* Bottom-bar buttons: borderless text links with text-shadow so they
   read against both dark and bright content. */
.ui-bottom button {
	font-family: 'DM Sans', sans-serif;
	font-size: 14px;
	padding: 8px 12px;
	background: transparent;
	color: white;
	border: none;
	border-radius: 0;
	cursor: pointer;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.7);
	transition: opacity 0.2s ease;
	opacity: 0.65;
}

.ui-bottom button:hover {
	opacity: 1;
}

.ui-bottom button:focus {
	outline: 2px solid white;
	outline-offset: 2px;
}

/* Primary action — full opacity + underline */
.ui-bottom button.btn-primary {
	opacity: 1;
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Secondary text-link buttons */
.ui-bottom button.btn-link {
	font-size: 13px;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Shared overlay button style (modal, camera error, processing cancel).
   Consolidated into one class to avoid triplicating identical CSS. */
.overlay-btn {
	font-family: 'DM Sans', sans-serif;
	font-size: 14px;
	padding: 8px 14px;
	background: transparent;
	color: white;
	border: 1px solid white;
	border-radius: 4px;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.overlay-btn:hover {
	background: white;
	color: black;
}

.overlay-btn:focus {
	outline: 2px solid white;
	outline-offset: 2px;
}

/* Mobile touch targets */
@media (pointer: coarse), (max-width: 768px) {
	.ui-bottom button {
		padding: 10px 12px;
		font-size: 15px;
		min-height: 44px;
	}

	.ui-bottom button.btn-link {
		font-size: 14px;
	}

	.overlay-btn {
		padding: 12px 20px;
		font-size: 16px;
		min-height: 44px;
		min-width: 44px;
	}

	.ui-top-right a {
		display: inline-block;
		padding: 10px 10px 0;
		min-width: 44px;
	}
}

/* Modal */
.modal {
	display: none;
	position: fixed;
	z-index: 40;
	left: 0;
	top: 0;
	width: 100vw;
	height: 100vh;
	background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 90%;
	max-width: 600px;
	transform: translate(-50%, -50%);
	background: #111;
	padding: 24px;
	border-radius: 6px;
	color: white;
	text-align: center;
}

.modal-content h2 {
	margin-top: 0;
	font-size: 22px;
	font-weight: 500;
}

.modal-content p {
	font-size: 16px;
	line-height: 1.6;
}

/* Accessibility: block UI interaction behind modal */
body.modal-open *:not(.modal):not(.modal *) {
	pointer-events: none;
}

.modal-content .credit {
	font-size: 14px;
}

.modal-content .credit a {
	color: white;
	text-decoration: underline;
}

.modal-content .credit a:focus {
	outline: 2px solid white;
	outline-offset: 2px;
}

/* Camera error overlay */
.camera-error {
	display: none;
	position: fixed;
	z-index: 25;
	left: 0;
	top: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(0, 0, 0, 0.9);
	align-items: center;
	justify-content: center;
}

.camera-error-content {
	text-align: center;
	max-width: 500px;
	padding: 24px;
}

.camera-error-content h2 {
	font-size: 22px;
	font-weight: 500;
	margin-bottom: 12px;
}

.camera-error-content p {
	font-size: 16px;
	line-height: 1.6;
	opacity: 0.7;
}

.camera-error-actions {
	margin-top: 24px;
}

/* Recording indicator */
.recording-indicator {
	display: none;
	position: fixed;
	top: 12px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 15;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-family: 'DM Sans', sans-serif;
	color: white;
	pointer-events: none;
}

.rec-dot {
	width: 10px;
	height: 10px;
	background: #e33;
	border-radius: 50%;
	animation: rec-pulse 1s ease-in-out infinite;
}

@keyframes rec-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.3; }
}

/* Screen reader only */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Toast notifications */
.toast {
	position: fixed;
	top: 50px;
	left: 50%;
	transform: translateX(-50%) translateY(-20px);
	z-index: 50;
	background: rgba(0, 0, 0, 0.9);
	color: white;
	font-family: 'DM Sans', sans-serif;
	font-size: 14px;
	padding: 10px 20px;
	border-radius: 6px;
	max-width: min(400px, 85vw);
	text-align: center;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.3s ease, transform 0.3s ease;
	border: 1px solid rgba(255, 255, 255, 0.15);
}

.toast.toast-visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
	pointer-events: auto;
	cursor: pointer;
}

/* Onboarding overlay */
.onboarding {
	display: none;
	position: fixed;
	z-index: 30;
	left: 0;
	top: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(0, 0, 0, 0.95);
	align-items: center;
	justify-content: center;
	overflow-y: auto;
}

.onboarding-content {
	text-align: center;
	max-width: 540px;
	width: 90%;
	padding: 48px 24px;
}

.onboarding-preview {
	width: min(380px, 70vw, 35vh);
	border-radius: 8px;
	margin-bottom: 28px;
}

.onboarding-tagline {
	font-size: clamp(20px, 3vw, 24px);
	font-weight: 500;
	margin-bottom: 12px;
	line-height: 1.4;
}

.onboarding-actions {
	display: flex;
	gap: 12px;
	justify-content: center;
	align-items: stretch;
	margin-top: 32px;
	flex-wrap: wrap;
}

.onboarding-btn {
	font-family: 'DM Sans', sans-serif;
	font-size: 16px;
	padding: 14px 28px;
	background: white;
	color: black;
	border: 1px solid white;
	border-radius: 4px;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	width: 220px;
	transition: background 0.2s ease, color 0.2s ease;
}

.onboarding-btn:hover {
	background: rgba(255, 255, 255, 0.85);
}

.onboarding-btn:focus {
	outline: 2px solid white;
	outline-offset: 2px;
}

.onboarding-btn-secondary {
	background: transparent;
	color: white;
}

.onboarding-btn-secondary:hover {
	background: rgba(255, 255, 255, 0.1);
}

.onboarding-btn-label {
	font-size: 16px;
	font-weight: 500;
}

.onboarding-btn-sub {
	font-size: 13px;
	font-weight: 400;
	opacity: 0.6;
}

.onboarding-btn-secondary .onboarding-btn-sub {
	opacity: 0.5;
}

@media (pointer: coarse), (max-width: 768px) {
	.onboarding-btn {
		min-height: 44px;
	}
}

@media (max-width: 480px) {
	.onboarding-btn {
		width: 100%;
	}
}

/* Processing overlay */
.processing-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.9);
	z-index: 35;
	align-items: center;
	justify-content: center;
}

.processing-content {
	text-align: center;
	max-width: 400px;
	padding: 24px;
}

.processing-content h2 {
	font-size: 22px;
	font-weight: 500;
	margin-top: 0;
	margin-bottom: 12px;
}

.processing-content p {
	font-size: 16px;
	line-height: 1.6;
	margin: 8px 0;
}

.progress-bar-container {
	width: 100%;
	height: 6px;
	background: rgba(255, 255, 255, 0.15);
	border-radius: 3px;
	margin: 16px 0;
	overflow: hidden;
}

.progress-bar {
	height: 100%;
	background: white;
	width: 0%;
	border-radius: 3px;
	transition: width 0.1s ease-out;
}

.processing-content .overlay-btn {
	margin-top: 16px;
}
