/* ============================================================
   RocketX — Hyperspace Launch Animation
   Triggered on [data-rx-launch] CTA clicks
   ============================================================ */

/* ── Overlay ── */
.rx-hyperspace {
	position: fixed;
	inset: 0;
	z-index: 99999;
	overflow: hidden;
	background: #00000c;
	opacity: 0;
	pointer-events: none;
	display: flex;
	align-items: center;
	justify-content: center;
}

.rx-hyperspace.is-active {
	pointer-events: all;
}

/* ── Three.js canvas ── */
.rx-hyperspace__canvas {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	display: block;
	z-index: 0;
}

/* ── Central light bloom ── */
.rx-hyperspace__bloom {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: radial-gradient(
		ellipse 55% 55% at 50% 50%,
		rgba(80, 130, 255, 0.0) 0%,
		rgba(80, 130, 255, 0.0) 35%,
		rgba(0,   0,  20, 0.55) 100%
	);
	pointer-events: none;
}

/* ── Center glow sphere (intensifies at full warp) ── */
.rx-hyperspace__glow {
	position: absolute;
	left: 50%; top: 50%;
	translate: -50% -50%;
	width: 320px;
	height: 320px;
	border-radius: 50%;
	background: radial-gradient(circle,
		rgba(90, 160, 255, 0.45) 0%,
		rgba(60, 100, 220, 0.18) 40%,
		transparent 70%
	);
	pointer-events: none;
	z-index: 1;
	opacity: 0;
}

/* ── Flash layer (exit) ── */
.rx-hyperspace__flash {
	position: absolute;
	inset: 0;
	z-index: 20;
	background: #fff;
	opacity: 0;
	pointer-events: none;
}

/* ── Scene (perspective container for 3D elements) ── */
.rx-hyperspace__scene {
	position: relative;
	z-index: 2;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	perspective: 900px;
	perspective-origin: 50% 50%;
}

/* ── Orbital rings ── */
.rx-hyperspace__orbits {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.rx-hyperspace__ring {
	position: absolute;
	border-radius: 50%;
	will-change: transform;
}

.rx-hyperspace__ring--1 {
	width: 340px;
	height: 340px;
	border: 1.5px solid rgba(220, 79, 44, 0.35);
	box-shadow:
		0 0 18px rgba(220, 79, 44, 0.12),
		inset 0 0 18px rgba(220, 79, 44, 0.06);
}

.rx-hyperspace__ring--2 {
	width: 560px;
	height: 560px;
	border: 1px solid rgba(120, 160, 255, 0.18);
	box-shadow:
		0 0 30px rgba(100, 150, 255, 0.06),
		inset 0 0 30px rgba(100, 150, 255, 0.04);
}

.rx-hyperspace__ring--3 {
	width: 820px;
	height: 820px;
	border: 1px solid rgba(220, 79, 44, 0.1);
}

/* ── Floating orbs ── */
.rx-hyperspace__orbs {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.rx-hyperspace__orb {
	position: absolute;
	border-radius: 50%;
	will-change: transform;
}

.rx-hyperspace__orb--1 {
	width: 14px; height: 14px;
	top: calc(50% - 140px);
	left: calc(50% - 220px);
	background: radial-gradient(circle, rgba(220, 79, 44, 0.9) 0%, rgba(220, 79, 44, 0.1) 70%);
	box-shadow: 0 0 16px rgba(220, 79, 44, 0.6), 0 0 32px rgba(220, 79, 44, 0.2);
}

.rx-hyperspace__orb--2 {
	width: 10px; height: 10px;
	top: calc(50% + 120px);
	left: calc(50% + 200px);
	background: radial-gradient(circle, rgba(100, 160, 255, 0.9) 0%, rgba(100, 160, 255, 0.1) 70%);
	box-shadow: 0 0 14px rgba(100, 160, 255, 0.5), 0 0 28px rgba(100, 160, 255, 0.2);
}

.rx-hyperspace__orb--3 {
	width: 8px; height: 8px;
	top: calc(50% + 80px);
	left: calc(50% - 260px);
	background: radial-gradient(circle, rgba(200, 230, 255, 0.9) 0%, rgba(200, 230, 255, 0.1) 70%);
	box-shadow: 0 0 12px rgba(200, 230, 255, 0.5);
}

/* ── Central glass panel ── */
.rx-hyperspace__panel {
	position: absolute;
	left: 50%; top: 50%;
	translate: -50% -50%;
	width: min(480px, 90vw);
	padding: 40px 36px 36px;
	border-radius: 28px;
	background: rgba(15, 20, 45, 0.55);
	border: 1px solid rgba(255, 255, 255, 0.12);
	backdrop-filter: blur(28px) saturate(1.6);
	-webkit-backdrop-filter: blur(28px) saturate(1.6);
	box-shadow:
		0 0 0 1px rgba(220, 79, 44, 0.12),
		0 8px 64px rgba(0, 0, 0, 0.6),
		0 0 100px rgba(90, 130, 255, 0.08),
		inset 0 1px 0 rgba(255, 255, 255, 0.1);
	text-align: center;
	z-index: 5;
	will-change: transform;
}

/* gradient border glow */
.rx-hyperspace__panel::before {
	content: '';
	position: absolute;
	inset: -1px;
	border-radius: 29px;
	padding: 1px;
	background: linear-gradient(
		135deg,
		rgba(220, 79, 44, 0.5) 0%,
		rgba(255, 255, 255, 0.06) 40%,
		rgba(100, 150, 255, 0.3) 100%
	);
	-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	pointer-events: none;
}

.rx-hyperspace__logo-wrap {
	margin-bottom: 20px;
	display: flex;
	justify-content: center;
}

.rx-hyperspace__logo {
	width: 200px;
	height: auto;
	display: block;
	/* Orange parts of the logo get a warm glow; white text gets a cool shimmer */
	filter:
		drop-shadow(0 0 12px rgba(239, 67, 35, 0.55))
		drop-shadow(0 0 28px rgba(239, 67, 35, 0.22))
		drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
}

.rx-hyperspace__tagline {
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.38);
	margin-bottom: 28px;
}

/* Progress bar */
.rx-hyperspace__progress {
	height: 3px;
	background: rgba(255, 255, 255, 0.08);
	border-radius: 2px;
	overflow: hidden;
}

.rx-hyperspace__bar {
	height: 100%;
	width: 0%;
	border-radius: 2px;
	background: linear-gradient(90deg, #DC4F2C 0%, #FF8A5E 50%, #a0c4ff 100%);
	box-shadow: 0 0 8px rgba(220, 79, 44, 0.6);
}

/* ── Floating data chips ── */
.rx-hyperspace__chips {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.rx-hyperspace__chip {
	position: absolute;
	left: 50%;   /* GSAP xPercent:-50 + x offsets from here */
	top:  50%;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	border-radius: 40px;
	background: rgba(15, 20, 50, 0.55);
	border: 1px solid rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	box-shadow:
		0 4px 24px rgba(0, 0, 0, 0.35),
		inset 0 1px 0 rgba(255, 255, 255, 0.08);
	white-space: nowrap;
	will-change: transform;
}

.rx-hyperspace__chip-sym {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	color: rgba(255, 255, 255, 0.55);
}

.rx-hyperspace__chip-val {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.02em;
	font-variant-numeric: tabular-nums;
	color: #4ADE80;
}

.rx-hyperspace__chip-val.is-down {
	color: #FF8C8C;
}

/* All chips are centred — GSAP owns x, y, z completely */

/* ── Skip button ── */
.rx-hyperspace__skip {
	position: absolute !important;
	top: 28px !important;
	right: 32px !important;
	z-index: 10 !important;
	display: inline-flex !important;
	align-items: center !important;
	gap: 6px !important;
	padding: 8px 18px !important;
	border-radius: 40px !important;
	background: rgba(255, 255, 255, 0.06) !important;
	border: 1px solid rgba(255, 255, 255, 0.12) !important;
	backdrop-filter: blur(12px) !important;
	-webkit-backdrop-filter: blur(12px) !important;
	color: rgba(255, 255, 255, 0.45) !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	letter-spacing: 0.06em !important;
	cursor: pointer !important;
	transition: color 200ms, background 200ms, border-color 200ms !important;
}

.rx-hyperspace__skip:hover {
	color: #fff !important;
	background: rgba(255, 255, 255, 0.1) !important;
	border-color: rgba(255, 255, 255, 0.2) !important;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
	.rx-hyperspace {
		display: none !important;
	}
}

/* ── Mobile: hide wide chips ── */
@media (max-width: 640px) {
	.rx-hyperspace__chip--1,
	.rx-hyperspace__chip--2,
	.rx-hyperspace__chip--3,
	.rx-hyperspace__chip--4,
	.rx-hyperspace__chip--5,
	.rx-hyperspace__chip--6,
	.rx-hyperspace__chip--7,
	.rx-hyperspace__chip--8,
	.rx-hyperspace__chip--9,
	.rx-hyperspace__chip--10 {
		display: none;
	}
	.rx-hyperspace__ring--2,
	.rx-hyperspace__ring--3 {
		display: none;
	}
	.rx-hyperspace__panel {
		width: 88vw;
		padding: 28px 20px 24px;
	}
}
