/* neuDB — xAI-inspired design system */
:root {
  --bg: #000000;
  --bg-elevated: #0a0a0a;
  --bg-card: #111111;
  --bg-panel: #0d0d0d;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.55);
  --text-faint: rgba(255, 255, 255, 0.35);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
  --max-width: 1280px;
  --header-h: 72px;
  --product-nav-h: 52px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  padding: 8px 16px;
  background: var(--text);
  color: var(--bg);
  border-radius: 6px;
  z-index: 1000;
  font-weight: 500;
}
.skip-link:focus { top: 16px; }

/* ── Header ── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 100;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 40px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
}

.logo-wordmark {
  height: 20px;
  width: auto;
  flex-shrink: 0;
  display: block;
}

.footer .logo-wordmark {
  height: 18px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-left: auto;
}

.nav a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
}
.nav a:hover { color: var(--text); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 999px;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}
.btn-primary:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-hover);
}
.btn-outline:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.04);
}

.btn-ghost {
  color: var(--text-muted);
  padding: 10px 16px;
}
.btn-ghost:hover { color: var(--text); }

.menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.menu-btn svg { width: 20px; height: 20px; }

/* ── Hero background (xAI-style) ── */
.hero-wrap {
  position: relative;
  overflow: hidden;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255, 255, 255, 0.06) 0%, transparent 60%),
    linear-gradient(180deg, transparent 60%, var(--bg) 100%);
  pointer-events: none;
  z-index: 1;
}

/* ── Hero ── */
.hero {
  position: relative;
  z-index: 2;
  padding: calc(var(--header-h) + 80px) 32px 32px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-content {
  max-width: 900px;
  margin-bottom: 64px;
}

.hero h1 {
  font-size: clamp(42px, 7vw, 76px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 28px;
}

.hero h1 .line { display: block; }
.hero h1 .emphasis {
  display: inline-block;
  position: relative;
  transition: opacity 0.2s var(--ease);
}

.hero-lead {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 520px;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ── Grok-style chat ── */
.grok-chat {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin: 0 auto 48px;
  padding: 0 32px;
}

.grok-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-hover);
  border-radius: 999px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.grok-input-wrap:focus-within {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04);
}

.grok-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text);
  padding: 12px 0;
  min-width: 0;
}

.grok-input::placeholder { color: var(--text-faint); }

.grok-submit {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease), opacity 0.2s;
}

.grok-submit:hover { transform: scale(1.05); }
.grok-submit svg { width: 18px; height: 18px; }

.grok-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.grok-suggestion {
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: all 0.2s var(--ease);
  text-align: left;
  line-height: 1.4;
}

.grok-suggestion:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.06);
}

.grok-response {
  margin-top: 20px;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 16px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.grok-response.visible {
  opacity: 1;
  transform: translateY(0);
}

.grok-thinking {
  font-size: 14px;
  color: var(--text-faint);
  font-style: italic;
}

.grok-answer {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  padding-left: 14px;
  border-left: 2px solid rgba(255, 255, 255, 0.15);
}

.grok-explore {
  display: inline-flex;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.2s;
}

.grok-explore:hover { color: var(--text); }

/* ── Sticky product nav ── */
.product-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 50;
  margin-bottom: 32px;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.product-nav.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.product-nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 8px 32px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}

.product-nav-inner::-webkit-scrollbar { display: none; }

.product-nav-link {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 999px;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
}

.product-nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }

.product-nav-link.active {
  color: var(--bg);
  background: var(--text);
}

/* ── Product showcase (xAI cards) ── */
.showcase {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 0 auto 120px;
  max-width: var(--max-width);
  padding: 0 32px;
}

.showcase-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

.showcase-card:hover,
.showcase-card.is-highlighted {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.showcase-card.is-highlighted {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 8px 32px rgba(0, 0, 0, 0.4);
}

.showcase-card.full { grid-column: 1 / -1; min-height: 380px; }

.showcase-preview {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(180deg, var(--bg-panel) 0%, var(--bg-card) 100%);
  overflow: hidden;
}

.showcase-footer {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
}

.showcase-footer span {
  font-size: 15px;
  font-weight: 500;
}

.showcase-link {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}
.showcase-card:hover .showcase-link { color: var(--text); }

/* Mock UIs inside cards */
.mock-chat {
  font-size: 13px;
  max-width: 400px;
}

.mock-prompt {
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.mock-prompt strong { color: var(--text); font-weight: 500; }

.mock-response {
  color: var(--text);
  line-height: 1.6;
  padding-left: 12px;
  border-left: 2px solid rgba(255, 255, 255, 0.15);
}

.mock-terminal {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-muted);
}

.mock-terminal .prompt { color: var(--text-faint); }
.mock-terminal .cmd { color: var(--text); }
.mock-terminal .flag { color: rgba(255, 255, 255, 0.7); }
.mock-terminal .str { color: rgba(255, 255, 255, 0.85); }
.mock-terminal .cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--text);
  animation: blink 1s step-end infinite;
  vertical-align: middle;
  margin-left: 2px;
}

@keyframes blink {
  50% { opacity: 0; }
}

.mock-agent {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
}

.mock-agent .task {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.mock-agent .task.done { color: var(--text-faint); }
.mock-agent .task.running { color: var(--text); }

.mock-agent .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}
.mock-agent .task.running .status-dot {
  background: var(--text);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.mock-agent .thought {
  color: var(--text-faint);
  margin: 12px 0 8px;
}

.mock-code {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--border);
}

.mock-code .ln { color: var(--text-faint); user-select: none; margin-right: 12px; }
.mock-code .kw { color: var(--text); }
.mock-code .fn { color: rgba(255, 255, 255, 0.8); }

.mock-search {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mock-search-query {
  font-size: 14px;
  color: var(--text);
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.mock-search-result {
  font-size: 12px;
  color: var(--text-muted);
  padding: 10px 14px;
  border-left: 2px solid rgba(255, 255, 255, 0.2);
  line-height: 1.5;
}

.mock-search-result .sim {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* ── Developer section ── */
.dev-section {
  padding: 120px 32px;
  max-width: var(--max-width);
  margin: 0 auto;
  border-top: 1px solid var(--border);
}

.dev-label {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.dev-section h2 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.dev-section h2 .line { display: block; }

.dev-desc {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 40px;
  line-height: 1.6;
}

.dev-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

.dev-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 48px;
}

.dev-stat-value {
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.dev-stat-label {
  font-size: 14px;
  color: var(--text-muted);
}

.code-window {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.code-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 8px;
  overflow-x: auto;
}

.code-tab {
  padding: 14px 20px;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s;
  white-space: nowrap;
}
.code-tab:hover { color: var(--text); }
.code-tab.active {
  color: var(--text);
  border-bottom-color: var(--text);
}

.code-panel { display: none; position: relative; }
.code-panel.active { display: block; }

.code-panel pre {
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
  overflow-x: auto;
}

.code-panel .kw { color: var(--text); }
.code-panel .fn { color: rgba(255, 255, 255, 0.85); }
.code-panel .str { color: rgba(255, 255, 255, 0.7); }
.code-panel .cm { color: var(--text-faint); }

.code-copy {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s;
}
.code-copy:hover { color: var(--text); border-color: var(--border-hover); }

/* ── Big stats (xAI mission block) ── */
.mission-section {
  padding: 120px 32px;
  max-width: var(--max-width);
  margin: 0 auto;
  border-top: 1px solid var(--border);
}

.mission-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  margin-bottom: 80px;
}

.mission-stat {
  text-align: left;
}

.mission-number {
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.mission-number .suffix {
  font-size: 0.5em;
  color: var(--text-muted);
}

.mission-label {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.5;
}

.mission-section h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 500;
  letter-spacing: -0.03em;
}

/* ── News / Changelog ── */
.news-section {
  padding: 0 32px 120px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.news-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.news-header h2 {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.news-header a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.2s;
}
.news-header a:hover { color: var(--text); }

.news-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s;
}
.news-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.news-thumb {
  height: 180px;
  background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 50%, #151515 100%);
  position: relative;
  overflow: hidden;
}

.news-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(255,255,255,0.06) 0%, transparent 60%);
}

.news-thumb .tag {
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.news-body {
  padding: 24px;
}

.news-date {
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.news-body h3 {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

/* ── Get started (two columns) ── */
.start-section {
  padding: 120px 32px;
  max-width: var(--max-width);
  margin: 0 auto;
  border-top: 1px solid var(--border);
}

.start-section > h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 500;
  letter-spacing: -0.03em;
  margin-bottom: 48px;
}

.start-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.start-card {
  padding: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.start-card h3 {
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.start-card > p {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.start-divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

.start-list {
  list-style: none;
  margin-bottom: 32px;
}

.start-list li {
  font-size: 14px;
  color: var(--text-muted);
  padding: 8px 0;
  padding-left: 20px;
  position: relative;
  line-height: 1.5;
}

.start-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--text-faint);
}

/* ── Footer ── */
.footer {
  padding: 48px 32px;
  max-width: var(--max-width);
  margin: 0 auto;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-links {
  display: flex;
  gap: 32px;
}

.footer-links a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--text); }

.footer-copy {
  font-size: 13px;
  color: var(--text-faint);
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .showcase { grid-template-columns: 1fr; }
  .showcase-card.full { grid-column: auto; }
  .dev-stats, .mission-stats { grid-template-columns: 1fr; gap: 24px; }
  .news-grid, .start-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .header-inner { padding: 0 20px; }
  .nav { display: none; }
  .nav.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    padding: 24px 32px 32px;
    border-bottom: 1px solid var(--border);
    gap: 20px;
    margin-left: 0;
  }
  .menu-btn { display: flex; }
  .hero, .dev-section, .mission-section, .news-section, .start-section { padding-left: 20px; padding-right: 20px; }
  .grok-chat, .showcase { padding-left: 20px; padding-right: 20px; }
  .product-nav-inner { padding-left: 20px; padding-right: 20px; }
  .header-actions .btn-ghost { display: none; }
  .grok-suggestions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .mock-terminal .cursor { animation: none; }
  .product-nav { opacity: 1; transform: none; pointer-events: auto; }
  .grok-response { opacity: 1; transform: none; }
}