/* ---
 * file: site.css
 * purpose: Shared tokens + components for every statefair-hq page.
 *          Palette = validated dataviz reference set (same as the 8/16
 *          status board). Light default, dark via prefers-color-scheme.
 * --- */

:root {
  color-scheme: light;
  --surface-1: #fcfcfb; --page: #f9f9f7;
  --ink-1: #0b0b0b; --ink-2: #52514e; --ink-3: #898781;
  --grid: #e1e0d9; --baseline: #c3c2b7;
  --border: rgba(11,11,11,0.10);
  --accent: #2a78d6;
  --good: #0ca30c; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b;
  --good-text: #006300; --warning-text: #7a5200; --serious-text: #9c3f1c; --critical-text: #d03b3b;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --surface-1: #1a1a19; --page: #0d0d0d;
    --ink-1: #ffffff; --ink-2: #c3c2b7; --ink-3: #898781;
    --grid: #2c2c2a; --baseline: #383835;
    --border: rgba(255,255,255,0.10);
    --accent: #3987e5;
    --good-text: #0ca30c; --warning-text: #fab219; --serious-text: #ec835a; --critical-text: #d03b3b;
  }
}

* { box-sizing: border-box; margin: 0; }
body {
  background: var(--page); color: var(--ink-1);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  padding-bottom: 60px;
}
main { max-width: 1080px; margin: 0 auto; padding: 20px 16px 0; }
a { color: var(--accent); }

/* Nav */
nav.site {
  display: flex; gap: 2px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: var(--surface-1); border-bottom: 1px solid var(--grid);
  padding: 0 8px; position: sticky; top: 0; z-index: 10;
}
nav.site a {
  color: var(--ink-2); text-decoration: none; white-space: nowrap;
  font-size: 13px; font-weight: 600; padding: 12px 10px 10px;
  border-bottom: 2px solid transparent;
}
nav.site a.active { color: var(--ink-1); border-bottom-color: var(--accent); }
nav.site a:hover { color: var(--ink-1); }

h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.sub { color: var(--ink-2); margin-top: 2px; font-size: 13px; }
section { margin-top: 28px; }
h2 {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: 10px;
}

/* Stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.tile .label { font-size: 12px; color: var(--ink-2); }
.tile .value { font-size: 26px; font-weight: 700; margin-top: 2px; }
.tile .note { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.tile.alert .value { color: var(--critical-text); }

/* Tables */
.tablewrap { overflow-x: auto; border-radius: 10px; }
table {
  width: 100%; border-collapse: collapse; background: var(--surface-1);
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden; font-size: 14px;
}
th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-3); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--grid);
  white-space: nowrap;
}
td { padding: 9px 12px; border-bottom: 1px solid var(--grid); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.item-name { font-weight: 600; }
.item-detail { color: var(--ink-2); font-size: 13px; margin-top: 2px; }

/* Status chips — the universal six-state vocabulary */
.chip {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font-size: 12px; font-weight: 600; padding: 2px 9px 2px 7px; border-radius: 999px;
  border: 1px solid var(--border);
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chip.good     { color: var(--good-text); }     .chip.good .dot     { background: var(--good); }
.chip.warning  { color: var(--warning-text); }  .chip.warning .dot  { background: var(--warning); }
.chip.serious  { color: var(--serious-text); }  .chip.serious .dot  { background: var(--serious); }
.chip.critical { color: var(--critical-text); } .chip.critical .dot { background: var(--critical); }
.chip.done, .chip.dead { color: var(--ink-3); } .chip.done .dot, .chip.dead .dot { background: var(--baseline); }

/* Pipeline (multi-stage tracker: demo units, plinko, banner rig, sheet order stages) */
.pipeline { display: flex; flex-wrap: wrap; gap: 4px 0; align-items: center; margin-top: 6px; }
.stage {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--ink-3); padding: 3px 8px;
  border: 1px solid var(--grid); border-radius: 6px; margin-right: 4px; background: var(--surface-1);
}
.stage .sdot { width: 7px; height: 7px; border-radius: 50%; background: var(--baseline); flex: none; }
.stage.done { color: var(--ink-2); } .stage.done .sdot { background: var(--good); }
.stage.now  { color: var(--ink-1); font-weight: 600; border-color: var(--accent); }
.stage.now .sdot { background: var(--accent); }
.stage.blocked { color: var(--critical-text); } .stage.blocked .sdot { background: var(--critical); }
.lane { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.lane .lane-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.lane .lane-title { font-weight: 700; }
.lane .lane-meta { font-size: 12px; color: var(--ink-3); }

/* Checklists (packing, booth kits) */
ul.check { list-style: none; padding: 0; }
ul.check li { padding: 6px 0 6px 26px; border-bottom: 1px solid var(--grid); font-size: 14px; position: relative; }
ul.check li:last-child { border-bottom: none; }
ul.check li::before {
  content: ""; position: absolute; left: 2px; top: 9px; width: 14px; height: 14px;
  border: 1.5px solid var(--baseline); border-radius: 4px;
}
ul.check li.ck::before { background: var(--good); border-color: var(--good); }
ul.check li.ck { color: var(--ink-3); }

/* Cards & lists */
.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 4px 14px; }
ul.plain { list-style: none; padding: 0; }
ul.plain li { padding: 7px 0; border-bottom: 1px solid var(--grid); font-size: 14px; }
ul.plain li:last-child { border-bottom: none; }
.k { color: var(--ink-2); }
.deadline-soon { color: var(--critical-text); font-weight: 600; }

footer { max-width: 1080px; margin: 36px auto 0; padding: 0 16px; color: var(--ink-3); font-size: 12px; line-height: 1.6; }
code {
  font-family: ui-monospace, monospace; font-size: 0.92em; background: var(--surface-1);
  border: 1px solid var(--border); border-radius: 4px; padding: 0 4px;
}
img, iframe { max-width: 100%; }
