/* ── Design tokens ── */
:root {
  --color-bg:           #ffffff;
  --color-surface:      #f8fafc;
  --color-border:       #e2e8f0;
  --color-text:         #1e293b;
  --color-muted:        #64748b;
  --color-accent:       #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-accent-light: #eff6ff;

  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', 'Fira Mono', monospace;

  --container: 1040px;
  --radius:    8px;
  --radius-sm: 4px;
}

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

html { scroll-behavior: smooth; }

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

/* ── Container ── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}
.btn-primary:hover { background: var(--color-accent-hover); }

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

.btn-large {
  padding: 0.75rem 1.75rem;
  font-size: 0.9375rem;
}

.btn-lang {
  background: transparent;
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s ease;
}
.btn-lang:hover { color: var(--color-text); }

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.875rem 0;
}

.nav-logo {
  font-weight: 700;
  font-size: 0.9375rem;
  font-family: var(--font-mono);
  color: var(--color-text);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  margin: 0 auto;
}

.nav-links a {
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--color-accent); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}

/* ── Hero ── */
.hero {
  padding: 6rem 0 5rem;
  text-align: center;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.hero-tagline {
  font-size: clamp(1rem, 2.5vw, 1.1875rem);
  color: var(--color-muted);
  max-width: 540px;
  margin: 0 auto 2rem;
  line-height: 1.65;
}

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

/* ── Sections ── */
.section { padding: 4.5rem 0; }
.section-alt { background: var(--color-surface); }

.section h2 {
  font-size: 1.625rem;
  font-weight: 700;
  margin-bottom: 2rem;
  letter-spacing: -0.01em;
}

/* ── About ── */
.about-content p {
  color: var(--color-muted);
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.75;
}

.about-content a,
.section a {
  color: var(--color-accent);
  text-decoration: none;
}
.about-content a:hover,
.section a:hover { text-decoration: underline; }

/* ── Six concepts grid ── */
.concepts-intro {
  color: var(--color-muted);
  font-size: 0.9375rem;
  margin-bottom: 1.25rem;
  max-width: 540px;
  font-style: italic;
}

.concepts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  max-width: 700px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0 auto 2rem;
}

.concept-item {
  padding: 1.125rem 1.25rem;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

/* Remove border on last column and last row */
.concept-item:nth-child(2n)  { border-right: none; }
.concept-item:nth-child(5),
.concept-item:nth-child(6)   { border-bottom: none; }

.concept-item::before {
  content: "";
  display: block;
  width: 3px;
  height: 1.125rem;
  background: var(--color-accent);
  position: absolute;
  left: 0;
  top: 1.25rem;
  border-radius: 0 2px 2px 0;
}

.concept-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.35rem;
}

.concept-desc {
  font-size: 0.8125rem;
  color: var(--color-muted);
  line-height: 1.55;
}

@media (max-width: 560px) {
  .concepts-grid { grid-template-columns: 1fr; }
  .concept-item { border-right: none; }
  .concept-item:nth-child(6) { border-bottom: none; }
  .concept-item:nth-child(5) { border-bottom: 1px solid var(--color-border); }
}

/* ── Pipeline diagram ── */
.pipeline-wrap {
  max-width: 700px;
  margin: 2rem auto 1.5rem;
  overflow-x: auto;
}

.pipeline-svg {
  width: 100%;
  max-width: 700px;
  display: block;
}

.pipe-box          { fill: var(--color-surface); stroke: var(--color-border); stroke-width: 1.5; }
.pipe-box-accent   { fill: var(--color-accent);  stroke: var(--color-accent-hover); stroke-width: 1.5; }
.pipe-box-kv       { fill: var(--color-accent-light); stroke: var(--color-accent); stroke-width: 1.5; }
.pipe-box-output   { fill: #f0fdf4; stroke: #86efac; stroke-width: 1.5; }
.pipe-arrowhead    { fill: var(--color-muted); }
.pipe-edge         { stroke: var(--color-muted); stroke-width: 1.5; fill: none; }

.pipe-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  fill: var(--color-text);
}
.pipe-label-light { fill: #ffffff; }
.pipe-sublabel {
  font-family: var(--font-body);
  font-size: 10px;
  fill: rgba(255, 255, 255, 0.8);
}

/* ── Stats row ── */
.stats-row {
  background: var(--color-accent);
  padding: 3rem 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  text-align: center;
}

.stat-number {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ffffff;
  line-height: 1;
}

.stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 0.4rem;
}

.stat-sub {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.48);
  margin-top: 0.3rem;
  font-family: var(--font-mono);
  letter-spacing: 0;
}

/* ── Capabilities grid ── */
.cap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.cap-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: var(--color-bg);
}

.cap-card-title {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.cap-card-desc {
  color: var(--color-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.cap-card-desc code {
  font-family: var(--font-mono);
  font-size: 0.825rem;
  background: var(--color-surface);
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

/* ── Tech stack table ── */
.stack-table {
  width: 100%;
  border-collapse: collapse;
  max-width: 680px;
}

.stack-table tr {
  border-bottom: 1px solid var(--color-border);
}

.stack-table td {
  padding: 0.875rem 0;
  font-size: 0.9375rem;
  vertical-align: top;
}

.stack-table td:first-child {
  font-weight: 600;
  width: 160px;
  padding-right: 2rem;
  color: var(--color-text);
}

.stack-table td:last-child {
  color: var(--color-muted);
}

.stack-table code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--color-surface);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  color: var(--color-text);
}

/* ── Terminal / CLI block ── */
.cli-desc {
  color: var(--color-muted);
  font-size: 1rem;
  max-width: 620px;
  margin-bottom: 1.25rem;
  line-height: 1.65;
}

.cli-desc code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: var(--color-surface);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.terminal {
  background: #1e293b;
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
}

.terminal pre { margin: 0; }

.terminal code {
  font-family: var(--font-mono);
  font-size: 0.84375rem;
  color: #e2e8f0;
  line-height: 1.75;
  white-space: pre;
}

.terminal .comment { color: #64748b; }

.section > .container > p > a {
  color: var(--color-accent);
  text-decoration: none;
  font-size: 0.9375rem;
}
.section > .container > p > a:hover { text-decoration: underline; }

/* ── CTA ── */
.cta-section {
  padding: 5rem 0;
  text-align: center;
  border-top: 1px solid var(--color-border);
}

.cta-section h2 {
  font-size: 1.625rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

/* ── Footer ── */
.footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 1.75rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--color-muted);
}

.footer-inner a {
  color: var(--color-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.footer-inner a:hover { color: var(--color-accent); }

.footer-links {
  display: flex;
  gap: 1.25rem;
}

/* ── Responsive ── */
@media (max-width: 800px) {
  .cap-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .nav-links { display: none; }

  .hero { padding: 4rem 0 3.5rem; }

  .cap-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .stack-table td:first-child { width: 120px; padding-right: 1rem; }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

@media (max-width: 400px) {
  .stats-grid { gap: 1rem; }
  .stat-number { font-size: 1.75rem; }
}
