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

:root {
  --bg:       #0f172a;
  --bg-alt:   #1e293b;
  --card:     #1e293b;
  --border:   #334155;
  --text:     #e2e8f0;
  --muted:    #94a3b8;
  --accent:   #6366f1;
  --accent2:  #f97316;
  --green:    #22c55e;
  --red:      #ef4444;
  --yellow:   #f59e0b;
  --orange:   #f97316;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

/* ====== HERO ====== */
.hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 60%, #172554 100%);
  padding: 4rem 0 3rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.hero h1 { font-size: 2.4rem; font-weight: 700; letter-spacing: -0.02em; }
.hero .subtitle { color: var(--muted); font-size: 1.1rem; margin-top: 0.5rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.badge-row { margin-top: 1.5rem; display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.badge {
  display: inline-block; padding: 0.4rem 1rem; border-radius: 6px;
  background: var(--accent); color: #fff; font-size: 0.85rem; font-weight: 600;
  transition: opacity 0.2s;
}
.badge:hover { opacity: 0.85; text-decoration: none; }

/* ====== SECTIONS ====== */
.section { padding: 3.5rem 0; }
.section-alt { background: var(--bg-alt); }
.section h2 { font-size: 1.6rem; margin-bottom: 1rem; }

/* ====== STACK ====== */
.stack-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 1.5rem 0; }
@media (max-width: 700px) { .stack-grid { grid-template-columns: 1fr; } }
.stack-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 1.5rem; position: relative;
}
.stack-icon {
  position: absolute; top: 1rem; right: 1rem;
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}
.stack-card h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }
.stack-source { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.6rem; }
.stack-card p:last-child { color: var(--muted); font-size: 0.9rem; }

.stack-details { margin-top: 2rem; }
.stack-details h3 { font-size: 1.1rem; margin-bottom: 0.75rem; }
.tech-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.pill {
  padding: 0.3rem 0.75rem; border-radius: 20px; font-size: 0.8rem; font-weight: 500;
  background: rgba(99,102,241,0.15); color: var(--accent); border: 1px solid rgba(99,102,241,0.3);
}

.pipeline-flow {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  padding: 1.25rem; background: var(--card); border: 1px solid var(--border); border-radius: 12px;
}
.flow-step {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 1rem; border-radius: 8px; background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.25);
}
.flow-num {
  width: 28px; height: 28px; border-radius: 6px; background: var(--accent);
  color: #fff; font-weight: 700; font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.flow-label { font-size: 0.82rem; line-height: 1.3; }
.flow-label small { color: var(--muted); }
.flow-arrow { font-size: 1.2rem; color: var(--muted); }

/* ====== RUN HEADERS ====== */
.run-header { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; }
.run-number {
  flex-shrink: 0; width: 48px; height: 48px; border-radius: 12px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center;
}
.run-date { color: var(--muted); font-size: 0.9rem; margin-top: 0.2rem; }

/* ====== HEADLINE BOX ====== */
.headline-box {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 1.5rem; margin-bottom: 2rem;
}
.headline-question { font-size: 0.95rem; color: var(--muted); margin-bottom: 1rem; }
.headline-forecast { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.forecast-pill {
  padding: 0.75rem 1.25rem; border-radius: 10px; text-align: center;
  font-size: 1.6rem; font-weight: 700; line-height: 1.2; min-width: 100px;
}
.forecast-pill span { display: block; font-size: 0.75rem; font-weight: 400; color: rgba(255,255,255,0.7); margin-top: 0.2rem; }
.forecast-pill.red { background: rgba(239,68,68,0.2); border: 1px solid rgba(239,68,68,0.4); color: #fca5a5; }
.forecast-pill.orange { background: rgba(249,115,22,0.2); border: 1px solid rgba(249,115,22,0.4); color: #fdba74; }
.forecast-pill.yellow { background: rgba(245,158,11,0.2); border: 1px solid rgba(245,158,11,0.4); color: #fcd34d; }
.forecast-pill.dark-red { background: rgba(185,28,28,0.25); border: 1px solid rgba(185,28,28,0.5); color: #fca5a5; }
.headline-summary { font-size: 0.95rem; color: var(--muted); }

/* ====== CHARTS ====== */
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 2rem; }
@media (max-width: 700px) { .charts-row { grid-template-columns: 1fr; } }
.chart-box {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 1.25rem;
}
.chart-box h3 { font-size: 0.95rem; margin-bottom: 0.75rem; }
.chart-box canvas { max-height: 320px; }

/* ====== KEY FINDINGS ====== */
.key-findings {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 1.5rem; margin-bottom: 1.5rem;
}
.key-findings h3 { font-size: 1rem; margin-bottom: 0.75rem; }
.key-findings ol { padding-left: 1.5rem; }
.key-findings li { margin-bottom: 0.6rem; font-size: 0.9rem; color: var(--muted); }
.key-findings li strong { color: var(--text); }

/* ====== CONVERGENCE CALLOUT ====== */
.convergence-callout {
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(249,115,22,0.08));
  border: 1px solid rgba(99,102,241,0.25); border-radius: 12px;
  padding: 1.5rem; margin-bottom: 1.5rem; text-align: center;
}
.convergence-callout h3 { margin-bottom: 0.5rem; }
.convergence-callout > p { color: var(--muted); font-size: 0.9rem; max-width: 700px; margin: 0 auto 1.25rem; }
.convergence-stats { display: flex; justify-content: center; gap: 2.5rem; flex-wrap: wrap; }
.conv-stat { text-align: center; }
.conv-value { font-size: 2rem; font-weight: 700; }
.conv-label { font-size: 0.8rem; color: var(--muted); margin-top: 0.15rem; }

/* ====== EXPERIMENT DETAILS ====== */
.experiment-details {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 1.5rem; margin-bottom: 1.5rem;
}
.experiment-details h3 { font-size: 1rem; margin-bottom: 0.75rem; }
.param-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem; }
.param {
  display: flex; justify-content: space-between; padding: 0.5rem 0.75rem;
  background: rgba(99,102,241,0.06); border-radius: 6px; font-size: 0.85rem;
}
.param-key { color: var(--muted); }
.param-val { font-weight: 600; }

.run-links { margin-top: 1rem; }

/* ====== ACCURACY ====== */
.accuracy-table-wrapper { margin-bottom: 2rem; }
.accuracy-table-wrapper h3 { font-size: 1.05rem; margin-bottom: 0.3rem; }
.run-score { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.75rem; }

.accuracy-table, .index-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
  background: var(--card); border-radius: 10px; overflow: hidden;
}
.accuracy-table th, .index-table th {
  background: rgba(99,102,241,0.1); text-align: left; padding: 0.6rem 0.75rem;
  font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.accuracy-table td, .index-table td { padding: 0.55rem 0.75rem; border-top: 1px solid var(--border); }
.grade-correct { color: var(--green); font-weight: 600; }
.grade-incorrect { color: var(--red); font-weight: 600; }

/* ====== FOOTER ====== */
.footer {
  padding: 2rem 0; text-align: center; border-top: 1px solid var(--border);
  font-size: 0.9rem;
}
.footer-sub { color: var(--muted); font-size: 0.8rem; margin-top: 0.3rem; }
