/* Fonts are loaded via <link rel="stylesheet"> in client/entry.html for better reliability. */

:root {
	/*
	 * Some :root vars are defined in styleVars.ts using the styleVars object, so
	 * that they are also available in JS.
	 */
	--: initial;

	--uiGlassBackdropSceneControls: none;
	--uiGlassBackdropPanelSheet: none;
	--uiGlassBackdropPanelCollapsePill: none;
	--uiGlassBackdropNavBottom: none;
	--uiGlassBackdropPanelTop: none;

	/*
	 * Shared semantic glass tiers. Each piece of UI references the closest tier
	 * via backdrop-filter: var(--uiGlassBackdrop<Tier>) so the blurred glass
	 * backdrop only appears when html.ui-glass-enabled is set (see the toggle in
	 * scene-controls-panel.ts). All tiers are `none` by default.
	 */
	--uiGlassBackdropFaint: none;
	--uiGlassBackdropSubtle: none;
	--uiGlassBackdropLight: none;
	--uiGlassBackdropSoft: none;
	--uiGlassBackdropPanel: none;
	--uiGlassBackdropModal: none;
	--uiGlassBackdropStrong: none;
	--uiGlassBackdropSplash: none;
	--uiGlassBackdropChrome: none;

	--bootScreenBackdrop:
		radial-gradient(120% 100% at 50% -20%, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 46%),
		linear-gradient(180deg, rgba(86, 78, 114, 0.58), rgba(34, 30, 52, 0.68));
	--bootScreenBackdropFilter: blur(34px) saturate(1.06);
	--bootLogoSize: 124px;
	--bootProgressWidth: 132px;
	--bootVioletGradient: linear-gradient(90deg, rgba(215, 197, 255, 0.95), rgba(178, 138, 255, 0.95));
	--bootTextPrimary: rgba(255, 255, 255, 0.95);
	--bootTextSecondary: rgba(255, 255, 255, 0.78);
	--bootTextHint: rgba(255, 255, 255, 0.52);
}

html.ui-glass-enabled {
	--uiGlassBackdropSceneControls: blur(12px) saturate(1.04);
	--uiGlassBackdropPanelSheet: blur(5px) saturate(1.04);
	--uiGlassBackdropPanelCollapsePill: blur(8px) saturate(1.08);
	--uiGlassBackdropNavBottom: blur(40px) saturate(1.22);
	--uiGlassBackdropPanelTop: blur(28px) saturate(1.1);

	--uiGlassBackdropFaint: blur(4px);
	--uiGlassBackdropSubtle: blur(6px);
	--uiGlassBackdropLight: blur(8px);
	--uiGlassBackdropSoft: blur(10px);
	--uiGlassBackdropPanel: blur(12px) saturate(1.04);
	--uiGlassBackdropModal: blur(18px) saturate(1.05);
	--uiGlassBackdropStrong: blur(24px);
	--uiGlassBackdropSplash: blur(34px) saturate(1.06);
	--uiGlassBackdropChrome: blur(50px);
}

html.ui-glass-enabled[data-theme='dark'] {
	--uiGlassBackdropPanelSheet: blur(10px) saturate(1.04);
	--uiGlassBackdropPanelCollapsePill: blur(24px) saturate(1.1);
	--uiGlassBackdropNavBottom: blur(44px) saturate(1.2);
}

html {
	font-size: 1em;
	line-height: 1.4;
	font-family: 'Poppins', sans-serif;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

html.is-dragging {
	user-select: none;
	cursor: ns-resize;
}

html,
body,
#root {
	width: 100%;
	height: 100dvh;
	min-height: 100dvh;
	padding: 0;
	margin: 0;
	pointer-events: none;
	box-sizing: border-box;
	overscroll-behavior: none;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;

	color: black;
	background: var(--appBackground);

	[data-theme='dark'] & {
		color: white;
		background: var(--appBackgroundDark);
	}
}

/* Boot splash — matches progress-loader overlay until the app shell mounts. */
#boot-splash,
#boot-failure {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 10000;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: var(--bootScreenBackdrop);
	backdrop-filter: var(--bootScreenBackdropFilter);
	-webkit-backdrop-filter: var(--bootScreenBackdropFilter);
}

#boot-splash {
	pointer-events: none;
	gap: 16px;
}

#root.boot-failure-active {
	pointer-events: auto;
}

#boot-failure {
	pointer-events: auto;
	padding: 24px;
	box-sizing: border-box;
}

.boot-failure-panel {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	max-width: min(360px, 100%);
}

.boot-splash-logo-stage {
	width: var(--bootLogoSize);
	height: var(--bootLogoSize);
	display: flex;
	align-items: center;
	justify-content: center;
}

#boot-splash .boot-splash-logo,
#boot-failure .boot-splash-logo {
	width: var(--bootLogoSize);
	height: auto;
	max-height: var(--bootLogoSize);
	object-fit: contain;
	display: block;
}

.boot-failure-copy {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	text-align: center;
}

.boot-failure-title {
	margin: 0;
	font-size: 18px;
	font-weight: var(--fontWeightSemiBold);
	color: var(--bootTextPrimary);
	line-height: 1.3;
}

.boot-failure-detail {
	margin: 0;
	font-size: var(--fontSizeTextSm);
	color: var(--bootTextSecondary);
	line-height: 1.45;
	max-width: min(300px, 88vw);
}

#boot-failure .btn.btn-primary {
	margin-top: 6px;
	min-width: 168px;
	padding: 12px 28px;
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: var(--borderRadiusPill);
	font-family: var(--fontFamily);
	font-size: var(--fontSizeTextSm);
	font-weight: var(--fontWeightSemiBold);
	color: #fff;
	cursor: pointer;
	background: var(--bootVioletGradient);
	box-shadow: 0 8px 24px rgba(18, 12, 36, 0.28);
	transition:
		transform var(--transitionTimeFast),
		filter var(--transitionTimeFast);
}

#boot-failure .btn.btn-primary:hover {
	filter: brightness(1.06);
	transform: translateY(-1px);
}

#boot-failure .btn.btn-primary:active {
	transform: translateY(0);
}

.boot-failure-hint {
	margin: 4px 0 0;
	font-size: 11px;
	color: var(--bootTextHint);
	line-height: 1.4;
	max-width: min(320px, 88vw);
	word-break: break-word;
}

#boot-splash .boot-splash-bar {
	position: relative;
	width: var(--bootProgressWidth);
	height: 8px;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.16);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 999px;
	box-sizing: border-box;
}

#boot-splash .boot-splash-bar::after {
	content: '';
	position: absolute;
	top: 0;
	left: -45%;
	width: 45%;
	height: 100%;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.88);
	animation: boot-splash-indeterminate 1.15s ease-in-out infinite;
}

@keyframes boot-splash-indeterminate {
	0% {
		left: -45%;
	}
	100% {
		left: 100%;
	}
}

/* prettier-ignore */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  text-transform: uppercase;
}
h1 {
	font-weight: 300;
	padding-bottom: 40px;
}
h3 {
	font-weight: 300;
	text-transform: lowercase;
}

a:link,
a:visited,
a:hover,
a:active {
	font-weight: 500;
	transition: all 0.5s;
	color: rgba(195, 195, 195, 0.9);
	text-decoration: none;
}

a:hover {
	color: rgba(255, 255, 255, 1);
	text-decoration: none;
}

button,
[role='button'],
input[type='button'],
input[type='submit'],
input[type='reset'] {
	font-family: var(--fontFamily);
	font-weight: var(--fontWeightSemiBold);
}

body {
	position: absolute;
	-webkit-transform-style: preserve-3d;
	transform-style: preserve-3d;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
	-webkit-perspective: 0;
	perspective: none;
	overflow: hidden;
	font-family: 'Poppins', sans-serif;
	font-size: 16px;
}

body.fadePageOut {
	opacity: 0;
	transition: opacity 0.5s;
}

.hidden {
	display: none;
}

.invisible {
	opacity: 0 !important;
}
