/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0e17;
  --bg-alt: #0f1420;
  --surface: #151b2b;
  --border: #1e2740;
  --text: #94a3b8;
  --text-bright: #e2e8f0;
  --heading: #f1f5f9;
  --accent: #22d3ee;
  --accent-dim: rgba(34, 211, 238, 0.12);
  --green: #34d399;
  --yellow: #fbbf24;
  --red: #f87171;
  --mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html { scroll-behavior: smooth; }

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 960px; margin: 0 auto; padding: 0 24px; }

/* ─── Nav ─── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-logo { display: flex; align-items: center; gap: 0; text-decoration: none; }
.logo-mesh { color: var(--accent); font-family: var(--mono); font-weight: 700; font-size: 18px; }
.logo-term { color: var(--text-bright); font-family: var(--mono); font-weight: 400; font-size: 18px; }

.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { color: var(--text); font-size: 14px; text-decoration: none; transition: color 0.2s; }
.nav-links a:hover { color: var(--text-bright); text-decoration: none; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-sm { padding: 6px 14px; font-size: 13px; }

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.btn-primary:hover { opacity: 0.9; text-decoration: none; }

.btn-outline {
  background: transparent;
  color: var(--text-bright);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--accent); text-decoration: none; }

/* ─── Install Box ─── */
.install-box {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 32px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.install-box:hover { border-color: var(--accent); }

.install-box code {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--text-bright);
}

.copy-btn {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.copy-btn:hover { color: var(--accent); }

/* ─── Hero ─── */
.hero {
  padding: 100px 0 80px;
  text-align: center;
}

.hero-tag {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.5px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  color: var(--heading);
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 18px;
  color: var(--text);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 40px;
  flex-wrap: wrap;
}

/* ─── Sections ─── */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }

.section h2 {
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 16px;
  text-align: center;
}

.section-sub {
  font-size: 16px;
  color: var(--text);
  max-width: 560px;
  margin: 0 auto 40px;
  text-align: center;
}

/* ─── Code Blocks ─── */
.code-block {
  background: #0b1020;
  border: 1px solid rgba(34, 211, 238, 0.15);
  border-radius: 12px;
  overflow: hidden;
  text-align: left;
  max-width: 640px;
  margin: 0 auto;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.code-block.compact { max-width: 100%; margin: 16px 0 0; box-shadow: none; }

.code-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.dots { display: flex; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.code-label {
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

.code-block pre {
  padding: 20px;
  overflow-x: auto;
  margin: 0;
}

.code-block code {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-bright);
}

.c-comment { color: #64748b; }
.c-cmd { color: var(--accent); }
.c-flag { color: var(--yellow); }
.c-str { color: var(--green); }

/* ─── Problem ─── */
.problem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  margin-top: 40px;
}

.problem-card {
  text-align: left;
}

.problem-card p {
  margin-bottom: 16px;
  font-size: 16px;
  line-height: 1.7;
}

.problem-card strong { color: var(--text-bright); }

/* ─── SVG Diagrams ─── */
.diagram-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  justify-content: center;
}

.diagram-box svg { width: 100%; max-width: 480px; height: auto; }
.diagram-box.wide { max-width: 700px; margin: 40px auto 0; }
.diagram-box.wide svg { max-width: 640px; }

/* ─── ASCII Diagrams ─── */
.ascii-diagram {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  overflow-x: auto;
}

.ascii-diagram pre {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  line-height: 1.5;
  margin: 0;
  white-space: pre;
  text-align: center;
}

.ascii-diagram.wide {
  max-width: 700px;
  margin: 40px auto 0;
}

/* ─── Supports Row ─── */
.supports-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 32px;
}

.badge {
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(34, 211, 238, 0.2);
}

/* ─── Features Grid ─── */
.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 40px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  text-align: left;
}

.feature-card h3 {
  font-size: 18px;
  color: var(--heading);
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 8px;
}

.mode-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--border);
}

/* ─── Tools Table ─── */
.tools-table { margin-top: 16px; overflow-x: auto; }

.tools-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tools-table th {
  text-align: left;
  padding: 8px 12px;
  color: var(--text);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tools-table td {
  padding: 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.tools-table code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
}

.tools-table .more {
  color: var(--text);
  font-style: italic;
  font-size: 12px;
}

/* ─── Check List ─── */
.check-list {
  list-style: none;
  margin-top: 16px;
}

.check-list li {
  padding: 6px 0;
  padding-left: 24px;
  position: relative;
  font-size: 14px;
}

.check-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}

/* ─── Comparison Table ─── */
.table-wrap { overflow-x: auto; margin-top: 40px; }

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

.compare-table th,
.compare-table td {
  padding: 12px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.compare-table th {
  color: var(--text);
  font-weight: 500;
  font-size: 13px;
}

.compare-table th.highlight {
  color: var(--accent);
  font-weight: 700;
}

.compare-table td:first-child {
  text-align: left;
  color: var(--text-bright);
  font-weight: 500;
}

.compare-table td.highlight {
  color: var(--green);
  font-weight: 600;
}

/* ─── Footer ─── */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.footer-brand { font-size: 20px; }

.footer-links {
  display: flex;
  gap: 24px;
  font-size: 14px;
}

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

.footer-copy {
  font-size: 13px;
  color: rgba(148, 163, 184, 0.6);
}

.footer-copy a { color: rgba(148, 163, 184, 0.8); }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .nav-links a:not(.btn) { display: none; }

  .hero { padding: 64px 0 48px; }
  .section { padding: 56px 0; }

  .problem-grid { grid-template-columns: 1fr; gap: 24px; }
  .features-grid { grid-template-columns: 1fr; }

  .code-block { border-radius: 8px; }
  .code-block code { font-size: 12px; }

  .compare-table { font-size: 13px; }
  .compare-table th, .compare-table td { padding: 8px 10px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 28px; }
  .hero-sub { font-size: 16px; }
  .hero-cta { flex-direction: column; align-items: center; }
  .btn { width: 100%; justify-content: center; max-width: 280px; }
}
