* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 0;
	display: flex;
	justify-content: center;
	min-height: 100vh;
	min-height: 100dvh;
}

.content-container {
	width: 100%;
	height: 100vh;
	height: 100dvh;
	max-width: 430px;
	position: relative;
	overflow: hidden;
	background-color: #fff;
}

canvas {
	border: none;
	outline: none;
}

/* All layers are absolutely positioned */
.layer {
	position: absolute;
	left: 0;
	/* Width set by JS to leave room for temp bar */
}

/* Sky: full height, at bottom (z-index 1) */
.sky-layer {
	bottom: 0;
	z-index: 1;
}

/* Photo: at bottom, centered, sized to skyline height (z-index 2) */
.photo-layer {
	bottom: 0;
	z-index: 2;
	left: 50%;
	transform: translateX(-50%);
}

/* Smog: full height, at bottom (z-index 3) */
.smog-layer {
	bottom: 0;
	z-index: 3;
}

/* Overlay: full height, at bottom (z-index 4) */
.overlay-layer {
	bottom: 0;
	z-index: 4;
	pointer-events: none;
}

/* Indicator canvases */
.indicator {
	position: absolute;
	bottom: 0;
	z-index: 5;
	pointer-events: none;
}

/* Height scale: overlaid on left of main canvas */
.height-indicator {
	left: 0;
	width: 45px;
}

/* Temperature indicator: far right, abutting main canvas */
.temp-indicator {
	right: 0;
}

/* Wind indicator: centered on main canvas */
.wind-indicator {
	/* Position set by JS */
}



/* Controls Container - parent for AQI badge and slider box */
.controls-container {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 10;
	padding: 12px 16px 8px 16px;
	pointer-events: auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

/* AQI Badge - compact horizontal badge */
.aqi-badge {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	border-radius: 20px;
	background-color: #4CAF50;
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
	border: 2px solid rgba(255, 255, 255, 0.3);
	transition: background-color 0.3s ease;
}

.aqi-badge .aqi-value {
	font-family: 'Arial Rounded MT Bold', 'Helvetica Rounded', sans-serif;
	font-size: 24px;
	font-weight: 800;
	color: #fff;
	line-height: 1;
	text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

.aqi-badge .aqi-label {
	font-family: sans-serif;
	font-size: 9px;
	font-weight: 600;
	color: #fff;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	max-width: 60px;
	line-height: 1.2;
}

/* Date/Slider Box - frosted glass effect */
.time-slider-box {
	width: 100%;
	padding: 12px 16px;
	border-radius: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;

	/* Frosted glass effect */
	background: rgba(255, 255, 255, 0.15);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid rgba(255, 255, 255, 0.25);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Date display above slider */
.time-display {
	font-family: sans-serif;
	font-size: 16px;
	font-weight: 600;
	color: rgba(30, 45, 70, 0.9);
	text-align: center;
	text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
	transition: color 0.3s ease;
}

/* Night mode - lighter text for dark backgrounds */
.time-display.night-mode {
	color: rgba(255, 220, 150, 0.95);
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}


/* Tracks wrapper - labels on left, tracks on right */
.slider-tracks-wrapper {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* Track labels - vertical stack */
.track-labels {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex-shrink: 0;
}

.track-label {
	font-family: sans-serif;
	font-size: 9px;
	font-weight: 600;
	color: rgba(40, 50, 70, 0.7);
	text-transform: uppercase;
	letter-spacing: 0.3px;
	line-height: 8px;
	height: 8px;
	transition: color 0.3s ease;
}

/* Night mode for track labels */
.track-labels.night-mode .track-label {
	color: rgba(255, 200, 120, 0.8);
}

.slider-track-container {
	position: relative;
	flex: 1;
	height: 18px;
}

/* Day/night gradient track - top bar */
.day-night-track {
	position: absolute;
	left: 0;
	right: 0;
	height: 8px;
	top: 0;
	border-radius: 4px;
	pointer-events: none;
}

/* AQI color track - bottom bar */
.aqi-track {
	position: absolute;
	left: 0;
	right: 0;
	height: 8px;
	top: 10px;
	border-radius: 4px;
	pointer-events: none;
}

/* Position indicator - thin line spanning both tracks */
.position-indicator {
	position: absolute;
	width: 2px;
	height: 18px;
	background: rgba(255, 255, 255, 0.95);
	top: 0;
	transform: translateX(-50%);
	pointer-events: none;
	box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
	border-radius: 1px;
	z-index: 3;
}

/* Now marker - hidden */
.now-marker {
	display: none;
}

/* Slider track container - holds the dark line and range input */
.slider-line-container {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 2px;
	padding-left: 28px;  /* Align with tracks (skip label width) */
}

/* Dark line the slider moves along */
.slider-line {
	flex: 1;
	height: 4px;
	background: rgba(40, 50, 70, 0.3);
	border-radius: 2px;
	position: relative;
}

/* Night mode for slider line */
.slider-line.night-mode {
	background: rgba(200, 180, 150, 0.3);
}

/* Range input - on top of the dark line */
#timeSlider {
	-webkit-appearance: none;
	appearance: none;
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	transform: translateY(-50%);
	width: 100%;
	height: 20px;
	background: transparent;
	outline: none;
	cursor: pointer;
}

/* Webkit (Chrome, Safari, Edge) */
#timeSlider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 28px;
	height: 20px;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 20'%3E%3Cpath d='M8 10l3-4v8l-3-4z' fill='%23888'/%3E%3Cpath d='M20 10l-3-4v8l3-4z' fill='%23888'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	border-radius: 10px;
	cursor: ew-resize;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
	border: 2px solid rgba(100, 150, 255, 0.7);
	transition: transform 0.1s ease;
}

#timeSlider::-webkit-slider-thumb:active {
	transform: scale(1.08);
}

/* Firefox */
#timeSlider::-moz-range-thumb {
	width: 28px;
	height: 20px;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 20'%3E%3Cpath d='M8 10l3-4v8l3-4z' fill='%23888'/%3E%3Cpath d='M20 10l-3-4v8l3-4z' fill='%23888'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	border-radius: 10px;
	cursor: ew-resize;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
	border: 2px solid rgba(100, 150, 255, 0.7);
}

.time-labels {
	display: flex;
	justify-content: space-between;
	margin-top: 8px;
	margin-bottom: 2px;
	padding: 0 2px;
}

.time-labels span {
	font-family: sans-serif;
	font-size: 10px;
	font-weight: 500;
	color: rgba(40, 40, 50, 0.7);
	transition: color 0.3s ease;
}

/* Night mode label colors - applied via JS */
.time-labels.night-mode span {
	color: rgba(255, 200, 120, 0.8);
}

/* ========== Landing Page ========== */

.landing-page {
	background-color: #1a1a1a;
}

.landing-container {
	width: 100%;
	min-height: 100vh;
	min-height: 100dvh;
	max-width: 430px;
	position: relative;
	overflow-x: hidden;
	overflow-y: auto;
}

/* Sky gradient background - fixed to viewport */
.landing-sky {
	position: fixed;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 100%;
	max-width: 430px;
	height: 100vh;
	height: 100dvh;
	background: linear-gradient(
		to bottom,
		rgb(135, 206, 235) 0%,
		rgb(224, 246, 255) 100%
	);
	z-index: 1;
}

/* Animated smog canvas - fixed to viewport */
.landing-smog-canvas {
	position: fixed;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 100%;
	max-width: 430px;
	height: 100vh;
	height: 100dvh;
	z-index: 2;
	pointer-events: none;
}

/* Content layer */
.landing-content {
	position: relative;
	z-index: 3;
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	pointer-events: none;
}

/* Logo section */
.logo-section {
	height: 40vh;
	height: 40dvh;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.logo {
	display: flex;
	flex-direction: column;
	align-items: center;
	line-height: 1;
	text-align: center;
	animation: bob 3s ease-in-out infinite;
}

@keyframes bob {
	0%, 100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-12px);
	}
}

.logo-line1,
.logo-line2 {
	font-family: 'Fredoka', 'Arial Rounded MT Bold', sans-serif;
	font-weight: 700;
	color: #fff;
	text-shadow:
		0 4px 0 rgba(80, 60, 40, 0.5),
		0 6px 20px rgba(0, 0, 0, 0.3);
	letter-spacing: 3px;
}

.logo-line1 {
	font-size: 100px;
}

.logo-line2 {
	font-size: 72px;
	margin-top: -4px;
}

/* Cities section - bottom half */
.cities-section {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	padding: 20px 20px;
	gap: 16px;
	pointer-events: auto;
}

/* City buttons - cartoony style (orange) */
.city-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 70%;
	max-width: 220px;
	padding: 10px 18px;
	background: linear-gradient(
		to bottom,
		#ff9f43 0%,
		#f39c12 50%,
		#e67e22 100%
	);
	border: 3px solid #d35400;
	border-radius: 12px;
	text-decoration: none;
	box-shadow:
		0 4px 0 #a04000,
		0 6px 10px rgba(0, 0, 0, 0.3),
		inset 0 2px 0 rgba(255, 255, 255, 0.3);
	transition: all 0.1s ease;
	cursor: pointer;
}

.city-button:hover {
	transform: translateY(-2px);
	box-shadow:
		0 6px 0 #a04000,
		0 8px 12px rgba(0, 0, 0, 0.35),
		inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.city-button:active {
	transform: translateY(3px);
	box-shadow:
		0 1px 0 #a04000,
		0 3px 6px rgba(0, 0, 0, 0.25),
		inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.city-name {
	font-family: 'Fredoka', 'Arial Rounded MT Bold', sans-serif;
	font-size: 18px;
	font-weight: 600;
	color: #fff;
	text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
	letter-spacing: 0.5px;
}

.city-flag {
	font-size: 20px;
}

.attribution {
	margin-top: 24px;
	margin-bottom: 20px;
	font-size: 14px;
	color: rgba(255, 255, 255, 0.5);
	text-align: center;
}

.attribution a {
	color: rgba(255, 255, 255, 0.6);
	text-decoration: none;
}

.attribution a:hover {
	color: rgba(255, 255, 255, 0.9);
	text-decoration: underline;
}

/* ========== Info Button ========== */

.info-button {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.2);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	color: rgba(30, 45, 70, 0.8);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.info-button:hover {
	background: rgba(255, 255, 255, 0.35);
	transform: scale(1.05);
}

.info-button:active {
	transform: scale(0.95);
}

/* ========== Info Panel (Side Drawer) ========== */

.info-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.3);
	z-index: 100;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

.info-modal-overlay.active {
	opacity: 1;
	visibility: visible;
}

.info-modal {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 66.67%;
	background: rgba(255, 255, 255, 0.97);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	padding: 12px 16px 16px;
	overflow-y: auto;
	box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
	transform: translateX(100%);
	transition: transform 0.3s ease;
}

.info-modal-overlay.active .info-modal {
	transform: translateX(0);
}

.info-modal-close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: none;
	outline: none;
	background: rgba(0, 0, 0, 0.05);
	color: rgba(0, 0, 0, 0.5);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
}

.info-modal-close svg {
	width: 18px;
	height: 18px;
}

.info-modal-close:hover {
	background: rgba(0, 0, 0, 0.1);
	color: rgba(0, 0, 0, 0.7);
}

.info-modal-title {
	font-family: 'Arial Rounded MT Bold', 'Helvetica Rounded', sans-serif;
	font-size: 15px;
	font-weight: 700;
	color: #333;
	margin: 0 0 12px 0;
}

.info-section {
	margin-bottom: 14px;
}

.info-section:last-child {
	margin-bottom: 0;
}

.info-section-title {
	display: flex;
	align-items: center;
	gap: 5px;
	font-family: sans-serif;
	font-size: 12px;
	font-weight: 700;
	color: #444;
	margin: 0 0 6px 0;
	padding-bottom: 4px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.info-wind-icon {
	width: 14px;
	height: 14px;
	color: rgba(50, 80, 120, 0.8);
}

.info-icon-label {
	color: inherit;
}

.info-example {
	margin-bottom: 8px;
}

.info-text {
	font-family: sans-serif;
	font-size: 11px;
	line-height: 1.45;
	color: #555;
	margin: 0 0 6px 0;
}

.info-text:last-child {
	margin-bottom: 0;
}

.info-text-muted {
	color: #888;
	font-size: 10px;
}

.info-list {
	font-family: sans-serif;
	font-size: 11px;
	line-height: 1.4;
	color: #555;
	margin: 0 0 6px 0;
	padding-left: 16px;
}

.info-list li {
	margin-bottom: 2px;
}

/* Mixing ceiling demo */
.mixing-demo {
	position: relative;
	width: 100%;
	height: 50px;
	border-radius: 6px;
	overflow: hidden;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.mixing-demo-sky {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 50%;
	background: linear-gradient(to bottom, #87ceeb, #b8e0f0);
}

.mixing-demo-smog {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 50%;
	background: linear-gradient(to bottom, rgba(139, 115, 85, 0.4), rgba(139, 115, 85, 0.7));
}

.mixing-demo-line {
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 2px;
	background: rgba(80, 60, 40, 0.6);
	transform: translateY(-50%);
}

.mixing-demo-label {
	position: absolute;
	top: 50%;
	right: 6px;
	transform: translateY(-50%);
	font-family: sans-serif;
	font-size: 9px;
	font-weight: 600;
	color: rgba(80, 60, 40, 0.9);
	background: rgba(255, 255, 255, 0.7);
	padding: 1px 4px;
	border-radius: 3px;
}

/* Wind bar demo */
.wind-demo-strip {
	width: 80px;
	margin: 0 auto;
	background: rgba(50, 80, 120, 0.08);
	border-radius: 6px;
	padding: 4px;
}

.wind-demo-level {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 4px 0;
}

.wind-demo-beaufort {
	font-family: sans-serif;
	font-size: 11px;
	font-weight: 600;
	color: rgba(50, 80, 120, 0.8);
}

.wind-demo-speed {
	font-family: sans-serif;
	font-size: 9px;
	color: rgba(50, 80, 120, 0.6);
}

.wind-demo-divider {
	height: 1px;
	background: rgba(50, 80, 120, 0.15);
	margin: 0 6px;
}

/* Altitude demo */
.altitude-demo {
	width: 55px;
	padding: 4px;
}

.altitude-demo-header {
	font-family: sans-serif;
	font-size: 10px;
	font-weight: 700;
	color: rgba(40, 40, 50, 0.8);
	text-decoration: underline;
	margin-bottom: 4px;
}

.altitude-demo-tick {
	display: flex;
	align-items: center;
	gap: 3px;
	margin-bottom: 3px;
}

.altitude-demo-tick::before {
	content: '';
	width: 5px;
	height: 1px;
	background: rgba(40, 40, 50, 0.5);
}

.altitude-demo-tick span {
	font-family: sans-serif;
	font-size: 9px;
	color: rgba(40, 40, 50, 0.7);
}

/* Info modal attribution */
.info-attribution {
	margin-top: 16px;
	padding-top: 12px;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
	font-family: sans-serif;
	font-size: 10px;
	color: rgba(0, 0, 0, 0.4);
	text-align: center;
}

.info-attribution a {
	color: rgba(0, 0, 0, 0.5);
	text-decoration: none;
}

.info-attribution a:hover {
	color: rgba(0, 0, 0, 0.7);
	text-decoration: underline;
}
