/* ── Variables ─────────────────────────────────── */
:root {
  --bg:        #080b10;
  --surface:   #0d1117;
  --border:    #1c2333;
  --fg:        #e6edf3;
  --muted:     #7d8590;
  --accent:    #00e5a0;
  --accent-dim:#00e5a018;
  --red:       #ff6b6b;
  --yellow:    #ffd93d;
  --mono:      'IBM Plex Mono', monospace;
  --sans:      'IBM Plex Sans', sans-serif;
  --radius:    8px;
  --max-w:     1160px;
  --pad:       clamp(24px, 5vw, 64px);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::selection { background: var(--accent); color: var(--bg); }

/* ── Typography ─────────────────────────────────── */
.mono { font-family: var(--mono); }

/* ── Navigation ─────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--pad);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}

.nav-brand {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-status {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.08em;
}

.brand-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--accent); }
  50% { opacity: 0.7; box-shadow: 0 0 16px var(--accent); }
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: blink 1.4s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* ── Section label ──────────────────────────────── */
.section-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
  display: block;
  margin-bottom: 20px;
}

/* ── Hero ───────────────────────────────────────── */
.hero {
  padding: clamp(60px, 10vw, 120px) var(--pad) clamp(48px, 8vw, 96px);
  max-width: var(--max-w);
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.hero-ticker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.ticker-live {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--bg);
  background: var(--accent);
  padding: 3px 8px;
  border-radius: 4px;
}

.ticker-stat {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.ticker-sep {
  color: var(--border);
  font-family: var(--mono);
}

.hero-headline-wrap { margin-bottom: 28px; }

.hero-headline {
  font-family: var(--mono);
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--fg);
}

.hero-sub {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--muted);
  max-width: 640px;
  line-height: 1.65;
}

/* ── How it works ──────────────────────────────── */
.how {
  padding: clamp(60px, 8vw, 100px) var(--pad);
  max-width: var(--max-w);
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.how-header { margin-bottom: 56px; }

.how-title {
  font-family: var(--mono);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.steps { display: grid; grid-template-columns: 1fr; gap: 0; }

.step {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  padding: 36px 0;
  border-top: 1px solid var(--border);
}

.step:last-child { border-bottom: 1px solid var(--border); }

.step-num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  padding-top: 4px;
  letter-spacing: 0.05em;
}

.step-title {
  font-family: var(--mono);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.step-desc {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
  max-width: 560px;
}

/* ── Protocol (live deals) ─────────────────────── */
.protocol {
  padding: clamp(60px, 8vw, 100px) var(--pad);
  max-width: var(--max-w);
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.protocol-header { margin-bottom: 48px; }

.protocol-sub {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

.deals {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.deal {
  background: var(--surface);
  padding: 28px 24px;
  position: relative;
  transition: background 0.2s;
}

.deal:hover { background: #111827; }

.deal-category {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.deal-match {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 8px;
  line-height: 1.4;
}

.deal-score {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 12px;
  letter-spacing: -0.04em;
}

.deal-score::after {
  content: '/100';
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0;
}

.deal-detail {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.deal-gap {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--yellow);
  margin-bottom: 16px;
}

.deal-settled {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.settled-label {
  font-size: 12px;
  color: var(--muted);
}

.settled-amount {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}

/* ── Code section ───────────────────────────────── */
.code-section {
  padding: clamp(60px, 8vw, 100px) var(--pad);
  max-width: var(--max-w);
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.code-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.code-title {
  font-family: var(--mono);
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.code-desc {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 24px;
}

.code-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 3px 10px;
  border-radius: 20px;
  opacity: 0.7;
}

.code-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.8;
}

.code-comment { color: #484f58; }
.code-cmd    { color: var(--muted); }
.code-text   { color: var(--fg); }
.code-kw     { color: #79c0ff; }
.code-var    { color: #ffa657; }
.code-fn     { color: #d2a8ff; }
.code-str    { color: var(--accent); }
.code-key    { color: var(--fg); }
.code-placeholder { color: var(--muted); opacity: 0.5; }

.indent { padding-left: 20px; }
.code-spacer { height: 8px; }

/* ── Manifesto ──────────────────────────────────── */
.manifesto {
  padding: clamp(80px, 10vw, 140px) var(--pad);
  max-width: var(--max-w);
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.manifesto-inner { max-width: 760px; }

.manifesto-line {
  font-family: var(--mono);
  font-size: clamp(20px, 3vw, 32px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 8px;
}

.manifesto-accent { color: var(--accent); margin-bottom: 40px !important; }

.manifesto-body {
  font-size: clamp(15px, 1.5vw, 17px);
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 20px;
}

.manifesto-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}

.mstat-val {
  font-family: var(--mono);
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.04em;
  margin-bottom: 6px;
}

.mstat-label {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

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

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.footer-brand {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-copy {
  font-size: 13px;
  color: var(--muted);
}

.footer-fee {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 768px) {
  .code-inner { grid-template-columns: 1fr; gap: 40px; }
  .deals { grid-template-columns: 1fr 1fr; }
  .manifesto-stats { grid-template-columns: repeat(2, 1fr); }
  .step { grid-template-columns: 48px 1fr; gap: 16px; }
}

@media (max-width: 480px) {
  .deals { grid-template-columns: 1fr; }
  .manifesto-stats { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .hero-ticker { gap: 10px; }
}