/* GIGI Builds — shared chrome for the 3D web-extra demos.
 * Dark theme, validated palette (surface #1a1a19):
 * blue #3987e5 aqua #199e70 yellow #c98500 orange #d95926
 * red #e66767 magenta #d55181 violet #9085e9
 */
:root {
  --surface: #1a1a19; --panel: #232322; --panel-2: #2c2c2a;
  --ink: #e8e6e0; --ink-2: #b5b2a8; --ink-3: #85827a; --line: #3a3934;
  --blue: #3987e5; --aqua: #199e70; --yellow: #c98500; --orange: #d95926;
  --red: #e66767; --magenta: #d55181; --violet: #9085e9;
  --accent: var(--yellow);
  /* Aliases so extras + tetmesh demo (the-mesh-that-audits-itself.html)
     share one palette vocabulary. Any tweak lands once. */
  --surface-1: var(--surface);
  --border: var(--line);
  --text-primary: var(--ink);
  --text-secondary: var(--ink-2);
  --text-muted: var(--ink-3);
  --series-1: var(--blue);
  --series-2: var(--aqua);
  --series-3: var(--yellow);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--surface); color: var(--ink);
  font: 15.5px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--blue); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--yellow); outline-offset: 2px;
}
code {
  font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  background: var(--panel-2); border-radius: 5px; padding: 1px 6px;
  font-size: 0.86em; overflow-wrap: anywhere;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }
nav.wx { position: sticky; top: 0; z-index: 50; background: rgba(16,16,15,0.92);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
nav.wx .wrap { display: flex; align-items: center; gap: 18px; height: 54px; }
.brand { color: #fff; font-weight: 800; text-decoration: none; font-size: 15px;
  display: flex; align-items: center; gap: 9px; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, #b9c4e8 45%, #6c7dbb); }
nav.wx .crumbs { color: var(--ink-2); font-size: 13.5px; margin-left: auto; }
nav.wx .crumbs a { color: var(--ink-2); text-decoration: none; }
nav.wx .crumbs a:hover { color: #fff; }

header.page { padding: 40px 0 6px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px;
  font-weight: 700; color: var(--accent); }
h1 { font-size: clamp(26px, 4vw, 40px); line-height: 1.12;
  letter-spacing: -0.015em; margin: 8px 0 8px; }
.lede { color: var(--ink-2); font-size: 16.5px; max-width: 52em; margin: 0 0 8px; }

.stage { position: relative; border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; background: #141413; margin: 18px 0 0; }
.stage canvas { display: block; width: 100%; height: auto; touch-action: none; }
.stage .hud { position: absolute; left: 14px; bottom: 12px; color: var(--ink-3);
  font-size: 12px; pointer-events: none; text-shadow: 0 1px 3px #000; }
.stage .hud b { color: var(--ink-2); font-weight: 650; }
.stage .corner { position: absolute; right: 14px; top: 12px; color: var(--ink-3);
  font-size: 12px; pointer-events: none; text-align: right; text-shadow: 0 1px 3px #000; }

/* Panel grammar — a light container matching the tetmesh's panel look
   so extras that group controls + stats (like spectrum + loop) share
   the same small-caps h2 + card feel instead of loose flex rows. */
.wx-panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 18px; margin: 14px 0;
}
.wx-panel-title {
  margin: 0 0 10px; font-size: 11px; font-weight: 700;
  color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.08em;
}
.wx-panel .controls { margin-top: 0; }
.wx-panel .stats {
  margin: 12px 0 0; padding-top: 12px;
  border-top: 1px solid var(--line);
}

.controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin: 14px 0 4px; }
button.wx { background: var(--accent); color: #131311; font-weight: 750;
  border: 0; border-radius: 9px; padding: 10px 15px; font-size: 14px; cursor: pointer; }
button.wx:hover { filter: brightness(1.1); }
button.wx:disabled { opacity: 0.45; cursor: default; }
button.wx.alt { background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); }
label.wx-slider { display: inline-flex; flex-direction: column; gap: 2px;
  font-size: 13px; color: var(--ink-2); min-width: 170px; }
label.wx-slider strong { color: var(--ink); font-variant-numeric: tabular-nums; }
label.wx-slider input { width: 100%; accent-color: var(--accent); }

.stats { display: flex; gap: 26px; flex-wrap: wrap; margin: 14px 0 4px; }
.stat .v { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 19px;
  font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .v.hot { color: var(--red); }
.stat .v.good { color: var(--aqua); }
.stat .k { font-size: 11.5px; color: var(--ink-3); text-transform: uppercase;
  letter-spacing: 0.06em; }

.note { color: var(--ink-2); font-size: 14px; max-width: 62em; margin: 14px 0; }
.note em { color: var(--ink); }

details.gql { background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 4px 20px 16px; margin: 18px 0; }
details.gql summary { cursor: pointer; font-weight: 700; padding: 12px 0;
  color: var(--ink); }
details.gql .hint { color: var(--ink-3); font-size: 13px; margin: 2px 0 10px; }
details.gql .row { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
details.gql input.ep { flex: 1 1 280px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 8px; color: var(--ink);
  padding: 9px 12px; font: 13px ui-monospace, Menlo, monospace; }
details.gql textarea { width: 100%; min-height: 64px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 8px; color: var(--ink);
  padding: 10px 12px; font: 13px/1.5 ui-monospace, Menlo, monospace; resize: vertical; }
details.gql button.chip { background: var(--panel-2); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
  font-size: 12.5px; cursor: pointer; }
details.gql button.chip:hover { color: var(--ink); border-color: var(--ink-3); }
details.gql pre { background: #131312; border: 1px solid var(--line);
  border-radius: 8px; padding: 12px 14px; overflow: auto; max-height: 320px;
  font: 12.5px/1.5 ui-monospace, Menlo, monospace; color: var(--ink-2);
  white-space: pre-wrap; }

/* Baseline "lives in GIGI as data" intro block — the tetmesh demo
   scopes its equivalent to #gigiwork, but the extras don't have that
   panel; give the class a free-standing rule so every extra can drop
   the block in as a first child of <main class="wrap"> and get the
   same warm, small-caps register. */
.gw-intro {
  font-size: 13px; line-height: 1.65;
  color: var(--ink-2);
  margin: 22px 0 26px;
  padding: 16px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--yellow);
  border-radius: 8px;
}
.gw-intro p { margin: 0; }
.gw-intro p + p { margin-top: 10px; }
.gw-intro b { color: var(--ink); font-weight: 650; }
.gw-intro code {
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--ink); border-radius: 4px;
  padding: 0 5px;
  font: 11.5px ui-monospace, Menlo, Consolas, monospace;
}

/* GQL cheatsheet + per-query gloss — the same landmarks the tetmesh
   demo carries so the panels feel like one family. WX.wireConsole
   auto-injects a `.gq-legend` under the summary and a `.gloss` block
   under the chip row; both get styled here. */
details.gql .gq-legend {
  font-size: 10.5px; color: var(--ink-3);
  margin: 10px 0 2px; padding: 6px 8px;
  border: 1px dashed var(--line); border-radius: 6px;
  line-height: 1.55;
}
details.gql .gq-legend b {
  color: var(--ink-2); font-weight: 650;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10px;
}
details.gql .gloss {
  display: block; font-size: 11px; color: var(--ink-2);
  font-style: italic; line-height: 1.5;
  margin: 6px 0 8px; padding: 4px 8px;
  border-left: 2px solid var(--line);
}
details.gql .gloss:empty { display: none; }

footer.wx { color: var(--ink-3); font-size: 13px; padding: 28px 0 46px; }
footer.wx a { color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  .stage canvas { scroll-behavior: auto; }
}
