/* ============================================================
   RocketX Hero
   ============================================================ */

.rx-hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	color: #fff;
	background: var(--rx-navy);
	min-height: clamp(640px, 92vh, 960px);
	padding: clamp(5rem, 9vw, 8rem) clamp(1.5rem, 4vw, 4rem) clamp(7rem, 12vw, 10rem);
	/* break out of any theme max-width container */
	width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

/* ---------- Entrance animation ----------
   Deliberately CSS-only, and deliberately NOT the shared rx-reveal system.

   The hero <h1> is the homepage's LCP element. rx-reveal-* hides matching
   elements at opacity:0 from the very first frame (the `html.rx-js` block in
   motion.css) and only reveals them once GSAP + ScrollTrigger + Lenis have
   downloaded from jsdelivr and rocketx.js has run. That put the LCP element
   behind three cross-origin round trips plus a 0.15s delay and a 1.1s tween,
   and field LCP sat at ~4s (CrUX, 2026-08).

   These keyframes run off the stylesheet alone, so the headline paints on the
   first animation frame after CSS parse. The <h1> gets no delay for exactly
   that reason — everything else staggers behind it. If you add an element to
   the hero, use .rx-hero__rise, NOT rx-reveal-*. See inc/shortcodes.php. */
@keyframes rx-hero-rise {
	from { opacity: 0; transform: translateY(24px); }
	to   { opacity: 1; transform: none; }
}

.rx-hero__rise {
	animation: rx-hero-rise 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) both;
	animation-delay: var(--rx-rise-delay, 0s);
}

@media (prefers-reduced-motion: reduce) {
	.rx-hero__rise {
		animation: none;
	}
}

/* ---------- Background layers ---------- */
.rx-hero__bg {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 0;
	background:
		radial-gradient(120% 80% at 75% 30%, rgba(220, 79, 44, 0.18) 0%, transparent 55%),
		radial-gradient(80% 60% at 15% 85%, rgba(31, 39, 71, 0.9) 0%, transparent 60%),
		linear-gradient(180deg, #0B1023 0%, #070A18 100%);
}

.rx-hero__grid {
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
	background-size: 80px 80px;
	mask-image: radial-gradient(ellipse 90% 70% at 50% 50%, #000 30%, transparent 80%);
	-webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 50%, #000 30%, transparent 80%);
}

.rx-hero__glow {
	position: absolute;
	border-radius: 50%;
	filter: blur(80px);
	opacity: 0.55;
}

.rx-hero__glow--a {
	width: 520px;
	height: 520px;
	right: -120px;
	top: -120px;
	background: radial-gradient(circle, var(--rx-orange) 0%, transparent 65%);
}

.rx-hero__glow--b {
	width: 420px;
	height: 420px;
	left: -100px;
	bottom: -100px;
	background: radial-gradient(circle, #2A6CFF 0%, transparent 65%);
	opacity: 0.35;
}

/* ---------- Layout ---------- */
.rx-hero__inner {
	position: relative;
	z-index: 2;
	max-width: 1320px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	gap: clamp(2rem, 4vw, 5rem);
	align-items: center;
}

@media (max-width: 960px) {
	/* !important: the widget's Column Ratio control (elementor-widgets.php)
	   prints an unqualified grid-template-columns rule into the Elementor
	   post CSS at (0,4,0) specificity, which otherwise wins at every width
	   and keeps the hero two-column on phones. Mobile must always stack. */
	.rx-hero__inner {
		/* minmax(0, …): a bare 1fr track's automatic minimum is the content's
		   max-content size, so a wide child (the eyebrow) blows the track past
		   the viewport instead of wrapping. */
		grid-template-columns: minmax(0, 1fr) !important;
		gap: 3rem;
	}

}

.rx-hero__content {
	display: flex;
	flex-direction: column;
	gap: var(--rx-s-3);
	max-width: 620px;
}

/* Centre the stack once the hero goes single-column. align-items also stops
   the column stretching its children: the eyebrow and badge are pills sized
   by `width: max-content`, but a stretched flex item ignores that and fills
   the column, which is why the eyebrow read as a full-width bar. */
@media (max-width: 960px) {
	.rx-hero__content {
		align-items: center;
		text-align: center;
		margin-inline: auto;
	}

	/* Centring a content-sized inline-grid is align-self, not justify-content
	   (which now only distributes inside the tracks). The base rule pins it to
	   flex-start, so it has to be restated here to beat it. */
	.rx-hero__cta-row {
		align-self: center;
		justify-content: center;
	}
}

/* ---------- Typography ---------- */
.rx-hero__eyebrow {
	display: inline-block;
	width: max-content;
	font-size: var(--rx-fs-xs);
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--rx-orange-300);
	padding: 0.5rem 1rem;
	border: 1px solid rgba(220, 79, 44, 0.35);
	border-radius: var(--rx-r-pill);
	background: rgba(220, 79, 44, 0.08);
}

/* The eyebrow pill is width: max-content (single line) — the instrument
   list is ~480px wide, which overflows a phone viewport AND inflates the
   hero grid track's intrinsic minimum. Shrink-to-fit and wrap instead.
   (Must come after the base rule above — equal specificity.) */
@media (max-width: 960px) {
	.rx-hero__eyebrow {
		width: auto;
		line-height: 1.7;
	}
}

.rx-hero__headline {
	font-size: var(--rx-fs-display);
	line-height: 1.04;
	letter-spacing: -0.02em;
	font-weight: 600;
	margin: 0;
	color: #fff;
}

.rx-hero__headline em {
	font-style: normal;
	background: linear-gradient(135deg, var(--rx-orange-300) 0%, var(--rx-orange) 60%, #FFB088 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.rx-hero__sub {
	font-size: var(--rx-fs-md);
	line-height: 1.55;
	color: rgba(255, 255, 255, 0.72);
	margin: 0;
	max-width: 520px;
}

/* ---------- CTAs ---------- */
/* Equal-width pair. As a plain flex row the buttons sized to their own labels
   and landed 1.06px apart at 1440px (207.281 vs 206.219) — close enough to
   look like a rendering error rather than a design choice, which is exactly
   how the client read it. Same equal-track inline-grid as the interior-hero
   CTAs (sections.css) and the header pair (header.css), so all three button
   pairs sitewide now resolve identically.

   align-self is explicit because .rx-hero__content is a flex column whose
   items stretch by default — a stretched grid would blow both tracks out to
   the full 620px content width. */
.rx-hero__cta-row {
	display: inline-grid;
	grid-auto-flow: column;
	grid-auto-columns: 1fr;
	align-self: flex-start;
	gap: var(--rx-s-2);
	margin-top: var(--rx-s-2);
}

/* .rx-btn is inline-flex, so it left-packs its label once a track is wider
   than the text. The primary also carries an arrow SVG, so it is the wider
   of the two and sets the shared track width. */
.rx-hero__cta-row .rx-btn {
	justify-content: center;
	text-align: center;
}

/* Grid tracks can't wrap the way flex-wrap did, so stack below phone width —
   still equal width, now full-row. */
@media (max-width: 480px) {
	.rx-hero__cta-row {
		grid-auto-flow: row;
	}
}

/* .rx-btn base + variants live in sections.css (sitewide) — they used to be
   here, but hero.css only loads on pages with the hero widget, so the header
   CTA buttons (also .rx-btn) rendered differently on every other page. */

/* ---------- Trust badge ---------- */
.rx-hero__badge {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.7rem 1.1rem;
	margin-top: var(--rx-s-2);
	width: max-content;
	max-width: 100%;
	font-size: var(--rx-fs-xs);
	letter-spacing: 0.04em;
	color: rgba(255, 255, 255, 0.85);
	border-radius: var(--rx-r-pill);
}

.rx-hero__badge-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #4ADE80;
	box-shadow: 0 0 12px rgba(74, 222, 128, 0.7);
}

/* ---------- Spline scene ---------- */
/* No will-change: transform — it paired with the data-rx-parallax that was
   removed from the scene wrapper (shortcodes.php). With nothing animating the
   transform it only promoted the globe's compositing layer for no reason. */
.rx-hero__scene {
	position: relative;
	aspect-ratio: 1 / 1;
	min-height: 460px;
	max-height: 700px;
	width: 100%;
	overflow: visible;
}

/* Below ~460px of column width, min-height beats aspect-ratio and the scene
   box turns portrait (≈327×460 on a phone). The globe can only ever be as big
   as the box is wide, so the extra height is dead space above and below it —
   let the square aspect-ratio govern instead. globe.js's camera fits the globe
   by width regardless, so a portrait box (e.g. if the widget's Scene Min
   Height control is set) renders correctly either way — just with the gap. */
@media (max-width: 960px) {
	.rx-hero__scene {
		min-height: 0;
	}
}

.rx-hero__three-canvas {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: var(--rx-r-xl);
	background: transparent;
	cursor: grab;
	/* globe.js disables drag for touch devices, so the canvas must not
	   swallow touch gestures — pan-y keeps the page scrollable when a
	   thumb lands on the (full-width, on mobile) globe. */
	touch-action: pan-y pinch-zoom;
}

.rx-hero__three-canvas:active {
	cursor: grabbing;
}

/* Mobile poster — hidden by default; globe.js toggles .rx-hero__scene--mobile
   on the wrapper to swap. The <picture> is the layout box now (it carries the
   media-gated <source> that keeps desktop from downloading the poster), so it
   owns the display toggle; the <img> just fills it. */
.rx-hero__poster {
	display: none;
	width: 100%;
	height: 100%;
}

.rx-hero__scene-mobile {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	border-radius: var(--rx-r-xl);
}

.rx-hero__scene--mobile .rx-hero__three-canvas {
	display: none;
}

.rx-hero__scene--mobile .rx-hero__poster {
	display: block;
}

/* ---------- Poster -> globe cross-fade ----------
   The progressive upgrade path on narrow screens (see scheduleUpgrade in
   globe.js): the poster has already painted, and the globe is built behind it
   and faded in once it has rendered a frame. During the upgrade the canvas is
   stacked *over* the poster rather than swapped for it — it needs real layout
   before initGlobe can measure it, and the poster has to stay visible until
   there is something to replace it with. */
.rx-hero__scene--upgrading {
	position: relative;
}

.rx-hero__scene--upgrading .rx-hero__poster {
	display: block;
	opacity: 1;
	transition: opacity 0.6s ease;
}

.rx-hero__scene--upgrading .rx-hero__three-canvas {
	display: block;
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.6s ease;
}

.rx-hero__scene--upgrading.rx-hero__scene--live .rx-hero__three-canvas {
	opacity: 1;
}

.rx-hero__scene--upgrading.rx-hero__scene--live .rx-hero__poster {
	opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
	.rx-hero__scene--upgrading .rx-hero__poster,
	.rx-hero__scene--upgrading .rx-hero__three-canvas {
		transition: none;
	}
}

.rx-hero__scene-placeholder {
	position: relative;
	width: 100%;
	height: 100%;
	display: grid;
	place-items: center;
	border-radius: var(--rx-r-xl);
	background:
		radial-gradient(circle at 50% 45%, rgba(220, 79, 44, 0.4) 0%, transparent 55%),
		linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
	border: 1px solid rgba(255, 255, 255, 0.08);
	overflow: hidden;
}

.rx-hero__scene-placeholder-orb {
	width: 60%;
	aspect-ratio: 1;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, #FF8C5A 0%, var(--rx-orange) 35%, #5A1B0E 80%);
	box-shadow:
		inset -20px -30px 80px rgba(0, 0, 0, 0.6),
		0 30px 80px rgba(220, 79, 44, 0.4);
	animation: rx-orb-float 9s ease-in-out infinite;
}

.rx-hero__scene-placeholder-note {
	position: absolute;
	bottom: 1rem;
	font-size: var(--rx-fs-xs);
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.4);
	margin: 0;
}

@keyframes rx-orb-float {
	0%, 100% { transform: translateY(0) rotate(0deg); }
	50%      { transform: translateY(-18px) rotate(2deg); }
}

/* ---------- Trust band (stat strip below hero) ---------- */
.rx-trust-band {
	width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	background: rgba(7, 10, 24, 0.96);
	border-top: 1px solid rgba(255, 255, 255, 0.07);
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rx-trust-band__inner {
	max-width: 1320px;
	margin: 0 auto;
	display: flex;
	flex-wrap: nowrap;
	overflow-x: auto;
	scrollbar-width: none;
}

.rx-trust-band__inner::-webkit-scrollbar { display: none; }

.rx-trust-band__item {
	flex: 1 1 0;
	min-width: 160px;
	padding: clamp(1.25rem, 2.5vw, 1.75rem) clamp(1rem, 2vw, 2rem);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.25rem;
	text-align: center;
	border-right: 1px solid rgba(255, 255, 255, 0.06);
	transition: background var(--rx-dur-fast);
}

.rx-trust-band__item:last-child { border-right: none; }

.rx-trust-band__item:hover {
	background: rgba(255, 255, 255, 0.025);
}

.rx-trust-band__value {
	font-size: clamp(1.5rem, 2.5vw, 2.25rem);
	font-weight: 700;
	letter-spacing: -0.025em;
	color: #fff;
	line-height: 1;
}

.rx-trust-band__label {
	font-size: var(--rx-fs-xs);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	/* Raised from 0.48 for WCAG AA (4.5:1) contrast on the dark band. */
	color: rgba(255, 255, 255, 0.62);
	margin-top: 0.1rem;
}

.rx-trust-band__text {
	font-size: var(--rx-fs-xs);
	line-height: 1.45;
	/* Raised from 0.28 (~2:1, failed AA) — this carries the FSP/ODP
	   regulatory disclosure and must be legible. Now ~4.5:1. */
	color: rgba(255, 255, 255, 0.62);
	margin-top: 0.15rem;
}

@media (max-width: 680px) {
	.rx-trust-band__inner {
		flex-wrap: wrap;
	}
	.rx-trust-band__item {
		flex-basis: 50%;
		min-width: 0;
		border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	}
	.rx-trust-band__item:nth-child(even) { border-right: none; }
	.rx-trust-band__item:nth-last-child(-n+2) { border-bottom: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.rx-hero__scene-placeholder-orb {
		animation: none;
	}
}

/* ============================================================
   Globe label overlay
   Positioned absolutely over the Three.js canvas.
   JS sets transform: translate(x, y) each frame.
   ============================================================ */

.rx-globe__labels {
	position: absolute;
	inset: 0;
	pointer-events: none;
	overflow: visible;
}

.rx-globe__label {
	position: absolute;
	top: 0;
	left: 0;
	display: flex;
	align-items: flex-start;
	gap: 5px;
	opacity: 0;
	white-space: nowrap;
	pointer-events: none;
	will-change: transform, opacity;
}

.rx-globe__label-body {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.rx-globe__label-head {
	display: flex;
	align-items: center;
	gap: 5px;
}

.rx-globe__label-dot {
	flex-shrink: 0;
	margin-top: 2px;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: #00e5ff;
	box-shadow: 0 0 6px #00e5ff, 0 0 14px rgba(0, 229, 255, 0.45);
}

.rx-globe__label-name {
	font-size: 10px;
	font-weight: 700;
	color: #fff;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	line-height: 1;
}

.rx-globe__label-sub {
	font-size: 9px;
	color: rgba(255, 255, 255, 0.48);
	letter-spacing: 0.06em;
	line-height: 1;
}

.rx-globe__label-ticker {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	font-size: 8px;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.5;
	padding: 1px 6px 1px 4px;
	border-radius: var(--rx-r-pill, 999px);
	width: fit-content;
}

.rx-globe__label-ticker--up {
	color: #4ADE80;
	background: rgba(74, 222, 128, 0.10);
	border: 1px solid rgba(74, 222, 128, 0.22);
}

.rx-globe__label-ticker--dn {
	color: #FF8C8C;
	background: rgba(255, 107, 107, 0.10);
	border: 1px solid rgba(255, 107, 107, 0.22);
}

/* Market closed: exchange pins mute to a neutral grey — no live green/red
   while nothing is actually ticking. Toggled by globe.js from the shared
   market-hours check. */
.rx-globe__label-ticker--closed {
	color: rgba(255, 255, 255, 0.45);
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.12);
}

.rx-globe__label-dot--closed {
	background: rgba(255, 255, 255, 0.35);
	box-shadow: none;
}

/* ---------- Market-hours status pill ----------
   Injected by globe.js into .rx-hero__scene (position: relative) and shown
   only while markets are closed (.is-visible). Mirrors .rx-hero__badge's
   glass-pill language, but amber — "paused", not an error. */
.rx-globe__status {
	position: absolute;
	left: 50%;
	bottom: clamp(10px, 5%, 36px);
	z-index: 3;
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	width: max-content;
	max-width: calc(100% - 32px);
	padding: 0.7rem 1.2rem;
	border-radius: var(--rx-r-pill, 999px);
	border: 1px solid rgba(245, 185, 97, 0.25);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.08),
		0 12px 32px -14px rgba(0, 0, 0, 0.65);
	font-size: var(--rx-fs-xs);
	font-weight: 600;
	font-style: normal;
	letter-spacing: 0.04em;
	line-height: 1;
	color: rgba(255, 255, 255, 0.82);
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transform: translateX(-50%) translateY(8px);
	transition: opacity 0.45s ease, transform 0.45s ease, visibility 0s linear 0.45s;
}

.rx-globe__status.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
	transition: opacity 0.45s ease, transform 0.45s ease, visibility 0s;
}

.rx-globe__status-dot {
	flex-shrink: 0;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #F5B961;
	box-shadow: 0 0 12px rgba(245, 185, 97, 0.7);
	animation: rx-status-breathe 2.8s ease-in-out infinite;
}

/* Softer second half ("Reopens Sunday 22:00 UTC" / "Public holiday"),
   separated from the lead by a quiet middot. */
.rx-globe__status-sub {
	color: rgba(255, 255, 255, 0.52);
	font-weight: 500;
}

.rx-globe__status-sub::before {
	content: '·';
	margin-right: 0.6rem;
	color: rgba(255, 255, 255, 0.3);
}

@keyframes rx-status-breathe {
	0%, 100% { opacity: 1; }
	50%      { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
	.rx-globe__label {
		opacity: 1;
	}
	.rx-globe__status {
		transition: none;
	}
	.rx-globe__status-dot {
		animation: none;
	}
}
