:root {
  --bg: #0a0b0d;
  --bg-elevated: #12141a;
  --surface: #1c1c1c;
  --surface-hover: #242424;
  --text: #d8dde6;
  --text-bright: #f2f4f7;
  --text-muted: #8b93a3;
  --text-faint: #5a6270;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-dim: rgba(59, 130, 246, 0.14);
  --danger: #f87171;
  --danger-dim: rgba(248, 113, 113, 0.12);
  --warn: #fbbf24;
  --warn-dim: rgba(251, 191, 36, 0.14);
  --success: #4ade80;
  --success-dim: rgba(74, 222, 128, 0.12);
  --mcp: #a78bfa;
  --border: rgba(255, 255, 255, 0.08);
  --border-solid: #2a2a2a;
  --font-display: 'IBM Plex Sans', 'Helvetica Neue', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --radius: 4px;
  --radius-lg: 10px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

/* Author display rules must not override the hidden attribute */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  font-family: var(--font-display);
  background: var(--bg);
  overflow-x: hidden;
}

/* ── Atmosphere ─────────────────────────────────────────────────────────── */

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 72% 8%, rgba(59, 130, 246, 0.2), transparent 55%),
    radial-gradient(ellipse 45% 35% at 8% 70%, rgba(34, 197, 94, 0.07), transparent 50%),
    radial-gradient(ellipse 40% 30% at 90% 85%, rgba(251, 191, 36, 0.05), transparent 50%),
    linear-gradient(165deg, #0a0b0d 0%, #10131a 45%, #0a0b0d 100%);
  animation: drift 20s ease-in-out infinite alternate;
}

@keyframes drift {
  from {
    filter: hue-rotate(0deg) saturate(1);
    transform: scale(1);
  }
  to {
    filter: hue-rotate(10deg) saturate(1.06);
    transform: scale(1.025);
  }
}

/* ── Top nav ────────────────────────────────────────────────────────────── */

.topnav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.75rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid var(--border);
  background: rgba(10, 11, 13, 0.78);
  backdrop-filter: blur(12px);
}

.topnav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  color: var(--text-bright);
  text-decoration: none;
}

.brand-mark {
  display: block;
  border-radius: 6px;
  flex-shrink: 0;
}

.topnav-links {
  display: flex;
  gap: 1rem;
  flex: 1;
}

.topnav-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.topnav-links a:hover {
  color: var(--text-bright);
}

.topnav-cta {
  display: flex;
  gap: 0.5rem;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0 1.1rem;
  border-radius: 6px;
  border: 1px solid transparent;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  color: var(--text);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  background: var(--accent-hover);
}

.btn.secondary {
  border-color: var(--border);
  color: var(--text);
}

.btn.secondary:hover {
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text-bright);
}

.btn.ghost {
  color: var(--text-muted);
  min-height: 2.25rem;
  padding: 0 0.85rem;
  font-size: 0.78rem;
}

.btn.ghost:hover {
  color: var(--text-bright);
}

.btn.small {
  min-height: 2rem;
  padding: 0 0.85rem;
  font-size: 0.75rem;
}

.btn.danger-ghost {
  border-color: rgba(248, 113, 113, 0.35);
  color: var(--danger);
}

.btn.danger-ghost:hover {
  background: var(--danger-dim);
}

/* ── Hero ───────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  min-height: calc(100vh - 52px);
  padding: clamp(2.5rem, 8vh, 5rem) clamp(1.25rem, 4vw, 3rem) clamp(2rem, 5vh, 3.5rem);
}

.hero-copy {
  max-width: 560px;
  padding-bottom: 0.5rem;
}

.hero-visual {
  min-width: 0;
  animation: rise 0.9s ease-out 0.22s both;
  perspective: 1400px;
}

.hero-visual .ide-chrome {
  transform: rotateY(-5deg) rotateX(2.5deg);
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
  will-change: transform;
}

.hero-visual .av-canvas {
  height: 280px;
  /* Fixed design width so node px + SVG edges share one coordinate space */
  min-width: 500px;
}

.hero-graph .av-node.sub,
.hero-graph .av-node.mcp {
  width: 128px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 1.15rem;
  font-family: var(--font-mono);
  font-size: clamp(2.75rem, 9vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
  color: var(--text-bright);
  animation: rise 0.7s ease-out both;
}

.brand .hero-mark {
  width: 80px;
  height: auto;
  border-radius: 12px;
}

.brand.small {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.4rem, 3.4vw, 2rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.025em;
  color: var(--text-bright);
  animation: rise 0.7s ease-out 0.08s both;
}

.lede {
  margin: 0 0 1.75rem;
  max-width: 36rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text-muted);
  animation: rise 0.7s ease-out 0.14s both;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  animation: rise 0.7s ease-out 0.2s both;
}

.note {
  margin: 0;
  max-width: 38rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--text-muted);
  animation: rise 0.7s ease-out 0.26s both;
}

.note code {
  font-family: inherit;
  font-size: 0.68rem;
  color: var(--text);
  word-break: break-all;
}

/* ── Feature sections ───────────────────────────────────────────────────── */

.feature {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(3rem, 8vh, 5.5rem) clamp(1.25rem, 4vw, 3rem);
}

.feature.flip {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

.feature.flip .feature-copy {
  order: 2;
}

.feature.flip .feature-demo {
  order: 1;
}

.feature-copy .eyebrow {
  margin: 0 0 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-hover);
}

.feature-copy h2 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--text-bright);
}

.feature-copy p {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 32rem;
}

.feature-copy .hint {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}

.feature-copy .hint strong {
  color: var(--text);
  font-weight: 500;
}

.feature-demo {
  min-width: 0;
}

.feature-demo.tall .ide-chrome {
  min-height: 420px;
}

/* Scroll reveal: transition (not delayed animation) so opacity never flashes */
.feature-copy,
.feature-demo {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.7s ease-out,
    transform 0.7s ease-out;
  will-change: opacity, transform;
}

.feature.is-visible .feature-copy,
.feature.is-visible .feature-demo {
  opacity: 1;
  transform: translateY(0);
}

.feature.is-visible .feature-demo {
  transition-delay: 0.06s;
}

/* ── IDE chrome ─────────────────────────────────────────────────────────── */

.ide-chrome {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  overflow: hidden;
  font-family: var(--font-mono);
}

.ide-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.ide-bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.ide-bar-title {
  margin-left: 0.65rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── Agent graph ────────────────────────────────────────────────────────── */

.av-canvas {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 320px;
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.04) 1px, transparent 0) 0 0 / 16px 16px,
    #0c0e12;
  overflow: hidden;
}

.av-canvas.term-demo {
  height: 280px;
}

.av-cluster {
  position: relative;
  flex-shrink: 0;
  height: 100%;
}

.av-cluster-agents {
  width: 440px;
}

.av-cluster-terms {
  width: 400px;
}

/* Intentional stack: later cards sit on top */
.av-cluster-agents .av-node.sub,
.av-cluster-agents .av-node.mcp,
.av-cluster-terms .av-node.term,
.av-cluster-terms .av-node.agent {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), -6px 0 12px rgba(0, 0, 0, 0.18);
}

.av-cluster-agents .av-node[data-node='sub-explore'] {
  z-index: 1;
}

.av-cluster-agents .av-node[data-node='sub-patch'] {
  z-index: 2;
}

.av-cluster-agents .av-node[data-node='mcp-gh'] {
  z-index: 3;
}

.av-cluster-terms .av-node[data-node='term-agent'] {
  z-index: 1;
}

.av-cluster-terms .av-node[data-node='term-api'] {
  z-index: 2;
}

.av-cluster-terms .av-node[data-node='term-vite'] {
  z-index: 4;
}

.av-node-demo .av-menu-btn {
  opacity: 1;
  background: var(--surface-hover);
  color: var(--text-bright);
}

.av-edges {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.av-edge {
  fill: none;
  stroke: #3a3a3a;
  stroke-width: 1.5;
}

.av-edge.active {
  stroke: var(--warn);
  stroke-width: 2;
  filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.35));
}

.av-edge.dashed {
  stroke: var(--mcp);
  stroke-dasharray: 4 4;
  opacity: 0.7;
}

.av-node {
  position: absolute;
  width: 148px;
  min-height: 50px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border-solid);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.av-node:hover {
  border-color: #3a3a3a;
  transform: translateY(-1px);
}

.av-node.project {
  width: 160px;
  background: var(--accent-dim);
  border-color: var(--accent);
}

.av-node.project .av-title {
  color: var(--accent-hover);
}

.av-node.active {
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.15), 0 8px 24px rgba(0, 0, 0, 0.45),
    0 0 20px rgba(251, 191, 36, 0.18);
}

.av-node.mcp {
  border-color: color-mix(in srgb, var(--mcp) 45%, var(--border-solid));
}

.av-node.term {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-solid));
}

.av-chip {
  display: inline-block;
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  margin-bottom: 2px;
}

.av-chip.sub {
  color: var(--accent-hover);
}

.av-chip.mcp {
  color: var(--mcp);
}

.av-chip.term {
  color: var(--accent-hover);
}

.av-title {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.av-sub {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.av-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
}

.av-dot.active {
  background: var(--warn);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.7);
  animation: pulse-dot 1.6s ease-in-out infinite;
}

.av-dot.done {
  background: var(--success);
}

.av-dot.idle {
  background: var(--text-faint);
}

.av-legend .av-dot,
.av-legend i.av-dot {
  position: static;
  display: inline-block;
  margin-right: 4px;
  vertical-align: middle;
  animation: none;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

.av-menu-btn {
  position: absolute;
  top: 22px;
  right: 2px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.35;
  transition: opacity 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.av-node:hover .av-menu-btn,
.av-menu-btn:focus-visible {
  opacity: 1;
}

.av-menu-btn:hover {
  background: var(--surface-hover);
  color: var(--text-bright);
}

.av-legend {
  position: absolute;
  left: 12px;
  bottom: 10px;
  display: flex;
  gap: 0.85rem;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.av-chat-peek {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: min(280px, calc(100% - 24px));
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #11141a;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  animation: rise 0.25s ease-out;
  z-index: 5;
}

.av-chat-peek-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.av-chat-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
}

.av-chat-close:hover {
  color: var(--text-bright);
}

.av-chat-body {
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.msg {
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text);
}

.msg.user {
  background: rgba(255, 255, 255, 0.05);
  align-self: flex-end;
  max-width: 92%;
}

.msg.assistant {
  background: var(--accent-dim);
  align-self: flex-start;
  max-width: 95%;
}

.msg.assistant.blocked {
  background: var(--danger-dim);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.msg.assistant.blocked strong {
  display: block;
  color: var(--danger);
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.msg.assistant.blocked p {
  margin: 0 0 0.4rem;
}

.msg.assistant.blocked p.muted {
  color: var(--text-muted);
  margin: 0;
}

.msg code,
.approve-body code,
.mcp-draft code {
  font-family: inherit;
  font-size: 0.68rem;
  color: var(--accent-hover);
}

.working {
  font-family: var(--font-mono);
  color: var(--accent-hover);
  margin-right: 0.25rem;
}

/* Terminal preview */

.term-preview {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0a0c10;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  animation: rise 0.25s ease-out;
  z-index: 5;
  overflow: hidden;
}

.term-preview-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.65rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
}

.term-preview-body {
  margin: 0;
  padding: 0.65rem 0.75rem;
  font-size: 0.68rem;
  line-height: 1.5;
  color: #9ae6b4;
  max-height: 110px;
  overflow: auto;
  white-space: pre-wrap;
}

/* ── Context menu ───────────────────────────────────────────────────────── */

.ctx-menu {
  position: fixed;
  z-index: 100;
  min-width: 160px;
  padding: 4px;
  border: 1px solid var(--border-solid);
  border-radius: 8px;
  background: #16181e;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  font-family: var(--font-mono);
}

.ctx-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.65rem;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

.ctx-item:hover {
  background: var(--surface-hover);
  color: var(--text-bright);
}

.ctx-item.danger {
  color: var(--danger);
}

.ctx-item.danger:hover {
  background: var(--danger-dim);
}

/* ── Guardrails ─────────────────────────────────────────────────────────── */

.guard-chrome {
  min-height: 420px;
}

.guard-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  min-height: 380px;
}

.guard-library {
  border-right: 1px solid var(--border);
  padding: 0.75rem;
  background: #11141a;
}

.guard-section-label {
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0.5rem 0 0.4rem;
}

.rule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.5rem;
  margin-bottom: 0.3rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.rule-row:hover:not(.static) {
  background: var(--surface-hover);
  border-color: var(--border);
}

.rule-row.static {
  cursor: default;
}

.rule-row.active-rule {
  background: rgba(255, 255, 255, 0.03);
}

.rule-row-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.rule-title {
  font-size: 0.72rem;
  color: var(--text-bright);
}

.rule-apply {
  flex-shrink: 0;
  font-size: 0.68rem;
  color: var(--accent-hover);
  font-weight: 500;
}

.rule-apply.on {
  color: var(--success);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.badge.block {
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.4);
  background: var(--danger-dim);
}

.badge.warn {
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.4);
  background: var(--warn-dim);
}

.badge.on {
  color: var(--success);
  border-color: rgba(74, 222, 128, 0.35);
  background: var(--success-dim);
}

.badge.inferred {
  color: var(--accent-hover);
  border-color: rgba(59, 130, 246, 0.35);
  background: var(--accent-dim);
}

.guard-stage {
  position: relative;
  background: #0c0e12;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.guard-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border);
}

.guard-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.7rem;
  padding: 0.35rem 0.65rem;
  border-radius: 5px;
  cursor: pointer;
}

.guard-tab.active {
  background: var(--surface);
  color: var(--text-bright);
}

.guard-panel {
  flex: 1;
  position: relative;
  padding: 0.85rem;
}

.mini-chat {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.mini-chat.dimmed {
  opacity: 0.45;
  filter: blur(0.5px);
}

.approve-modal {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(300px, calc(100% - 24px));
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #16181e;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  animation: rise 0.3s ease-out;
}

.approve-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.55rem;
}

.approve-body {
  margin: 0 0 1rem;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.approve-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ── MCP ────────────────────────────────────────────────────────────────── */

.mcp-chrome {
  min-height: 320px;
}

.mcp-stage {
  position: relative;
  min-height: 300px;
}

.mcp-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  min-height: 300px;
}

.mcp-list {
  border-right: 1px solid var(--border);
  padding: 0.5rem;
  background: #11141a;
}

.mcp-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.45rem;
  margin-bottom: 0.25rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.mcp-row:hover,
.mcp-row.active {
  background: var(--surface-hover);
  border-color: var(--border);
}

.mcp-row.featured {
  border-color: color-mix(in srgb, var(--mcp) 40%, transparent);
}

.mcp-row.featured.active {
  border-color: var(--mcp);
  box-shadow: 0 0 16px rgba(167, 139, 250, 0.15);
}

.mcp-icon {
  color: var(--text-faint);
  font-size: 0.7rem;
}

.mcp-icon.macha {
  color: var(--mcp);
}

.mcp-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mcp-name {
  font-size: 0.75rem;
  color: var(--text-bright);
}

.mcp-cmd {
  font-size: 0.58rem;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mcp-pulse {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 0.55rem;
  color: var(--mcp);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

.mcp-chat {
  display: flex;
  flex-direction: column;
  background: #0c0e12;
  min-height: 0;
}

.mcp-chat-bar {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.mcp-chat-thread {
  flex: 1;
  padding: 0.75rem;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.mcp-empty {
  margin: 2rem 0;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-faint);
}

.mcp-composer {
  border-top: 1px solid var(--border);
  padding: 0.65rem 0.75rem;
}

.mcp-draft {
  min-height: 2.5rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text);
}

.mcp-draft.typing::after {
  content: '▌';
  color: var(--accent-hover);
  animation: pulse-dot 0.9s step-end infinite;
}

/* ── Browser ────────────────────────────────────────────────────────────── */

.browser-chrome {
  min-height: 420px;
}

.browser-layout {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 380px;
}

.browser-layout.has-preview {
  grid-template-columns: 170px 1fr;
}

.server-list {
  padding: 0.75rem;
  background: #11141a;
}

.browser-layout.has-preview .server-list {
  border-right: 1px solid var(--border);
}

.server-hint {
  margin: 0 0 0.65rem;
  font-size: 0.65rem;
  color: var(--text-faint);
  line-height: 1.4;
}

.server-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.65rem 0.55rem;
  margin-bottom: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.server-card:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.server-port {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-hover);
  line-height: 1.2;
}

.server-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 0.1rem;
}

.server-host {
  font-size: 0.58rem;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

.server-src {
  font-size: 0.58rem;
  color: var(--text-faint);
  margin-top: 0.15rem;
}

.server-open {
  font-size: 0.68rem;
  color: var(--accent-hover);
}

.browser-pane {
  display: flex;
  flex-direction: column;
  background: #0c0e12;
  min-width: 0;
}

.browser-chrome-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--border);
}

.browser-nav {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.7rem;
  cursor: default;
}

.browser-url {
  flex: 1;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #0a0c10;
  font-size: 0.68rem;
  color: var(--text-muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.magic-toggle {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
}

.magic-toggle.active {
  border-color: var(--accent);
  color: var(--accent-hover);
  background: var(--accent-dim);
}

.browser-viewport {
  position: relative;
  flex: 1;
  min-height: 260px;
  overflow: hidden;
  cursor: crosshair;
}

.browser-viewport.magic-off {
  cursor: default;
}

.fake-page {
  padding: 1.25rem 1.5rem;
  height: 100%;
  background:
    linear-gradient(180deg, #f4f6f9 0%, #e8ecf2 100%);
  color: #1a2332;
  font-family: var(--font-display);
}

.fake-nav {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  color: #334155;
}

.fake-hero h3 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.fake-hero p {
  margin: 0 0 1.5rem;
  font-size: 0.85rem;
  color: #64748b;
}

.fake-cta {
  display: inline-flex;
  padding: 0.7rem 1.2rem;
  border: none;
  border-radius: 6px;
  background: #0f172a;
  color: #f8fafc;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: crosshair;
  transition: box-shadow 0.12s ease, outline 0.12s ease;
}

.fake-cta.is-hot {
  outline: 2px solid #3b82f6;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.magic-hint {
  position: absolute;
  left: 12px;
  bottom: 10px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: #64748b;
  background: rgba(255, 255, 255, 0.85);
  padding: 0.25rem 0.45rem;
  border-radius: 4px;
}

.inspect-popover {
  position: absolute;
  z-index: 4;
  width: 280px;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #16181e;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  font-family: var(--font-mono);
  animation: rise 0.2s ease-out;
}

.inspect-chip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.68rem;
}

.inspect-chip code {
  color: var(--accent-hover);
}

.inspect-chip span {
  color: var(--text-muted);
}

.inspect-popover textarea {
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.72rem;
  resize: vertical;
}

.browser-chat-chip {
  padding: 0.55rem 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: #11141a;
  animation: rise 0.25s ease-out;
}

.file-chip {
  display: inline;
  border: none;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: var(--accent-dim);
  color: var(--accent-hover);
  font-family: inherit;
  font-size: 0.7rem;
  cursor: pointer;
}

.file-chip:hover {
  background: rgba(59, 130, 246, 0.22);
}

/* ── Closing ────────────────────────────────────────────────────────────── */

.closing {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(3rem, 10vh, 6rem) clamp(1.25rem, 4vw, 3rem) clamp(2rem, 5vh, 3rem);
  text-align: left;
}

.closing h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.35rem, 2.8vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-bright);
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem clamp(1.25rem, 4vw, 3rem) 2.25rem;
  border-top: 1px solid var(--border);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

.footer-copy {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
}

/* ── Legal pages ────────────────────────────────────────────────────────── */

.legal-page .topnav {
  position: relative;
}

.legal {
  position: relative;
  z-index: 1;
  max-width: 40rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vh, 4rem) clamp(1.25rem, 4vw, 3rem) 3rem;
}

.legal-kicker {
  margin: 0 0 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-hover);
}

.legal h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text-bright);
}

.legal-meta {
  margin: 0 0 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}

.legal h2 {
  margin: 1.75rem 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-bright);
}

.legal p,
.legal li {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.legal p {
  margin: 0 0 0.85rem;
}

.legal ul {
  margin: 0 0 0.85rem;
  padding-left: 1.2rem;
}

.legal li {
  margin-bottom: 0.45rem;
}

.legal a {
  color: var(--accent-hover);
  text-decoration: none;
}

.legal a:hover {
  text-decoration: underline;
}

.legal strong {
  color: var(--text);
  font-weight: 600;
}

/* ── Toast ──────────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #16181e;
  color: var(--text-bright);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  animation: rise 0.25s ease-out;
}

.invoice-link {
  display: inline;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent-hover);
  font-family: inherit;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.invoice-link:hover {
  color: #93c5fd;
}

/* In-demo browser panel (stays inside MCP stage) */
.mcp-stage .invoice-browser {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  width: auto;
  border: none;
  border-radius: 0;
  background: var(--bg-elevated);
  box-shadow: none;
  animation: rise 0.25s ease-out;
}

.invoice-browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.invoice-browser-bar > span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.invoice-url {
  flex: 1;
  margin-left: 0.4rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #0a0c10;
  font-size: 0.68rem;
  color: var(--text-muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.invoice-sheet {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1.1rem 1.2rem 1rem;
  background: #f7f8fa;
  color: #1a2332;
  font-family: var(--font-display);
}

.invoice-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.invoice-brand {
  margin: 0 0 0.2rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.invoice-sheet h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.invoice-meta {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #64748b;
}

.invoice-meta p {
  margin: 0 0 0.2rem;
}

.invoice-meta strong {
  color: #0f172a;
}

.invoice-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.invoice-label {
  display: block;
  margin-bottom: 0.2rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

.invoice-parties p {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: #0f172a;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.85rem;
  font-size: 0.8rem;
}

.invoice-table th {
  padding: 0.4rem 0;
  border-bottom: 1px solid #d8dee6;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  color: #94a3b8;
}

.invoice-table th:last-child,
.invoice-table td:last-child {
  text-align: right;
}

.invoice-table td {
  padding: 0.65rem 0;
  border-bottom: 1px solid #e8ecf2;
  color: #27303f;
}

.invoice-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 0.25rem;
  font-size: 0.9rem;
  color: #0f172a;
}

.invoice-foot span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.invoice-foot strong {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ── Motion ─────────────────────────────────────────────────────────────── */

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

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 960px) {
  .topnav-links {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-visual .ide-chrome {
    transform: none;
  }

  .feature,
  .feature.flip {
    grid-template-columns: 1fr;
  }

  .feature.flip .feature-copy,
  .feature.flip .feature-demo {
    order: unset;
  }

  .av-canvas {
    height: 360px;
  }

  .av-node {
    transform: scale(0.92);
    transform-origin: top left;
  }
}

@media (max-width: 720px) {
  .topnav-cta .btn.ghost {
    display: none;
  }

  .guard-layout,
  .mcp-layout,
  .browser-layout.has-preview {
    grid-template-columns: 1fr;
  }

  .guard-library {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .mcp-list {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .browser-layout.has-preview .server-list {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  /* Compact graph for small screens — stack nodes more tightly via JS positions stay; allow scroll */
  .av-canvas {
    overflow-x: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .atmosphere,
  .av-dot.active,
  .mcp-pulse,
  .mcp-draft.typing::after {
    animation: none;
  }

  .brand,
  h1,
  .lede,
  .cta,
  .note,
  .feature-copy,
  .feature-demo,
  .feature.is-visible .feature-copy,
  .feature.is-visible .feature-demo {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
