:root {
  --bg:       #0d1117;
  --surface:  #161b22;
  --border:   #30363d;
  --text:     #c9d1d9;
  --muted:    #8b949e;
  --green:    #3fb950;
  --red:      #f85149;
  --blue:     #58a6ff;
  --yellow:   #d29922;
  --accent:   #1f6feb;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 2rem 2.5rem 1.5rem;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #e6edf3;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.badges { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.badge {
  padding: 0.2rem 0.65rem;
  border-radius: 2rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge.sharpe   { background: rgba(63,185,80,.15); color: var(--green); border: 1px solid rgba(63,185,80,.3); }
.badge.drawdown { background: rgba(248,81,73,.15);  color: var(--red);   border: 1px solid rgba(248,81,73,.3); }
.badge.hitrate  { background: rgba(88,166,255,.15); color: var(--blue);  border: 1px solid rgba(88,166,255,.3); }

main { padding: 2rem 2.5rem; max-width: 1400px; margin: 0 auto; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.stat-value { font-size: 1.35rem; font-weight: 700; color: #e6edf3; font-variant-numeric: tabular-nums; }

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.chart-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

.chart-box h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.architecture, .backtest-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.architecture h2, .backtest-table h2 {
  font-size: 1rem;
  color: #e6edf3;
  margin-bottom: 1rem;
}

.arch-diagram {
  font-family: 'Cascadia Code', 'Fira Code', monospace;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: pre;
  overflow-x: auto;
  line-height: 1.5;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.06em; }
td strong { color: var(--green); font-weight: 700; }

footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
}
footer a { color: var(--blue); text-decoration: none; }
footer a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  header, main { padding: 1rem; }
  .charts-grid { grid-template-columns: 1fr; }
}
