* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

/* --- 1. Desktop / Default (Restored) --- */
html, body {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	background-color: #000;
}

#video-container,
#static-layer {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
	pointer-events: none;
	overflow: hidden;
}

.static-img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: opacity 0.5s ease;
	opacity: 0;
	z-index: 0;
}

.flipped-img {
	transform: scaleX(-1);
}

/* Initial state: show first-normal */
#static-first-normal {
	opacity: 1;
	z-index: 1;
}

#video-container.flipped {
	transform: scaleX(-1);
}

#bg-video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity 0.8s ease;
	will-change: opacity;
}

#bg-video.visible {
	opacity: 1;
}

/* Dark Overlay for Text Legibility */
.overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: transparent;
	z-index: -1;
	pointer-events: none;
}

/* --- 2. Mobile / iOS 26 Specific Fixes --- */
@media (max-width: 1024px) {

	/* CRITICAL: Unset backgrounds to stop Safe Area masking */
	html {
		background-color: transparent !important;
	}

	body {
		background-color: transparent !important;
		min-height: 100lvh;
	}

	/* THE LOOPHOLE: Zero-Height Anchor */
	/* Safari clips 'full height' fixed elements, but ignores '0px' ones. */
	/* We make the container 0px tall, but let the video overflow it. */
	#video-container,
	#static-layer {
		position: fixed;
		top: 0;
		left: 0;
		width: 100vw;
		height: 1px;
		overflow: visible;
		z-index: -2;
	}

	/* The content itself uses lvh (Large Viewport Height) */
	/* lvh is distinct from vh/dvh as it explicitly includes the area BEHIND the bars */
	#bg-video,
	.static-img {
		width: 100vw;
		height: 100lvh;
		object-fit: cover;
		-webkit-mask-image: -webkit-radial-gradient(white, black);
		transform: translateZ(0);
	}

	/* Ensure flipped state still works with the 0-height container */
	#video-container.flipped #bg-video {
		transform: scaleX(-1);
	}
}

/* Content Container - Title at top, email at bottom */
.content {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	height: 100dvh;
	transition: opacity 0.6s ease-in;
}

.content.loaded {
	opacity: 1;
}

/* Main Heading - Bright Blue, Top Positioned, Scales to Fit */
h1 {
	font-family: 'Sour Gummy', cursive;
	font-weight: 900;
	font-size: clamp(2.5rem, 10vw, 12rem);
	max-width: 95vw;
	color: #3b82f6;
	text-shadow:
		3px 3px 0 #fff,
		-3px -3px 0 #fff,
		3px -3px 0 #fff,
		-3px 3px 0 #fff,
		4px 4px 0 #fff,
		5px 5px 0 rgba(255, 255, 255, 0.8),
		6px 6px 0 rgba(255, 255, 255, 0.6),
		7px 7px 20px rgba(0, 0, 0, 0.3);
	margin: 0 auto;
	line-height: 1.1;
	letter-spacing: 0.02em;
	white-space: nowrap;
	text-align: center;
}

/* Individual letter styling for drag and hover */
h1 .letter {
	display: inline-block;
	cursor: grab;
	position: relative;
	user-select: none;
	transition: none;
	will-change: transform;
}

h1 .letter.dragging {
	cursor: grabbing;
	z-index: 1000;
	animation: none !important;
}

/* Action bar for contact + social */
.action-bar {
	position: fixed;
	bottom: max(40px, env(safe-area-inset-bottom) + 20px);
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: 14px;
	z-index: 2;
	flex-wrap: nowrap;
	justify-content: center;
	width: min(95vw, 1100px);
	white-space: nowrap;
}

.action-bar a,
.action-bar button {
	appearance: none;
	border: none;
	color: inherit;
}

.action-bar a:link,
.action-bar a:visited {
	color: inherit;
}

.btn-base {
	background: #3b82f6;
	color: #fff !important;
	border: none;
	outline: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 20px 56px;
	border-radius: 999px;
	font-family: 'Sour Gummy', sans-serif;
	font-weight: 400;
	font-size: clamp(1.15rem, 3.5vw, 2.8rem);
	text-decoration: none;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
	transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
	white-space: nowrap;
}

.btn-base:hover {
	transform: translateY(-2px) scale(1.05);
	background: #2f70d4;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.btn-circle {
	width: 80px;
	height: 80px;
	padding: 0;
	border-radius: 50%;
}

.btn-icon {
	width: 44px;
	height: 44px;
	fill: currentColor;
	display: block;
	flex-shrink: 0;
}

.btn-icon.icon-lg {
	width: 52px;
	height: 52px;
}

.btn-icon path {
	fill: currentColor;
}

.btn-email {
	padding: 14px 32px;
	gap: 6px;
}

.email-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.email-icon .btn-icon {
	width: 1.1em;
	height: 1.1em;
}

.email-text {
	display: inline;
	white-space: nowrap;
}

#pause-trigger {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: min(30vw, 320px);
	height: min(30vh, 320px);
	min-width: 220px;
	min-height: 220px;
	background: rgba(0, 0, 0, 0);
	cursor: pointer;
	z-index: 1;
	user-select: none;
	outline: none;
	border: none;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}

.disclaimer {
	position: fixed;
	bottom: max(8px, env(safe-area-inset-bottom) + 8px);
	left: 50%;
	transform: translateX(-50%);
	font-family: 'Sour Gummy', sans-serif;
	font-size: clamp(0.9rem, 2vw, 1.2rem);
	color: #3b82f6;
	text-align: center;
	pointer-events: none;
	white-space: nowrap;
}

/* Responsive Adjustments for Small Screens */
@media (max-width: 640px) {
	.content {
		padding: 20px 10px 120px 10px;
	}

	/* Slight zoom to avoid edge gaps on devices with notches/home indicator */
	#bg-video {
		transform: scale(1.15);
		transform-origin: center center;
	}

	.static-img {
		transform: scale(1.12);
		transform-origin: center center;
	}

	.static-img.flipped-img {
		transform: scaleX(-1.12) scaleY(1.12);
		transform-origin: center center;
	}

	#video-container.flipped #bg-video {
		transform: scaleX(-1.15) scaleY(1.15);
		transform-origin: center center;
	}

	h1 {
		font-size: clamp(2rem, 12vw, 5rem);
		max-width: 100%;
		width: 100%;
		text-align: center;
		text-shadow:
			2px 2px 0 #fff,
			-2px -2px 0 #fff,
			2px -2px 0 #fff,
			-2px 2px 0 #fff,
			3px 3px 0 #fff,
			4px 4px 0 rgba(255, 255, 255, 0.8),
			5px 5px 15px rgba(0, 0, 0, 0.3);
	}

	.action-bar {
		bottom: max(32px, env(safe-area-inset-bottom) + 12px);
		gap: 2vw;
		width: calc(100% - 20px);
		justify-content: space-between;
		flex-wrap: nowrap;
	}

	.btn-base {
		height: 16vw;
		max-height: 64px;
		padding: 0;
		font-size: clamp(1rem, 4vw, 1.6rem);
		box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
		flex: 1 1 0;
		min-width: 0;
	}

	.btn-circle {
		flex: 1 1 0;
		width: 16vw;
		height: 16vw;
		max-width: 64px;
		max-height: 64px;
	}

	.btn-icon {
		width: 9vw;
		height: 9vw;
		max-width: 36px;
		max-height: 36px;
	}

	.btn-icon.icon-lg {
		width: 11vw;
		height: 11vw;
		max-width: 42px;
		max-height: 42px;
	}

	.btn-email {
		width: 16vw;
		height: 16vw;
		max-width: 64px;
		max-height: 64px;
		padding: 0;
		border-radius: 50%;
		justify-content: center;
	}

	.btn-email .btn-icon {
		width: 9vw;
		height: 9vw;
		max-width: 36px;
		max-height: 36px;
	}

	.email-text {
		display: none;
	}

	.email-icon {
		display: inline-flex;
	}

	.disclaimer {
		font-size: clamp(0.7rem, 2.5vw, 1rem);
	}
}

/* Loading State */
.loading {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: #000000;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
	transition: opacity 0.5s ease-out;
}

.loading.hidden {
	opacity: 0;
	pointer-events: none;
}
