:root{
  --ink:#0E1116;
  --paper:#EEF0F2;
  --purple:#8B2FE0;
  --yellow:#FFC53D;
  --green:#33B26B;

  --bg:var(--paper);
  --surface:#FFFFFF;
  --surface-2:#E4E7EB;
  --text:#14171C;
  --text-dim:#565C68;
  --border:#CDD1D8;
  --accent:var(--purple);
  --accent-ink:#FFFFFF;

  --tag-purple-bg:#F1E4FF; --tag-purple-fg:#6A1FB5;
  --tag-yellow-bg:#FFF3D6; --tag-yellow-fg:#8A5B00;
  --tag-green-bg:#DFF6E8;  --tag-green-fg:#1C7A45;

  /* chart series - validated light (surface #FFFFFF) */
  --series-a:#8B2FE0;
  --series-b:#C76A00;
  --grid:#E2E5EA;

  --shadow:0 1px 0 rgba(14,17,22,0.06);
}

@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:var(--ink);
    --surface:#14171D;
    --surface-2:#1B1F26;
    --text:#EDEFF2;
    --text-dim:#9BA1AD;
    --border:#3A3F49;
    --accent:#B27CFF;
    --accent-ink:#14071F;
    --tag-purple-bg:#2C1B47; --tag-purple-fg:#CBA3FF;
    --tag-yellow-bg:#3A2E0E; --tag-yellow-fg:#FFD469;
    --tag-green-bg:#143A25;  --tag-green-fg:#6FE0A0;
    --series-a:#9F5CEF;
    --series-b:#C2761A;
    --grid:#282D36;
    --shadow:0 1px 0 rgba(0,0,0,0.4);
  }
}
:root[data-theme="dark"]{
  --bg:var(--ink);
  --surface:#14171D;
  --surface-2:#1B1F26;
  --text:#EDEFF2;
  --text-dim:#9BA1AD;
  --border:#3A3F49;
  --accent:#B27CFF;
  --accent-ink:#14071F;
  --tag-purple-bg:#2C1B47; --tag-purple-fg:#CBA3FF;
  --tag-yellow-bg:#3A2E0E; --tag-yellow-fg:#FFD469;
  --tag-green-bg:#143A25;  --tag-green-fg:#6FE0A0;
  --series-a:#9F5CEF;
  --series-b:#C2761A;
  --grid:#282D36;
  --shadow:0 1px 0 rgba(0,0,0,0.4);
}

*{box-sizing:border-box;}
html{color-scheme:light dark;}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:'IBM Plex Sans',system-ui,sans-serif;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
.wrap{max-width:1080px;margin:0 auto;padding:0 24px 80px;}

h1,h2,h3{
  font-family:'Big Shoulders Display','Arial Narrow',sans-serif;
  text-transform:uppercase;letter-spacing:0.01em;text-wrap:balance;margin:0;
}
.mono,.num{font-family:'IBM Plex Mono',ui-monospace,monospace;font-variant-numeric:tabular-nums;}
a{color:inherit;}
.eyebrow{
  font-family:'IBM Plex Mono',monospace;font-size:11px;letter-spacing:0.14em;
  text-transform:uppercase;color:var(--text-dim);
}

/* header */
header.site{border-bottom:1px solid var(--border);padding:18px 24px;}
header.site .row{max-width:1080px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;}
.wordmark{
  font-family:'Big Shoulders Display',sans-serif;font-weight:800;font-size:26px;
  letter-spacing:0.02em;display:flex;align-items:center;gap:10px;text-decoration:none;
}
.wordmark .dot{width:10px;height:10px;background:var(--accent);border-radius:1px;display:inline-block;transform:rotate(45deg);}
header.site nav{display:flex;align-items:center;gap:22px;font-size:13px;font-weight:600;text-transform:uppercase;letter-spacing:0.06em;color:var(--text-dim);}
header.site nav a{text-decoration:none;}
header.site nav a:hover,header.site nav a[aria-current="page"]{color:var(--text);}
header.site nav a[aria-current="page"]{color:var(--accent);}
a:focus-visible,button:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:3px;}

.theme-toggle{
  background:none;border:1px solid var(--border);color:var(--text-dim);
  font-family:'IBM Plex Mono',monospace;font-size:10px;letter-spacing:0.08em;text-transform:uppercase;
  padding:5px 9px;cursor:pointer;border-radius:2px;
}
.theme-toggle:hover{color:var(--text);border-color:var(--accent);}

/* sections */
section{padding:36px 0;border-bottom:1px solid var(--border);}
section:last-of-type{border-bottom:none;}
.section-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:18px;flex-wrap:wrap;}
.section-head h2{font-size:26px;}
.section-head .sub{font-size:12px;color:var(--text-dim);font-family:'IBM Plex Mono',monospace;}

/* tables */
table{width:100%;border-collapse:collapse;font-size:14px;}
th{
  text-align:left;font-size:10px;letter-spacing:0.08em;text-transform:uppercase;color:var(--text-dim);
  font-weight:600;padding:8px 10px;border-bottom:1px solid var(--border);font-family:'IBM Plex Mono',monospace;
  white-space:nowrap;
}
td{padding:9px 10px;border-bottom:1px solid var(--border);}
td.num,th.num{text-align:right;font-family:'IBM Plex Mono',monospace;font-variant-numeric:tabular-nums;}
tbody tr:hover td{background:var(--surface-2);}
.table-scroll{overflow-x:auto;border:1px solid var(--border);background:var(--surface);}
.table-scroll th:first-child,.table-scroll td:first-child{padding-left:14px;}
.table-scroll th:last-child,.table-scroll td:last-child{padding-right:14px;}
th.sortable{cursor:pointer;user-select:none;}
th.sortable:hover{color:var(--text);}
th.sortable[aria-sort]:not([aria-sort="none"]){color:var(--accent);}

.tag{
  display:inline-block;font-family:'IBM Plex Mono',monospace;font-size:10px;font-weight:600;
  letter-spacing:0.05em;text-transform:uppercase;padding:2px 6px;border-radius:2px;
}
.tag-purple{background:var(--tag-purple-bg);color:var(--tag-purple-fg);}
.tag-yellow{background:var(--tag-yellow-bg);color:var(--tag-yellow-fg);}
.tag-green{background:var(--tag-green-bg);color:var(--tag-green-fg);}

.team-swatch{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:7px;vertical-align:middle;flex:none;}

/* controls */
select{
  font-family:'IBM Plex Sans',sans-serif;font-size:13px;padding:7px 10px;
  background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:2px;cursor:pointer;
}
.control-row{display:flex;gap:14px;align-items:flex-end;flex-wrap:wrap;margin-bottom:18px;}
.control{display:flex;flex-direction:column;gap:5px;}
.control label{font-family:'IBM Plex Mono',monospace;font-size:10px;letter-spacing:0.08em;text-transform:uppercase;color:var(--text-dim);}

/* status */
.status{font-family:'IBM Plex Mono',monospace;font-size:12px;color:var(--text-dim);padding:10px 0;}
.status.err{color:var(--tag-yellow-fg);background:var(--tag-yellow-bg);padding:10px 14px;border-radius:2px;}
.skeleton{opacity:0.45;}

/* metric tiles */
.metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:1px;background:var(--border);border:1px solid var(--border);margin-bottom:20px;}
@media (max-width:860px){.metrics{grid-template-columns:repeat(2,1fr);}}
.metric{background:var(--surface);padding:13px 15px;min-width:0;}
.metric .label{font-family:'IBM Plex Mono',monospace;font-size:10px;letter-spacing:0.08em;text-transform:uppercase;color:var(--text-dim);margin-bottom:7px;}
.metric .pair{display:flex;align-items:baseline;gap:10px;justify-content:space-between;min-width:0;}
.metric .v{font-family:'IBM Plex Mono',monospace;font-size:16px;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap;}
.metric .v.a{color:var(--series-a);}
.metric .v.b{color:var(--series-b);}
.metric .unit{font-size:11px;color:var(--text-dim);font-weight:400;}

/* chart */
.chart-box{background:var(--surface);border:1px solid var(--border);padding:16px 16px 10px;margin-bottom:20px;}
.legend{display:flex;gap:18px;flex-wrap:wrap;margin-bottom:12px;font-size:12px;}
.legend .item{display:flex;align-items:center;gap:7px;}
.legend .key{width:14px;height:3px;border-radius:2px;flex:none;}
.legend .key.a{background:var(--series-a);}
.legend .key.b{background:var(--series-b);}
.chart-svg{display:block;width:100%;height:auto;overflow:visible;}
.chart-svg .gridline{stroke:var(--grid);stroke-width:1;}
.chart-svg .axis-label{fill:var(--text-dim);font-family:'IBM Plex Mono',monospace;font-size:10px;}
.chart-svg .trace{fill:none;stroke-width:2;stroke-linejoin:round;stroke-linecap:round;}
.chart-svg .trace.a{stroke:var(--series-a);}
.chart-svg .trace.b{stroke:var(--series-b);}
.chart-svg .brakeband{fill:var(--text-dim);opacity:0.09;}
.chart-svg .crosshair{stroke:var(--text-dim);stroke-width:1;stroke-dasharray:3 3;}
.chart-svg .cursor-dot{stroke:var(--surface);stroke-width:2;}
.chart-note{font-size:11px;color:var(--text-dim);margin:8px 0 0;}

.tooltip{
  position:absolute;pointer-events:none;background:var(--surface);border:1px solid var(--border);
  box-shadow:0 4px 14px rgba(0,0,0,0.16);padding:9px 11px;font-size:12px;border-radius:3px;
  font-family:'IBM Plex Mono',monospace;white-space:nowrap;z-index:10;
}
.tooltip .t-row{display:flex;gap:12px;justify-content:space-between;}
.tooltip .t-row .k{display:flex;align-items:center;gap:6px;}
.chart-wrap{position:relative;}

footer{padding:28px 0 40px;}
footer p{font-size:12px;color:var(--text-dim);margin:0 0 6px;}
footer a{color:var(--accent);}

::selection{background:var(--accent);color:var(--accent-ink);}

@media (prefers-reduced-motion:reduce){
  *{animation-duration:0.01ms !important;transition-duration:0.01ms !important;}
}
