:root {
  --bg: #0a0e17;
  --surface: #111827;
  --surface-2: #1a2332;
  --border: #2a3444;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-dim: #1e40af;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #eab308;
  --orange: #f97316;
  --mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ============================================
   TOPBAR
   ============================================ */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-logo {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.topbar-tag {
  font-size: 0.65rem;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  font-family: var(--mono);
}

.topbar-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  margin-left: auto;
}

.topbar-dot.offline { background: var(--red); }

/* ============================================
   HERO
   ============================================ */

.hero {
  padding: 4rem 2rem 3.5rem;
  text-align: center;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: 680px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  color: var(--text);
}

.hero-headline {
  font-size: 1.15rem;
  color: var(--text);
  font-weight: 400;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.hero-punch {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.hero-rule {
  font-size: 0.92rem;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.hero-rule-sub {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
}

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

.hero-btn {
  font-size: 0.85rem;
  padding: 0.55rem 1.4rem;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
}

.hero-btn-primary {
  background: var(--accent);
  color: white;
}

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

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

.hero-btn-secondary:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

/* ============================================
   SECTIONS (landing page content)
   ============================================ */

.landing-sections {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 2rem;
}

.landing-section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

.landing-section:last-child {
  border-bottom: none;
}

.landing-section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.landing-section p {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.landing-section p:last-child {
  margin-bottom: 0;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1rem;
}

@media (max-width: 600px) {
  .feature-grid { grid-template-columns: 1fr; }
}

.feature-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.1rem 1.25rem;
}

.feature-item h3 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.feature-item p {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 0;
}

.stage-list {
  list-style: none;
  margin-top: 0.75rem;
}

.stage-list li {
  font-size: 0.85rem;
  color: var(--text-dim);
  padding: 0.3rem 0;
  padding-left: 1.25rem;
  position: relative;
}

.stage-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
}

.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.6;
}

.pain-list {
  list-style: none;
  margin-top: 0.5rem;
}

.pain-list li {
  font-size: 0.85rem;
  color: var(--text-dim);
  padding: 0.25rem 0 0.25rem 1.25rem;
  position: relative;
}

.pain-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 8px;
  height: 2px;
  background: var(--red);
  border-radius: 1px;
}

.demo-list {
  list-style: none;
  margin-top: 0.5rem;
}

.demo-list li {
  font-size: 0.85rem;
  color: var(--text-dim);
  padding: 0.25rem 0 0.25rem 1.25rem;
  position: relative;
}

.demo-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 8px;
  height: 2px;
  background: var(--green);
  border-radius: 1px;
}

/* ============================================
   DEMO TABS
   ============================================ */

#demo-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.demo-anchor {
  display: block;
  position: relative;
  top: -60px;
  visibility: hidden;
}

nav {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px 6px 0 0;
  display: flex;
  gap: 0;
  overflow-x: auto;
}

nav button {
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  font-size: 0.82rem;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}

nav button:hover { color: var(--text); }
nav button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 6px 6px;
}

.panel-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.panel-body { padding: 1rem; }

textarea.json-editor {
  width: 100%;
  min-height: 280px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.6;
  resize: vertical;
  tab-size: 2;
}

textarea.json-editor:focus {
  outline: none;
  border-color: var(--accent);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: background 0.15s;
}

.btn:hover { background: var(--accent-dim); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--text);
  background: transparent;
}

.btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
}

.btn-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ============================================
   RESULTS
   ============================================ */

.result {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
}

.result.valid {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: var(--green);
}

.result.invalid {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--red);
}

.result.info {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: var(--accent);
}

.result.neutral {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 800px) {
  .grid-2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.5rem; }
  .hero { padding: 2.5rem 1.5rem 2rem; }
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================
   PIPELINE
   ============================================ */

.pipeline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.pipeline-step {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.4rem 0.8rem;
  font-size: 0.78rem;
  font-family: var(--mono);
}

.pipeline-step.complete { border-color: var(--green); color: var(--green); }
.pipeline-step.active { border-color: var(--accent); color: var(--accent); animation: pulse 1.5s infinite; }
.pipeline-step.failed { border-color: var(--red); color: var(--red); }
.pipeline-step.invalidated { border-color: var(--orange); color: var(--orange); text-decoration: line-through; }

.pipeline-arrow { color: var(--text-dim); font-size: 0.85rem; }

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

/* ============================================
   MISC COMPONENTS
   ============================================ */

.section-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.tab-intro {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.tab-intro code {
  font-family: var(--mono);
  font-size: 0.75rem;
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

.tab-intro strong { color: var(--text); }

.scl-flow { display: flex; flex-direction: column; gap: 0.5rem; margin: 1rem 0; }
.scl-flow-step { display: flex; align-items: center; gap: 0.75rem; font-size: 0.8rem; }
.scl-flow-step .label { min-width: 140px; color: var(--text-dim); text-align: right; }
.scl-flow-step .value { font-family: var(--mono); font-size: 0.75rem; color: var(--text); }
.scl-flow-step .arrow { color: var(--accent); font-size: 1rem; }

.hash-display { font-family: var(--mono); font-size: 0.72rem; color: var(--text-dim); word-break: break-all; }
.match-indicator { font-weight: 700; font-size: 0.85rem; }
.match-indicator.yes { color: var(--green); }
.match-indicator.no { color: var(--red); }

.badge { font-size: 0.65rem; padding: 0.1rem 0.4rem; border-radius: 3px; font-weight: 600; text-transform: uppercase; }
.badge.complete { background: rgba(34,197,94,0.15); color: var(--green); }
.badge.failed { background: rgba(239,68,68,0.15); color: var(--red); }
.badge.invalidated { background: rgba(249,115,22,0.15); color: var(--orange); }
.badge.pending { background: rgba(148,163,184,0.15); color: var(--text-dim); }

/* ============================================
   BREAK IT
   ============================================ */

.break-section {
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  text-align: center;
}

.break-inner {
  max-width: 800px;
  margin: 0 auto;
}

.break-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.break-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 700px) {
  .break-grid { grid-template-columns: 1fr; }
}

.break-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  font-family: inherit;
  color: inherit;
}

.break-card:hover {
  border-color: var(--red);
  background: rgba(239, 68, 68, 0.04);
}

.break-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--red);
  font-family: var(--mono);
  line-height: 1;
}

.break-action {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.break-result {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.break-footer {
  font-size: 0.88rem;
  color: var(--text-dim);
  font-style: italic;
}

/* ============================================
   FOOTER
   ============================================ */

footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  margin-top: 3rem;
  text-align: center;
}

footer p {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.6;
}
