/* Hero: copy on the left, interactive Parcel Journey globe dominating the right.
 * --p (0..1) is the hero scroll progress, written by assets/js/hero/hero.js. */
.hero {
	--p: 0;
	--copy-w: clamp(30rem, 36vw, 36rem); /* text column */
	--globe-gap: 32px; /* minimum space between text column and globe stage */
	/* how far the globe stage may extend past the content container (into the page margin) */
	--globe-bleed: min(calc((100vw - min(100vw, var(--maxw))) / 2 + 4vw), 120px);
	position: relative; isolation: isolate; overflow: clip;
	min-height: 100vh; min-height: 100svh;
	background: var(--ink);
}
.hero__backdrop {
	position: absolute; inset: 0; z-index: -1; pointer-events: none;
	background:
		radial-gradient(60% 70% at 72% 50%, rgba(43, 92, 214, .16), transparent 70%),
		radial-gradient(40% 40% at 76% 46%, rgba(127, 231, 255, .05), transparent 70%),
		radial-gradient(120% 80% at 50% 120%, rgba(10, 14, 27, 1), transparent 60%);
}
.hero__backdrop::after { /* hairline horizon where the hero meets the next section */
	content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
	background: linear-gradient(90deg, transparent, var(--line-strong) 30%, var(--line-strong) 70%, transparent);
}

.hero__inner {
	position: relative;
	max-width: var(--maxw); min-height: inherit; margin: 0 auto;
	padding: calc(var(--header-top) + var(--header-h) + 32px) var(--gutter) 48px;
	display: flex; align-items: center;
}

/* ---------- copy ---------- */
.hero__copy {
	position: relative; z-index: 2;
	display: flex; flex-direction: column; align-items: flex-start;
	width: min(100%, var(--copy-w));
	opacity: calc(1 - var(--p) * 1.7);
	transform: translate3d(0, calc(var(--p) * -56px), 0);
	will-change: opacity, transform;
}
.hero__copy > * { animation: rise 1.1s var(--ease) both; }
.hero__title    { animation-delay: .15s; }
.hero__tagline  { animation-delay: .35s; }
.hero__desc     { animation-delay: .45s; }
.hero__actions  { animation-delay: .55s; }
.hero__trackform { animation-delay: .65s; }
.hero__status   { animation-delay: .8s; }

.hero__title {
	font-size: clamp(2.7rem, 1.1rem + 4.1vw, 5.1rem);
	font-weight: 600; line-height: .98; letter-spacing: -.045em;
	font-stretch: 100%;
}
.hero__line { display: block; white-space: nowrap; }
.hero__soft { font-weight: 400; color: var(--paper-faint); letter-spacing: -.04em; }

.hero__tagline {
	margin-top: clamp(20px, 3vh, 28px);
	font-size: clamp(1.08rem, .95rem + .4vw, 1.3rem); font-weight: 500; letter-spacing: -.012em; line-height: 1.4;
}
.hero__desc { margin-top: 10px; max-width: 29rem; font-size: 15.5px; line-height: 1.6; color: var(--paper-dim); }

.hero__actions { margin-top: clamp(26px, 4vh, 36px); display: flex; flex-wrap: wrap; gap: 10px; }
.hero__trackform { margin-top: 14px; width: min(100%, 27rem); }

.hero__status {
	order: 5; margin-top: clamp(28px, 5vh, 48px);
	display: inline-flex; align-items: center; gap: 10px;
	font-size: 13px; font-weight: 500; color: var(--paper-dim);
}
.status-dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.status-dot::after {
	content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--cyan);
	animation: ping 2.8s var(--ease) infinite;
}
@keyframes ping { from { transform: scale(.4); opacity: .8; } to { transform: scale(1.8); opacity: 0; } }

@keyframes rise { from { opacity: 0; transform: translate3d(0, 18px, 0); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

/* ---------- globe stage ---------- */
.globe {
	/* Stage starts after the text column + gap and fits the globe inside itself,
	 * so the globe can never overlap the copy at any width. */
	position: absolute; z-index: 1; top: 0; bottom: 0;
	left: calc(var(--gutter) + var(--copy-w) + var(--globe-gap));
	right: calc(var(--globe-bleed) * -1);
	opacity: calc(1 - var(--p) * .85);
	transform: translate3d(0, calc(var(--p) * -6%), 0) scale(calc(1 - var(--p) * .08));
	will-change: opacity, transform;
}
.globe__stage {
	position: absolute; inset: 0; container-type: size;
	pointer-events: none;
}
.globe__stage canvas {
	position: absolute; inset: 0; width: 100%; height: 100%;
	opacity: 0; transition: opacity 1.6s var(--ease);
}
.globe.is-ready .globe__stage canvas { opacity: 1; }

/* Poster: shown at once, and kept when WebGL is unavailable. Same footprint as the 3D globe. */
.globe__poster {
	position: absolute; left: 50%; top: 50%;
	width: min(84cqh, 84cqw); aspect-ratio: 1;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background:
		radial-gradient(circle at 34% 30%, rgba(80, 120, 220, .22), transparent 55%),
		radial-gradient(circle at 50% 50%, #0b1226 0%, #070a16 70%);
	box-shadow: 0 0 0 1px rgba(141, 176, 255, .12), 0 0 90px -10px rgba(59, 123, 255, .35), inset -30px -40px 80px rgba(0, 0, 0, .55), inset 6px 8px 40px rgba(127, 231, 255, .08);
	transition: opacity 1.2s var(--ease);
}
.globe__poster span { /* dotted surface */
	position: absolute; inset: 0; border-radius: 50%;
	background-image: radial-gradient(rgba(141, 176, 255, .35) 1px, transparent 1.4px);
	background-size: 9px 9px;
	-webkit-mask-image: radial-gradient(circle at 40% 38%, #000 10%, transparent 68%); mask-image: radial-gradient(circle at 40% 38%, #000 10%, transparent 68%);
	opacity: .5;
}
.globe.is-ready .globe__poster { opacity: 0; }

/* ---------- pins (positioned every frame by globe/pins.js) ---------- */
.globe__pins { position: absolute; inset: 0; }
.pin {
	position: absolute; left: 0; top: 0;
	transition: opacity .5s var(--ease);
	will-change: transform;
}
.pin.is-hidden { opacity: 0; pointer-events: none; }
.pin__hit {
	position: absolute; left: -16px; top: -16px; width: 32px; height: 32px; border-radius: 50%;
	pointer-events: auto; cursor: default;
}
.pin__label {
	position: absolute; left: 14px; bottom: 10px;
	display: grid; gap: 1px; padding-left: 10px;
	border-left: 1px solid rgba(238, 241, 248, .28);
	white-space: nowrap;
	opacity: 0; transform: translate3d(-4px, 0, 0);
	transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.pin__label b { font-size: 13px; font-weight: 600; letter-spacing: .01em; color: var(--paper); }
.pin__label em {
	font-style: normal; font-size: 10px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--paper-faint);
	display: inline-flex; align-items: center; gap: 6px;
}
.pin--origin .pin__label em::before,
.pin.is-active .pin__label em::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--amber); }
.pin.is-active.is-arrived .pin__label em::before { background: var(--cyan); }
.pin--origin .pin__label, .pin.is-active .pin__label, .pin.is-hover .pin__label { opacity: 1; transform: none; }

.pin__card {
	position: absolute; left: 24px; top: 8px;
	width: max-content; max-width: 260px; padding: 10px 12px; border-radius: 12px;
	background: rgba(12, 16, 31, .78); border: 1px solid var(--line-strong);
	-webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
	font-size: 12.5px; line-height: 1.45; color: var(--paper-dim);
	opacity: 0; transform: translate3d(0, -4px, 0); pointer-events: none;
	transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.pin__card strong { display: block; color: var(--paper); font-weight: 600; font-size: 13px; }
.pin__card .pin__route { display: block; margin-top: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; color: var(--blue-soft); }
.pin.is-hover .pin__card { opacity: 1; transform: none; }
.pin.is-hover { z-index: 2; }

/* ---------- HUD ---------- */
.globe__hud {
	position: absolute; left: 50%; bottom: clamp(24px, 6vh, 64px);
	width: min(400px, 84%);
	display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: 18px;
	padding: 12px 16px; border-radius: 16px;
	background: rgba(12, 16, 31, .5); border: 1px solid var(--line);
	-webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
	opacity: 0; transform: translate3d(-50%, 8px, 0);
	transition: opacity 1s var(--ease) .6s, transform 1s var(--ease) .6s;
}
.globe.is-ready .globe__hud { opacity: 1; transform: translate3d(-50%, 0, 0); }
.hud__end { display: grid; gap: 2px; min-width: 0; }
.hud__end--to { text-align: right; }
.hud__k { font-size: 10px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--paper-faint); }
.hud__v { font-size: 14px; font-weight: 600; white-space: nowrap; transition: opacity .4s; }
.hud__track { display: grid; gap: 8px; padding-bottom: 6px; }
.hud__state {
	order: -1; justify-self: center;
	display: inline-flex; align-items: center; gap: 6px;
	font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--paper-dim);
}
.hud__state::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.globe__hud.is-arrived .hud__state::before { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.hud__bar { position: relative; height: 1px; background: var(--line-strong); }
.hud__bar i {
	position: absolute; inset: 0; transform-origin: left; transform: scaleX(.55);
	background: linear-gradient(90deg, rgba(255, 176, 84, .15), var(--amber));
}

/* ---------- tablet landscape: side by side, smaller globe ---------- */
@media (max-width: 1199px) {
	.hero { --copy-w: 28rem; --globe-gap: 24px; --globe-bleed: 10vw; }
	.hero__title { font-size: clamp(2.6rem, 1rem + 4vw, 4.2rem); }
}

/* ---------- stacked: tablet portrait + phones (dedicated composition) ---------- */
@media (max-width: 899px) {
	.hero { min-height: 0; }
	.hero__inner {
		flex-direction: column; align-items: stretch;
		padding-top: calc(var(--header-top) + var(--header-h) + 28px); padding-bottom: var(--section-pad);
	}
	.hero__copy { width: 100%; max-width: 36rem; }
	.hero__status { order: 0; margin: 0 0 18px; padding: 6px 12px 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: rgba(238, 241, 248, .03); font-size: 12.5px; }
	.hero__title { font-size: clamp(2.5rem, 10.4vw, 4rem); }
	.hero__desc { font-size: 15px; }
	.hero__actions { width: 100%; margin-top: 24px; }
	/* Dedicated mobile order: headline → CTA → globe → tracking. The copy wrapper
	 * dissolves so its children can be ordered around the globe. */
	.hero__copy { display: contents; }
	.hero__status { order: 0; align-self: flex-start; }
	.hero__title { order: 1; }
	.hero__tagline { order: 2; }
	.hero__desc { order: 3; }
	.hero__actions { order: 4; }
	.globe {
		order: 5;
		position: relative; inset: auto; width: auto;
		height: clamp(340px, 96vw, 560px);
		margin: 8px calc(var(--gutter) * -1) 0;
		opacity: 1; transform: none;
	}
	.globe__hud { bottom: 6px; width: min(360px, calc(100% - 2 * var(--gutter))); padding: 10px 14px; gap: 14px; }
	.hero__trackform { order: 6; width: 100%; margin-top: 14px; }
}
@media (max-width: 559px) {
	.hero__actions .btn { flex: 1; }
	.pin__label b { font-size: 12px; }
}

/* ---------- reduced motion: final state, nothing moves ---------- */
@media (prefers-reduced-motion: reduce) {
	.hero__copy > * { animation: none; }
	.status-dot::after { animation: none; opacity: 0; }
	.hero__copy, .globe { transform: none; }
	.globe__stage canvas, .globe__poster, .globe__hud, .pin, .pin__label, .pin__card { transition: none; }
}
