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

/* ===== Variables ===== */
:root {
  --bg:          oklch(9% 0.006 55);
  --surface:     oklch(13.5% 0.009 55);
  --surface-2:   oklch(19% 0.011 55);
  --border:      oklch(27% 0.013 55);
  --border-hi:   oklch(38% 0.018 55);
  --text:        oklch(97% 0.004 75);
  --text-2:      oklch(84% 0.009 70);
  --text-muted:  oklch(68% 0.014 65);
  --text-subtle: oklch(51% 0.012 58);
  --accent:      oklch(73% 0.17 65);
  --accent-dim:  oklch(63% 0.14 65);
  --accent-glow: oklch(73% 0.17 65 / 0.09);
  --accent-ring: oklch(73% 0.17 65 / 0.20);
  --green:       oklch(74% 0.14 158);
  --green-bg:    oklch(74% 0.14 158 / 0.08);
  --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:        'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --radius:      6px;
  --radius-sm:   3px;
  --max-w:       1100px;
}

/* ===== Base ===== */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* ===== Layout ===== */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Nav ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: oklch(9% 0.006 55 / 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  transition: color 0.15s;
}

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

.btn-ghost {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  transition: color 0.15s, border-color 0.15s;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-hi);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 130px 0 110px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, oklch(48% 0.012 55 / 0.38) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 68%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 68%);
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 920px;
  height: 640px;
  background: radial-gradient(ellipse at 50% 18%, oklch(73% 0.17 65 / 0.12) 0%, transparent 62%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid var(--accent-ring);
  border-radius: 100px;
  padding: 5px 14px;
  margin-bottom: 38px;
  letter-spacing: 0.03em;
  position: relative;
}

.hero h1 {
  font-size: clamp(2.75rem, 6.5vw, 4.5rem);
  font-weight: 700;
  line-height: 1.07;
  letter-spacing: -0.04em;
  margin-bottom: 26px;
  color: var(--text);
}

.hero h2 {
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.hero-sub {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto 46px;
  line-height: 1.74;
  letter-spacing: -0.005em;
}

.install-block {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 22px;
  overflow: hidden;
  transition: border-color 0.2s;
}

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

.install-prompt {
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  padding: 14px 0 14px 20px;
  user-select: none;
}

.install-cmd {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--green);
  padding: 14px 20px 14px 10px;
  white-space: nowrap;
}

.copy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-subtle);
  cursor: pointer;
  padding: 14px 16px;
  transition: color 0.15s, background 0.15s;
  min-width: 48px;
}

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

.compat-line {
  font-size: 0.8125rem;
  color: var(--text-subtle);
}

.compat-line span {
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== Section scaffolding ===== */
.section {
  padding: 100px 0;
}

.outputs-section  { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.phases-section   { background: var(--bg); }
.agents-section   { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.install-section  { background: var(--bg); }

.section-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-dim);
  text-align: center;
  margin-bottom: 14px;
}

.section-title {
  font-size: clamp(1.875rem, 3.2vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-align: center;
  margin-bottom: 14px;
  color: var(--text);
}

.section-sub {
  font-size: 0.9375rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 460px;
  margin: 0 auto 56px;
  line-height: 1.74;
}

/* ===== Outputs List ===== */
.outputs-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.output-item {
  display: grid;
  grid-template-columns: 172px 1fr;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.output-item:last-child {
  border-bottom: none;
}

.output-item-left {
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  transition: background 0.15s;
}

.output-item:hover .output-item-left {
  background: var(--surface-2);
}

.output-item:hover .output-item-right {
  background: oklch(11% 0.007 55);
}

.output-tag {
  display: inline-flex;
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid var(--accent-ring);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  letter-spacing: 0.08em;
  width: fit-content;
}

.output-path {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--text-subtle);
  line-height: 1.5;
}

.output-item-right {
  padding: 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: background 0.15s;
}

.output-item-right h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.015em;
}

.output-item-right p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.66;
  max-width: 560px;
}

/* ===== Phases ===== */
.phases {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.phases-line {
  position: absolute;
  left: 19px;
  top: 22px;
  bottom: 22px;
  width: 1px;
  background: linear-gradient(to bottom, var(--border) 0%, var(--border) 88%, transparent 100%);
  z-index: 0;
}

.phase {
  display: flex;
  gap: 28px;
  padding-bottom: 36px;
  position: relative;
  z-index: 1;
}

.phase:last-child {
  padding-bottom: 0;
}

.phase-num {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-subtle);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.phase:hover .phase-num {
  border-color: var(--accent-ring);
  color: var(--accent);
  background: var(--accent-glow);
}

.phase-body {
  padding-top: 8px;
  flex: 1;
}

.phase-body h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 7px;
  color: var(--text);
}

.phase-body p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.68;
}

.phase-body code {
  font-family: var(--mono);
  font-size: 0.82em;
  color: var(--green);
  background: var(--green-bg);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ===== Agents Table ===== */
.agents-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  overflow-x: auto;
}

.agents-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.agents-table th {
  background: var(--surface);
  padding: 12px 24px;
  text-align: left;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-subtle);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.agents-table td {
  padding: 15px 24px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-2);
}

.agents-table tr:last-child td {
  border-bottom: none;
}

.agents-table tr:hover td {
  background: var(--surface);
}

.agents-table strong {
  font-weight: 600;
  color: var(--text);
}

.agents-table code {
  font-family: var(--mono);
  font-size: 0.8125em;
  color: var(--green);
  background: var(--green-bg);
  padding: 2px 6px;
  border-radius: 3px;
}

/* ===== Install Section ===== */
.install-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.install-opt {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.install-opt-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-subtle);
}

.code-block {
  display: flex;
  align-items: stretch;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.install-section .code-block {
  background: var(--surface);
}

.code-block pre {
  flex: 1;
  padding: 14px 20px;
  overflow-x: auto;
}

.code-block code {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--green);
  line-height: 1.75;
}

.copy-code-btn {
  background: none;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-subtle);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0 18px;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

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

.usage-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.usage-code code {
  color: var(--text-2);
}

.c-cmd {
  color: var(--green);
}

.c-comment {
  color: var(--text-subtle);
}

.natural-lang {
  font-size: 0.875rem;
  color: var(--text-subtle);
  padding-top: 4px;
}

.natural-lang em {
  font-style: normal;
  color: var(--text-muted);
}

/* ===== Builder OS Section ===== */
.builder-os-section {
  background: var(--bg);
}

.session-compare {
  display: grid;
  grid-template-columns: 1fr 44px 1fr;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.session-col {
  padding: 32px 36px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.session-col--before {
  background: var(--surface);
}

.session-col--after {
  background: oklch(11% 0.008 55);
}

.session-col-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-subtle);
}

.session-col--after .session-col-label {
  color: var(--accent-dim);
}

.session-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 11px;
  flex: 1;
}

.session-list li {
  font-size: 0.875rem;
  color: var(--text-subtle);
  line-height: 1.5;
  padding-left: 18px;
  position: relative;
}

.session-list li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--border-hi);
}

.session-col--after .session-list li {
  color: var(--text-muted);
}

.session-col--after .session-list li::before {
  content: '→';
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.session-col--after .session-list li:last-child {
  color: var(--text);
  font-weight: 500;
}

.session-col--after .session-list li code {
  font-family: var(--mono);
  font-size: 0.82em;
  color: var(--green);
  background: var(--green-bg);
  padding: 1px 5px;
  border-radius: 3px;
}

.session-col-note {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.session-col--before .session-col-note {
  color: var(--text-subtle);
}

.session-col--after .session-col-note {
  color: var(--accent);
}

.session-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-subtle);
  background: var(--surface-2);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  writing-mode: vertical-rl;
  gap: 0;
}

.how-it-sticks {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 36px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.how-it-sticks-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-dim);
}

.how-it-sticks p:last-child {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.72;
  max-width: 740px;
}

.how-it-sticks code {
  font-family: var(--mono);
  font-size: 0.84em;
  color: var(--green);
  background: var(--green-bg);
  padding: 1px 6px;
  border-radius: 3px;
}

.agent-switch {
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.agent-switch-header {
  padding: 28px 32px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agent-switch-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-dim);
}

.agent-switch-header h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.3;
}

.agent-switch-header p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.68;
  max-width: 640px;
}

.relay-chain {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.relay-stop {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  border-right: 1px solid var(--border);
  background: var(--bg);
}

.relay-stop:last-child {
  border-right: none;
}

.relay-stop--active {
  background: var(--accent-glow);
}

.relay-agent-name {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.relay-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.relay-bar-fill {
  height: 100%;
  background: var(--border-hi);
  border-radius: 2px;
  transition: width 0.3s;
}

.relay-stop--active .relay-bar-fill {
  background: var(--accent);
}

.relay-stop-note {
  font-size: 0.6875rem;
  color: var(--text-subtle);
}

.relay-stop--active .relay-stop-note {
  color: var(--accent);
  font-weight: 500;
}

.relay-context {
  padding: 13px 24px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.relay-context-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.relay-context-text {
  font-size: 0.8125rem;
  color: var(--text-subtle);
}

.relay-context-text code {
  font-family: var(--mono);
  font-size: 0.8em;
  color: var(--green);
  background: var(--green-bg);
  padding: 1px 5px;
  border-radius: 3px;
}

@media (max-width: 860px) {
  .relay-chain {
    grid-template-columns: repeat(2, 1fr);
  }

  .relay-stop:nth-child(2) {
    border-right: none;
  }

  .relay-stop:nth-child(1),
  .relay-stop:nth-child(2) {
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 700px) {
  .session-compare {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto 1fr;
  }

  .session-divider {
    writing-mode: horizontal-tb;
    padding: 12px;
    border-left: none;
    border-right: none;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
}

/* ===== Why Section ===== */
.why-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.pain-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 52px;
  margin-bottom: 56px;
}

.pain-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pain-col-num {
  font-family: var(--mono);
  font-size: 2.25rem;
  font-weight: 500;
  color: var(--border-hi);
  line-height: 1;
  letter-spacing: -0.05em;
}

.pain-col h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
  line-height: 1.35;
}

.pain-col p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.72;
}

.resolution-block {
  border: 1px solid var(--accent-ring);
  border-radius: var(--radius);
  padding: 36px 44px;
  background: var(--accent-glow);
  max-width: 820px;
  margin: 0 auto 48px;
}

.resolution-block p {
  font-size: 1.0625rem;
  color: var(--text-2);
  line-height: 1.74;
  text-align: center;
}

.resolution-block strong {
  color: var(--text);
  font-weight: 600;
}

.outcomes-strip {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.outcome-item {
  flex: 1;
  padding: 22px 28px;
  border-right: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg);
  transition: background 0.15s;
}

.outcome-item:last-child {
  border-right: none;
}

.outcome-item:hover {
  background: var(--surface-2);
}

.outcome-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 5px;
}

.outcome-item p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.62;
}

.outcome-item strong {
  color: var(--text);
  font-weight: 600;
  display: block;
  margin-bottom: 3px;
  font-size: 0.875rem;
  letter-spacing: -0.01em;
}

@media (max-width: 860px) {
  .pain-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .outcomes-strip {
    flex-direction: column;
  }

  .outcome-item {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .outcome-item:last-child {
    border-bottom: none;
  }
}

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

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--text-subtle);
}

.footer-inner a {
  color: var(--text-muted);
  transition: color 0.15s;
}

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

.footer-gh-link {
  font-weight: 500;
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .output-item {
    grid-template-columns: 1fr;
  }

  .output-item-left {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
  }

  .output-item:hover .output-item-left {
    background: var(--surface);
  }

  .output-item-right {
    padding: 18px 20px;
  }
}

@media (max-width: 640px) {
  .section {
    padding: 68px 0;
  }

  .hero {
    padding: 88px 0 76px;
  }

  .hero h1 {
    font-size: 2.5rem;
    letter-spacing: -0.03em;
  }

  .hero-sub {
    font-size: 1rem;
  }

  .install-block {
    max-width: calc(100vw - 48px);
  }

  .install-cmd {
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .phases-line {
    display: none;
  }

  .agents-table th:last-child,
  .agents-table td:last-child {
    display: none;
  }

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