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

:root {
  --bg: #08080d;
  --bg-card: #0e0e18;
  --border: #1a1a2e;
  --text: #c8c8d4;
  --text-dim: #6a6a80;
  --heading: #e8e8f0;
  --accent: #4fc3f7;
  --accent-dim: #2a7ea8;
  --keyword: #c792ea;
  --string: #c3e88d;
  --comment: #546e7a;
  --type: #ffcb6b;
  --number: #f78c6c;
  --fn: #82aaff;
  --mono: 'SF Mono', 'Cascadia Code', 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

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

/* ── Lattice background pattern ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(79,195,247,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79,195,247,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ── */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

section {
  padding: 80px 0;
}

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

.hero-title {
  font-family: var(--mono);
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--heading), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: 1.25rem;
  color: var(--text-dim);
  margin-bottom: 28px;
  font-weight: 400;
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.badge {
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--accent);
  background: rgba(79,195,247,0.06);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 10px 22px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}
.btn-primary:hover {
  background: #6fd0fa;
  transform: translateY(-1px);
}

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

/* ── Section headings ── */
.section-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 12px;
}

.section-desc {
  color: var(--text-dim);
  max-width: 640px;
  margin-bottom: 32px;
}

/* ── Phase System ── */
.phase-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.phase-node {
  font-family: var(--mono);
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  text-align: center;
}

.phase-node strong {
  display: block;
  color: var(--heading);
  margin-bottom: 2px;
}

.phase-node span {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.phase-node.flux { border-color: #f78c6c40; }
.phase-node.flux strong { color: #f78c6c; }
.phase-node.fix { border-color: #4fc3f740; }
.phase-node.fix strong { color: #4fc3f7; }

.phase-arrow {
  color: var(--text-dim);
  font-size: 1.2rem;
}

/* ── Code Blocks ── */
.code-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.01);
}

.code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}
.code-dot:nth-child(1) { background: #ff5f57; }
.code-dot:nth-child(2) { background: #febc2e; }
.code-dot:nth-child(3) { background: #28c840; }

.code-filename {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-left: 8px;
}

.code-card pre {
  padding: 24px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text);
  tab-size: 4;
}

/* Syntax highlighting */
.kw { color: var(--keyword); }
.str { color: var(--string); }
.cmt { color: var(--comment); font-style: italic; }
.typ { color: var(--type); }
.num { color: var(--number); }
.fn { color: var(--fn); }
.op { color: var(--text-dim); }
.punct { color: var(--text-dim); }

/* ── Features Grid ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  padding: 28px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: border-color 0.2s;
}
.feature-card:hover {
  border-color: var(--accent-dim);
}

.feature-icon {
  font-size: 1.5rem;
  margin-bottom: 12px;
  display: block;
}

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

.feature-card p {
  font-size: 0.875rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ── Quick Start ── */
.quickstart-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quickstart-step {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.step-num {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  flex-shrink: 0;
  width: 24px;
}

.step-content {
  flex: 1;
}

.step-content p {
  margin-bottom: 8px;
  color: var(--text-dim);
}

.step-content code {
  font-family: var(--mono);
  font-size: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 8px;
  display: block;
  color: var(--accent);
}

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

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
}

.footer-links a {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent); }

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  section { padding: 60px 0; }
  .hero { padding: 80px 0 60px; }

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

  .phase-flow {
    flex-direction: column;
  }

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

  .code-card pre {
    font-size: 0.78rem;
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero-title { font-size: 2.5rem; }
  .hero-meta { flex-direction: column; }
}
