/* =========================================================
   EDGE — Hero (cinematic scroll) + Navigation
   ========================================================= */

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition: background .5s var(--ease), backdrop-filter .5s, border-color .5s, padding .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(8,0,18,0.6);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: padding .4s var(--ease);
}
.nav.scrolled .nav-inner { padding-block: 14px; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.04em;
}
.logo-mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--neon-violet), var(--violet));
  box-shadow: 0 0 24px rgba(168,85,247,0.6), inset 0 1px 0 rgba(255,255,255,0.4);
  position: relative;
}
.logo-mark::after {
  content: "";
  position: absolute; inset: 8px;
  border-radius: 4px;
  border: 1.5px solid rgba(255,255,255,0.85);
  border-right-color: transparent;
  border-bottom-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
  list-style: none;
}
.nav-links a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  transition: color .3s;
}
.nav-links a::after {
  content: "";
  position: absolute; left: 0; bottom: -6px;
  width: 0; height: 1.5px;
  background: var(--neon-violet);
  transition: width .35s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.nav-cta { display: flex; align-items: center; gap: 16px; }

.burger {
  display: none;
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--glass);
  position: relative;
}
.burger span {
  position: absolute;
  left: 12px; right: 12px; height: 1.8px;
  background: var(--text);
  transition: transform .35s var(--ease), opacity .25s;
}
.burger span:nth-child(1) { top: 16px; }
.burger span:nth-child(2) { top: 21px; }
.burger span:nth-child(3) { top: 26px; }
.burger.open span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 49;
  background: rgba(8,0,18,0.92);
  backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: var(--gutter);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s var(--ease);
}
.mobile-menu.open { opacity: 1; pointer-events: auto; }
.mobile-menu a {
  font-family: var(--font-display);
  font-size: clamp(2rem, 9vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  padding-block: 8px;
  color: var(--text-soft);
}
.mobile-menu .btn {
  margin-top: 28px;
  align-self: flex-start;
  max-width: 100%;
  font-size: 15px;
  letter-spacing: -0.01em;
  white-space: normal;
}

/* =========================================================
   HERO — pinned cinematic scroll
   ========================================================= */
.hero {
  position: relative;
  height: 720vh;        /* scroll runway */
  z-index: 2;
}
.hero-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
}

/* Earth */
.earth-wrap {
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  width: 116vmin;
  height: 116vmin;
  will-change: transform;
  z-index: 1;
}
.earth {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  box-shadow:
    inset -34px -24px 110px 10px rgba(2,0,10,0.78),
    inset 26px 16px 90px rgba(168,85,247,0.45),
    0 0 90px rgba(124,58,237,0.35);
  background:
    radial-gradient(circle at 36% 30%, #6b3bb8 0%, #4a2390 26%, #2c0f60 52%, #170836 78%, #0c0426 100%);
}
/* continents / city-light texture */
.earth::before {
  content: "";
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(circle at 20% 32%, rgba(192,132,252,0.55) 0 1.4px, transparent 2px),
    radial-gradient(circle at 28% 44%, rgba(168,85,247,0.7) 0 1.6px, transparent 2.4px),
    radial-gradient(circle at 40% 38%, rgba(216,180,254,0.6) 0 1.2px, transparent 2px),
    radial-gradient(circle at 52% 50%, rgba(192,132,252,0.5) 0 1.3px, transparent 2px),
    radial-gradient(circle at 60% 36%, rgba(168,85,247,0.65) 0 1.5px, transparent 2.2px),
    radial-gradient(circle at 70% 56%, rgba(216,180,254,0.55) 0 1.2px, transparent 2px),
    radial-gradient(circle at 44% 64%, rgba(192,132,252,0.45) 0 1.2px, transparent 2px),
    radial-gradient(ellipse 30% 22% at 30% 40%, rgba(74,30,120,0.55), transparent 70%),
    radial-gradient(ellipse 26% 30% at 62% 58%, rgba(60,24,100,0.5), transparent 70%),
    radial-gradient(ellipse 20% 16% at 50% 28%, rgba(54,20,96,0.5), transparent 70%);
  background-size: 100% 100%;
  animation: spin 90s linear infinite;
  opacity: 0.95;
}
.earth::after {  /* terminator shadow + specular */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 26%, rgba(255,255,255,0.18), transparent 30%),
    linear-gradient(115deg, transparent 42%, rgba(4,0,12,0.55) 70%);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* atmosphere */
.atmo {
  position: absolute;
  inset: -5%;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 58%, rgba(168,85,247,0.0) 60%, rgba(168,85,247,0.5) 69%, rgba(124,58,237,0.0) 80%);
  box-shadow: 0 0 160px 30px rgba(124,58,237,0.5), inset 0 0 140px rgba(168,85,247,0.22);
}
.atmo-2 {
  position: absolute;
  inset: -1%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 46%, transparent 66%, rgba(192,132,252,0.45) 70%, transparent 74%);
  filter: blur(6px);
}

/* orbit rings */
.orbits {
  position: absolute;
  left: 50%; top: 58%;
  transform: translate(-50%,-50%);
  width: 116vmin; height: 116vmin;
  z-index: 2;
  pointer-events: none;
  will-change: transform, opacity;
}
.orbit {
  position: absolute;
  left: 50%; top: 50%;
  border: 1px solid rgba(168,85,247,0.18);
  border-radius: 50%;
  transform: translate(-50%,-50%) rotateX(72deg);
}
.orbit.o1 { width: 118%; height: 118%; }
.orbit.o2 { width: 140%; height: 140%; border-color: rgba(192,132,252,0.13); }
.orbit.o3 { width: 168%; height: 168%; border-color: rgba(124,58,237,0.12); }
.orbit .sat {
  position: absolute; top: -3px; left: 50%;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.orbit.o1 { animation: orbspin 28s linear infinite; }
.orbit.o2 { animation: orbspin 44s linear infinite reverse; }
.orbit.o3 { animation: orbspin 64s linear infinite; }
@keyframes orbspin { to { transform: translate(-50%,-50%) rotateX(72deg) rotate(360deg); } }

/* connection grid that fades in */
.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  background-image:
    linear-gradient(rgba(168,85,247,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168,85,247,0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 55%, black, transparent 70%);
  will-change: opacity;
}

/* Hero text stages */
.hero-stages {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.hstage {
  position: absolute;
  width: min(880px, 86vw);
  text-align: center;
  opacity: 0;
  will-change: opacity, transform;
}
.hstage h1 {
  font-size: clamp(2.6rem, 7.5vw, 6.2rem);
}
.hstage h2 {
  font-size: clamp(1.8rem, 4.6vw, 3.6rem);
  font-weight: 600;
}
.hstage p {
  color: var(--text-soft);
  font-size: clamp(1.05rem, 1.8vw, 1.4rem);
  line-height: 1.5;
  max-width: 60ch;
  margin: 22px auto 0;
}
.hstage .mini {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}
.hgrad {
  background: linear-gradient(120deg, #fff 30%, var(--accent) 70%, var(--neon-violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 38px;
  flex-wrap: wrap;
  pointer-events: auto;
}

/* scroll indicator */
.scroll-cue {
  position: absolute;
  bottom: 30px; left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-faint);
  will-change: opacity;
}
.scroll-cue .mouse {
  width: 22px; height: 36px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  position: relative;
}
.scroll-cue .mouse::after {
  content: "";
  position: absolute;
  left: 50%; top: 7px;
  width: 3px; height: 7px;
  border-radius: 3px;
  background: var(--accent);
  transform: translateX(-50%);
  animation: wheel 1.8s var(--ease) infinite;
}
@keyframes wheel { 0%{opacity:0;transform:translate(-50%,0)} 30%{opacity:1} 100%{opacity:0;transform:translate(-50%,12px)} }

/* progress bar */
.hero-progress {
  position: absolute;
  left: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--violet), var(--accent));
  z-index: 7;
  width: 0%;
  box-shadow: 0 0 12px var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .earth::before, .orbit, .scroll-cue .mouse::after { animation: none !important; }
  .hero { height: auto; }
  .hero-stage { position: relative; height: auto; min-height: 100vh; padding-block: 18vh; }
  .hstage { position: relative; opacity: 1 !important; transform: none !important; margin-block: 6vh; }
}

@media (max-width: 860px) {
  .nav-links, .nav-cta .btn { display: none; }
  .burger { display: block; }
  .earth-wrap, .orbits { width: 104vmin; height: 104vmin; }
}
