/* ==========================================================================
   Homepage hero: headline + interactive dotted globe with orbiting services.
   Markup in index.html, behaviour in js/hero.js.
   ========================================================================== */

.hx {
  --hx-ink: #fff;
  --hx-muted: #A0A0B0;
  --hx-panel: rgba(16, 17, 22, 0.9);
  --hx-panel-solid: #101116;
  --hx-line: rgba(255, 255, 255, 0.09);
  --hx-glow: rgba(0, 170, 255, 0.35);
  --hx-violet: #7B2FFF;
  --hx-green: #00E676;
  --mx: 50%;
  --my: 40%;
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 120px 0 90px;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg-primary);
}

[data-theme="light"] .hx {
  --hx-ink: #0A0A0A;
  --hx-muted: #555566;
  --hx-panel: rgba(255, 255, 255, 0.94);
  --hx-panel-solid: #fff;
  --hx-line: rgba(10, 20, 40, 0.1);
  --hx-glow: rgba(0, 136, 255, 0.25);
}

/* ---------- Background layers ---------- */
.hx-grid,
.hx-grid::after {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(var(--hx-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--hx-line) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center top;
}

.hx-grid {
  opacity: 0.55;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 75%);
}

/* Brighter grid revealed under the cursor */
.hx-grid::after {
  content: '';
  background-image:
    linear-gradient(rgba(0, 170, 255, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 170, 255, 0.5) 1px, transparent 1px);
  -webkit-mask-image: radial-gradient(260px circle at var(--mx) var(--my), #000, transparent 70%);
  mask-image: radial-gradient(260px circle at var(--mx) var(--my), #000, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.hx.is-pointer .hx-grid::after {
  opacity: 1;
}

.hx-aurora {
  position: absolute;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  overflow: hidden;
}

.hx-aurora span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  animation: hxFloat 18s ease-in-out infinite alternate;
}

.hx-aurora span:nth-child(1) {
  width: 46vw;
  height: 46vw;
  top: -18vw;
  right: -8vw;
  background: radial-gradient(circle, rgba(0, 170, 255, 0.55), transparent 65%);
}

.hx-aurora span:nth-child(2) {
  width: 36vw;
  height: 36vw;
  bottom: -16vw;
  left: -10vw;
  background: radial-gradient(circle, rgba(123, 47, 255, 0.4), transparent 65%);
  animation-delay: -6s;
}

.hx-aurora span:nth-child(3) {
  width: 26vw;
  height: 26vw;
  top: 30%;
  left: 38%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.25), transparent 65%);
  animation-delay: -11s;
}

[data-theme="light"] .hx-aurora span {
  opacity: 0.3;
}

@keyframes hxFloat {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(4vw, 3vw, 0) scale(1.12); }
  100% { transform: translate3d(-3vw, -2vw, 0) scale(0.92); }
}

/* Fade into the next section */
.hx::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 140px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--bg-primary));
}

/* ---------- Layout ---------- */
.hx-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: center;
}

/* ---------- Copy ---------- */
.hx-copy > * {
  opacity: 0;
  transform: translateY(18px);
  animation: hxIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.hx-copy > :nth-child(2) { animation-delay: 0.08s; }
.hx-copy > :nth-child(3) { animation-delay: 0.16s; }
.hx-copy > :nth-child(4) { animation-delay: 0.24s; }
.hx-copy > :nth-child(5) { animation-delay: 0.32s; }

@keyframes hxIn {
  to { opacity: 1; transform: none; }
}

.hx-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.9rem 0.45rem 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-primary) 8%, transparent);
  color: var(--hx-ink);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.hx-eyebrow:hover {
  border-color: var(--border-glow);
  background: color-mix(in srgb, var(--accent-primary) 14%, transparent);
}

.hx-eyebrow i {
  transition: transform 0.3s ease;
}

.hx-eyebrow:hover i {
  transform: translateX(3px);
}

.hx-eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hx-green);
  box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.6);
  animation: hxPing 2s ease-out infinite;
}

@keyframes hxPing {
  0% { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.6); }
  80%, 100% { box-shadow: 0 0 0 9px rgba(0, 230, 118, 0); }
}

.hx-title {
  margin: 1.4rem 0 1.25rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  color: var(--hx-ink);
  text-transform: none;
}

.hx-rot {
  display: block;
  white-space: nowrap;
  height: 1.12em;
  overflow: hidden;
}

.hx-rot-word {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 0.86em;
  line-height: 1.3;
  background: linear-gradient(100deg, #00D4FF 0%, #00AAFF 35%, #7B2FFF 70%, #00D4FF 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: hxShine 6s linear infinite;
}

.hx-rot-word.is-out {
  animation: hxShine 6s linear infinite, hxWordOut 0.35s cubic-bezier(0.5, 0, 0.75, 0) forwards;
}

.hx-rot-word.is-in {
  animation: hxShine 6s linear infinite, hxWordIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes hxShine {
  to { background-position: -220% 0; }
}

@keyframes hxWordOut {
  to { transform: translateY(-70%); opacity: 0; filter: blur(6px); }
}

@keyframes hxWordIn {
  from { transform: translateY(70%); opacity: 0; filter: blur(6px); }
  to { transform: none; opacity: 1; filter: none; }
}

.hx-title-end {
  display: block;
}

.hx-sub {
  max-width: 34rem;
  margin: 0 0 2rem;
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--hx-muted);
}

.hx-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 2.4rem;
}

.hx-btn {
  --tx: 0px;
  --ty: 0px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.95rem 1.5rem;
  border-radius: 12px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transform: translate(var(--tx), var(--ty));
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.hx-btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #00AAFF, #0077FF);
  box-shadow: 0 10px 30px -8px rgba(0, 170, 255, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  overflow: hidden;
}

/* Light sweep on hover */
.hx-btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s ease;
}

.hx-btn-primary:hover::before {
  transform: translateX(120%);
}

.hx-btn-primary:hover {
  color: #fff;
  box-shadow: 0 16px 40px -8px rgba(0, 170, 255, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.hx-btn-primary i {
  transition: transform 0.3s ease;
}

.hx-btn-primary:hover i {
  transform: translate(2px, -2px);
}

.hx-btn-ghost {
  color: var(--hx-ink);
  border: 1px solid var(--hx-line);
  background: color-mix(in srgb, var(--hx-panel-solid) 55%, transparent);
  backdrop-filter: blur(8px);
}

.hx-btn-ghost:hover {
  color: var(--hx-ink);
  border-color: var(--border-glow);
}

.hx-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

/* ---------- Globe ---------- */
.hx-orbit {
  position: relative;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 1 / 1;
  margin-left: auto;
  touch-action: pan-y;
  opacity: 0;
  animation: hxStageIn 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s forwards;
}

@keyframes hxStageIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: none; }
}

.hx-globe {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
}

.hx-orbit.is-dragging .hx-globe {
  cursor: grabbing;
}

/* Label pinned to Mauritius on the globe (positioned by js/hero.js) */
.hx-pin {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.hx-pin-label {
  position: absolute;
  bottom: 14px;
  left: 0;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid rgba(0, 230, 118, 0.45);
  border-radius: 999px;
  background: var(--hx-panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--hx-ink);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  white-space: nowrap;
  box-shadow: 0 8px 24px -8px rgba(0, 230, 118, 0.5);
}

.hx-pin-label i {
  color: var(--hx-green);
}

[data-theme="light"] .hx-pin-label i {
  color: #0E9F6E;
}

/* Services orbiting the globe (positioned by js/hero.js) */
.hx-sats {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hx-sat {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem 0.45rem 0.45rem;
  border: 1px solid var(--hx-line);
  border-radius: 999px;
  background: var(--hx-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--hx-ink);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  pointer-events: auto;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.6);
  will-change: transform, opacity;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.hx-sat i {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent-primary) 16%, transparent);
  color: var(--accent-primary);
  font-size: 1rem;
}

.hx-sat:hover,
.hx-sat:focus-visible {
  color: var(--hx-ink);
  text-shadow: none;
  border-color: var(--border-glow);
  box-shadow: 0 12px 34px -8px var(--hx-glow);
}

.hx-sat:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

/* Before JS places them, keep the badges out of sight */
.hx-orbit:not(.is-ready) .hx-sat,
.hx-orbit:not(.is-ready) .hx-pin {
  opacity: 0;
}

.hx-hint {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 2%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--hx-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  opacity: 0.7;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.hx-orbit.is-touched .hx-hint {
  opacity: 0;
}

/* Scroll cue */
.hx-scroll {
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 24px;
  height: 38px;
  margin-left: -12px;
  border: 2px solid var(--hx-line);
  border-radius: 14px;
  opacity: 0.8;
}

.hx-scroll span {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--accent-primary);
  animation: hxScroll 1.8s ease-in-out infinite;
}

@keyframes hxScroll {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hx {
    padding: 110px 0 60px;
  }

  .hx-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hx-copy {
    text-align: center;
  }

  .hx-sub {
    margin-left: auto;
    margin-right: auto;
  }

  .hx-ctas {
    justify-content: center;
  }

  .hx-orbit {
    max-width: 560px;
    margin: 0 auto;
  }

  .hx-scroll {
    display: none;
  }
}

@media (max-width: 700px) {
  .hx {
    min-height: 0;
    padding: 104px 0 30px;
  }

  .hx-title {
    font-size: clamp(2.15rem, 9.5vw, 2.8rem);
  }

  .hx-sub {
    font-size: 1rem;
  }

  .hx-eyebrow {
    font-size: 0.68rem;
    padding: 0.4rem 0.75rem 0.4rem 0.65rem;
  }

  .hx-ctas {
    flex-direction: column;
    margin-bottom: 0;
  }

  .hx-btn {
    justify-content: center;
  }

  .hx-sat {
    padding: 0.3rem;
    font-size: 0.72rem;
  }

  /* Icons only on phones; labels would crowd the globe */
  .hx-sat span {
    display: none;
  }

  .hx-sat i {
    width: 30px;
    height: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hx-copy > *,
  .hx-orbit {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .hx-aurora span,
  .hx-rot-word,
  .hx-eyebrow-dot,
  .hx-scroll span {
    animation: none;
  }
}
