/* SpecGraph landing — mirrors the app's dark Obsidian-inspired theme.
   Neutral-950 canvas, neutral-900 surfaces, brand navy-blue accents. */

:root {
  --bg: #0a0a0a;
  --surface: #171717;
  --border: #262626;
  --border-soft: #1f1f1f;
  --text: #f5f5f5;
  --text-2: #d4d4d4;
  --muted: #a3a3a3;
  --faint: #737373;
  --brand-300: #97b0da;
  --brand-400: #6489c4;
  --brand-500: #426aab;
  --brand-800: #253a61;
  --danger: #e5484d;
  --amber: #d4a72c;
  --green: #46a758;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; }

body {
  background: var(--bg);
  color: var(--text-2);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* Faint dot grid behind the hero, fading out downward */
.bg-grid {
  position: absolute;
  inset: 0 0 auto 0;
  height: 900px;
  background-image: radial-gradient(circle, #1e222b 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.7), transparent 85%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.7), transparent 85%);
  pointer-events: none;
  z-index: 0;
}
.nav, main, .footer { position: relative; z-index: 1; }

/* ---- nav ---- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px 24px;
}
.logo { font-size: 17px; font-weight: 650; letter-spacing: -0.02em; color: var(--text); }
.accent { color: var(--brand-400); }
.nav nav { display: flex; align-items: center; gap: 20px; }
.nav nav > a:not(.btn) { font-size: 14px; color: var(--muted); }
.nav nav > a:not(.btn):hover { color: var(--text-2); }

/* ---- buttons ---- */
.btn {
  display: inline-block;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 550;
  padding: 7px 14px;
  border: 1px solid transparent;
  transition: background 140ms ease, border-color 140ms ease;
}
.btn-primary { background: var(--brand-500); color: var(--text); }
.btn-primary:hover { background: var(--brand-400); }
.btn-ghost { border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface); border-color: #333; }
.btn-lg { padding: 10px 22px; font-size: 15px; }

/* ---- hero ---- */
.hero {
  max-width: 920px;
  margin: 0 auto;
  padding: 72px 24px 24px;
  text-align: center;
}
.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--brand-300);
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
}
.sub {
  max-width: 620px;
  margin: 20px auto 0;
  font-size: 17px;
  color: var(--muted);
}
.cta-row { display: flex; gap: 12px; justify-content: center; margin-top: 28px; }

/* ---- simulation frame ---- */
.graph-frame {
  position: relative;
  margin: 52px auto 0;
  max-width: 800px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 35%, #13161d 0%, #0b0c10 78%);
  box-shadow: 0 0 80px rgba(66, 106, 171, 0.09), 0 24px 60px rgba(0, 0, 0, 0.5);
}

.sim-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(23, 23, 23, 0.7);
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 12px;
}
.sim-title { color: var(--text-2); font-weight: 600; }
.sim-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--faint);
}
.sim-status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--faint);
  transition: background 300ms ease;
}
.sim-status[data-state="building"] .sim-status-dot { background: var(--brand-400); }
.sim-status[data-state="analyzing"] .sim-status-dot {
  background: var(--brand-300);
  animation: pulse 900ms ease-in-out infinite;
}
.sim-status[data-state="drift"] .sim-status-dot { background: var(--amber); }
.sim-status[data-state="analyzing"] { color: var(--brand-300); }
.sim-status[data-state="drift"] { color: var(--amber); }
.sim-score {
  margin-left: auto;
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
}
.sim-score-max { color: var(--faint); font-weight: 400; }

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

.graph { width: 100%; height: auto; display: block; }

/* nodes pop in */
.node-g {
  opacity: 0;
  transition: opacity 420ms ease;
}
.node-g.on { opacity: 1; }
.node { stroke-width: 2; }
.node-feature { fill: var(--brand-800); stroke: var(--brand-400); }
.node-intent  { fill: #10131a; stroke: var(--brand-300); }
.node-impl    { fill: #10131a; stroke: #7c8ba1; }
.node-halo {
  fill: none;
  stroke: var(--brand-500);
  stroke-opacity: 0.35;
  animation: halo 2.6s ease-in-out infinite;
}
@keyframes halo {
  0%, 100% { stroke-opacity: 0.35; r: 22; }
  50% { stroke-opacity: 0.08; r: 26; }
}
/* flagged nodes turn drift-red when the contradiction fires */
.node-g.flag .node { stroke: var(--danger); transition: stroke 400ms ease; }

.lbl {
  fill: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  text-anchor: middle;
}
.lbl-feature { fill: var(--brand-300); font-weight: 600; }

/* edges draw in via stroke-dashoffset (dasharray set from JS) */
.edge {
  fill: none;
  stroke: #2a3242;
  stroke-width: 1.5;
  transition: stroke-dashoffset 700ms ease;
}
.edge.on { stroke-dashoffset: 0 !important; }
.e-drift {
  stroke: var(--danger);
  stroke-width: 1.7;
  transition: stroke-dashoffset 1100ms ease;
}

.elbl {
  fill: #4d5567;
  font-family: var(--mono);
  font-size: 10px;
  text-anchor: middle;
  opacity: 0;
  transition: opacity 500ms ease;
}
.elbl.on { opacity: 1; }
.elbl-drift { fill: var(--danger); font-weight: 600; }

/* analyzer sweep */
.sim-scanline {
  position: absolute;
  top: 41px; bottom: 0;
  width: 140px;
  left: -160px;
  background: linear-gradient(90deg, transparent, rgba(151, 176, 218, 0.07) 45%, rgba(151, 176, 218, 0.16) 50%, rgba(151, 176, 218, 0.07) 55%, transparent);
  pointer-events: none;
  opacity: 0;
}
.sim-scanline.on {
  opacity: 1;
  animation: sweep 1.4s linear;
}
@keyframes sweep {
  from { left: -160px; }
  to { left: 100%; }
}

/* finding chip slides up from the bottom of the frame */
.finding-chip {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translate(-50%, 24px);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100% - 40px);
  border: 1px solid rgba(229, 72, 77, 0.35);
  background: rgba(23, 16, 17, 0.92);
  border-radius: 999px;
  padding: 7px 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  opacity: 0;
  transition: opacity 450ms ease, transform 450ms ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.finding-chip.on { opacity: 1; transform: translate(-50%, 0); }
.finding-chip strong { color: var(--danger); font-weight: 600; }
.finding-chip .dot {
  flex-shrink: 0;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger);
  animation: pulse 1.6s ease-in-out infinite;
}

.sim-caption {
  margin-top: 14px;
  font-size: 13px;
  color: var(--faint);
  text-align: center;
}

/* ---- problem section ---- */
.problem-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: 880px;
  margin: 44px auto 0;
}
.problem-item { text-align: center; }
.problem-title {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--danger);
  margin-bottom: 8px;
}
.problem-item p:last-child { font-size: 14px; color: var(--muted); }
.value-line {
  max-width: 640px;
  margin: 48px auto 0;
  text-align: center;
  font-size: 18px;
  color: var(--text-2);
  line-height: 1.55;
}
.value-line em { font-style: normal; color: var(--brand-300); }
.value-accent { color: var(--text); font-weight: 600; }

/* ---- agent callout ---- */
.agent-callout {
  max-width: 640px;
  margin: 32px auto 0;
  border: 1px solid #223252;
  background: linear-gradient(180deg, rgba(37, 58, 97, 0.22), rgba(22, 33, 56, 0.10));
  border-radius: 10px;
  padding: 20px 24px;
  text-align: center;
}
.agent-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-300);
  border: 1px solid #2c3f66;
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 12px;
}
.agent-callout p {
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.65;
}
.agent-callout em { font-style: normal; color: var(--brand-300); }

/* ---- MCP chat simulation ---- */
.chat-frame {
  max-width: 640px;
  margin: 40px auto 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #101012;
  box-shadow: 0 0 70px rgba(66, 106, 171, 0.08), 0 24px 60px rgba(0, 0, 0, 0.5);
}
.chat-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  background: #151517;
}
.chat-lights { display: flex; gap: 6px; }
.chat-lights span {
  width: 10px; height: 10px; border-radius: 50%;
  background: #2e2e2e;
}
.chat-title {
  margin: 0 auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}
.chat-body {
  padding: 20px 20px 24px;
  min-height: 268px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 14px;
  text-align: left;
}
.msg {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 380ms ease, transform 380ms ease;
}
.msg.on { opacity: 1; transform: translateY(0); }
.msg-role {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 4px;
}
.role-claude { color: var(--brand-300); }
.msg-user p { color: var(--text); }
.msg-tool {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  background: #16181d;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 8px 12px;
}
.tool-glyph { color: var(--brand-400); }
.tool-state { margin-left: auto; color: var(--faint); font-size: 11px; }
.tool-state.ok { color: var(--green); }
.msg-result code {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--amber);
  background: #17140d;
  border: 1px solid #2a2416;
  border-radius: 8px;
  padding: 8px 12px;
}
.msg-claude p { color: var(--text-2); line-height: 1.6; }
.caret {
  display: inline-block;
  width: 7px; height: 15px;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--brand-300);
  opacity: 0;
}
.caret.blink { opacity: 1; animation: pulse 800ms steps(2) infinite; }

.mcp-points {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 880px;
  margin: 36px auto 0;
}
.mcp-point { text-align: center; }
.mcp-point-title code {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--brand-300);
  background: #14181f;
  border: 1px solid #1f2733;
  border-radius: 6px;
  padding: 3px 9px;
}
.mcp-point p:last-child {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

/* ---- product screenshot ---- */
.shot-frame {
  margin: 40px auto 0;
  max-width: 960px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 0 90px rgba(66, 106, 171, 0.10), 0 30px 70px rgba(0, 0, 0, 0.55);
}
.shot-chrome {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  background: #121212;
}
.shot-chrome > span:not(.shot-url) {
  width: 10px; height: 10px; border-radius: 50%;
  background: #2e2e2e;
}
.shot-url {
  margin: 0 auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  background: #1a1a1a;
  border-radius: 5px;
  padding: 3px 26px;
}
.shot-frame img { display: block; width: 100%; height: auto; }

/* ---- sections ---- */
.section {
  max-width: 1040px;
  margin: 0 auto;
  padding: 72px 24px;
  border-top: 1px solid var(--border-soft);
}
.section h2 {
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
  text-align: center;
}
.section-sub {
  max-width: 560px;
  margin: 12px auto 0;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 40px;
}
.card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 22px;
  transition: border-color 160ms ease, transform 160ms ease;
}
.card:hover { border-color: #333c4f; transform: translateY(-2px); }
.card-step {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--brand-300);
  margin-bottom: 10px;
}
.card h3 { font-size: 16px; color: var(--text); margin-bottom: 8px; }
.card p:last-child { font-size: 14px; color: var(--muted); }

.code {
  max-width: 560px;
  margin: 28px auto 0;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-2);
}

.section-final { text-align: center; }
.section-final .btn { margin-top: 24px; }

/* ---- footer ---- */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 24px 40px;
  border-top: 1px solid var(--border-soft);
  font-size: 13px;
  color: var(--faint);
}
.footer nav { display: flex; gap: 18px; }
.footer a:hover { color: var(--text-2); }

@media (max-width: 720px) {
  .cards, .problem-row, .mcp-points { grid-template-columns: 1fr; }
  .cta-row { flex-direction: column; align-items: center; }
  .nav nav > a:not(.btn) { display: none; }
  .finding-chip { font-size: 11px; }
}
