:root {
  --bg: #f6efe3;
  --surface: #fffaf2;
  --ink: #1d1a17;
  --muted: #5b544b;
  --accent: #b6542e;
  --accent-2: #1f6f68;
  --ring: #e4c7ae;
}

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

html, body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, #f9f0e1 0, transparent 45%),
    radial-gradient(circle at 90% 20%, #ead7bd 0, transparent 45%),
    linear-gradient(130deg, #f4e6d3, #f7f2ea 50%, #efe4d5);
  min-height: 100dvh;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.07;
  background-image: radial-gradient(#000 0.6px, transparent 0.6px);
  background-size: 5px 5px;
  z-index: 10;
}

/* ── Nav ── */
.arch-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 56px;
  background: rgba(255, 250, 242, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ring);
}

.nav-back {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  transition: color 0.15s;
}
.nav-back:hover { color: var(--ink); }

.nav-brand {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
  letter-spacing: -0.02em;
}

/* ── Main layout ── */
.arch-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 48px 96px;
}

/* ── Hero ── */
.arch-hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--ring);
  margin-bottom: 64px;
}

.arch-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 20px;
}

.arch-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.05;
  margin: 0 0 24px;
  color: var(--ink);
}

.arch-title .accent { color: var(--accent); }

.arch-lead {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 560px;
  margin: 0 0 20px;
}

.arch-stack {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ── Sections ── */
.arch-section {
  padding-bottom: 64px;
  margin-bottom: 64px;
  border-bottom: 1px solid var(--ring);
}
.arch-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.section-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 12px;
}

.section-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0 0 32px;
  line-height: 1.25;
  color: var(--ink);
}
.section-title .accent { color: var(--accent); }

.section-caption {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 16px;
  font-style: italic;
}

/* ── Flow panel ── */
.flow-panel {
  background: var(--surface);
  border: 1px solid var(--ring);
  border-radius: 12px;
  padding: 32px 24px;
  overflow-x: auto;
}

.flow-svg {
  width: 100%;
  min-width: 640px;
  display: block;
}

/* SVG node/edge classes */
.node-rect { fill: var(--surface); stroke: var(--ring); stroke-width: 1.5; }
.node-rect.accent { fill: rgba(182, 84, 46, 0.04); stroke: var(--accent); }
.node-text { font-family: 'Syne', sans-serif; font-size: 12px; font-weight: 600; }
.edge { fill: none; stroke: var(--ring); stroke-width: 1.5; }
.edge.accent { stroke: var(--accent); }

/* ── Topology ── */
.topo-layers {
  border: 1px solid var(--ring);
  border-radius: 12px;
  overflow: hidden;
}

.topo-layer {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 20px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--ring);
}
.topo-layer:last-child { border-bottom: none; }

.topo-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--muted);
  min-width: 28px;
}

.topo-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
  min-width: 180px;
}

.topo-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.topo-connector {
  padding: 10px 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--ring);
  background: var(--bg);
  border-bottom: 1px solid var(--ring);
  border-left: none;
  border-right: none;
  letter-spacing: 0.04em;
}

/* ── Agents grid ── */
.agents-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--ring);
  border: 1px solid var(--ring);
  border-radius: 12px;
  overflow: hidden;
}

.agent-cell {
  background: var(--surface);
  padding: 20px 24px;
}

.agent-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.agent-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  margin-bottom: 5px;
}

.agent-role {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .arch-main { padding: 0 20px 60px; }
  .arch-nav { padding: 14px 20px; }
  .agents-grid { grid-template-columns: 1fr; }
  .topo-layer { flex-direction: column; gap: 6px; }
  .topo-name { min-width: unset; }
}
