/* ==========================================================================
   Hero stage — layered, GPU-composited scene (see assets/js/scenes/hero.js).
   Every moving plane is its own element animated with transform/opacity only,
   so the browser slides cached bitmaps instead of re-rasterising anything.
   ========================================================================== */

.stage {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1440px;
  height: 920px;
  margin-left: -720px;
  pointer-events: none;
}
.stage .layer {
  position: absolute;
  inset: 0;
}
/* only things that really move get their own GPU layer */
.earthwrap,
#moon,
.explorer,
.lantern {
  will-change: transform;
}
.stage svg {
  display: block;
}
.stage .anim {
  position: absolute;
  inset: 0;
}
.stage canvas {
  display: block;
}
#moon {
  width: 1440px;
  height: 920px;
}

/* Soft glows: radial gradients (cheap) rather than blurred SVG shapes (expensive) */
.glow {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    var(--c),
    color-mix(in srgb, var(--c) 46%, transparent) 36%,
    color-mix(in srgb, var(--c) 14%, transparent) 66%,
    transparent 100%
  );
}
.glow.breathe {
  animation: breathe 9s ease-in-out infinite;
}
@keyframes breathe {
  0%,
  100% {
    opacity: var(--glow-o);
  }
  50% {
    opacity: calc(var(--glow-o) * 0.78);
  }
}
.drift,
.comet,
.glow.breathe,
.shoot {
  will-change: transform, opacity;
}
.drift {
  animation: drift 26s ease-in-out infinite alternate;
}
.comet {
  animation: drift 70s ease-in-out infinite alternate;
}
@keyframes drift {
  from {
    transform: translate3d(-18px, 6px, 0);
  }
  to {
    transform: translate3d(18px, -6px, 0);
  }
}

@keyframes twinkle {
  from {
    opacity: 0.2;
  }
  to {
    opacity: 1;
  }
}
.shoot {
  position: absolute;
  left: 230px;
  top: 92px;
  width: 150px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #fff);
  opacity: 0;
  animation: shoot 40s linear 6s infinite;
}
:root[data-theme='light'] .shoot {
  display: none;
}
@keyframes shoot {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(13deg);
  }
  1% {
    opacity: 0.9;
  }
  4% {
    opacity: 0;
    transform: translate3d(200px, 46px, 0) rotate(13deg);
  }
  100% {
    opacity: 0;
    transform: translate3d(200px, 46px, 0) rotate(13deg);
  }
}

.earthwrap {
  position: absolute;
  left: 798px;
  top: 196px;
  width: 540px;
  height: 540px;
  pointer-events: none;
}
.earthwrap canvas {
  width: 100%;
  height: 100%;
}

/* ---------- the explorer ---------- */
.explorer {
  position: absolute;
  left: 1092px;
  top: 688px;
  width: 120px;
  height: 80px;
}
.ex {
  overflow: visible;
}
.ex-arm,
.ex-head,
.ex-lantern {
  transform-box: view-box;
}
.ex-arm {
  transform-origin: 69px 36px;
  animation: extype 0.23s ease-in-out infinite alternate;
}
@keyframes extype {
  from {
    transform: rotate(-2.6deg);
  }
  to {
    transform: rotate(2.6deg);
  }
}
.ex-head {
  transform-origin: 66px 30px;
  animation: exlook 12s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}
@keyframes exlook {
  0%,
  56%,
  100% {
    transform: rotate(0);
  }
  63%,
  79% {
    transform: rotate(-18deg) translate(-1px, -1px);
  }
  86% {
    transform: rotate(-5deg);
  }
}
.ex-cone {
  animation: excone 2.4s ease-in-out infinite alternate;
}
@keyframes excone {
  from {
    opacity: 0.55;
  }
  to {
    opacity: 1;
  }
}
.ex-flame {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: exflame 1.1s ease-in-out infinite alternate;
}
@keyframes exflame {
  from {
    transform: scale(1, 0.85);
    opacity: 0.8;
  }
  to {
    transform: scale(0.9, 1.1);
    opacity: 1;
  }
}
.lantern {
  animation: exflame 1.6s ease-in-out infinite alternate;
}
.ex-code text {
  font:
    600 7px ui-monospace,
    'SF Mono',
    Menlo,
    monospace;
  opacity: 0;
  animation: exglyph 5.4s ease-out infinite;
}
.ex-code .g2 {
  animation-delay: 1.8s;
}
.ex-code .g3 {
  animation-delay: 3.6s;
}
@keyframes exglyph {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  15% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translateY(-34px);
  }
}

/* ---------- live Earth chip ---------- */
.earthchip {
  position: absolute;
  right: 96px;
  top: 128px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  font: 500 10.5px var(--sans);
  letter-spacing: 0.14em;
  color: var(--muted);
}
.ec-live {
  display: flex;
  align-items: center;
  gap: 9px;
  text-transform: uppercase;
}
.ec-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pin);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.7);
  }
}

/* ---------- icons ---------- */
.ic {
  flex: none;
  display: inline-block;
  vertical-align: middle;
}
.ico {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 30%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .glow.breathe,
  .drift,
  .comet,
  .tw,
  .shoot,
  .ex-arm,
  .ex-head,
  .ex-breathe,
  .ex-scarf,
  .ex-hands,
  .ex-steam,
  .ex-cone,
  .ex-flame,
  .lantern,
  .ex-code text,
  .ec-live i {
    animation: none !important;
  }
  .ex-code text {
    opacity: 0;
  }
}

/* the globe keeps its own box (beats the generic `.stage .layer` inset) */
.stage .earthwrap {
  inset: auto;
  left: 798px;
  top: 196px;
  width: 540px;
  height: 540px;
}

/* home: a label pinned to Gurugram on the globe (position set from earth.js as the globe turns) */
.ec-home {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.ec-home:before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, var(--pin), color-mix(in srgb, var(--fg) 70%, transparent));
  transform-origin: 0 0;
  transform: rotate(-128deg);
}

.eh-card {
  position: absolute;
  right: 22px;
  top: -62px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px 10px 12px;
  white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--fg) 22%, transparent);
  border-radius: 18px;
  background: rgb(var(--bg-rgb) / 0.66);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.25);
  color: var(--soft);
}
.eh-ic {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.eh-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.eh-main small {
  display: flex;
  align-items: center;
  gap: 7px;
  font: 500 9.5px var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.eh-main small i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pin);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pin) 28%, transparent);
}
.eh-main strong {
  font: 400 19px/1.1 var(--serif);
  color: var(--fg);
  letter-spacing: 0.005em;
}
.eh-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  padding-left: 14px;
  border-left: 1px solid color-mix(in srgb, var(--line) 50%, transparent);
}
.eh-side b {
  font: 600 15px var(--sans);
  letter-spacing: 0.05em;
  color: var(--fg);
}
.eh-side em {
  font: 500 11.5px var(--sans);
  font-style: normal;
  color: var(--soft);
}

/* the explorer, alive: a little wind in the scarf, steam from the flask, light from the screen on his hands */
.ex-scarf,
.ex-steam,
.ex-hands {
  transform-box: view-box;
}
.ex-scarf {
  transform-origin: 71px 31px;
  animation: exscarf 2.6s ease-in-out infinite alternate;
}
@keyframes exscarf {
  from {
    transform: rotate(-5deg) skewY(-3deg);
  }
  to {
    transform: rotate(6deg) skewY(4deg);
  }
}
.ex-steam {
  animation: exsteam 3.4s ease-in-out infinite;
}
@keyframes exsteam {
  0% {
    opacity: 0;
    transform: translateY(2px);
  }
  40% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translateY(-4px);
  }
}
.ex-hands {
  opacity: 0.22;
  animation: exhands 1.7s ease-in-out infinite alternate;
}
@keyframes exhands {
  from {
    opacity: 0.1;
  }
  to {
    opacity: 0.34;
  }
}
.ex-breathe {
  transform-box: view-box;
  transform-origin: 74px 64px;
  animation: exbreathe 4.6s ease-in-out infinite;
}
@keyframes exbreathe {
  50% {
    transform: scale(1.012, 1.02);
  }
}
