/* === CUSTOM PROPERTIES === */
:root {
	--btn-size: 36px;
	--btn-offset: 16px;
	--btn-bg: trasnparent;
	--btn-border: rgba(255, 47, 47, 0.25);
	--btn-color: rgba(255, 47, 47, 0.8);
	--transition-speed: 0.2s;
}

/* === GLOBAL RESET === */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

/* === ROOT & BODY === */
html,
body {
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: #000;

	/* Prevent selection and dragging on everything */
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	-webkit-user-drag: none;

	/* Disable tap highlight on mobile */
	-webkit-tap-highlight-color: transparent;

	scroll-behavior: smooth;

	/* Font smoothing resets */
	text-rendering: optimizeLegibility !important;
	-webkit-font-smoothing: antialiased !important;
	-moz-osx-font-smoothing: grayscale !important;
	-moz-font-smoothing: unset !important;
	font-smooth: always !important;

	/* Optimize animation performance */
	backface-visibility: hidden !important;
	-webkit-backface-visibility: hidden !important;
	-moz-backface-visibility: hidden !important;
}

/* === RETINA FONT SMOOTHING OVERRIDE === */
@media screen and (-webkit-min-device-pixel-ratio: 2),
screen and (min-resolution: 2dppx) {
	body {
		-webkit-font-smoothing: subpixel-antialiased;
	}
}

/* === REPEATING PATTERN OVERLAY === */
body::after {
	content: '';
	display: block;
	position: fixed;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
	/* Must be above video (z-index 0) but below all UI (button is z-index 10) */
	z-index: 1;
	opacity: 0.0639;
	background: url("/assets/img/pattern.svg");
	background-repeat: repeat;
	pointer-events: none;
}

/* === FULLSCREEN VIDEO === */
/* width/height auto + min-width/min-height ensures the video always covers the
   viewport in any orientation without stretching, anchored to the top edge */
#bg-video {
	position: fixed;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: auto;
	height: auto;
	min-width: 100vw;
	min-height: 100vh;
	z-index: 0;

	/* Prevent video from intercepting any pointer interactions */
	pointer-events: none;

	/* Prevent drag behavior */
	-webkit-user-drag: none;
	user-select: none;
}

/* === MUTE TOGGLE BUTTON === */
.mute-toggle {
	position: fixed;
	bottom: var(--btn-offset);
	right: var(--btn-offset);
	z-index: 10;

	display: flex;
	align-items: center;
	justify-content: center;

	width: var(--btn-size);
	height: var(--btn-size);

	background: var(--btn-bg);
	border-color: var(--btn-border);
	border-style: solid;
	border-width: 0 2px 2px 0;
	color: var(--btn-color);

	cursor: pointer;
	outline: none;
	transition:
		background var(--transition-speed) ease,
		border-color var(--transition-speed) ease,
		color var(--transition-speed) ease,
		transform var(--transition-speed) ease;
	opacity: 1;
}

.mute-toggle:active {
	transform: scale(0.93);
}

/* Focus ring for keyboard accessibility, invisible on mouse click */
.mute-toggle:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.5);
	outline-offset: 2px;
}

/* === ICON VISIBILITY BY STATE === */
.icon {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	transition: opacity var(--transition-speed) ease;
}

/* Default (is-muted): show sound-off icon, hide sound-on icon */
.mute-toggle .icon-sound-on {
	display: none;
}

.mute-toggle .icon-sound-off {
	display: block;
}

/* Unmuted state: flip which icon is visible */
.mute-toggle.is-unmuted .icon-sound-off {
	display: none;
}

.mute-toggle.is-unmuted .icon-sound-on {
	display: block;
}