/* Tasiast–Tijirit prospectivity showcase
   Palette roles come from the dataviz skill's documented dark instance.
   Do not substitute raw hex in the body of the sheet — use the role vars. */

:root {
  color-scheme: dark;

  /* surfaces & ink (documented dark chrome tokens) */
  --surface-0: #0d0d0d;          /* page plane */
  --surface-1: #1a1a19;          /* panel / chart surface */
  --surface-2: #22221f;          /* raised card */
  --surface-3: #2a2a27;          /* control track */
  --ink-1: #ffffff;
  --ink-2: #c3c2b7;
  --ink-3: #898781;
  --rule: #2c2c2a;
  --rule-strong: #383835;
  --border: rgba(255, 255, 255, 0.10);

  /* geology fills — the three hue-carrying classes validated all-pairs */
  --geo-greenstone: #199e70;
  --geo-granitoid:  #3987e5;
  --geo-vein:       #d95926;
  --geo-other:      #6f6d66;     /* folded rare bedrock units, neutral */
  --geo-cover:      #5a5a54;     /* Cenozoic cover — recessive mask class */

  /* semantic map layers */
  --accent:  #c98500;            /* the ten targets */
  --reveal:  #ffffff;            /* every blind-test element */
  --struct:  #a8a69b;            /* lineaments */

  /* SHAP diverging pair (blue <-> red, gray midpoint) */
  --shap-up:   #e66767;
  --shap-down: #3987e5;
  --shap-mid:  #383835;

  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
  --sidebar-w: 400px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface-0);
  color: var(--ink-2);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--ink-1); font-weight: 600; margin: 0; line-height: 1.25; }
p { margin: 0 0 0.85em; }
a { color: var(--ink-1); }
strong { color: var(--ink-1); font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- shell -- */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  min-height: 620px;
}

.sidebar {
  background: var(--surface-1);
  border-right: 1px solid var(--rule);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.map-wrap { position: relative; background: var(--surface-0); }
#map { position: absolute; inset: 0; }

/* ------------------------------------------------------------- masthead -- */

.masthead { padding: 22px 22px 18px; border-bottom: 1px solid var(--rule); }

.eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 9px;
}

.masthead h1 { font-size: 20px; letter-spacing: -0.01em; }
.masthead .sub { margin: 8px 0 0; font-size: 13px; color: var(--ink-3); }

/* --------------------------------------------------------------- blocks -- */

.block { padding: 18px 22px; border-bottom: 1px solid var(--rule); }
.block:last-child { border-bottom: 0; }

.block-title {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  margin: 0 0 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.block-title .hint { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 11px; }

.lede { font-size: 13.5px; color: var(--ink-2); }

/* ------------------------------------------------------------ CTA / btn -- */

.btn {
  font: inherit;
  font-weight: 600;
  color: var(--surface-0);
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  padding: 12px 16px;
  width: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: filter 0.14s ease, transform 0.14s ease;
}
.btn:hover { filter: brightness(1.09); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--ink-1); outline-offset: 2px; }
.btn[aria-pressed="true"] { background: var(--surface-3); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--rule-strong); }
.btn .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.btn-sub { margin: 9px 0 0; font-size: 11.5px; color: var(--ink-3); text-align: center; }

.btn-ghost {
  font: inherit;
  font-size: 12px;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: 5px;
  padding: 6px 11px;
  cursor: pointer;
}
.btn-ghost:hover { border-color: var(--ink-3); color: var(--ink-1); }

/* ------------------------------------------------------------- targets -- */

.target-note {
  background: var(--surface-2);
  border: 1px solid var(--rule-strong);
  border-left: 2px solid var(--ink-3);
  border-radius: 5px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 12px;
}
.target-note b { color: var(--ink-1); }

.target-list { list-style: none; margin: 0; padding: 0; }

.target-row {
  border: 1px solid transparent;
  border-radius: 6px;
  margin-bottom: 2px;
  overflow: hidden;
  transition: background 0.12s ease;
}
.target-row:hover { background: var(--surface-2); }
.target-row.is-open { background: var(--surface-2); border-color: var(--rule-strong); }

.target-head {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 11px;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.target-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.rank-badge {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--surface-0);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.target-label { font-size: 13px; color: var(--ink-1); font-weight: 500; }
.target-coord { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.target-score { font-size: 13px; color: var(--ink-1); font-variant-numeric: tabular-nums; font-weight: 600; }
.target-pct { font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; text-align: right; }

.target-body { padding: 0 11px 12px 48px; }
.target-body[hidden] { display: none; }

/* --------------------------------------------------------- SHAP drivers -- */

.drivers { margin: 0; }
.drivers-title {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  margin-bottom: 8px;
}

.driver { margin-bottom: 9px; }
.driver-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 4px;
}
.driver-name { color: var(--ink-1); }
.driver-val { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 11px; white-space: nowrap; }

/* diverging bar: 2px marks, 4px rounded data-end, anchored to a centre baseline */
.driver-bar { position: relative; height: 8px; background: var(--surface-3); border-radius: 2px; }
.driver-bar::before {
  content: ""; position: absolute; left: 50%; top: -1px; bottom: -1px;
  width: 1px; background: var(--shap-mid);
}
.driver-fill { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.driver-fill.up { left: 50%; background: var(--shap-up); border-radius: 0 4px 4px 0; }
.driver-fill.down { right: 50%; background: var(--shap-down); border-radius: 4px 0 0 4px; }

.driver-dir {
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 3px;
  display: flex;
  gap: 5px;
  align-items: center;
}
.driver-dir .arrow { font-weight: 700; }
.driver-dir .arrow.up { color: var(--shap-up); }
.driver-dir .arrow.down { color: var(--shap-down); }

/* --------------------------------------------------------------- layers -- */

.slider-row { display: flex; align-items: center; gap: 11px; margin-bottom: 4px; }
.slider-row label { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.slider-row output { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; width: 34px; text-align: right; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 3px; border-radius: 2px;
  background: var(--surface-3); cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface-1); cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface-1); cursor: pointer;
}

.layer { border-bottom: 1px solid var(--rule); }
.layer:last-child { border-bottom: 0; }

.layer-head {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 0;
  background: none; border: 0; font: inherit; color: inherit;
  text-align: left; cursor: pointer;
}
.layer-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.layer-name { flex: 1; font-size: 12.5px; color: var(--ink-2); }
.layer-head[aria-pressed="true"] .layer-name { color: var(--ink-1); }

.switch {
  width: 30px; height: 17px; border-radius: 9px;
  background: var(--surface-3); position: relative; flex: none;
  transition: background 0.15s ease;
  box-shadow: inset 0 0 0 1px var(--rule-strong);
}
.switch::after {
  content: ""; position: absolute; top: 2.5px; left: 2.5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--ink-3); transition: transform 0.15s ease, background 0.15s ease;
}
.layer-head[aria-pressed="true"] .switch { background: var(--accent); box-shadow: none; }
.layer-head[aria-pressed="true"] .switch::after { transform: translateX(13px); background: var(--surface-0); }

.layer-legend { padding: 0 0 11px 40px; }
.layer-legend[hidden] { display: none; }

.ramp { height: 8px; border-radius: 2px; border: 1px solid var(--border); }
.ramp-labels {
  display: flex; justify-content: space-between;
  font-size: 10.5px; color: var(--ink-3);
  font-variant-numeric: tabular-nums; margin-top: 4px;
}

.swatch-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; font-size: 11.5px; color: var(--ink-2); }
.swatch {
  width: 13px; height: 13px; border-radius: 3px; flex: none;
  box-shadow: inset 0 0 0 1px var(--border);
}
.swatch.line { height: 0; border-top: 2px solid; border-radius: 0; box-shadow: none; }

.layer-missing { font-size: 11.5px; color: var(--ink-3); padding: 9px 0; }

/* ------------------------------------------------------- floating cards -- */

.card {
  background: var(--surface-1);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
}

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--rule);
}
.card-head h3 { font-size: 13px; }
.card-body { padding: 12px 14px; }

.card-close {
  background: none; border: 0; color: var(--ink-3);
  font-size: 17px; line-height: 1; cursor: pointer; padding: 2px 4px;
}
.card-close:hover { color: var(--ink-1); }

/* cell inspector */
#inspector {
  position: absolute; top: 16px; right: 16px; width: 296px;
  z-index: 5; max-height: calc(100% - 32px); overflow-y: auto;
}
#inspector[hidden] { display: none; }

.readout { display: flex; gap: 20px; margin-bottom: 13px; }
.readout-item .k {
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
}
.readout-item .v {
  font-size: 23px; color: var(--ink-1); font-variant-numeric: tabular-nums;
  line-height: 1.15; margin-top: 2px;
}
.readout-item .v small { font-size: 12px; color: var(--ink-3); font-weight: 400; }

.coord-line {
  font-size: 10.5px; color: var(--ink-3);
  font-variant-numeric: tabular-nums; margin-bottom: 12px;
  padding-bottom: 11px; border-bottom: 1px solid var(--rule);
}

.flag-warn {
  display: flex; gap: 8px; align-items: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--rule-strong);
  border-left: 2px solid var(--accent);
  border-radius: 5px; padding: 9px 11px;
  font-size: 11.5px; color: var(--ink-2); margin-top: 12px;
}
.flag-warn .ico { color: var(--accent); font-weight: 700; flex: none; }

.hint-empty { font-size: 12px; color: var(--ink-3); }

/* --------------------------------------------------------- reveal card -- */

#reveal-card {
  position: absolute; left: 50%; bottom: 26px;
  transform: translate(-50%, 14px);
  width: min(660px, calc(100% - 48px));
  z-index: 6;
  opacity: 0;
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  border-color: var(--reveal);
}
#reveal-card[hidden] { display: none; }
#reveal-card.is-in { opacity: 1; transform: translate(-50%, 0); }

.reveal-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--rule); border-radius: 6px; overflow: hidden;
}
.stat { background: var(--surface-1); padding: 12px 13px; }
.stat .v {
  font-size: 25px; color: var(--ink-1);
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.stat .v small { font-size: 13px; color: var(--ink-3); }
.stat .k { font-size: 11px; color: var(--ink-3); margin-top: 5px; line-height: 1.35; }

.reveal-foot {
  font-size: 11.5px; color: var(--ink-3);
  margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--rule);
}

/* --------------------------------------------------------- map markers -- */

.mk { cursor: pointer; }

.mk-target {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: var(--surface-0);
  font-family: var(--font); font-size: 11.5px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--surface-0), 0 2px 7px rgba(0, 0, 0, 0.6);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mk-target:hover { transform: scale(1.14); }
.mk-target.is-active {
  transform: scale(1.24);
  box-shadow: 0 0 0 2px var(--surface-0), 0 0 0 5px rgba(201, 133, 0, 0.42);
}

/* blind-test occurrence: white diamond, distinct in shape from the gold discs */
.mk-holdout-wrap {
  position: relative; width: 15px; height: 15px;
  opacity: 0; transform: translateY(-12px);
  transition: opacity 0.34s ease, transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}
.mk-holdout-wrap.is-in { opacity: 1; transform: translateY(0); }

.mk-holdout {
  width: 15px; height: 15px; transform: rotate(45deg);
  background: var(--reveal);
  box-shadow: 0 0 0 2px var(--surface-0), 0 0 11px rgba(255, 255, 255, 0.45);
}
/* hollow = spectral signal destroyed by the open pit; these two are scored on
   non-spectral evidence alone, so they must not look like the clean five */
.mk-holdout.is-masked {
  background: var(--surface-1);
  box-shadow: inset 0 0 0 2.5px var(--reveal), 0 0 0 2px var(--surface-0);
}

.mk-holdout-wrap .mk-label {
  position: absolute; left: 22px; top: 50%; transform: translateY(-50%);
}

.mk-train {
  width: 9px; height: 9px; border-radius: 50%;
  background: transparent; border: 1.5px solid var(--ink-3);
}

.mk-label {
  font-family: var(--font); font-size: 10.5px; font-weight: 600;
  color: var(--ink-1); white-space: nowrap;
  text-shadow: 0 0 4px var(--surface-0), 0 0 8px var(--surface-0);
  pointer-events: none;
}

/* --------------------------------------------------------- map furniture -- */

.map-legend {
  position: absolute; left: 16px; bottom: 16px; z-index: 4;
  background: rgba(26, 26, 25, 0.93);
  border: 1px solid var(--rule-strong); border-radius: 7px;
  padding: 10px 12px; font-size: 11.5px;
  backdrop-filter: blur(6px);
}
.map-legend h4 {
  font-size: 10px; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 7px;
}

.map-hint {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%);
  z-index: 4; background: rgba(26, 26, 25, 0.93);
  border: 1px solid var(--rule-strong); border-radius: 20px;
  padding: 6px 15px; font-size: 11.5px; color: var(--ink-3);
  backdrop-filter: blur(6px);
  transition: opacity 0.3s ease;
}
.map-hint[hidden] { display: none; }

.maplibregl-ctrl-group { background: var(--surface-1) !important; border: 1px solid var(--rule-strong) !important; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--rule) !important; }
.maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(0.82); }
.maplibregl-ctrl-scale {
  background: rgba(26, 26, 25, 0.9) !important;
  border-color: var(--rule-strong) !important;
  color: var(--ink-3) !important; font-family: var(--font) !important; font-size: 10.5px !important;
}
.maplibregl-ctrl-attrib { background: rgba(26, 26, 25, 0.86) !important; }
.maplibregl-ctrl-attrib a { color: var(--ink-3) !important; }

/* ---------------------------------------------------------------- about -- */

.about { border-top: 1px solid var(--rule); background: var(--surface-0); }
.about-inner { max-width: 1120px; margin: 0 auto; padding: 60px 40px 76px; }

.about h2 { font-size: 25px; letter-spacing: -0.01em; margin-bottom: 10px; }
.about .section-lede { font-size: 15px; color: var(--ink-2); max-width: 68ch; }

.about-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 34px; margin-top: 38px;
}
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } }

.figure {
  background: var(--surface-1);
  border: 1px solid var(--rule);
  border-radius: 8px; padding: 15px; margin: 0;
}
.figure img { width: 100%; height: auto; display: block; border-radius: 4px; background: #fff; }
.figure figcaption { font-size: 11.5px; color: var(--ink-3); margin-top: 11px; line-height: 1.5; }
.figure figcaption b { color: var(--ink-2); font-weight: 600; }

.about h3 { font-size: 16px; margin: 34px 0 12px; }
.about h3:first-child { margin-top: 0; }
.prose { max-width: 68ch; }
.prose p { color: var(--ink-2); }

.limits { list-style: none; margin: 0; padding: 0; max-width: 78ch; counter-reset: lim; }
.limits li {
  counter-increment: lim;
  position: relative;
  padding: 11px 0 11px 38px;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
}
.limits li:last-child { border-bottom: 0; }
.limits li::before {
  content: counter(lim);
  position: absolute; left: 0; top: 11px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface-2); color: var(--ink-3);
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: center;
}
.limits b { color: var(--ink-1); }

.metrics-table { width: 100%; border-collapse: collapse; font-size: 13px; max-width: 620px; }
.metrics-table th, .metrics-table td {
  text-align: left; padding: 9px 14px 9px 0;
  border-bottom: 1px solid var(--rule);
}
.metrics-table th {
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
}
.metrics-table td { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.metrics-table td:first-child { color: var(--ink-1); font-variant-numeric: normal; }
.metrics-table .em { color: var(--ink-1); font-weight: 600; }

.colophon {
  margin-top: 52px; padding-top: 22px;
  border-top: 1px solid var(--rule);
  font-size: 11.5px; color: var(--ink-3);
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}

.scroll-cue {
  position: absolute; right: 16px; bottom: 16px; z-index: 4;
  font-size: 11px; color: var(--ink-3);
  background: rgba(26, 26, 25, 0.93);
  border: 1px solid var(--rule-strong); border-radius: 20px;
  padding: 6px 14px; text-decoration: none;
  backdrop-filter: blur(6px);
}
.scroll-cue:hover { color: var(--ink-1); border-color: var(--ink-3); }

/* ------------------------------------------------------------ narrow UI -- */

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; height: auto; }
  .map-wrap { height: 74vh; }
  #inspector { width: 262px; }
  .reveal-stats { grid-template-columns: repeat(2, 1fr); }
  .about-inner { padding: 44px 22px 56px; }
}

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