/* styles.css — MET-AL heavy-metal: chrome/steel on near-black, readable science. */

:root {
  --bg: #0a0c10;
  --bg2: #0e1117;
  --panel: #14181f;
  --panel2: #1a1f28;
  --edge: #2a313d;
  --edge2: #3a434f;
  --chrome: linear-gradient(180deg, #e9edf2 0%, #aab3bf 22%, #6c7682 52%, #aeb7c2 78%, #d7dde3 100%);
  --steel: linear-gradient(180deg, #3a424d 0%, #232a33 60%, #161b22 100%);
  --ink: #dfe5ee;
  --ink-dim: #97a1b0;
  --accent: #6fb6ff;
  --accent-warm: #ffbe78;
  --gold: #ffd56b;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(1200px 700px at 70% -10%, #161c26 0%, transparent 60%),
    radial-gradient(900px 600px at -10% 110%, #12161d 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font: 14px/1.45 var(--mono);
  -webkit-font-smoothing: antialiased;
}

/* ---- banner ---- */
.synth-banner {
  background: repeating-linear-gradient(45deg, #2a221008 0 12px, #00000000 12px 24px), #1c1408;
  border-bottom: 1px solid #5a4a1e;
  color: #ffd98a;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  text-transform: uppercase;
}
.synth-banner b { color: #ffe9b0; }

/* ---- header ---- */
header.app {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 18px;
  background: linear-gradient(180deg, #11151c, #0c0f15);
  border-bottom: 1px solid var(--edge);
  box-shadow: 0 1px 0 #000, 0 2px 14px #0008;
}
header.app img.logo { height: 46px; image-rendering: auto; filter: drop-shadow(0 2px 4px #000a); }
.title-block h1 {
  margin: 0; font-size: 19px; letter-spacing: 0.02em;
  background: var(--chrome); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: #cfd6df;
  text-shadow: 0 1px 0 #000;
}
.title-block .sub { color: var(--ink-dim); font-size: 11.5px; margin-top: 2px; }
.theme-pill {
  margin-left: auto; padding: 6px 12px; border-radius: 4px;
  background: var(--steel); border: 1px solid var(--edge2);
  color: #c4ccd6; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase;
  box-shadow: inset 0 1px 0 #ffffff14, 0 1px 3px #000a;
}

/* ---- layout ---- */
main {
  display: grid;
  grid-template-columns: 260px 1fr 320px;
  gap: 12px;
  padding: 12px;
  height: calc(100vh - 92px);
  min-height: 520px;
}
@media (max-width: 1100px) {
  main { grid-template-columns: 1fr; height: auto; }
}

.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.card {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--edge);
  border-radius: 7px;
  box-shadow: inset 0 1px 0 #ffffff0a, 0 4px 16px #0006;
  padding: 12px;
}
.card h2 {
  margin: 0 0 9px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-dim); border-bottom: 1px solid var(--edge); padding-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.card h2 .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); }

/* ---- scene ---- */
.scene-card { flex: 1; padding: 0; position: relative; overflow: hidden; display: flex; }
#scene {
  width: 100%; height: 100%; min-height: 360px;
  display: block; cursor: grab;
  background:
    radial-gradient(700px 500px at 50% 18%, #161d28 0%, transparent 70%),
    #0b0e13;
  touch-action: none;
}
#scene.grabbing { cursor: grabbing; }
.scene-hint {
  position: absolute; right: 12px; bottom: 10px;
  color: var(--ink-dim); font-size: 10.5px; pointer-events: none;
  background: #0009; padding: 4px 8px; border-radius: 4px; border: 1px solid var(--edge);
}
#tooltip {
  position: absolute; display: none; pointer-events: none;
  background: linear-gradient(180deg, #1c2330, #12171f);
  border: 1px solid var(--edge2); border-radius: 6px;
  padding: 8px 10px; font-size: 11.5px; max-width: 240px;
  box-shadow: 0 8px 24px #000a; z-index: 5; color: var(--ink);
}
#tooltip .hv { color: var(--gold); font-weight: 700; }
#tooltip .raw { color: var(--accent); font-size: 10.5px; }

/* ---- buttons ---- */
.btn-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.mbtn, .rbtn {
  font: 600 11px var(--mono); cursor: pointer;
  padding: 6px 9px; border-radius: 4px;
  color: #c2cad4; background: var(--steel);
  border: 1px solid var(--edge2);
  box-shadow: inset 0 1px 0 #ffffff12;
}
.mbtn:hover, .rbtn:hover { color: #fff; border-color: #586472; }
.mbtn.on, .rbtn.on {
  color: #08111c; background: var(--chrome);
  border-color: #cfd6df; text-shadow: 0 1px 0 #ffffff66;
  box-shadow: 0 0 0 1px #00000040, 0 2px 8px #6fb6ff33;
}

button.action {
  font: 600 11px var(--mono); cursor: pointer; width: 100%;
  padding: 8px; border-radius: 4px; color: #d6dde6;
  background: var(--steel); border: 1px solid var(--edge2);
  box-shadow: inset 0 1px 0 #ffffff12;
}
button.action:hover { color: #fff; border-color: #6a7686; }

/* ---- controls ---- */
.ctrl { margin-bottom: 11px; }
.ctrl:last-child { margin-bottom: 0; }
.ctrl label { display: block; color: var(--ink-dim); font-size: 10.5px; margin-bottom: 4px; letter-spacing: 0.03em; }
.ctrl label .v { color: var(--gold); float: right; font-weight: 700; }
.ctrl .row { display: flex; gap: 8px; align-items: center; }
input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px;
  background: linear-gradient(90deg, #2a3340, #1a2029); border-radius: 3px; outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 15px; height: 15px; border-radius: 50%;
  background: var(--chrome); border: 1px solid #cfd6df; cursor: pointer;
  box-shadow: 0 1px 3px #000a;
}
input[type=range]::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%;
  background: #cfd6df; border: 1px solid #cfd6df; cursor: pointer;
}
select {
  width: 100%; font: 11px var(--mono); color: var(--ink);
  background: var(--bg2); border: 1px solid var(--edge2); border-radius: 4px; padding: 6px 8px;
}
.chk { display: flex; align-items: center; gap: 7px; color: var(--ink-dim); font-size: 11px; cursor: pointer; }
.chk input { accent-color: var(--accent); }

/* ---- legend ---- */
.legend-bar { height: 14px; border-radius: 3px; border: 1px solid var(--edge2); margin: 6px 0 4px; }
.legend-scale { display: flex; justify-content: space-between; color: var(--ink-dim); font-size: 10px; }
#metricDesc { color: var(--ink); font-size: 11px; margin-top: 6px; }
#dataRange { color: var(--ink-dim); font-size: 10px; margin-top: 3px; }

/* ---- slice panel ---- */
#sliceTitle { color: var(--ink); font-size: 11px; margin-bottom: 6px; }
#sliceCanvas { width: 100%; height: 200px; display: block; background: #0b0e13; border-radius: 5px; border: 1px solid var(--edge); }

/* ---- aggregation honesty ---- */
.agg-table { width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 4px; }
.agg-table td { padding: 4px 6px; border-bottom: 1px solid var(--edge); }
.agg-table td:last-child { text-align: right; font-weight: 700; }
.agg-good { color: #8fe39a; }
.agg-bad { color: #ff9a8f; }
.agg-diff { color: var(--gold); }
.agg-note { color: var(--ink-dim); font-size: 10px; margin-top: 7px; line-height: 1.4; }
#aggContext { color: var(--accent); font-size: 10px; margin-bottom: 4px; }

.foot {
  color: var(--ink-dim); font-size: 10px; text-align: center;
  padding: 8px; border-top: 1px solid var(--edge);
}
.foot a { color: var(--accent); }
kbd {
  font: 10px var(--mono); background: #1a2029; border: 1px solid var(--edge2);
  border-radius: 3px; padding: 1px 5px; color: #c2cad4;
}
