/* Measurement Archive — design system (dark, developer-tool grade). */
:root {
  --bg: #0b0d11;
  --surface: #12151c;
  --surface-2: #1a1e27;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.11);
  --text: #f8fafc;
  --text-secondary: #a1aab8;
  --text-muted: #6b7280;
  --accent: #60a5fa;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

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

/* Fixture banner (P0) — unmissable, rendered on every page from fixtures */
.fixture-banner {
  background: #7f1d1d;
  color: #fecaca;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  padding: 9px 16px;
  border-bottom: 1px solid #991b1b;
}

.container { max-width: 1152px; margin: 0 auto; padding: 0 24px; width: 100%; }
.container.narrow { max-width: 880px; }

/* Topbar + breadcrumb */
.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 13, 17, 0.85);
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
  z-index: 10;
}
.topbar-inner { display: flex; align-items: center; gap: 18px; height: 52px; }
.brand { font-weight: 700; color: var(--text); font-size: 14px; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.breadcrumb .sep { color: var(--text-muted); opacity: 0.6; flex: 0 0 auto; }
.breadcrumb a { color: var(--text-secondary); max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb .current { color: var(--text); max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { flex: 1; padding: 36px 0 72px; }

h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; }
.lead { color: var(--text-secondary); font-size: 15px; margin: 0 0 28px; }
h2 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 40px 0 14px;
}
.meta-line { color: var(--text-muted); font-size: 13px; font-family: var(--mono); margin: 4px 0 24px; }

/* Subnav tabs */
.subnav {
  display: flex;
  gap: 6px;
  margin: 16px 0 28px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.subnav a { color: var(--text-secondary); font-size: 13px; padding: 6px 12px; border-radius: 7px; }
.subnav a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.subnav a.active { background: var(--surface); color: var(--text); }

/* Stat cards */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 14px 16px;
}
.stat-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.stat-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* Project cards (home) */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.project-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 18px 20px;
  transition: border-color 0.15s, transform 0.15s;
}
.project-card:hover { border-color: var(--border-strong); text-decoration: none; transform: translateY(-1px); }
.project-card .name { font-size: 16px; font-weight: 600; color: var(--text); grid-column: 1; }
.project-card .chevron { color: var(--text-muted); font-size: 16px; grid-column: 2; grid-row: 1 / span 3; align-self: center; }
.project-card .status { grid-column: 1; font-size: 11px; color: var(--text-muted); }
.project-card .metrics { grid-column: 1; display: flex; gap: 20px; margin-top: 12px; }
.project-card .metric { color: var(--text-muted); font-size: 12px; }
.project-card .metric b {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Tables */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: left;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}
td { padding: 11px 16px; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
tbody tr { transition: background-color 0.1s; }
tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
td a { color: var(--text); font-weight: 500; }
td a:hover { color: var(--accent); text-decoration: underline; }
th.numeric, td.numeric { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12px; }
td.mono { font-family: var(--mono); font-size: 12px; }

/* Two-column dashboard */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* Badges (muted, low-opacity) */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-family: var(--mono);
  white-space: nowrap;
}
.badge.green { color: #34d399; background: rgba(16, 185, 129, 0.10); border-color: rgba(16, 185, 129, 0.20); }
.badge.amber { color: #fbbf24; background: rgba(245, 158, 11, 0.10); border-color: rgba(245, 158, 11, 0.20); }
.badge.red { color: #fb7185; background: rgba(244, 63, 94, 0.10); border-color: rgba(244, 63, 94, 0.20); }
.badge.muted { color: var(--text-secondary); background: rgba(255, 255, 255, 0.04); border-color: var(--border); }

/* Inline hashes (no pill box) */
.hash-text { font-family: var(--mono); font-size: 12px; color: var(--text-secondary); }
.hash-text.to { color: var(--text); }
.arrow { color: var(--text-muted); font-family: var(--mono); }
.hash {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
}

/* Error mix bars (with track + %) */
.error-row { display: flex; align-items: center; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.error-row .label { width: 130px; font-family: var(--mono); font-size: 12px; color: var(--text-secondary); }
.error-row .bar { flex: 1; height: 6px; background: rgba(255, 255, 255, 0.04); border-radius: 3px; overflow: hidden; }
.error-row .fill { display: block; height: 100%; background: linear-gradient(90deg, #22d3ee, #60a5fa); border-radius: 3px; }
.error-row .pct { width: 92px; text-align: right; font-family: var(--mono); font-size: 11px; color: var(--text-muted); }
.mix-note { color: var(--text-muted); font-size: 12px; margin: -6px 0 10px; }

/* Homepage hero (P1.4) */
.hero { margin: 8px 0 40px; }
.hero-claim { font-size: 30px; line-height: 1.25; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 16px; max-width: 780px; }
.hero-number { color: var(--text-secondary); font-size: 16px; margin: 0; }

/* Half-life confidence interval */
.ci { font-family: var(--mono); font-size: 13px; color: var(--text-muted); font-weight: 400; }

/* Recency line (P2.3) */
.recency { color: var(--text-secondary); font-size: 14px; margin: -14px 0 24px; }

/* Selectable table + CTA (P2.1) */
.selectable .watch { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }
.selection { color: var(--text); font-size: 14px; min-height: 22px; margin: -6px 0 12px; }
.cta { margin: 20px 0 8px; }
.cta-link {
  display: inline-block;
  background: var(--accent);
  color: #0b0d11;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 8px;
}
.cta-link:hover { text-decoration: none; filter: brightness(1.08); }

/* Paste-your-config (P2.2) */
.paste-config { margin-top: 56px; }
.paste-config textarea {
  width: 100%;
  min-height: 140px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  padding: 14px 16px;
  resize: vertical;
}
.paste-config textarea:focus { outline: none; border-color: var(--accent); }
#config-result { margin-top: 14px; }

/* Consequence + prose (P2.3) */
.consequence { font-size: 16px; font-weight: 600; color: #fb7185; margin: 16px 0; }
.prose { font-size: 15px; line-height: 1.6; max-width: 720px; margin: 16px 0; }

/* Incident writeup */
.subhead { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: 24px 0 8px; }
.hash-row { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--text-secondary); }
.diff-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12px; line-height: 1.5; }
.diff-table td { padding: 1px 10px; border: none; white-space: pre; }
.diff-table .ln { color: var(--text-muted); text-align: right; user-select: none; width: 1%; opacity: 0.6; }
.diff-table .cell { width: 49%; }
.diff-table .del { background: rgba(244, 63, 94, 0.10); color: #fda4af; }
.diff-table .add { background: rgba(16, 185, 129, 0.10); color: #6ee7b7; }
.diff-table .change { background: rgba(245, 158, 11, 0.10); color: #fcd34d; }
.diff-table .same { color: var(--text-secondary); }

/* Footer */
footer {
  margin-top: 72px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
