/* Copilot Feedback RCA demo for Outerscope. Self-contained, no external assets. */

:root {
  --bg: #070a12;
  --bg-2: #0a0e1a;
  --surface: #0e1320;
  --surface-2: #131a2b;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #e9edf7;
  --muted: #8b94a8;
  --dim: #5e6678;
  --accent: #5b8cff;
  --accent-2: #a78bfa;
  --teal: #2dd4bf;
  --teal-dim: rgba(45, 212, 191, 0.16);
  --amber: #fbbf24;
  --amber-dim: rgba(251, 191, 36, 0.16);
  --emerald: #34d399;
  --rose: #fb7185;
  --slate: #64748b;
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1080px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  top: -260px;
  left: 50%;
  transform: translateX(-50%);
  width: 1100px;
  height: 600px;
  background:
    radial-gradient(closest-side, rgba(91, 140, 255, 0.22), transparent),
    radial-gradient(closest-side, rgba(167, 139, 250, 0.16), transparent 70%);
  filter: blur(20px);
  z-index: 0;
  pointer-events: none;
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(140%) blur(12px);
  background: rgba(7, 10, 18, 0.7);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 650; letter-spacing: -0.01em; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: conic-gradient(from 200deg, var(--accent), var(--accent-2), var(--teal), var(--accent)); box-shadow: 0 0 14px rgba(91, 140, 255, 0.7); }
.brand-name { font-weight: 700; }
.topnav { display: flex; gap: 22px; }
.topnav a { color: var(--muted); text-decoration: none; font-size: 14px; transition: color 0.15s; }
.topnav a:hover { color: var(--text); }

/* Hero */
.hero { padding: 84px 0 36px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--muted);
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 6px 14px; background: rgba(255, 255, 255, 0.02);
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.6); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.5); } 70% { box-shadow: 0 0 0 9px rgba(45, 212, 191, 0); } 100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0); } }

h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.05; letter-spacing: -0.03em; margin: 22px 0 0; font-weight: 760; }
.lede { font-size: clamp(17px, 2.2vw, 20px); color: var(--muted); max-width: 680px; margin: 16px 0 0; }
.prov { font-size: 13px; color: var(--dim); margin: 14px 0 0; font-family: var(--mono); }

.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-top: 38px; }
.kpi { background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--accent), transparent); opacity: 0.7; }
.kpi .v { font-size: 28px; font-weight: 720; letter-spacing: -0.02em; }
.kpi .l { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi .s { font-size: 11.5px; color: var(--dim); margin-top: 2px; }

/* Panels */
.panel { background: linear-gradient(180deg, rgba(20, 26, 43, 0.5), rgba(10, 14, 26, 0.4)); border: 1px solid var(--line); border-radius: 22px; padding: 30px; margin: 26px 0; }
.panel.emphasis { border-color: rgba(91, 140, 255, 0.3); box-shadow: 0 0 60px rgba(91, 140, 255, 0.06) inset; }
.panel-head h2 { font-size: 23px; letter-spacing: -0.02em; margin: 0; font-weight: 700; }
.panel-head h2 em { font-style: normal; color: var(--accent); }
.panel-head p { color: var(--muted); margin: 8px 0 0; max-width: 760px; font-size: 14.5px; }
.panel-head.sub { margin-top: 30px; }
.panel-head.sub h3 { margin: 0; font-size: 17px; }
.panel-head.sub p { font-size: 13.5px; }
.panel-body { margin-top: 22px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.grid-2 .panel { margin: 26px 0; }

/* Horizontal bars (distribution) */
.bar-row { display: grid; grid-template-columns: 190px 1fr 48px; align-items: center; gap: 14px; padding: 7px 0; }
.bar-label { font-size: 13.5px; display: inline-flex; align-items: center; gap: 8px; }
.bar-label .tag { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.bar-track { height: 26px; background: rgba(255, 255, 255, 0.04); border-radius: 7px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 7px; transform-origin: left; animation: grow 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.bar-val { font-size: 13px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

.legend { display: flex; gap: 18px; margin-top: 18px; flex-wrap: wrap; }
.legend span { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* Connector cards */
.conn-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.conn { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--surface); }
.conn .name { font-size: 14px; font-weight: 600; text-transform: capitalize; }
.conn .rate { font-size: 30px; font-weight: 740; margin-top: 6px; letter-spacing: -0.02em; }
.conn .meta { font-size: 12px; color: var(--dim); margin-top: 2px; }
.conn .meter { height: 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); margin-top: 12px; overflow: hidden; }
.conn .meter i { display: block; height: 100%; border-radius: 4px; }

/* Trend + agent bars */
.col-chart { display: flex; align-items: flex-end; gap: 8px; height: 160px; padding-top: 8px; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.col .stalk { width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--accent), rgba(91, 140, 255, 0.35)); animation: rise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes rise { from { height: 0 !important; } }
.col .wk { font-size: 10.5px; color: var(--dim); font-family: var(--mono); }
.col .ct { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.agent-row { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.agent-row:last-child { border-bottom: none; }
.agent-name { font-size: 13.5px; font-weight: 560; }
.agent-bar { height: 10px; background: rgba(255, 255, 255, 0.05); border-radius: 6px; overflow: hidden; }
.agent-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 6px; }
.agent-top { font-size: 11.5px; color: var(--muted); }

/* Filters + table */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; align-items: center; }
.filters .flabel { font-size: 12px; color: var(--dim); margin-right: 4px; }
.chip { font-size: 12.5px; color: var(--muted); border: 1px solid var(--line-strong); background: transparent; border-radius: 999px; padding: 6px 13px; cursor: pointer; transition: all 0.14s; font-family: inherit; }
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #051; color: #04101f; font-weight: 600; }
.chip.active.conf-high { background: var(--emerald); border-color: var(--emerald); }
.chip.active.conf-medium { background: var(--amber); border-color: var(--amber); }
.chip.active.conf-low { background: var(--slate); border-color: var(--slate); }

.diag { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; background: var(--surface); transition: border-color 0.15s; }
.diag:hover { border-color: var(--line-strong); }
.diag-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cause-pill { font-size: 12.5px; font-weight: 620; padding: 4px 11px; border-radius: 7px; }
.sec-pill { font-size: 11.5px; color: var(--muted); }
.conf { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 9px; border-radius: 6px; }
.conf-high { background: rgba(52, 211, 153, 0.16); color: var(--emerald); }
.conf-medium { background: var(--amber-dim); color: var(--amber); }
.conf-low { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }
.diag-meta { margin-left: auto; font-size: 11.5px; color: var(--dim); font-family: var(--mono); }
.diag-verbatim { margin: 12px 0 0; font-size: 14px; color: var(--text); font-style: italic; border-left: 2px solid var(--line-strong); padding-left: 12px; }
.diag-verbatim .lang { font-style: normal; font-size: 10.5px; color: var(--dim); margin-left: 8px; text-transform: uppercase; }
.diag-ev { margin: 12px 0 0; list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.diag-ev li { font-size: 12.5px; color: var(--muted); font-family: var(--mono); line-height: 1.45; padding-left: 18px; position: relative; }
.diag-ev li::before { content: "›"; position: absolute; left: 4px; color: var(--accent); }
.drill-empty { color: var(--dim); font-size: 14px; padding: 20px 0; text-align: center; }
.drill-count { font-size: 12px; color: var(--dim); margin: 14px 0 0; }

/* Evaluation */
.eval-callout { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; margin-top: 8px; }
.eval-num { text-align: center; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--surface); }
.eval-num .v { font-size: 40px; font-weight: 760; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.eval-num .l { font-size: 13px; color: var(--muted); margin-top: 4px; }
.eval-num.good .v { color: var(--text); }
.eval-num.floor .v { color: var(--amber); }
.eval-arrow { color: var(--dim); font-size: 26px; }
.eval-arrow span { display: block; font-size: 11px; color: var(--dim); text-align: center; margin-top: 2px; }

.grouprow { display: grid; grid-template-columns: 175px 1fr; align-items: center; gap: 14px; padding: 6px 0; }
.grouprow .gl { font-size: 13px; display: inline-flex; align-items: center; gap: 8px; }
.grouprow .gl .tag { width: 7px; height: 7px; border-radius: 2px; }
.gbars { display: flex; flex-direction: column; gap: 5px; }
.gbar { height: 16px; background: rgba(255, 255, 255, 0.04); border-radius: 5px; position: relative; overflow: hidden; }
.gbar i { display: block; height: 100%; border-radius: 5px; animation: grow 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.gbar .gv { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 10.5px; color: var(--text); font-variant-numeric: tabular-nums; }
.gbar.base i { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.gbar.off i { background: rgba(251, 191, 36, 0.55); }

.honesty { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 30px; }
.honesty-col { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--surface); }
.honesty-col h3 { margin: 0 0 8px; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.honesty-col h3::before { content: ""; width: 9px; height: 9px; border-radius: 50%; }
.honesty-col h3.ok::before { background: var(--teal); }
.honesty-col h3.warn::before { background: var(--amber); }
.honesty-col p { margin: 0; font-size: 13.5px; color: var(--muted); }
.honesty-col strong { color: var(--text); }

/* Confusion matrix */
.matrix { overflow-x: auto; }
.matrix table { border-collapse: collapse; font-size: 11px; min-width: 640px; }
.matrix th { color: var(--dim); font-weight: 500; padding: 5px; font-family: var(--mono); font-size: 10px; }
.matrix th.rowh { text-align: right; padding-right: 10px; white-space: nowrap; }
.matrix th.colh { writing-mode: vertical-rl; transform: rotate(180deg); height: 92px; vertical-align: bottom; }
.matrix td { width: 30px; height: 30px; text-align: center; border-radius: 5px; color: var(--text); font-variant-numeric: tabular-nums; border: 1px solid var(--bg); }
.matrix td.diag-cell { outline: 1px solid rgba(45, 212, 191, 0.5); }
.matrix td.zero { color: var(--dim); }

/* Pipeline */
.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 22px; }
.stage { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--surface); position: relative; }
.stage .n { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.stage h4 { margin: 8px 0 6px; font-size: 15px; }
.stage p { margin: 0; font-size: 12.5px; color: var(--muted); }
.stage::after { content: "→"; position: absolute; right: -12px; top: 50%; transform: translateY(-50%); color: var(--dim); z-index: 2; }
.stage:last-child::after { display: none; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 30px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.muted { color: var(--muted); font-size: 13px; }

.loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg); color: var(--muted); z-index: 50; font-size: 14px; transition: opacity 0.4s; }
.loading.hidden { opacity: 0; pointer-events: none; }

/* Responsive */
@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .conn-grid { grid-template-columns: repeat(2, 1fr); }
  .honesty { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .stage::after { display: none; }
  .topnav { display: none; }
  .eval-callout { grid-template-columns: 1fr; }
  .eval-arrow { transform: rotate(90deg); }
  .bar-row { grid-template-columns: 130px 1fr 40px; }
  .grouprow { grid-template-columns: 120px 1fr; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .conn-grid { grid-template-columns: 1fr; }
  .panel { padding: 22px 18px; }
  .diag-meta { margin-left: 0; width: 100%; }
}
