/* Palette: dataviz skill reference instance (references/palette.md) — swapped nowhere,
   used as-is. Sequential hue (blue) for magnitude bars; first three categorical slots
   (blue/orange/aqua, pre-validated all-pairs in both modes) for the device-type identity
   swatches. System sans throughout — no external font load, keeps the CSP dependency-free. */
:root {
  color-scheme: light;
  --page:            #f9f9f7;
  --surface:         #fcfcfb;
  --text-primary:    #0b0b0b;
  --text-secondary:  #52514e;
  --text-muted:      #898781;
  --border:          rgba(11, 11, 11, 0.10);
  --gridline:        #e1e0d9;
  --seq-400:         #3987e5;
  --seq-450:         #2a78d6;
  --cat-1:           #2a78d6;
  --cat-2:           #eb6834;
  --cat-3:           #1baf7a;
  --radius:          8px;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page:            #0d0d0d;
    --surface:         #1a1a19;
    --text-primary:    #ffffff;
    --text-secondary:  #c3c2b7;
    --text-muted:      #898781;
    --border:          rgba(255, 255, 255, 0.10);
    --gridline:        #2c2c2a;
    --seq-400:         #3987e5;
    --seq-450:         #3987e5;
    --cat-1:           #3987e5;
    --cat-2:           #d95926;
    --cat-3:           #199e70;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page:            #0d0d0d;
  --surface:         #1a1a19;
  --text-primary:    #ffffff;
  --text-secondary:  #c3c2b7;
  --text-muted:      #898781;
  --border:          rgba(255, 255, 255, 0.10);
  --gridline:        #2c2c2a;
  --seq-400:         #3987e5;
  --seq-450:         #3987e5;
  --cat-1:           #3987e5;
  --cat-2:           #d95926;
  --cat-3:           #199e70;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
}
.container { max-width: 960px; margin: 0 auto; padding: 0 24px; }

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}
.site-header .container { display: flex; align-items: baseline; gap: 8px; }
.brand { color: var(--text-primary); text-decoration: none; font-weight: 600; }
.brand-sep { color: var(--text-muted); }
.brand-current { color: var(--text-secondary); }

.section { padding: 40px 0; }
.section h1 { font-size: 1.75rem; margin: 0 0 8px; }
.section h2 { font-size: 1.25rem; margin: 0 0 20px; }
.lede { color: var(--text-secondary); max-width: 60ch; }

.empty-state { color: var(--text-muted); padding: 40px 0; }

.stat-tiles { display: flex; flex-wrap: wrap; gap: 16px; }
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  min-width: 160px;
}
.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 600;
  font-variant-numeric: proportional-nums;
}
.stat-label { color: var(--text-muted); font-size: 0.85rem; }

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 160px;
  border-bottom: 1px solid var(--gridline);
  padding: 0 4px;
}
.bar-chart-year { justify-content: flex-start; }
.bar-col {
  flex: 1;
  max-width: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 6px;
}
.bar {
  width: 100%;
  min-height: 2px;
  background: var(--seq-400);
  border-radius: 4px 4px 0 0;
}
.bar-tick { font-size: 0.7rem; color: var(--text-muted); }

.mix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.mix-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.mix-card h3 { margin: 0 0 12px; font-size: 0.95rem; color: var(--text-secondary); }
.mix-list { list-style: none; margin: 0; padding: 0; }
.mix-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--gridline);
  font-size: 0.9rem;
}
.mix-list li:last-child { border-bottom: none; }
.mix-list strong { font-variant-numeric: tabular-nums; }
.swatch {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 2px;
  margin-right: 8px;
}
.swatch-desktop { background: var(--cat-1); }
.swatch-mobile  { background: var(--cat-2); }
.swatch-other   { background: var(--cat-3); }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 40px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.site-footer a { color: var(--text-secondary); }
