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

:root {
  --bg: #06060b;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8e8ed;
  --muted: #8888a0;
  --accent-a: #38bdf8;
  --accent-b: #c084fc;
  --accent-mix: #818cf8;
  --accent-green: #34d399;
  --font-sans: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --radius: 12px;
  --header-h: 64px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 20%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.bg-glow-a { top: -200px; left: -100px; background: var(--accent-a); }
.bg-glow-b { bottom: -200px; right: -100px; background: var(--accent-b); }

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: rgba(6, 6, 11, 0.7);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

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

.logo-icon { font-size: 1.2rem; color: var(--accent-mix); }

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.nav a:hover { color: var(--text); }

.lang-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  gap: 0.15rem;
  transition: border-color 0.2s;
}

.lang-toggle:hover { border-color: rgba(255,255,255,0.15); }
.lang-opt.active { color: var(--text); font-weight: 600; }
.lang-sep { opacity: 0.3; }

main {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 4rem) 2rem 4rem;
}

.hero {
  text-align: center;
  padding: 2rem 0 4rem;
}

.hero-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto 2rem;
  font-weight: 300;
}

.hero-desc code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--accent-a);
  background: rgba(56, 189, 248, 0.08);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: transform 0.15s, box-shadow 0.2s;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent-a), var(--accent-mix));
  color: #06060b;
  box-shadow: 0 4px 24px rgba(56, 189, 248, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 6px 32px rgba(56, 189, 248, 0.35);
}

.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.section-desc {
  color: var(--muted);
  margin-bottom: 2rem;
  max-width: 640px;
}

.section-desc code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--accent-a);
}

.flow-section { margin-bottom: 5rem; }

.pipeline-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.pipeline-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.step-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(56,189,248,0.2), rgba(129,140,248,0.2));
  border: 1px solid rgba(129,140,248,0.3);
  border-radius: 50%;
  color: var(--accent-mix);
}

.step-body h3 {
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.step-body h3 code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--accent-a);
}

.step-body p {
  font-size: 0.85rem;
  color: var(--muted);
}

.step-body p code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--accent-a);
}

.flow-diagram {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.flow-lane {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem;
  border-radius: 10px;
  background: rgba(0,0,0,0.2);
}

.lane-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

.lane-node {
  font-size: 0.8rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  text-align: center;
  min-width: 120px;
}

.lane-arrow {
  font-size: 0.9rem;
  color: var(--muted);
}

.lane-arrow.bidir { color: var(--accent-mix); }

.skill-node { border-color: rgba(52, 211, 153, 0.3); background: rgba(52, 211, 153, 0.08); }
.ui-node { border-color: rgba(129, 140, 248, 0.3); background: rgba(129, 140, 248, 0.08); }
.prompt-node { border-color: rgba(192, 132, 252, 0.3); background: rgba(192, 132, 252, 0.08); }
.mcp-node { border-color: rgba(52, 211, 153, 0.25); background: rgba(52, 211, 153, 0.06); }
.hub-node {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  border-color: rgba(129, 140, 248, 0.4);
  background: rgba(129, 140, 248, 0.1);
}
.hub-port {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-mix);
}
.session-a { border-color: rgba(56, 189, 248, 0.35); background: rgba(56, 189, 248, 0.08); color: var(--accent-a); }
.session-b { border-color: rgba(192, 132, 252, 0.35); background: rgba(192, 132, 252, 0.08); color: var(--accent-b); }

.setup-section { margin-bottom: 5rem; }

.setup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.setup-desc { margin-bottom: 0; }

.hub-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--muted);
  padding: 0.5rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.status-dot.offline { background: #f59e0b; }
.status-dot.online { background: var(--accent-green); }

.setup-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.setup-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-block {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.panel-block:last-of-type { border-bottom: none; }

.config-top {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
}

.config-field { display: flex; flex-direction: column; }

.roles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.role-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  background: rgba(0,0,0,0.2);
}

.task-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.task-grid .field-label { margin-top: 0; }

.panel-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.panel-actions .setup-hint { margin: 0; text-align: left; }

.panel-title {
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.role-a-title { color: var(--accent-a); }
.role-b-title { color: var(--accent-b); }

.field-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.35rem;
  margin-top: 0.65rem;
}

.field-label:first-of-type { margin-top: 0; }

.field-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  transition: border-color 0.2s;
}

.field-input:focus {
  outline: none;
  border-color: rgba(129, 140, 248, 0.5);
}

.field-textarea {
  resize: vertical;
  min-height: 60px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
}

select.field-input { cursor: pointer; }

.prompts-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.prompts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.prompt-card {
  background: #0d0d14;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

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

.prompt-role {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-right: 0.5rem;
}

.role-a-badge { background: rgba(56,189,248,0.2); color: var(--accent-a); }
.role-b-badge { background: rgba(192,132,252,0.2); color: var(--accent-b); }

.prompt-role-name {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.btn-copy {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.btn-copy:hover { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.08); }
.btn-copy.copied { border-color: rgba(52,211,153,0.4); color: var(--accent-green); }

.prompt-body {
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 180px;
  max-height: 360px;
  overflow-y: auto;
}

.prompt-body.empty {
  color: var(--muted);
  font-style: italic;
}

.profile-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
}

.profile-preview summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--muted);
  user-select: none;
}

.profile-json {
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--muted);
  white-space: pre-wrap;
  max-height: 240px;
  overflow-y: auto;
}

.setup-hint {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.setup-hint strong { color: var(--text); }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 5rem;
}

.feature-card {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-2px);
}

.feature-icon { font-size: 1.5rem; margin-bottom: 0.75rem; }
.feature-card h3 { font-size: 1rem; margin-bottom: 0.4rem; }
.feature-card p { font-size: 0.85rem; color: var(--muted); }
.feature-card code {
  font-family: var(--font-mono);
  font-size: 0.8em;
  color: var(--accent-a);
}

.arch-section { margin-bottom: 3rem; }

.arch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.arch-card {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.arch-layer {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.6rem;
  background: rgba(52, 211, 153, 0.15);
  color: var(--accent-green);
}

.arch-layer.mcp { background: rgba(52, 211, 153, 0.12); }
.arch-layer.ui { background: rgba(129, 140, 248, 0.15); color: var(--accent-mix); }
.arch-layer.hub { background: rgba(56, 189, 248, 0.15); color: var(--accent-a); }

.arch-card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
}

.arch-card ul {
  list-style: none;
  font-size: 0.8rem;
  color: var(--muted);
}

.arch-card li {
  padding: 0.25rem 0;
  padding-left: 0.85rem;
  position: relative;
}

.arch-card li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--accent-mix);
}

.arch-card code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--accent-a);
}

.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-sub {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  opacity: 0.6;
}

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 0.65rem 1.25rem;
  background: rgba(20, 20, 30, 0.95);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--text);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 200;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

@media (max-width: 900px) {
  .flow-diagram { grid-template-columns: 1fr; }
  .config-top,
  .roles-grid,
  .task-grid,
  .prompts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header { padding: 0 1rem; }
  .nav a:not(.nav-github) { display: none; }
  main { padding-left: 1rem; padding-right: 1rem; }
}
