:root {
  --bg: #050508;
  --surface: #0a0a0f;
  --border: rgba(255,255,255,0.08);
  --text: #ffffff;
  --muted: rgba(255,255,255,0.55);
  --accent: #6366f1;
  --red: #ef4444;
  --gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}

.container { max-width: 880px; margin: 0 auto; padding: 0 2rem; }

/* NAV */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1rem 2rem;
  background: rgba(5,5,8,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
nav .inner {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
nav .logo {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
nav .logo span { color: var(--accent); }
nav .links { display: flex; gap: 1.5rem; }
nav .links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
}
nav .links a:hover, nav .links a.active { color: var(--text); }

/* HERO */
.hero {
  padding: 8rem 2rem 4rem;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  line-height: 1.15;
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 2rem;
  max-width: 600px;
}
.hero-list {
  list-style: none;
  margin-bottom: 2rem;
}
.hero-list li {
  padding: 0.4rem 0 0.4rem 1.25rem;
  position: relative;
  color: var(--muted);
  font-size: 0.95rem;
}
.hero-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
}

/* SECTIONS */
section { padding: 4rem 0; border-bottom: 1px solid var(--border); }
section:last-of-type { border-bottom: none; }
section.dark { background: var(--surface); }

.section-label {
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  margin-top: 2rem;
}
h3:first-child { margin-top: 0; }
h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

p { color: var(--muted); margin-bottom: 0.75rem; }
p:last-child { margin-bottom: 0; }
strong { color: var(--text); font-weight: 500; }

/* DEFINITION BOX */
.definition {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.definition h3 { margin-top: 0; margin-bottom: 1rem; color: var(--text); }
.definition p { font-size: 0.95rem; line-height: 1.7; }
.definition ul {
  list-style: none;
  margin: 1rem 0;
}
.definition li {
  padding: 0.3rem 0 0.3rem 1rem;
  position: relative;
  color: var(--muted);
  font-size: 0.9rem;
}
.definition li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* OUTCOME BOX */
.outcome-box {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.outcome-box h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}
.outcome-box ul { list-style: none; }
.outcome-box li {
  padding: 0.5rem 0;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.outcome-box li:last-child { border-bottom: none; }

/* LOSS BOX */
.loss-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.loss-box h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--red);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}
.loss-box ul { list-style: none; }
.loss-box li {
  padding: 0.5rem 0;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.loss-box li:last-child { border-bottom: none; }

/* SUMMARY */
.summary {
  font-size: 1rem;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding: 0.75rem 0 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--surface);
}

/* LAYER CARDS */
.layer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.layer-card .layer-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--gradient);
  border-radius: 5px;
  font-weight: 600;
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}
.layer-card h4 { margin-bottom: 0.5rem; }
.layer-card p { font-size: 0.9rem; margin-bottom: 0.75rem; }

/* CODE */
code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  background: var(--bg);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  color: var(--accent);
}
pre {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1.25rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  margin: 1rem 0;
}
pre code { background: none; padding: 0; color: var(--muted); }

.endpoint {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent);
  margin: 0.25rem 0.25rem 0.25rem 0;
}

/* FIELDS */
.fields-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin: 1.5rem 0;
}
@media (max-width: 600px) { .fields-grid { grid-template-columns: 1fr; } }
.field-item {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1rem;
}
.field-item h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.4rem;
  font-weight: 500;
}
.field-item p { font-size: 0.85rem; margin-bottom: 0; }

/* TAGS */
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.5rem 0; }
.tag {
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}

/* CONF GRID */
.conf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}
@media (max-width: 600px) { .conf-grid { grid-template-columns: 1fr; } }
.conf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.25rem;
}
.conf-card h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--accent);
}
.conf-card ul { list-style: none; }
.conf-card li {
  padding: 0.4rem 0;
  font-size: 0.85rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.conf-card li:last-child { border-bottom: none; }
.conf-card li strong { color: var(--text); }

/* PAGE HEADER */
.page-header {
  padding: 6rem 0 2rem;
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.page-header p { color: var(--muted); }

/* FOOTER */
footer {
  padding: 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
}
footer p { color: var(--muted); font-size: 0.8rem; }

/* SPACING */
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 1.5rem; }
.mt-3 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.75rem; }

/* FLOW STEPS */
.flow-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 2rem 0;
}
.flow-step {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  text-align: center;
  min-width: 100px;
}
.flow-step.cash {
  border-color: #22c55e;
}
.flow-step .step-num {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.flow-step.cash .step-num {
  color: #22c55e;
}
.flow-step p {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}
.flow-arrow {
  color: var(--muted);
  font-size: 1.25rem;
}
@media (max-width: 600px) {
  .flow-arrow { display: none; }
  .flow-steps { gap: 0.75rem; }
}

/* COMPARE GRID */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 600px) {
  .compare-grid { grid-template-columns: 1fr; }
}

/* METRICS GRID */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}
@media (max-width: 600px) {
  .metrics-grid { grid-template-columns: 1fr; }
}
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.25rem;
}
.metric-card.loss {
  border-left: 3px solid var(--red);
}
.metric-card h4 {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.metric-card .metric-def {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.metric-card code {
  display: block;
  margin: 0.5rem 0;
  font-size: 0.75rem;
}
.metric-card .metric-link {
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0;
}
.metric-card .metric-example {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0;
  margin-top: 0.5rem;
}
.metric-card .metric-example strong {
  color: #22c55e;
}
.metric-card.loss .metric-example strong {
  color: var(--red);
}

/* PRICING BOX */
.pricing-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid #22c55e;
  padding: 1.25rem;
  margin: 1.5rem 0;
}
.pricing-box h4 {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.75rem;
}
.pricing-box p {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.pricing-box strong {
  color: #22c55e;
}

/* SUBTITLE */
.subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  max-width: 650px;
}

/* MONO */
.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: var(--text);
  letter-spacing: 0.02em;
}

/* HARD RULE */
.hard-rule {
  background: var(--surface);
  border-left: 3px solid var(--red);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.hard-rule strong {
  color: var(--text);
  font-size: 0.95rem;
}

/* SELECTION RULE */
.selection-rule {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

/* CTA BUTTONS */
.cta-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 5px;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--gradient);
  color: var(--text);
}
.btn-primary:hover {
  opacity: 0.9;
}
.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}
.btn-secondary:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  h2 { font-size: 1.35rem; }
  nav .links { display: none; }
  .cta-buttons { flex-direction: column; }
}
