:root {
  --navy-950: #060f1e;
  --navy-900: #0b1f3a;
  --navy-800: #0e2a4d;
  --navy-700: #173a63;
  --cyan-400: #3fd0ff;
  --cyan-300: #7ee8ff;
  --ice-100: #eafcff;
  --white: #ffffff;
  --violet-400: #8b7bff;
  --green-400: #3fffb0;
  --text-muted: #a9c0d8;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--navy-950);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

a { text-decoration: none; color: inherit; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(6, 15, 30, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  height: 44px;
  width: auto;
  max-width: 100%;
  display: block;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--white);
}

.brand-name .accent { color: var(--cyan-400); }

.main-nav {
  display: flex;
  gap: 32px;
}

.main-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
  position: relative;
}

.main-nav a:hover { color: var(--white); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--white);
  border-radius: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.25s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-sm { padding: 10px 20px; font-size: 0.88rem; }

.btn-primary {
  background: linear-gradient(135deg, var(--cyan-400), #2aa9e0);
  color: var(--navy-950);
  box-shadow: 0 8px 24px rgba(63, 208, 255, 0.28);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(63, 208, 255, 0.4);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding-top: 76px;
  background: var(--navy-950);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  mix-blend-mode: screen;
  animation: drift 18s ease-in-out infinite alternate;
}

.aurora-1 {
  width: 520px; height: 520px;
  top: -160px; left: -100px;
  background: radial-gradient(circle, var(--cyan-400), transparent 70%);
}

.aurora-2 {
  width: 480px; height: 480px;
  top: -100px; right: -120px;
  background: radial-gradient(circle, var(--green-400), transparent 70%);
  animation-delay: -6s;
}

.aurora-3 {
  width: 600px; height: 600px;
  top: 10%; left: 40%;
  background: radial-gradient(circle, var(--violet-400), transparent 70%);
  animation-delay: -12s;
  opacity: 0.22;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(40px, 30px) scale(1.08); }
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 40%, transparent 90%);
}

.mountains {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
  min-height: 260px;
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding-top: 40px;
  padding-bottom: 80px;
}

.hero-copy,
.hero-visual {
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--cyan-300);
  background: rgba(63, 208, 255, 0.08);
  border: 1px solid rgba(63, 208, 255, 0.25);
  padding: 8px 16px;
  border-radius: 999px;
  margin-bottom: 24px;
  max-width: 100%;
}

.eyebrow > * { min-width: 0; }

.dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-400);
  box-shadow: 0 0 0 0 rgba(63, 255, 176, 0.6);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(63, 255, 176, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(63, 255, 176, 0); }
  100% { box-shadow: 0 0 0 0 rgba(63, 255, 176, 0); }
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4.4vw, 3.6rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
}

.accent-text {
  background: linear-gradient(100deg, var(--cyan-300), var(--green-400));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 0 36px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  margin-bottom: 56px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.stat { display: flex; flex-direction: column; gap: 4px; }

.stat-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------- Hero visual ---------- */
.hero-visual {
  position: relative;
  height: 520px;
}

.visual-card {
  position: absolute;
  background: rgba(14, 32, 58, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.map-card {
  top: 0;
  left: 0;
  width: 92%;
  height: 270px;
  padding: 20px 20px 16px;
  animation: floaty 7s ease-in-out infinite;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

.code-card {
  bottom: 0;
  right: 0;
  width: 74%;
  padding: 18px 20px 22px;
  animation: floaty 7s ease-in-out infinite;
  animation-delay: -3.2s;
  z-index: 2;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.card-header > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.card-header,
.card-footer {
  flex-wrap: wrap;
}

.signal-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cyan-400);
  box-shadow: 0 0 8px var(--cyan-400);
}

.route-map { width: 100%; flex: 1 1 auto; min-height: 0; }

.route-line {
  stroke-dasharray: 6 6;
  animation: dash 2.4s linear infinite;
}

@keyframes dash {
  to { stroke-dashoffset: -24; }
}

.nodes circle {
  filter: drop-shadow(0 0 6px rgba(234, 252, 255, 0.8));
}

.node-main {
  fill: var(--green-400) !important;
  filter: drop-shadow(0 0 10px rgba(63, 255, 176, 0.9)) !important;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.badge-live {
  background: rgba(63, 255, 176, 0.15);
  color: var(--green-400);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

.code-dots span {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.code-dots span:nth-child(1) { background: #ff6b6b; }
.code-dots span:nth-child(2) { background: #ffd166; }
.code-dots span:nth-child(3) { background: #3fffb0; }

.code-block {
  margin: 8px 0 0;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--ice-100);
  overflow-x: auto;
  max-width: 100%;
}

.tok-key { color: #8b7bff; }
.tok-fn { color: var(--cyan-300); }
.tok-str { color: var(--green-400); }

/* ---------- Scroll cue ---------- */
.scroll-cue {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0 auto 28px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.scroll-cue span {
  width: 1px;
  height: 28px;
  background: linear-gradient(var(--cyan-400), transparent);
  animation: scrollLine 1.8s ease-in-out infinite;
}

@keyframes scrollLine {
  0% { opacity: 0; transform: scaleY(0.4); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); }
  100% { opacity: 0; transform: scaleY(0.4); transform-origin: bottom; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
  .hero-visual {
    height: 400px;
    order: -1;
  }
  .main-nav { display: none; }
  .nav-toggle { display: flex; }

  .main-nav.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: rgba(6, 15, 30, 0.97);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 24px 24px;
    gap: 4px;
  }

  .main-nav.is-open a {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
}

@media (max-width: 640px) {
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }
  .hero-stats { gap: 24px; }
  .header-actions .btn-sm { display: none; }
  .brand-mark { height: 34px; }
  .brand-name { font-size: 1.05rem; }
  .hero-visual { height: 340px; }
  .map-card { height: 260px; }
}

@media (max-width: 360px) {
  .brand-mark { height: 28px; }
  .brand-name { font-size: 0.92rem; }
}
