/* SynapseNet — Protocol site stylesheet */
/* Aesthetic: dark neural / electric / open-source precision */

:root {
  --bg:        #09090b;
  --surface:   #111118;
  --surface-2: #18181f;
  --border:    #27272f;
  --border-2:  #3f3f52;
  --accent:    #818cf8;          /* indigo */
  --accent-2:  #22d3ee;          /* cyan */
  --accent-dim: rgba(129,140,248,0.12);
  --green:     #4ade80;
  --text:      #e4e4e7;
  --muted:     #71717a;
  --muted-2:   #a1a1aa;
  --code-bg:   #0d0d17;
  --radius:    8px;
  --radius-lg: 14px;
  --max-w:     1100px;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ──────────────────────────────────────── */

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
p  { color: var(--muted-2); }
a  { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-2); }

.label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ── Layout ──────────────────────────────────────────── */

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 100px 0; }

.section-header {
  text-align: center;
  margin-bottom: 64px;
}
.section-header .label { margin-bottom: 12px; }
.section-header h2 { margin-bottom: 16px; }
.section-header p { max-width: 560px; margin: 0 auto; font-size: 1.05rem; }

/* ── Nav ─────────────────────────────────────────────── */

nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(9,9,11,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
}

.nav-logo svg { flex-shrink: 0; }

.nav-logo .logo-name { color: var(--text); }
.nav-logo .logo-dot  { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  color: var(--muted-2);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color .2s;
}
.nav-links a:hover { color: var(--text); }

.nav-cta {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--text) !important;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  transition: border-color .2s, background .2s !important;
}
.nav-cta:hover {
  border-color: var(--accent) !important;
  background: var(--accent-dim) !important;
  color: var(--text) !important;
}

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

#hero {
  padding: 160px 0 100px;
  position: relative;
  overflow: hidden;
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(129,140,248,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(129,140,248,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, black 40%, transparent 100%);
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(129,140,248,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted-2);
  margin-bottom: 28px;
}
.hero-badge span.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  flex-shrink: 0;
}

.hero-title {
  margin-bottom: 24px;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.15rem;
  max-width: 560px;
  margin: 0 auto 40px;
  color: var(--muted-2);
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #6366f1);
  color: #fff;
  box-shadow: 0 0 24px rgba(129,140,248,0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 36px rgba(129,140,248,0.5);
  color: #fff;
}

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

.hero-meta {
  margin-top: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}
.hero-stat .num {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-stat .desc {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

.hero-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

/* ── Problem ─────────────────────────────────────────── */

#problem {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.problem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 56px;
}

.problem-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.problem-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity .3s;
}
.problem-card:hover::before { opacity: 1; }

.problem-stat {
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(135deg, #f87171, #fb923c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 10px;
}

.problem-card h3 {
  color: var(--text);
  margin-bottom: 10px;
}
.problem-card p {
  font-size: 0.9rem;
}

.problem-diagram {
  grid-column: 1 / -1;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
}

.diagram-agents {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.agent-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  text-align: center;
  min-width: 110px;
}

.agent-box .agent-name {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}
.agent-box .agent-framework {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 3px;
}

.arrow-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 12px;
}
.arrow-line {
  width: 60px;
  height: 2px;
  background: var(--border);
  position: relative;
}
.arrow-line.broken {
  background: repeating-linear-gradient(90deg, #f87171 0, #f87171 6px, transparent 6px, transparent 12px);
}
.arrow-label {
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 6px;
  white-space: nowrap;
}
.arrow-label.bad { color: #f87171; }

.diagram-caption {
  text-align: center;
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ── How it works ────────────────────────────────────── */

#how {
  position: relative;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.op-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color .25s;
}
.op-card:hover { border-color: var(--accent); }

.op-method {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 14px;
}

.method-post  { background: rgba(74,222,128,0.15); color: var(--green); border: 1px solid rgba(74,222,128,0.3); }
.method-delete{ background: rgba(248,113,113,0.15); color: #f87171;      border: 1px solid rgba(248,113,113,0.3); }
.method-get   { background: rgba(34,211,238,0.12);  color: var(--accent-2); border: 1px solid rgba(34,211,238,0.3); }

.op-card h3 {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 8px;
}
.op-card > p {
  font-size: 0.87rem;
  margin-bottom: 18px;
}

/* ── Code blocks ─────────────────────────────────────── */

.code-block {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.code-lang {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.code-copy {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.65rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all .2s;
  font-weight: 500;
}
.code-copy:hover { color: var(--text); border-color: var(--border-2); }
.code-copy.copied { color: var(--green); border-color: var(--green); }

pre {
  padding: 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.65;
}

code { font-family: var(--font-mono); }

/* Syntax highlighting via spans */
.kw   { color: #c792ea; }   /* keywords */
.str  { color: #c3e88d; }   /* strings */
.num  { color: #f78c6c; }   /* numbers */
.fn   { color: #82aaff; }   /* functions */
.cm   { color: #546e7a; font-style: italic; }  /* comments */
.key  { color: var(--accent-2); }  /* JSON keys */
.val  { color: var(--green); }     /* JSON values */
.url  { color: #f78c6c; }

/* ── Architecture diagram ────────────────────────────── */

.arch-diagram {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin: 60px 0 0;
  text-align: center;
}

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

.arch-layers {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.arch-layer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.arch-node {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 6px;
  padding: 9px 18px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text);
  white-space: nowrap;
}

.arch-node.accent { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }
.arch-node.cyan   { border-color: rgba(34,211,238,0.4); background: rgba(34,211,238,0.08); color: var(--accent-2); }

.arch-arrow-down {
  font-size: 1.2rem;
  color: var(--border-2);
  align-self: center;
}

.arch-separator {
  width: 100%;
  max-width: 420px;
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ── Protocol section ────────────────────────────────── */

#protocol {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

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

.protocol-text .label { margin-bottom: 12px; }
.protocol-text h2 { margin-bottom: 16px; }
.protocol-text p { margin-bottom: 16px; }

.analogy-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.analogy-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color .2s;
}
.analogy-card:hover { border-color: var(--accent); }

.analogy-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.analogy-icon svg {
  width: 22px;
  height: 22px;
  stroke: #818cf8;
  stroke-width: 1.5;
}

.analogy-card h4 {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 4px;
}
.analogy-card p {
  font-size: 0.82rem;
  margin: 0;
}

.products-avoided {
  margin-top: 24px;
  padding: 18px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
}

.products-avoided .prod-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.prod-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.prod-tag {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted-2);
}

.prod-vs {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 8px;
}

/* ── Get started ─────────────────────────────────────── */

#quickstart {
  position: relative;
}

.quickstart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.quickstart-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.step {
  display: flex;
  gap: 16px;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-content h4 {
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 4px;
}
.step-content p { font-size: 0.85rem; }

/* ── Roadmap ─────────────────────────────────────────── */

#roadmap {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.roadmap-track {
  position: relative;
  padding-left: 32px;
}

.roadmap-track::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), var(--accent-2), var(--border));
}

.milestone {
  position: relative;
  padding-bottom: 40px;
}
.milestone:last-child { padding-bottom: 0; }

.milestone::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border-2);
}

.milestone.done::before {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 8px rgba(74,222,128,0.4);
}

.milestone.active::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(129,140,248,0.5);
}

.milestone-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.milestone-ver {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
}

.milestone-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
}

.tag-done   { background: rgba(74,222,128,0.12); color: var(--green); border: 1px solid rgba(74,222,128,0.3); }
.tag-active { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(129,140,248,0.3); }
.tag-planned{ background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

.milestone h3 {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 6px;
}

.milestone-context {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.6;
}

.milestone-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.milestone-items li {
  font-size: 0.85rem;
  color: var(--muted-2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.milestone-items li::before {
  content: '—';
  color: var(--border-2);
  flex-shrink: 0;
}

.milestone.done .milestone-items li::before { content: '✓'; color: var(--green); }

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

footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
}

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

.footer-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--muted-2);
  transition: color .2s;
}
.footer-links a:hover { color: var(--text); }

.footer-credit {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: right;
}
.footer-credit a { color: var(--muted-2); }
.footer-credit a:hover { color: var(--accent); }

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

@media (max-width: 768px) {
  section { padding: 72px 0; }

  .nav-links { display: none; }

  .problem-grid,
  .ops-grid,
  .protocol-grid,
  .quickstart-grid {
    grid-template-columns: 1fr;
  }

  .problem-diagram { grid-column: 1; }

  .diagram-agents {
    gap: 8px;
    flex-direction: column;
  }

  .arrow-block { transform: rotate(90deg); }

  .hero-divider { display: none; }

  h1 { font-size: 2rem; }

  .arch-node { font-size: 0.7rem; padding: 8px 12px; }

  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-credit { text-align: left; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; align-items: center; }
  .btn { width: 100%; justify-content: center; max-width: 280px; }
}

/* ── Scrollbar ───────────────────────────────────────── */

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Selection ───────────────────────────────────────── */

::selection { background: rgba(129,140,248,0.25); color: var(--text); }
