:root {
  color-scheme: light;
  --bg: #f5f7f9;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #667085;
  --line: #d7dde5;
  --accent: #0f766e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

a:hover {
  text-decoration: underline;
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.header {
  max-width: 760px;
  margin-bottom: 28px;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 0.92rem;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.header p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.header .eyebrow {
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1;
}

.primary-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  padding: 0 16px;
}

.primary-button:hover {
  background: #0b5f59;
  text-decoration: none;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--accent);
  padding: 0 16px;
}

.secondary-button:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.chart-grid {
  display: grid;
  gap: 18px;
}

.chart-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  font-size: 1rem;
  letter-spacing: 0;
}

.panel-heading a {
  flex: 0 0 auto;
  font-size: 0.9rem;
  font-weight: 700;
}

.chart-panel img {
  display: block;
  width: 100%;
  height: auto;
  background: #ffffff;
}

.demo-page {
  max-width: 1120px;
}

.demo-hero {
  max-width: 900px;
}

.intro-section,
.pipeline-section,
.terminal-panel,
.feature-section,
.cta-section,
.breakdown-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.intro-section {
  margin-bottom: 18px;
  padding: 18px;
}

.intro-section p,
.breakdown-grid p,
.feature-section p,
.cta-section p {
  color: var(--muted);
  line-height: 1.7;
}

.pipeline-section {
  margin-bottom: 18px;
  padding: 18px;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.pipeline-node {
  position: relative;
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.pipeline-node::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -11px;
  width: 10px;
  height: 1px;
  background: var(--line);
}

.pipeline-node:last-child::after {
  display: none;
}

.pipeline-node span {
  display: block;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.pipeline-node strong {
  display: block;
  font-size: 0.98rem;
}

.pipeline-node.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
  transform: translateY(-2px);
}

.terminal-panel {
  overflow: hidden;
  margin-bottom: 18px;
  background: #111827;
  color: #d1fae5;
}

.terminal-actions {
  display: flex;
  justify-content: flex-end;
  margin: -2px 0 12px;
}

.terminal-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #9ca3af;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.85rem;
}

.terminal-panel pre {
  min-height: 340px;
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  white-space: pre-wrap;
  color: #d1fae5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.7;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.breakdown-grid article {
  padding: 16px;
}

.breakdown-grid h2,
.feature-section h2 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.feature-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  margin-bottom: 18px;
  padding: 18px;
}

.feature-section ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.cta-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
}

.link-button {
  flex: 0 0 auto;
  text-decoration: none;
}

@media (max-width: 900px) {
  .pipeline,
  .breakdown-grid {
    grid-template-columns: 1fr;
  }

  .pipeline-node::after {
    top: auto;
    right: 50%;
    bottom: -11px;
    width: 1px;
    height: 10px;
  }
}

@media (max-width: 640px) {
  .page {
    width: min(100% - 20px, 1180px);
    padding-top: 22px;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .hero-actions,
  .cta-section {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .pipeline,
  .breakdown-grid,
  .feature-section,
  .feature-section ul {
    grid-template-columns: 1fr;
  }

  .terminal-panel pre {
    min-height: 300px;
    font-size: 0.85rem;
  }
}
