/* ==========================================================================
   HERO
   --------------------------------------------------------------------------
   - Background: drifting gradient-mesh blobs + masked grid, both parallaxing
     against the pointer (JS writes --mx / --my in the range -1…1)
   - Copy: staggered entrance, headline words rising out of overflow masks
   - Visual: a wireframe globe echoing the PlanetLink mark, with orbit rings,
     pinned capability labels and floating glass stat cards
   ========================================================================== */

.hero {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding-block: calc(var(--header-h) + 38px + 2rem) 5.5rem;
  overflow: hidden;
}

/* Fade the hero into the page background */
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 180px;
  background: linear-gradient(to bottom, transparent, var(--c-bg));
  z-index: -1;
  pointer-events: none;
}

/* --- Animated background ------------------------------------------------- */
.hero__bg { position: absolute; inset: 0; z-index: -2; pointer-events: none; }

.hero__bg-layer {
  position: absolute;
  inset: -60px;
  transform: translate3d(calc(var(--mx, 0) * -22px), calc(var(--my, 0) * -22px), 0);
  transition: transform 1.4s var(--ease-out);
}

.hero__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform;
  animation: blob-drift 24s var(--ease-in-out) infinite alternate;
}
.hero__blob--1 {
  width: min(640px, 95vw); aspect-ratio: 1;
  left: -10%; top: -20%;
  background: radial-gradient(circle, rgb(43 163 207 / .55), transparent 68%);
}
.hero__blob--2 {
  width: min(560px, 85vw); aspect-ratio: 1;
  right: -12%; top: 4%;
  background: radial-gradient(circle, rgb(0 229 255 / .3), transparent 68%);
  animation-duration: 28s;
  animation-direction: alternate-reverse;
}
.hero__blob--3 {
  width: min(700px, 100vw); aspect-ratio: 1;
  left: 28%; bottom: -38%;
  background: radial-gradient(circle, rgb(20 104 141 / .5), transparent 68%);
  animation-duration: 32s;
  animation-delay: -8s;
}

@keyframes blob-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(70px, 40px, 0) scale(1.12); }
  100% { transform: translate3d(-40px, 90px, 0) scale(.94); }
}

.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgb(255 255 255 / .04) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / .04) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 25%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 25%, transparent 75%);
}

/* --- Layout -------------------------------------------------------------- */
.hero__inner {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  align-items: center;
  gap: clamp(2rem, 4vw, 4rem);
}

/* --- Copy ---------------------------------------------------------------- */
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  padding: .35rem .95rem .35rem .4rem;
  border-radius: var(--r-full);
  font-size: .8125rem;
  color: var(--c-text-muted);
  background: rgb(255 255 255 / .04);
  box-shadow: inset 0 0 0 1px var(--c-border-strong);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
}
.hero__badge-tag {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .2rem .6rem;
  border-radius: var(--r-full);
  font-size: .72rem;
  font-weight: 700;
  color: var(--c-ink);
  background: var(--grad-brand);
}
.pulse-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-ink);
}
.pulse-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  animation: pulse 2s var(--ease-out) infinite;
}
@keyframes pulse {
  from { transform: scale(1); opacity: .8; }
  to   { transform: scale(3); opacity: 0; }
}

.hero__title {
  margin-top: 1.25rem;
  font-size: var(--fs-h1);
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: -.045em;
}

/* Word mask reveal: the outer span clips, the inner span rises into place */
.hero__title .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: .1em;
  margin-bottom: -.1em;
}
.hero__title .word > span { display: inline-block; }
.js .hero__title .word > span {
  transform: translateY(110%);
  transition: transform 1.1s var(--ease-out);
  transition-delay: calc(180ms + var(--w, 0) * 60ms);
}
.js .is-loaded .hero__title .word > span { transform: none; }

.hero__lead    { margin-top: 1.25rem; max-width: 34rem; }
.hero__actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .9rem; }

.hero__points {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.5rem;
  padding: 0;
  list-style: none;
  font-size: var(--fs-sm);
  color: var(--c-text-subtle);
}
.hero__points li { display: inline-flex; align-items: center; gap: .45rem; }
.hero__points .icon { width: 1rem; height: 1rem; color: var(--c-primary-2); }

/* Staggered entrance for badge / lead / actions / points / visual */
.js [data-hero] {
  opacity: 0;
  transform: translateY(22px);
  filter: blur(6px);
  transition:
    opacity .9s var(--ease-out),
    transform .9s var(--ease-out),
    filter .9s var(--ease-out);
  transition-delay: calc(120ms + var(--i, 0) * 100ms);
}
.js .is-loaded [data-hero] { opacity: 1; transform: none; filter: none; }

/* --- Visual: wireframe globe + orbits ------------------------------------ */
.hero__visual {
  position: relative;
  width: 100%;
  max-width: 540px;
  aspect-ratio: 1;
  justify-self: center;
}

.orbit-system { position: absolute; inset: 0; transition: transform .6s var(--ease-out); }

.globe {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40%;
  aspect-ratio: 1;
  translate: -50% -50%;
  animation: globe-bob 9s ease-in-out infinite;
}
.globe__svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 40px rgb(43 163 207 / .45));
}
/* Meridians drift to suggest rotation without repainting the whole globe */
.globe__mesh   { animation: mesh-spin 26s linear infinite; transform-origin: center; }
.globe__node   { animation: node-flicker 4s ease-in-out infinite; }
.globe__node:nth-of-type(2n) { animation-delay: -1.3s; }
.globe__node:nth-of-type(3n) { animation-delay: -2.6s; }

@keyframes globe-bob     { 50% { translate: -50% calc(-50% - 10px); } }
@keyframes mesh-spin     { to { transform: rotate(360deg); } }
@keyframes node-flicker  { 50% { opacity: .35; } }

.orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  animation: spin var(--spin, 40s) linear infinite;
}
.orbit--inner { --spin: 40s; width: 60%; border: 1px dashed rgb(255 255 255 / .13); }
.orbit--outer { --spin: 64s; width: 84%; border: 1px solid rgb(255 255 255 / .07); animation-direction: reverse; }

/* A glowing comet rides each ring */
.orbit::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -3px;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--c-accent);
  box-shadow: 0 0 12px 3px rgb(0 229 255 / .7);
}
.orbit--inner::before { top: auto; bottom: -3px; }

@keyframes spin { to { rotate: 360deg; } }

.orbit__node {
  position: absolute;
  translate: -50% -50%;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .75rem .45rem .5rem;
  border-radius: var(--r-full);
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
/* Markers inside a rotating ring counter-rotate so their icon stays upright */
.orbit .orbit__node { animation: spin var(--spin) linear infinite reverse; }

.orbit__node--mini {
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
          backdrop-filter: none;
}

.orbit__node .icon-wrap {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--c-ink);
  background: var(--grad-brand);
  box-shadow: 0 0 16px -2px rgb(43 163 207 / .9);
}
.orbit__node .icon { width: 14px; height: 14px; stroke-width: 2; }

/* Capability labels are pinned to fixed points on the outer ring (top-left,
   left, bottom-right) so they stay legible and never drift under a card. */
.orbit-labels {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 84%;
  aspect-ratio: 1;
  translate: -50% -50%;
  z-index: 2;
}
.orbit-labels .orbit__node { animation: label-float 7s ease-in-out var(--f, 0s) infinite; }
@keyframes label-float { 50% { translate: -50% calc(-50% - 7px); } }

/* --- Floating glass cards ------------------------------------------------ */
.float-card {
  position: absolute;
  z-index: 3;
  min-width: 190px;
  padding: .95rem 1.05rem;
  border-radius: var(--r-lg);
  font-size: .8rem;
  overflow: hidden;
  animation: float 7s ease-in-out infinite;
  transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out);
}
.float-card:hover {
  box-shadow: var(--shadow-lg), 0 0 40px -10px rgb(43 163 207 / .6), inset 0 1px 0 rgb(255 255 255 / .08);
}
/* Glare that follows the cursor — JS writes --gx / --gy */
.float-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(240px circle at var(--gx, 50%) var(--gy, 0%), rgb(255 255 255 / .12), transparent 60%);
  opacity: 0;
  transition: opacity var(--dur);
}
.float-card:hover::after { opacity: 1; }

/* Parked in the corners, clear of the ring the labels sit on */
.float-card--roles { left: -12%; bottom: -3%; }
.float-card--time  { right: -12%; top: -5%; animation-delay: -3.5s; }

@keyframes float { 50% { translate: 0 -12px; } }

.float-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.float-card__title { font-weight: 600; color: var(--c-text); }
.float-card__meta  { color: var(--c-text-subtle); font-size: .72rem; }
.float-card__big   {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .15rem .5rem;
  border-radius: var(--r-full);
  font-size: .7rem;
  font-weight: 600;
  color: var(--c-success);
  background: rgb(52 211 153 / .12);
}
.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

/* Stacked role avatars */
.avatars { display: flex; margin-top: .65rem; }
.avatars span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-right: -5px;
  border-radius: 50%;
  font-size: .6rem;
  line-height: 1;
  letter-spacing: -.01em;
  font-weight: 700;
  color: var(--c-ink);
  background: var(--grad-brand);
  box-shadow: 0 0 0 2px var(--c-elevated);
}
.avatars span:last-child {
  color: var(--c-text-muted);
  background: var(--c-surface-2);
  box-shadow: 0 0 0 2px var(--c-elevated), inset 0 0 0 1px var(--c-border);
}

.sparkline { width: 100%; height: 40px; margin-top: .6rem; overflow: visible; }
.sparkline__line {
  fill: none;
  stroke: url(#spark-grad);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  animation: draw 2.2s var(--ease-out) 1.2s forwards;
}
.sparkline__area { fill: url(#spark-fill); opacity: 0; animation: fade-in 1s ease 2.4s forwards; }

@keyframes draw    { to { stroke-dashoffset: 0; } }
@keyframes fade-in { to { opacity: 1; } }

/* --- Scroll cue ---------------------------------------------------------- */
.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 1.75rem;
  translate: -50% 0;
  display: grid;
  justify-items: center;
  gap: .5rem;
  font-size: var(--fs-xs);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-text-subtle);
}
.hero__scroll-mouse {
  position: relative;
  width: 22px;
  height: 34px;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1.5px var(--c-border-strong);
}
.hero__scroll-mouse::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 7px;
  width: 3px;
  height: 7px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--c-accent);
  animation: scroll-cue 1.8s var(--ease-in-out) infinite;
}
@keyframes scroll-cue {
  0%   { transform: translateY(0); opacity: 1; }
  70%  { transform: translateY(10px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* --- Responsive ---------------------------------------------------------- */

/* Short laptop screens: trim the headline so the CTAs still land above the fold */
@media (min-width: 1101px) and (max-height: 900px) {
  .hero__title  { font-size: clamp(2.4rem, 1rem + 3.6vw, 3.6rem); }
  .hero__lead   { font-size: 1.0625rem; }
  .hero__points { margin-top: 1.25rem; }
  .hero__visual { max-width: 450px; }
}

@media (max-width: 1100px) {
  .hero { padding-bottom: 4rem; }
  .hero__inner  { grid-template-columns: 1fr; text-align: center; }
  .hero__copy   { display: grid; justify-items: center; }
  .hero__actions,
  .hero__points { justify-content: center; }
  .hero__visual { max-width: 440px; }
  .hero__scroll { display: none; }
}

@media (max-width: 520px) {
  /* Keep the badge on one line instead of breaking mid-phrase */
  .hero__badge     { flex-direction: column; gap: .45rem; padding: .5rem .9rem; font-size: .75rem; }
  .hero__badge-tag { white-space: nowrap; }

  .hero__actions .btn     { flex: 1 1 100%; }
  .orbit__node            { font-size: .68rem; padding: .35rem .6rem .35rem .4rem; }
  .orbit__node .icon-wrap { width: 22px; height: 22px; }
  .float-card             { min-width: 150px; padding: .7rem .8rem; }
  .float-card--roles      { left: -4%; bottom: 0; }
  .float-card--time       { right: -4%; top: 0; }
}
