:root {
  --bg: #0c0c0c;
  --surface: #141414;
  --surface-2: #1a1a1a;
  --border: #252525;
  --border-hi: #333;
  --green: #39ff14;
  --green-dim: #39ff1418;
  --green-mid: #39ff1440;
  --green-glow: #39ff1425;
  --amber: #ffaf40;
  --amber-dim: #ffaf4020;
  --red: #ff4444;
  --cyan: #00d4ff;
  --cyan-dim: #00d4ff20;
  --purple: #b48eff;
  --text: #c8c8c8;
  --text-dim: #666;
  --text-bright: #eee;
  --comment: #555;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.6;
}

::selection { background: var(--green-mid); color: var(--text-bright); }

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, #00000008 2px, #00000008 4px);
  pointer-events: none;
  z-index: 9999;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--green);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

/* ── Top bar ── */
.topbar {
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-logo { color: var(--green); font-weight: 700; font-family: 'Space Mono', monospace; letter-spacing: 0.05em; }
.topbar-sep { color: var(--border-hi); }
.topbar-status { color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green-mid); }
.topbar-links { display: flex; gap: 20px; }
.topbar-links a { color: var(--text-dim); font-size: 12px; transition: color 0.2s; }
.topbar-links a:hover { color: var(--green); text-decoration: none; }

/* ── Hero Terminal ── */
.hero { padding: 72px 0 56px; }
.terminal { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.term-header { background: var(--surface-2); border-bottom: 1px solid var(--border); padding: 10px 16px; display: flex; align-items: center; gap: 8px; }
.term-dot { width: 10px; height: 10px; border-radius: 50%; }
.term-dot.r { background: #ff5f57; }
.term-dot.y { background: #febc2e; }
.term-dot.g { background: #28c840; }
.term-header span { margin-left: 12px; font-size: 11px; color: var(--text-dim); }
.term-body { padding: 24px; font-size: 13px; line-height: 1.8; }
.prompt { color: var(--green); }
.flag { color: var(--amber); }
.comment { color: var(--comment); font-style: italic; }
.output { color: var(--text-dim); }
.highlight { color: var(--text-bright); }

.term-line { animation: slideUp 0.4s ease both; }
.term-line:nth-child(1)  { animation-delay: 0.05s; }
.term-line:nth-child(2)  { animation-delay: 0.10s; }
.term-line:nth-child(3)  { animation-delay: 0.15s; }
.term-line:nth-child(4)  { animation-delay: 0.20s; }
.term-line:nth-child(5)  { animation-delay: 0.25s; }
.term-line:nth-child(6)  { animation-delay: 0.30s; }
.term-line:nth-child(7)  { animation-delay: 0.35s; }
.term-line:nth-child(8)  { animation-delay: 0.40s; }
.term-line:nth-child(9)  { animation-delay: 0.45s; }
.term-line:nth-child(10) { animation-delay: 0.50s; }
.term-line:nth-child(11) { animation-delay: 0.55s; }
.term-line:nth-child(12) { animation-delay: 0.60s; }

/* ── Section styles ── */
.section { padding: 56px 0; border-top: 1px solid var(--border); }
.section-head { margin-bottom: 28px; }
.section-head .comment-line { color: var(--comment); font-size: 12px; margin-bottom: 4px; }
.section-head h2 { font-family: 'Space Mono', monospace; font-size: 18px; font-weight: 700; color: var(--text-bright); }
.section-head h2 .accent { color: var(--green); }
.section-head .sub { color: var(--text-dim); font-size: 12px; margin-top: 8px; line-height: 1.6; max-width: 640px; }

/* ── Pipeline stages ── */
.stage-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  margin-bottom: 12px;
  transition: border-color 0.3s, box-shadow 0.3s;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 20px;
  align-items: start;
}
.stage-card:hover { border-color: var(--green); box-shadow: 0 0 16px var(--green-glow); }

.stage-num {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Space Mono', monospace;
  flex-shrink: 0;
}
.stage-num.done { background: var(--green-dim); color: var(--green); border: 1px solid var(--green-mid); }
.stage-num.live { background: var(--cyan-dim); color: var(--cyan); border: 1px solid #00d4ff40; }
.stage-num.wip { background: var(--amber-dim); color: var(--amber); border: 1px solid #ffaf4040; }
.stage-num.planned { background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border); }

.stage-content { min-width: 0; }
.stage-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.stage-header h3 { font-size: 14px; font-weight: 600; color: var(--text-bright); }
.stage-badge {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 600;
}
.stage-badge.done { background: var(--green-dim); color: var(--green); }
.stage-badge.live { background: var(--cyan-dim); color: var(--cyan); }
.stage-badge.wip { background: var(--amber-dim); color: var(--amber); }
.stage-badge.planned { background: var(--surface-2); color: var(--text-dim); }

.stage-module { font-size: 11px; color: var(--purple); margin-bottom: 8px; }
.stage-desc { font-size: 12px; color: var(--text-dim); line-height: 1.6; margin-bottom: 8px; }
.stage-learn { font-size: 11px; color: var(--text); line-height: 1.5; margin-bottom: 12px; padding-left: 12px; border-left: 2px solid var(--border); }
.stage-learn em { color: var(--amber); font-style: normal; }

.stage-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stage-tag { font-size: 10px; color: var(--text-dim); background: var(--surface-2); padding: 2px 8px; border-radius: 3px; border: 1px solid var(--border); }
.stage-script {
  font-size: 10px;
  color: var(--green);
  background: var(--green-dim);
  padding: 3px 8px;
  border-radius: 3px;
  font-family: inherit;
  border: 1px solid var(--green-mid);
}

.stage-actions { margin-top: 12px; display: flex; gap: 8px; }
.stage-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: 3px;
  font-family: inherit; font-size: 10px; font-weight: 600;
  letter-spacing: 0.04em; transition: box-shadow 0.3s;
}
.stage-btn:hover { text-decoration: none; }
.stage-btn.primary { background: var(--green); color: var(--bg); }
.stage-btn.primary:hover { box-shadow: 0 0 12px var(--green-mid); }
.stage-btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.stage-btn.secondary:hover { border-color: var(--border-hi); }

/* ── Docs section ── */
.docs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.doc-card {
  background: var(--surface);
  padding: 20px;
  transition: background 0.3s;
}
.doc-card:hover { background: #16162080; }
.doc-card .doc-status { font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 6px; font-weight: 600; }
.doc-card .doc-status.published { color: var(--green); }
.doc-card .doc-status.draft { color: var(--amber); }
.doc-card .doc-status.planned { color: var(--text-dim); }
.doc-card h3 { font-size: 13px; font-weight: 600; color: var(--text-bright); margin-bottom: 4px; }
.doc-card .doc-module { font-size: 10px; color: var(--purple); margin-bottom: 6px; }
.doc-card p { font-size: 11px; color: var(--text-dim); line-height: 1.5; }
.doc-card .doc-chapters { font-size: 10px; color: var(--text-dim); margin-top: 8px; }

/* ── Build log ── */
.log-entry {
  display: grid;
  grid-template-columns: 90px 64px 1fr auto;
  gap: 14px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  transition: background 0.2s;
}
.log-entry:hover { background: var(--surface); }
.log-date { color: var(--text-dim); }
.log-type { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.log-type.experiment { color: var(--green); }
.log-type.finding { color: var(--amber); }
.log-type.fix { color: var(--red); }
.log-type.release { color: var(--cyan); }
.log-type.milestone { color: var(--purple); }
.log-msg { color: var(--text-bright); }
.log-link { color: var(--green); font-size: 11px; white-space: nowrap; }

/* ── Get involved ── */
.involved-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.involved-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  text-align: center;
  transition: border-color 0.3s;
}
.involved-card:hover { border-color: var(--border-hi); }
.involved-card .ic-icon { font-size: 24px; margin-bottom: 10px; display: block; }
.involved-card h3 { font-size: 12px; font-weight: 600; color: var(--text-bright); margin-bottom: 4px; }
.involved-card p { font-size: 10px; color: var(--text-dim); line-height: 1.5; }

/* ── Newsletter ── */
.newsletter { padding: 56px 0; border-top: 1px solid var(--border); text-align: center; }
.newsletter p { color: var(--text-dim); font-size: 12px; margin-bottom: 20px; max-width: 480px; margin-left: auto; margin-right: auto; }
.newsletter-form { display: flex; gap: 8px; max-width: 420px; margin: 0 auto; }
.newsletter-form input {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px; padding: 10px 14px; color: var(--text);
  font-family: inherit; font-size: 12px; outline: none; transition: border-color 0.3s;
}
.newsletter-form input:focus { border-color: var(--green); }
.newsletter-form input::placeholder { color: var(--text-dim); }
.newsletter-form button {
  background: var(--green); color: var(--bg); border: none;
  padding: 10px 20px; border-radius: 4px; font-family: inherit;
  font-size: 11px; font-weight: 700; cursor: pointer;
  letter-spacing: 0.05em; transition: box-shadow 0.3s;
}
.newsletter-form button:hover { box-shadow: 0 0 16px var(--green-mid); }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
footer a { color: var(--text-dim); }
footer a:hover { color: var(--green); }
.footer-links { display: flex; gap: 16px; }

/* ── Code blocks ── */
.code-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.code-label {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 6px 16px;
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.code-label::before {
  content: '●';
  font-size: 7px;
}
.code-label.python::before { color: #4ecdc4; }
.code-label.bash::before { color: var(--green); }
.code-label.output::before { color: var(--text-dim); }

.code-block pre {
  padding: 16px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text);
  font-family: inherit;
  white-space: pre;
  overflow-x: auto;
  margin: 0;
}
.code-block code { color: var(--text-bright); }
.output-pre { color: var(--text-dim) !important; }

/* ── Syntax highlighting ── */
.code-keyword { color: #ff79c6; }
.code-function { color: #50fa7b; }
.code-string { color: #f1fa8c; }
.code-class { color: #8be9fd; }
.code-comment { color: #6272a4; font-style: italic; }
.code-number { color: #bd93f9; }
.code-builtin { color: #ffb86c; }
.shell-flag { color: var(--amber); }
.shell-argument { color: var(--cyan); }

/* ── CLI rows ── */
.cli-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.cli-label { color: var(--text-dim); min-width: 200px; font-size: 11px; }
.cli-cmd { color: var(--green); font-size: 11px; }

/* ── API nav ── */
.api-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.api-nav-link {
  font-size: 10px;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 3px;
  transition: all 0.2s;
}
.api-nav-link:hover {
  color: var(--green);
  border-color: var(--green-mid);
  text-decoration: none;
}

/* ── API reference ── */
.api-module {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 12px;
  overflow: hidden;
}
.api-module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.api-module-header h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  font-family: 'Space Mono', monospace;
}
.api-source-link { font-size: 10px; color: var(--text-dim); }
.api-module-desc { padding: 12px 20px 0; font-size: 11px; color: var(--text-dim); line-height: 1.5; }

.api-members { padding: 8px 20px 16px; }
.api-member {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.api-member:last-child { border-bottom: none; }
.api-member-name { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.api-member-name code { font-size: 12px; color: var(--text-bright); }
.api-kind {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 600;
}
.api-kind.class { background: var(--cyan-dim); color: var(--cyan); }
.api-kind.dataclass { background: var(--green-dim); color: var(--green); }
.api-kind.function { background: var(--amber-dim); color: var(--amber); }
.api-kind.protocol { background: #b48eff20; color: var(--purple); }
.api-member p { font-size: 11px; color: var(--text-dim); line-height: 1.5; }

/* ── Examples ── */
.example-block { margin-bottom: 20px; }
.example-header { margin-bottom: 8px; }
.example-header h3 { font-size: 13px; color: var(--text-bright); font-weight: 600; margin-bottom: 2px; }
.example-header p { font-size: 11px; color: var(--text-dim); }

/* ── Demos ── */
.demos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.demo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  transition: border-color 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}
.demo-card:hover { border-color: var(--green); box-shadow: 0 0 16px var(--green-glow); }
.card-status { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.card-status.live { color: var(--green); }
.card-status.wip { color: var(--amber); }
.card-status.planned { color: var(--text-dim); }
.status-dot-card { width: 6px; height: 6px; border-radius: 50%; }
.card-status.live .status-dot-card { background: var(--green); box-shadow: 0 0 6px var(--green-mid); }
.card-status.wip .status-dot-card { background: var(--amber); }
.card-status.planned .status-dot-card { background: var(--text-dim); }
.demo-card h3 { font-size: 13px; font-weight: 600; color: var(--text-bright); margin-bottom: 6px; }
.demo-card p { font-size: 11px; color: var(--text-dim); line-height: 1.5; flex-grow: 1; }
.card-footer { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; font-size: 10px; }
.card-tag { color: var(--text-dim); background: var(--surface-2); padding: 2px 6px; border-radius: 3px; border: 1px solid var(--border); }
.try-btn {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--bg); background: var(--green);
  padding: 5px 12px; border-radius: 3px;
  font-family: inherit; font-size: 10px; font-weight: 600;
  margin-top: 12px; letter-spacing: 0.04em;
  transition: box-shadow 0.3s; align-self: flex-start;
}
.try-btn:hover { box-shadow: 0 0 12px var(--green-mid); text-decoration: none; }
.try-btn.planned { background: var(--border); color: var(--text-dim); cursor: default; }

/* ── Roadmap ── */
.roadmap-group { margin-bottom: 24px; }
.roadmap-horizon {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.roadmap-item {
  display: flex;
  gap: 16px;
  padding: 8px 0;
  font-size: 12px;
  align-items: baseline;
}
.roadmap-title { color: var(--text-bright); font-weight: 500; min-width: 240px; }
.roadmap-desc { color: var(--text-dim); font-size: 11px; }

/* ── Responsive ── */
@media (max-width: 700px) {
  .demos-grid { grid-template-columns: 1fr; }
  .log-entry { grid-template-columns: 1fr; gap: 4px; }
  .log-date, .log-link { display: none; }
  .topbar-links { display: none; }
  .newsletter-form { flex-direction: column; }
  .hero { padding: 40px 0 32px; }
  .term-body { padding: 16px; font-size: 12px; }
  .cli-row { flex-direction: column; gap: 4px; }
  .cli-label { min-width: auto; }
  .api-member-name { flex-wrap: wrap; }
  .roadmap-item { flex-direction: column; gap: 4px; }
  .roadmap-title { min-width: auto; }
}
