/* =============================================
   AI ENGRAM — Marketing Site
   Aesthetic: Cerebral dark. Neural. Warm sparks in deep space.
   ============================================= */

:root {
  --bg-void: #07080c;
  --bg-deep: #0c0e14;
  --bg-surface: #12151e;
  --bg-elevated: #1a1e2a;
  --bg-card: #161a24;

  --text-primary: #e8e4df;
  --text-secondary: #8e8b86;
  --text-muted: #5a5752;

  --accent: #d4a053;
  --accent-glow: #d4a05340;
  --accent-dim: #d4a05318;
  --accent-bright: #f0c060;

  --border: #ffffff0a;
  --border-hover: #ffffff14;

  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

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

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Canvas ---- */

#neurons {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ---- Nav ---- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: #07080ccc;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.nav-logo {
  font-size: 20px;
  color: var(--accent);
}

.nav-name {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-cta {
  background: var(--accent) !important;
  color: var(--bg-void) !important;
  padding: 8px 20px;
  border-radius: 6px;
  font-weight: 600 !important;
  transition: transform 0.2s var(--ease-spring), background 0.2s !important;
}

.nav-cta:hover {
  transform: translateY(-1px);
  background: var(--accent-bright) !important;
}

/* ---- Hero ---- */

.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 80px;
}

.hero-content {
  max-width: 740px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 16px;
  border: 1px solid var(--accent-dim);
  border-radius: 100px;
  margin-bottom: 40px;
  animation: fadeUp 0.8s var(--ease-out) 0.2s both;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
}

.hero-line {
  display: block;
  font-size: clamp(48px, 8vw, 88px);
  animation: fadeUp 0.8s var(--ease-out) 0.4s both;
}

.hero-accent {
  color: var(--accent);
  animation-delay: 0.55s;
}

.hero-accent em {
  font-style: italic;
}

.hero-subtitle {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 40px;
  animation: fadeUp 0.8s var(--ease-out) 0.7s both;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeUp 0.8s var(--ease-out) 0.85s both;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-top: 64px;
  animation: fadeUp 0.8s var(--ease-out) 1s both;
}

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

.stat-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--text-primary);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border-hover);
}

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s var(--ease-out);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-void);
}

.btn-primary:hover {
  background: var(--accent-bright);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-hover);
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
  background: #ffffff06;
}

.btn-large {
  padding: 18px 40px;
  font-size: 17px;
  border-radius: 10px;
}

.btn-arrow {
  transition: transform 0.2s;
}

.btn:hover .btn-arrow {
  transform: translateX(4px);
}

/* ---- Section Labels ---- */

.section-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 600px;
  margin-bottom: 56px;
}

.section-subtitle em {
  color: var(--text-primary);
  font-style: normal;
}

/* ---- Problem ---- */

.problem {
  position: relative;
  z-index: 1;
  padding: 120px 0;
  background: linear-gradient(180deg, var(--bg-void) 0%, var(--bg-deep) 100%);
}

.problem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.problem-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 20px;
}

.problem-body {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 16px;
}

.problem-body strong {
  color: var(--text-primary);
}

.amnesia-demo {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.amnesia-msg {
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 85%;
}

.amnesia-user {
  background: var(--bg-elevated);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  color: var(--text-primary);
}

.amnesia-ai {
  background: var(--accent-dim);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  color: var(--text-secondary);
}

.amnesia-fail {
  border: 1px solid #e0433520;
  color: #cc8888;
}

.amnesia-divider {
  text-align: center;
  padding: 8px 0;
}

.amnesia-divider span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.amnesia-label {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ---- How It Works / Pipeline ---- */

.how-it-works {
  position: relative;
  z-index: 1;
  padding: 120px 0;
  background: var(--bg-deep);
}

.pipeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pipeline-stage {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  align-items: center;
  gap: 20px;
  padding: 28px 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.3s var(--ease-out);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.6s var(--ease-out) calc(var(--delay) * 0.12s + 0.2s) both;
}

.pipeline-stage:hover {
  border-color: var(--accent-dim);
  background: var(--bg-card);
  transform: translateX(4px);
}

.stage-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--accent-dim);
  color: var(--accent);
}

.stage-icon svg {
  width: 20px;
  height: 20px;
}

.stage-content h4 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 4px;
}

.stage-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.stage-agent {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 4px 12px;
  border-radius: 4px;
  white-space: nowrap;
}

.stage-cadence {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.pipeline-connector {
  width: 2px;
  height: 20px;
  background: linear-gradient(180deg, var(--accent-dim), var(--border));
  margin-left: 50px;
}

/* ---- Architecture ---- */

.architecture {
  position: relative;
  z-index: 1;
  padding: 120px 0;
  background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-void) 100%);
}

.arch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.arch-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 28px;
  transition: all 0.3s var(--ease-out);
}

.arch-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px #00000040;
}

.arch-card-icon {
  font-size: 28px;
  margin-bottom: 16px;
}

.arch-card h4 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 8px;
}

.arch-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.arch-card code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--accent);
}

/* ---- Try It ---- */

.try-it {
  position: relative;
  z-index: 1;
  padding: 120px 0;
  text-align: center;
  background: var(--bg-void);
}

.try-content {
  max-width: 500px;
  margin: 0 auto;
}

.try-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 400;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.try-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 36px;
}

/* ---- Tech Stack ---- */

.tech-stack {
  position: relative;
  z-index: 1;
  padding: 80px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-void);
}

.tech-stack .section-label {
  text-align: center;
  margin-bottom: 32px;
}

.stack-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.stack-item {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.stack-item:hover {
  border-color: var(--accent-dim);
  color: var(--text-primary);
}

/* ---- Footer ---- */

.footer {
  position: relative;
  z-index: 1;
  padding: 64px 0 32px;
  border-top: 1px solid var(--border);
  background: var(--bg-void);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-tagline {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

.footer-links h5 {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.footer-links a {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 10px;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.footer-bottom p {
  font-size: 13px;
  color: var(--text-muted);
}

/* ---- Animations ---- */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
  .nav-links a:not(.nav-cta) {
    display: none;
  }

  .hero {
    padding: 100px 20px 60px;
  }

  .hero-stats {
    flex-direction: column;
    gap: 16px;
  }

  .stat-divider {
    width: 32px;
    height: 1px;
  }

  .problem-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .pipeline-stage {
    grid-template-columns: 44px 1fr;
    gap: 12px;
  }

  .stage-agent,
  .stage-cadence {
    grid-column: 2;
  }

  .arch-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 480px) {
  .nav {
    padding: 12px 16px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    justify-content: center;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}
