:root[data-theme="light"] {
  --bg: #fafafa;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #1e293b;
  --text-muted: #64748b;
  --connector: #cbd5e1;
  --nav-bg: rgba(255, 255, 255, 0.85);
  --nav-border: #e5e7eb;

  --input: #2563eb;
  --input-bg: #eff6ff;
  --step: #059669;
  --step-bg: #ecfdf5;
  --ai: #7c3aed;
  --ai-bg: #f5f3ff;
  --output: #d97706;
  --output-bg: #fffbeb;

  --node-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --node-shadow-hover: 0 10px 28px rgba(15, 23, 42, 0.12);
  --node-glow: none;
}

:root[data-theme="dark"] {
  --bg: #1a1a2e;
  --surface: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.08);
  --text: rgba(255, 255, 255, 0.9);
  --text-muted: rgba(255, 255, 255, 0.45);
  --connector: rgba(255, 255, 255, 0.2);
  --nav-bg: rgba(26, 26, 46, 0.9);
  --nav-border: rgba(255, 255, 255, 0.08);

  --input: #818cf8;
  --input-bg: rgba(129, 140, 248, 0.14);
  --step: #22d3ee;
  --step-bg: rgba(34, 211, 238, 0.14);
  --ai: #f472b6;
  --ai-bg: rgba(244, 114, 182, 0.14);
  --output: #fbbf24;
  --output-bg: rgba(251, 191, 36, 0.14);

  --node-shadow: none;
  --node-shadow-hover: 0 0 18px rgba(255, 255, 255, 0.06);
  --node-glow: 0 0 14px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-width: 900px;
}

code {
  font-family: "SF Mono", "Fira Code", ui-monospace, monospace;
  font-size: 0.92em;
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 40px;
}

#nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--nav-border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-logo {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.3px;
}

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
  flex-wrap: wrap;
}

.nav-link {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: var(--surface);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

:root[data-theme="light"] .icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }

#hero {
  text-align: center;
  padding-top: 80px;
  padding-bottom: 32px;
}

#hero h1 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.section-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* === Flow diagram === */

.flow-container {
  position: relative;
  padding: 16px 0;
}

.flow-connectors {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.flow-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px 56px;
  position: relative;
  z-index: 2;
}

.flow-node {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--node-shadow);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.flow-node:hover {
  transform: translateY(-3px);
  box-shadow: var(--node-shadow-hover);
}

.flow-node .node-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
}

.flow-node .node-label {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.2px;
}

.flow-node .node-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.flow-node.flow-input { border-color: var(--input); }
.flow-node.flow-input .node-icon { background: var(--input-bg); color: var(--input); }
.flow-node.flow-input:hover { box-shadow: var(--node-shadow-hover), var(--node-glow) var(--input); }

.flow-node.flow-step { border-color: var(--step); }
.flow-node.flow-step .node-icon { background: var(--step-bg); color: var(--step); }
.flow-node.flow-step:hover { box-shadow: var(--node-shadow-hover), var(--node-glow) var(--step); }

.flow-node.flow-ai { border-color: var(--ai); }
.flow-node.flow-ai .node-icon { background: var(--ai-bg); color: var(--ai); }
.flow-node.flow-ai:hover { box-shadow: var(--node-shadow-hover), var(--node-glow) var(--ai); }

.flow-node.flow-output { border-color: var(--output); }
.flow-node.flow-output .node-icon { background: var(--output-bg); color: var(--output); }
.flow-node.flow-output:hover { box-shadow: var(--node-shadow-hover), var(--node-glow) var(--output); }

/* === Cards === */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
  box-shadow: var(--node-shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-card h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.info-card p,
.info-card ul {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.info-card ul {
  list-style: none;
  padding: 0;
}

.info-card li {
  padding: 4px 0;
  padding-left: 14px;
  position: relative;
}

.info-card li::before {
  content: "\2022";
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.tool-card .tool-badge {
  display: inline-block;
  font-family: "SF Mono", "Fira Code", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--ai-bg);
  color: var(--ai);
  align-self: flex-start;
}

/* === Decision table === */

.decision-table-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--node-shadow);
}

.decision-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.decision-table th,
.decision-table td {
  text-align: left;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.decision-table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  background: var(--bg);
}

.decision-table tbody tr:last-child td {
  border-bottom: none;
}

.decision-table tbody tr:hover {
  background: var(--bg);
}

.decision-table code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

/* === CLI block === */

.cli-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--node-shadow);
}

.cli-block pre {
  margin: 0;
  padding: 18px 22px;
  overflow-x: auto;
  font-size: 13px;
}

.cli-block code {
  font-family: "SF Mono", "Fira Code", ui-monospace, monospace;
  background: transparent;
  border: none;
  padding: 0;
  line-height: 1.7;
  color: var(--text);
}

.env-note {
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

/* === Footer === */

footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 40px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  gap: 16px;
}

.footer-inner a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

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

/* === Connectors === */

.flow-connector-line {
  stroke: var(--connector);
  stroke-width: 1.6;
  fill: none;
}

.flow-connector-arrow {
  fill: var(--connector);
}
