/* ==========================================================================
   AgentNexus - Graph Engineering Standalone Document Stylesheet
   Theme: Neural Cyan & Cosmic Violet, Deep Structural Matrix, High-Density Readability
   ========================================================================== */

:root {
  --ge-bg: #070611;
  --ge-surface: rgba(18, 14, 34, 0.75);
  --ge-surface-elevated: rgba(28, 22, 52, 0.9);
  --ge-border: rgba(168, 85, 247, 0.2);
  --ge-border-glow: rgba(0, 240, 255, 0.45);
  --ge-violet: #a855f7;
  --ge-cyan: #00f0ff;
  --ge-cyan-glow: rgba(0, 240, 255, 0.25);
  --ge-emerald: #10b981;
  --ge-rose: #f43f5e;
  --ge-amber: #f59e0b;
  --ge-text-main: #f8fafc;
  --ge-text-muted: #94a3b8;
  --ge-text-faint: #64748b;
  --font-sans: -apple-system, BlinkMacSystemFont, "Outfit", "Inter", "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--ge-bg);
  color: var(--ge-text-main);
  line-height: 1.7;
  padding-bottom: 120px;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(0, 240, 255, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 85% 30%, rgba(168, 85, 247, 0.09) 0%, transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(16, 185, 129, 0.05) 0%, transparent 40%),
    linear-gradient(to bottom, #070611 0%, #0d0a1f 100%);
}

.graph-canvas-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.25;
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(168, 85, 247, 0.1) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 240, 255, 0.08) 1px, transparent 1px);
  mask-image: radial-gradient(ellipse at 50% 25%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 25%, black 30%, transparent 80%);
  z-index: 0;
}

.ge-container {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Breadcrumb & Top Bar */
.ge-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--ge-surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--ge-border);
  border-radius: 14px;
  margin-bottom: 32px;
}

.ge-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--ge-text-muted);
}

.ge-breadcrumb a {
  color: var(--ge-cyan);
  text-decoration: none;
  transition: color 0.2s;
}

.ge-breadcrumb a:hover {
  text-decoration: underline;
}

.ge-source-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 8px;
  font-size: 0.75rem;
  color: var(--ge-cyan);
  text-decoration: none;
  font-family: var(--font-mono);
  transition: all 0.2s ease;
}

.ge-source-tag:hover {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--ge-cyan);
  transform: translateY(-1px);
}

/* Hero Title */
.ge-hero {
  margin-bottom: 48px;
  position: relative;
}

.ge-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid var(--ge-border);
  border-radius: 9999px;
  font-size: 0.8rem;
  color: #d8b4fe;
  font-weight: 600;
  margin-bottom: 16px;
}

.ge-hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #ffffff 30%, #38bdf8 70%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ge-hero-sub {
  font-size: 1.15rem;
  color: #cbd5e1;
  line-height: 1.6;
  max-width: 860px;
  margin-bottom: 24px;
}

.ge-author-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--ge-text-muted);
  border-top: 1px solid var(--ge-border);
  padding-top: 16px;
  flex-wrap: wrap;
}

.ge-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ge-meta-item strong {
  color: #ffffff;
}

/* Article Sections */
.ge-article-body {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.ge-section {
  background: var(--ge-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--ge-border);
  border-radius: 20px;
  padding: 36px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.ge-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--ge-border);
  padding-bottom: 14px;
}

.ge-section-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ge-cyan);
  background: rgba(0, 240, 255, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(0, 240, 255, 0.25);
}

.ge-section-title h2 {
  font-size: 1.55rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.ge-text {
  font-size: 1rem;
  color: #cbd5e1;
  line-height: 1.75;
  margin-bottom: 20px;
}

.ge-text strong {
  color: #ffffff;
}

/* Three Eras Comparison Grid */
.eras-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 24px 0;
}

.era-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--ge-border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.era-card.highlight {
  border-color: var(--ge-cyan);
  background: linear-gradient(180deg, rgba(0, 240, 255, 0.08) 0%, rgba(0, 0, 0, 0.5) 100%);
  box-shadow: 0 0 25px -5px var(--ge-cyan-glow);
}

.era-stage {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ge-violet);
  margin-bottom: 6px;
}

.era-card.highlight .era-stage {
  color: var(--ge-cyan);
}

.era-card h3 {
  font-size: 1.15rem;
  color: #ffffff;
  margin-bottom: 10px;
}

.era-card p {
  font-size: 0.85rem;
  color: var(--ge-text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.era-bottleneck {
  font-size: 0.78rem;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid #64748b;
  color: #94a3b8;
}

.era-card.highlight .era-bottleneck {
  border-left-color: var(--ge-cyan);
  color: #e2e8f0;
  background: rgba(0, 240, 255, 0.05);
}

/* Visual Architecture Diagrams (CSS Wireframe Nodes & Edges) */
.graph-diagram-box {
  background: #020408;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 28px;
  margin: 24px 0;
  position: relative;
  overflow-x: auto;
}

.diagram-header {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ge-text-faint);
  text-transform: uppercase;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
}

.diamond-flow-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  min-width: 580px;
}

.graph-node {
  background: rgba(28, 22, 52, 0.85);
  border: 1px solid var(--ge-violet);
  border-radius: 12px;
  padding: 12px 20px;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  z-index: 2;
}

.graph-node.planner {
  border-color: var(--ge-cyan);
  background: rgba(0, 240, 255, 0.12);
  color: var(--ge-cyan);
}

.graph-node.barrier {
  border-color: var(--ge-amber);
  background: rgba(245, 158, 11, 0.12);
  color: var(--ge-amber);
}

.graph-node.verifier {
  border-color: var(--ge-emerald);
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.fan-out-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  width: 100%;
}

.sub-agent-node {
  flex: 1;
  max-width: 190px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 12px 14px;
  text-align: center;
  font-size: 0.82rem;
  color: #e2e8f0;
}

.sub-agent-node .sub-role {
  font-size: 0.72rem;
  color: var(--ge-violet);
  font-family: var(--font-mono);
  margin-bottom: 4px;
}

.edge-arrow-down {
  color: var(--ge-cyan);
  font-size: 1.1rem;
  line-height: 1;
}

/* Callout Alert Box */
.ge-callout {
  padding: 20px 24px;
  border-radius: 14px;
  margin: 20px 0;
  display: flex;
  gap: 14px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.ge-callout.insight {
  background: rgba(0, 240, 255, 0.07);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: #e0f2fe;
}

.ge-callout.warning {
  background: rgba(244, 63, 94, 0.07);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #ffe4e6;
}

.ge-callout-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

/* Rules / Check List */
.ge-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 20px 0;
}

.ge-checklist li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--ge-border);
  border-radius: 12px;
  font-size: 0.92rem;
}

.ge-checklist li .icon-ok {
  color: #34d399;
  font-weight: bold;
}

.ge-checklist li .icon-no {
  color: #f87171;
  font-weight: bold;
}

/* Decision Matrix Table */
.matrix-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.88rem;
}

.matrix-table th {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.5);
  border-bottom: 2px solid var(--ge-border);
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ge-cyan);
}

.matrix-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}

.matrix-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Code Snippet */
.code-spec-box {
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 18px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #bae6fd;
  line-height: 1.6;
  overflow-x: auto;
  margin: 18px 0;
}

/* ==========================================================================
   Loop Engineering vs Graph Engineering Showdown Diagram
   ========================================================================== */
.showdown-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 28px 0;
}

.showdown-panel {
  background: #020409;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.showdown-panel.loop-panel {
  border-top: 3px solid #10b981;
}

.showdown-panel.graph-panel {
  border-top: 3px solid #eab308;
}

.showdown-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 20px;
  text-align: center;
  letter-spacing: -0.01em;
}

.showdown-title.loop-title {
  color: #10b981;
}

.showdown-title.graph-title {
  color: #eab308;
}

/* Loop Diagram Elements */
.the-loop-boundary {
  border: 2px dashed rgba(16, 185, 129, 0.5);
  border-radius: 16px;
  padding: 20px 16px;
  background: rgba(16, 185, 129, 0.03);
  position: relative;
  margin: 10px 0;
}

.the-loop-tag {
  position: absolute;
  top: -12px;
  left: 18px;
  background: #020409;
  padding: 2px 10px;
  color: #10b981;
  font-weight: 800;
  font-size: 0.95rem;
}

.loop-inner-agent {
  border: 1.5px solid #10b981;
  border-radius: 12px;
  padding: 14px 10px;
  background: rgba(16, 185, 129, 0.06);
  position: relative;
  margin-bottom: 16px;
}

.loop-agent-label {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #020409;
  padding: 0 8px;
  font-size: 0.75rem;
  color: #a7f3d0;
  font-family: var(--font-mono);
}

.react-steps-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 6px;
  margin-bottom: 10px;
}

.react-step-pill {
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  color: #ecfdf5;
  font-family: var(--font-mono);
  background: rgba(16, 185, 129, 0.1);
}

.react-arrow {
  color: #10b981;
  font-weight: bold;
}

.inner-loop-arrow {
  text-align: center;
  font-size: 0.75rem;
  color: #34d399;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.checkpoint-box {
  border: 1.5px solid #eab308;
  background: rgba(234, 179, 8, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  text-align: center;
  font-size: 0.82rem;
  color: #fef08a;
  font-weight: 600;
  margin: 12px 0;
}

.feedback-loop-track {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #f87171;
  font-family: var(--font-mono);
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px dashed rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  margin-top: 8px;
}

/* Graph Diagram Elements */
.graph-flow-vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  position: relative;
}

.node-pill-start {
  border: 1.5px solid #eab308;
  border-radius: 10px;
  padding: 8px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fef08a;
  background: rgba(234, 179, 8, 0.08);
}

.node-pill-result {
  border: 1.5px solid #eab308;
  border-radius: 10px;
  padding: 8px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fef08a;
  background: rgba(234, 179, 8, 0.08);
}

.node-box-agent {
  border: 1.5px solid #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border-radius: 12px;
  padding: 12px 28px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #38bdf8;
  text-align: center;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.15);
  position: relative;
}

.node-box-function {
  border: 1.5px solid #eab308;
  background: rgba(234, 179, 8, 0.1);
  border-radius: 12px;
  padding: 12px 28px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #eab308;
  text-align: center;
  box-shadow: 0 4px 14px rgba(234, 179, 8, 0.15);
  position: relative;
}

.graph-feedback-curved {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #eab308;
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.25);
  border-radius: 8px;
  padding: 6px 12px;
  margin-top: 4px;
}

@media (max-width: 860px) {
  .showdown-wrapper {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .eras-grid {
    grid-template-columns: 1fr;
  }
  .ge-section {
    padding: 24px;
  }
  .ge-hero h1 {
    font-size: 2rem;
  }
}

