:root {
  --bg: #060608;
  --surface: rgba(19, 18, 21, 0.72);
  --surface-solid: #111014;
  --text: #f4f2ef;
  --muted: #96939b;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #ff5a36;
  --accent-hot: #ff8a3d;
  --header-height: 86px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, system-ui, sans-serif;
  overflow-x: hidden;
}
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
  background:
    radial-gradient(circle at 50% 45%, rgba(118, 27, 10, 0.18), transparent 34%),
    linear-gradient(#060608, #08070a 55%, #060608);
}

.noise {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  padding: 0 clamp(24px, 5vw, 80px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
  background: linear-gradient(to bottom, rgba(6, 6, 8, .88), transparent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font: 700 13px/1 Space Mono, monospace;
  letter-spacing: .14em;
}
.brand-mark {
  width: 14px;
  height: 14px;
  border: 1px solid var(--accent);
  transform: rotate(45deg);
  box-shadow: 0 0 16px rgba(255, 90, 54, .35);
}
.site-nav { display: flex; gap: 32px; }
.site-nav a {
  color: #d9d6d2;
  font: 500 11px/1 Space Mono, monospace;
  letter-spacing: .12em;
  transition: color .25s ease;
}
.site-nav a:hover { color: var(--accent-hot); }
.menu-toggle { display: none; }

.hero {
  min-height: 100svh;
  padding: calc(var(--header-height) + 56px) clamp(24px, 8vw, 128px) 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  position: relative;
}
.hero-copy { max-width: 720px; }
.eyebrow {
  margin: 0 0 22px;
  color: var(--accent-hot);
  font: 500 11px/1.5 Space Mono, monospace;
  letter-spacing: .16em;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 18px;
  font-size: clamp(86px, 13vw, 210px);
  line-height: .8;
  letter-spacing: -.075em;
}
.dot { color: var(--accent); }
.hero-title {
  margin-bottom: 16px;
  font-size: clamp(28px, 4vw, 54px);
  line-height: 1.05;
  letter-spacing: -.045em;
}
.hero-description {
  max-width: 620px;
  margin-bottom: 34px;
  color: #bbb7bc;
  font-size: clamp(16px, 1.7vw, 21px);
  line-height: 1.65;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button {
  min-height: 50px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  font: 600 12px/1 Space Mono, monospace;
  letter-spacing: .06em;
  transition: transform .25s ease, border-color .25s ease, background .25s ease;
}
.button:hover { transform: translateY(-2px); }
.button-primary {
  color: #110906;
  background: linear-gradient(135deg, var(--accent-hot), var(--accent));
  border-color: transparent;
  box-shadow: 0 16px 44px rgba(255, 90, 54, .18);
}
.button-ghost { background: rgba(10, 10, 12, .38); backdrop-filter: blur(12px); }
.button-ghost:hover { border-color: rgba(255, 138, 61, .6); }

.hero-status {
  width: 220px;
  align-self: end;
  margin-bottom: 62px;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}
.hero-status div {
  padding: 15px 0;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.hero-status span {
  color: var(--muted);
  font: 400 9px/1 Space Mono, monospace;
  letter-spacing: .12em;
}
.hero-status strong {
  font: 500 10px/1 Space Mono, monospace;
  letter-spacing: .06em;
}
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 10px;
  color: #726f76;
  font: 400 9px/1 Space Mono, monospace;
  letter-spacing: .14em;
}
.scroll-cue i {
  width: 1px;
  height: 32px;
  background: linear-gradient(var(--accent), transparent);
  animation: scrollPulse 1.8s infinite ease-in-out;
}

.section {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  padding: 140px 0;
  position: relative;
}
.section-heading { max-width: 810px; margin-bottom: 62px; }
.section-heading h2,
.final-cta h2 {
  margin-bottom: 22px;
  font-size: clamp(42px, 7vw, 92px);
  line-height: .98;
  letter-spacing: -.06em;
}
.section-heading > p:last-child,
.docs-copy > p {
  max-width: 670px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.metric-card {
  min-height: 290px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .015));
}
.metric-card:last-child { border-right: 0; }
.metric-index {
  margin-bottom: auto;
  color: #615d64;
  font: 400 10px/1 Space Mono, monospace;
}
.metric-card strong {
  margin-bottom: 16px;
  font-size: clamp(48px, 6vw, 82px);
  letter-spacing: -.065em;
}
.metric-card p {
  max-width: 260px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}
.signal-panel {
  margin-top: 34px;
  min-height: 280px;
  padding: 42px;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(11, 10, 13, .52);
  backdrop-filter: blur(18px);
}
.signal-copy h3 {
  margin-bottom: 16px;
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: -.04em;
}
.signal-copy > p:last-child { color: var(--muted); line-height: 1.65; }
.signal-visual { position: relative; height: 120px; }
.signal-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,90,54,.9), transparent);
  box-shadow: 0 0 22px rgba(255,90,54,.35);
}
.signal-visual span {
  position: absolute;
  left: var(--x);
  top: 50%;
  width: 12px;
  height: 12px;
  border: 1px solid var(--accent-hot);
  transform: translate(-50%, -50%) rotate(45deg);
  animation: nodePulse 2.5s var(--delay) infinite ease-in-out;
}

.principles-list { border-top: 1px solid var(--line); }
.principle {
  min-height: 132px;
  padding: 28px 0;
  display: grid;
  grid-template-columns: 70px 1fr 1fr;
  gap: 28px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.principle > span { color: var(--accent); font: 400 10px/1 Space Mono, monospace; }
.principle h3 { margin: 0; font-size: clamp(24px, 3vw, 38px); letter-spacing: -.04em; }
.principle p { margin: 0; color: var(--muted); line-height: 1.6; }

.docs {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(42px, 8vw, 110px);
  align-items: center;
}
.code-panel {
  border: 1px solid var(--line);
  background: rgba(10, 9, 12, .82);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .35);
}
.code-toolbar {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  color: #78757d;
  font: 400 10px/1 Space Mono, monospace;
}
pre {
  margin: 0;
  padding: clamp(22px, 4vw, 42px);
  overflow-x: auto;
  font: 400 clamp(12px, 1.3vw, 16px)/1.8 Space Mono, monospace;
}
.code-keyword { color: #ff8a6e; }
.code-number { color: #d6b7ff; }
.code-string { color: #f0d58a; }
.docs-copy h2 { font-size: clamp(40px, 6vw, 78px); line-height: 1; letter-spacing: -.055em; }
.text-link {
  display: inline-flex;
  gap: 14px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--accent);
  font: 500 12px/1 Space Mono, monospace;
}
.text-link span { color: var(--accent); }

.final-cta {
  width: min(1000px, calc(100% - 48px));
  margin: 0 auto;
  padding: 160px 0 190px;
  text-align: center;
}
.final-cta .hero-actions { justify-content: center; }
.final-cta > p:not(.eyebrow) { margin-bottom: 34px; color: var(--muted); font-size: 19px; }
footer {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 34px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: #66636b;
  font: 400 9px/1 Space Mono, monospace;
  letter-spacing: .12em;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .85s ease, transform .85s cubic-bezier(.2,.8,.2,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

@keyframes scrollPulse {
  0%, 100% { opacity: .25; transform: scaleY(.65); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); }
}
@keyframes nodePulse {
  0%, 100% { opacity: .25; box-shadow: 0 0 0 rgba(255,90,54,0); }
  50% { opacity: 1; box-shadow: 0 0 22px rgba(255,90,54,.65); }
}

@media (max-width: 860px) {
  :root { --header-height: 72px; }
  .menu-toggle {
    width: 42px;
    height: 42px;
    display: grid;
    place-content: center;
    gap: 7px;
    border: 0;
    color: var(--text);
    background: transparent;
    z-index: 22;
  }
  .menu-toggle span { width: 22px; height: 1px; background: currentColor; transition: transform .3s ease; }
  .menu-open .menu-toggle span:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-open .menu-toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .site-nav {
    position: fixed;
    inset: 0;
    padding: 130px 32px 40px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    background: rgba(6, 6, 8, .97);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: .3s ease;
  }
  .menu-open .site-nav { opacity: 1; visibility: visible; transform: translateY(0); }
  .site-nav a { font-size: 20px; }
  .hero { grid-template-columns: 1fr; align-content: center; }
  .hero-status { display: none; }
  .metrics-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 230px; border-right: 0; border-bottom: 1px solid var(--line); }
  .metric-card:last-child { border-bottom: 0; }
  .signal-panel { grid-template-columns: 1fr; }
  .principle { grid-template-columns: 46px 1fr; }
  .principle p { grid-column: 2; }
  .docs { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .site-header { padding-inline: 20px; }
  .hero { padding-inline: 20px; }
  .hero-description { font-size: 16px; }
  .hero-actions { width: 100%; }
  .button { flex: 1; min-width: 150px; }
  .scroll-cue { display: none; }
  .section { width: min(100% - 40px, 1200px); padding: 105px 0; }
  .signal-panel { padding: 28px 22px; }
  .principle { grid-template-columns: 34px 1fr; gap: 14px; }
  footer { width: calc(100% - 40px); flex-direction: column; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* -------------------------------------------------------------------------- */
/* Martian Labs hero emblem                                                   */
/* -------------------------------------------------------------------------- */

.hero-emblem {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --lens-x: 58%;
  --lens-y: 37%;
  position: absolute;
  top: clamp(94px, 14vh, 164px);
  right: clamp(-26px, 4vw, 42px);
  width: clamp(320px, 34vw, 560px);
  aspect-ratio: 1;
  transform: perspective(900px)
    rotateX(var(--tilt-y)) rotateY(var(--tilt-x));
  transform-style: preserve-3d;
  transform-origin: center center;
  transition: transform 180ms ease-out, opacity .35s ease;
  pointer-events: none;
  isolation: isolate;
}

.emblem-main,
.emblem-ghost {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
}

.emblem-main {
  z-index: 3;
  filter:
    drop-shadow(0 32px 58px rgba(0, 0, 0, .58))
    drop-shadow(0 0 34px rgba(255, 89, 47, .18));
  animation: emblem-float 7s ease-in-out infinite;
}

.emblem-ghost {
  z-index: 1;
  opacity: .22;
  filter: blur(28px) saturate(1.35);
  transform: scale(1.04) translateZ(-30px);
  animation: emblem-breathe 5.6s ease-in-out infinite;
}

.emblem-halo {
  position: absolute;
  z-index: 0;
  inset: 12%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 54% 45%,
      rgba(255, 154, 83, .20),
      rgba(255, 74, 37, .08) 37%,
      transparent 69%);
  filter: blur(28px);
  animation: halo-pulse 5.6s ease-in-out infinite;
}

.emblem-ring {
  position: absolute;
  z-index: 2;
  inset: 17%;
  border: 1px solid rgba(255, 115, 66, .13);
  border-radius: 50%;
  transform: rotateX(68deg) rotateZ(8deg) translateZ(-15px);
}

.emblem-ring::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border-top: 1px solid rgba(255, 143, 88, .34);
  border-right: 1px solid transparent;
  animation: orbit-spin 11s linear infinite;
}

.emblem-ring-two {
  inset: 22%;
  opacity: .52;
  transform: rotateY(72deg) rotateZ(-21deg) translateZ(-22px);
}

.emblem-ring-two::before {
  animation-duration: 15s;
  animation-direction: reverse;
}

@keyframes emblem-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-12px) scale(1.012); }
}

@keyframes emblem-breathe {
  0%, 100% { opacity: .17; transform: scale(1.02); }
  50% { opacity: .29; transform: scale(1.085); }
}

@keyframes halo-pulse {
  0%, 100% { opacity: .62; transform: scale(.96); }
  50% { opacity: 1; transform: scale(1.07); }
}

@keyframes orbit-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1080px) {
  .hero-emblem {
    top: 104px;
    right: -10vw;
    width: clamp(290px, 40vw, 440px);
    opacity: .9;
  }

  .hero-copy {
    position: relative;
    z-index: 7;
    max-width: 640px;
  }
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    align-content: center;
  }

  .hero-emblem {
    top: 88px;
    right: -18vw;
    width: min(78vw, 420px);
    opacity: .52;
    filter: saturate(.96);
  }

  .emblem-ring {
    display: none;
  }

  .hero-copy {
    max-width: 92%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .emblem-main,
  .emblem-ghost,
  .emblem-halo,
  .emblem-ring::before {
    animation: none;
  }
}
