:root {
  --bg: #0a0a0b;
  --bg-surface: #111113;
  --bg-elevated: #1a1a1d;
  --fg: #fafafa;
  --fg-muted: #8a8a8e;
  --fg-subtle: #5a5a5e;
  --accent: #ff4d00;
  --accent-dim: #cc3d00;
  --border: #2a2a2d;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Navigation */
.nav {
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-logo {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 18px;
  color: var(--fg);
  letter-spacing: -0.02em;
}

.nav-tag {
  font-size: 13px;
  color: var(--fg-muted);
  font-family: 'IBM Plex Mono', monospace;
}

/* Hero */
.hero {
  padding: 120px 40px 100px;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
  max-width: 800px;
}

.hero-lede {
  font-size: 20px;
  color: var(--fg-muted);
  max-width: 600px;
  line-height: 1.6;
  margin-bottom: 60px;
}

.hero-metrics {
  display: flex;
  gap: 60px;
  flex-wrap: wrap;
}

.metric {
  display: flex;
  flex-direction: column;
}

.metric-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 40px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.metric-label {
  font-size: 14px;
  color: var(--fg-muted);
  margin-top: 4px;
}

/* Features */
.features {
  padding: 100px 40px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.features-header {
  max-width: 1200px;
  margin: 0 auto 80px;
}

.features-header h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.features-sub {
  font-size: 18px;
  color: var(--fg-muted);
  max-width: 600px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.feature {
  padding: 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.feature-icon {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 20px;
  font-weight: 600;
}

.feature h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.feature p {
  font-size: 15px;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* How */
.how {
  padding: 100px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.how-content h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 60px;
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 40px;
}

.step {
  display: flex;
  gap: 20px;
}

.step-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 32px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  flex-shrink: 0;
}

.step-content h4 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.step-content p {
  font-size: 15px;
  color: var(--fg-muted);
  line-height: 1.5;
}

/* Closing */
.closing {
  padding: 120px 40px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  text-align: center;
}

.closing h2 {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 20px;
}

.closing-sub {
  font-size: 18px;
  color: var(--fg-muted);
}

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

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-brand {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 16px;
}

.footer-tag {
  font-size: 14px;
  color: var(--fg-muted);
}

/* Nav CTA */
.nav-cta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent);
  padding: 8px 16px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.nav-cta:hover {
  background: var(--accent);
  color: #fff;
}

/* CTA button */
.cta-btn {
  display: inline-block;
  margin-top: 36px;
  padding: 14px 32px;
  background: var(--accent);
  color: #fff;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  letter-spacing: 0.02em;
  transition: background 0.15s;
}

.cta-btn:hover {
  background: var(--accent-dim);
}

/* ── App Page ──────────────────────────────────────────────────── */
.app-main {
  padding: 40px;
  min-height: calc(100vh - 61px);
}

.app-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.app-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
}

.panel-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 12px;
}

.panel-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}

.field-group { margin-bottom: 20px; }
.field-group--half { flex: 1; }

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
}

.field-hint {
  font-size: 12px;
  color: var(--fg-subtle);
  font-weight: 400;
  margin-left: 6px;
}

.spec-textarea {
  width: 100%;
  height: 200px;
  padding: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}

.spec-textarea:focus { border-color: var(--accent); }

.text-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.text-input:focus { border-color: var(--accent); }

.settings-row {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
}

.range-input {
  width: 100%;
  margin: 8px 0 4px;
  accent-color: var(--accent);
  cursor: pointer;
}

.range-bounds {
  display: flex;
  justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--fg-subtle);
}

.accent-val {
  color: var(--accent);
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
}

.pill-group {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.pill {
  padding: 6px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg-muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.pill:hover { border-color: var(--accent); color: var(--fg); }

.pill.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255,77,0,0.08);
}

.run-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.run-btn:hover:not(:disabled) { background: var(--accent-dim); }
.run-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.run-arrow { font-size: 16px; transition: transform 0.15s; }
.run-btn:hover:not(:disabled) .run-arrow { transform: translateX(4px); }

/* Results panel */
.results-state { height: 100%; }
.results-state.hidden { display: none !important; }

.idle-glyph { font-size: 48px; margin-bottom: 20px; opacity: 0.4; }
.idle-text { font-size: 17px; font-weight: 600; margin-bottom: 12px; }
.idle-sub { font-size: 14px; color: var(--fg-muted); line-height: 1.6; max-width: 360px; }

.status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.section { margin-bottom: 24px; }
.section.hidden { display: none !important; }

.scenarios-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }

.scenario-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
}

.method-badge {
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.method-get    { background: rgba(34,197,94,0.15);  color: #4ade80; }
.method-post   { background: rgba(59,130,246,0.15); color: #60a5fa; }
.method-put    { background: rgba(234,179,8,0.15);  color: #facc15; }
.method-patch  { background: rgba(168,85,247,0.15); color: #c084fc; }
.method-delete { background: rgba(239,68,68,0.15);  color: #f87171; }

.scenario-path { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scenario-weight { color: var(--fg-subtle); font-size: 11px; }

.progress-track {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  width: 0%;
  transition: width 0.4s ease;
}

.progress-meta { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--fg-muted); }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.metric-card {
  padding: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
}

.metric-card-val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.metric-card-label { font-size: 12px; color: var(--fg-muted); margin-top: 4px; }

.ep-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }

.ep-table th {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-subtle);
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.ep-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--fg-muted);
}

.ep-name {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--fg) !important;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.error-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 4px;
  font-size: 14px;
  color: #fca5a5;
  line-height: 1.5;
}

.error-icon { font-weight: 700; flex-shrink: 0; }

/* Sample spec button */
.sample-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.sample-btn:hover { background: var(--accent); color: #fff; }

.hidden { display: none !important; }

/* Responsive */
@media (max-width: 768px) {
  .nav {
    padding: 16px 24px;
  }
  
  .hero {
    padding: 80px 24px 60px;
  }
  
  .hero-metrics {
    gap: 40px;
  }
  
  .metric-value {
    font-size: 32px;
  }
  
  .features {
    padding: 60px 24px;
  }
  
  .how {
    padding: 60px 24px;
  }
  
  .closing {
    padding: 80px 24px;
  }
  
  .footer-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  /* App page: stack panels vertically on mobile */
  .app-main { padding: 20px 16px; }

  .app-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .settings-row {
    flex-direction: column;
    gap: 16px;
  }
}