/* PROSPECT — the survey. Paper is the surface, forest is the ink, gold only ever touches ore.
   Tokens are the ones the art direction fixed; nothing here invents a colour. */
:root {
  --paper: #F3F1DC;
  --paper-raised: #FAF8E9;
  --paper-recessed: #E5E5CC;
  --ink: #07200F;
  --forest: #0E4A2B;
  --ink-2: #42604A;
  --rule: #A6B29A;
  --ore: #E8B23A;

  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --display: "Silkscreen", var(--mono);

  --gutter: 32px;
  --nav: 64px;
  --max: 1376px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--forest); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
img { max-width: 100%; height: auto; display: block; }

/* ---- the measuring language: labels, data, numbers ------------------------------------- */
.label {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}
.data { font-family: var(--mono); font-size: 14px; line-height: 20px; font-variant-numeric: tabular-nums; }
.readout {
  font-family: var(--mono);
  font-size: 32px;
  line-height: 36px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.readout.small { font-size: 22px; line-height: 28px; }
.muted { color: var(--ink-2); }
.note { font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.nodata { color: var(--rule); }

/* ---- shell ------------------------------------------------------------------------------ */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

nav.top {
  height: var(--nav);
  border-bottom: 1px solid var(--ink);
  display: flex; align-items: center; gap: 28px;
  position: sticky; top: 0; z-index: 40;
  background: var(--paper);
}
nav.top .brand {
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  display: flex; align-items: center; gap: 10px;
}
nav.top .brand svg { display: block; }
nav.top .links { display: flex; gap: 22px; margin-left: auto; align-items: center; }
nav.top .links a {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-2); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent;
}
nav.top .links a:hover { color: var(--ink); }
nav.top .links a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--forest); }

/* ---- panels: corner brackets, never a filled pill ---------------------------------------- */
.panel { position: relative; border: 1px solid var(--rule); background: var(--paper-raised); padding: 18px 20px; }
.panel.flat { background: transparent; }
.panel::before, .panel::after {
  content: ""; position: absolute; width: 10px; height: 10px; border: 2px solid var(--forest);
}
.panel::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.panel::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.panel h2, .panel h3 { margin: 0 0 12px; font-family: var(--mono); font-size: 14px; letter-spacing: 0.05em; text-transform: uppercase; font-weight: 600; }

.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* ---- the allocation rail: the one thing that must never leave the screen ------------------ */
.rail { border-bottom: 1px solid var(--ink); background: var(--paper); }
.rail .cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 16px 0 14px; }
.rail .cell .label { display: block; margin-bottom: 2px; }
.rail .cell .note { margin-top: 2px; }
.rail .formula {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--ink-2);
  padding: 0 0 12px; text-transform: uppercase;
}
.rail .formula b { color: var(--ink); font-weight: 600; }

/* ---- steps: the numbered sequence runs HORIZONTALLY, above the work --------------------- */
.steps { display: flex; gap: 0; border-bottom: 1px solid var(--rule); }
.steps .step {
  flex: 1; padding: 10px 14px; display: flex; gap: 10px; align-items: baseline;
  border-right: 1px solid var(--rule);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-2);
}
.steps .step:last-child { border-right: 0; }
.steps .step b { color: var(--ink); font-weight: 600; }
.steps .step[data-state="active"] { background: var(--paper-recessed); color: var(--ink); }
.steps .step[data-state="locked"] { color: var(--rule); }

/* ---- buttons: solid forest, cream label. Gold is not a call to action. ------------------- */
.btn {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--forest); color: var(--paper); border: 1px solid var(--forest);
  padding: 11px 18px; cursor: pointer; display: inline-block; text-decoration: none;
}
.btn:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn[disabled], .btn.is-disabled { background: transparent; color: var(--rule); border-color: var(--rule); cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--forest); }
.btn.ghost:hover { background: var(--paper-recessed); color: var(--ink); }

.tabs { display: flex; gap: 6px; }
.tabs button {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase;
  background: transparent; border: 1px solid var(--rule); color: var(--ink-2); padding: 6px 12px; cursor: pointer;
}
.tabs button[aria-pressed="true"] { border-color: var(--forest); color: var(--ink); background: var(--paper-recessed); }

input[type="text"], input[type="number"] {
  font-family: var(--mono); font-size: 14px; background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule); padding: 10px 12px; width: 100%;
}
input:focus { outline: 2px solid var(--forest); outline-offset: 1px; }

/* ---- tables ----------------------------------------------------------------------------- */
table.data-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 13px; }
table.data-table th {
  text-align: left; font-weight: 500; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-2); border-bottom: 1px solid var(--ink); padding: 8px 10px 6px;
}
table.data-table td { padding: 8px 10px; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
table.data-table tr:last-child td { border-bottom: 0; }
table.data-table td.num, table.data-table th.num { text-align: right; }

/* ---- the board -------------------------------------------------------------------------- */
.board-wrap { background: var(--paper-raised); border: 1px solid var(--rule); padding: 16px; overflow: auto; }
#board { display: block; margin: 0 auto; max-width: 100%; height: auto; touch-action: manipulation; }
#board .cell { cursor: pointer; }
#board .cell:focus { outline: none; }
.legend { display: flex; flex-wrap: wrap; gap: 18px 26px; align-items: center; padding-top: 14px; }
.legend .item { display: flex; gap: 8px; align-items: center; font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.legend svg { display: block; }

.hovercard {
  position: fixed; z-index: 60; pointer-events: none; background: var(--paper-raised);
  border: 1px solid var(--ink); padding: 8px 10px; font-family: var(--mono); font-size: 12px;
  line-height: 1.5; box-shadow: 3px 3px 0 var(--ink); display: none; max-width: 240px;
}
.hovercard b { font-weight: 600; }

/* ---- layout: work surface + inspector ---------------------------------------------------- */
.work { display: grid; grid-template-columns: minmax(0, 1fr) 384px; gap: 24px; padding: 24px 0 40px; align-items: start; }
.work .inspector { position: sticky; top: calc(var(--nav) + 16px); }

.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-family: var(--mono); font-size: 13px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.kv .strong { font-weight: 600; }

/* ---- a bar that shows a share, without colour being the only channel -------------------- */
.share-bar { height: 22px; border: 1px solid var(--ink); display: flex; background: var(--paper); margin: 8px 0 6px; }
.share-bar .mine { background: var(--forest); }
.share-bar .theirs { background: repeating-linear-gradient(135deg, var(--paper) 0 3px, var(--paper-recessed) 3px 6px); }

/* ---- banners ---------------------------------------------------------------------------- */
.banner {
  border: 2px solid var(--forest); background: var(--paper-recessed);
  padding: 12px 16px; display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap;
}
.banner .tag { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }
.banner p { margin: 0; font-size: 13.5px; }

/* ---- landing ---------------------------------------------------------------------------- */
.hero { display: grid; grid-template-columns: 5fr 7fr; align-items: center; gap: 0; padding: 0; }
.hero .copy { padding: 56px 40px 56px 0; }
.hero h1 { font-family: var(--display); font-size: 46px; line-height: 1.12; margin: 0 0 18px; letter-spacing: 0.01em; }
.hero .lede { font-size: 17px; line-height: 1.55; max-width: 34ch; margin: 0 0 26px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .art { margin-right: calc(var(--gutter) * -1); }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.facts .fact { padding: 20px 22px 18px; border-right: 1px solid var(--rule); }
.facts .fact:last-child { border-right: 0; }

.seven { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border-top: 1px solid var(--rule); }
.seven article { padding: 26px 26px 26px 0; border-bottom: 1px solid var(--rule); }
.seven article:nth-child(even) { padding-left: 26px; border-left: 1px solid var(--rule); }
.seven h3 { font-family: var(--mono); font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 8px; }
.seven .n { font-family: var(--display); font-size: 13px; color: var(--forest); display: block; margin-bottom: 10px; }
.seven p { margin: 0 0 8px; font-size: 14.5px; }

footer.foot { border-top: 1px solid var(--ink); margin-top: 48px; padding: 22px 0 40px; display: flex; gap: 20px; flex-wrap: wrap; align-items: baseline; }
footer.foot .label { margin-right: auto; }

/* ---- mobile: the board stops being a purchase surface and becomes a map ----------------- */
@media (max-width: 1100px) {
  .work { grid-template-columns: 1fr; }
  .work .inspector { position: static; }
  .hero { grid-template-columns: 1fr; }
  .hero .copy { padding: 34px 0 24px; }
  .hero .art { margin-right: 0; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .facts .fact:nth-child(2) { border-right: 0; }
  .facts .fact:nth-child(1), .facts .fact:nth-child(2) { border-bottom: 1px solid var(--rule); }
  .rail .cols { grid-template-columns: repeat(2, 1fr); gap: 14px 24px; }
}
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  body { font-size: 15px; }
  .hero h1 { font-size: 32px; }
  .seven { grid-template-columns: 1fr; }
  .seven article, .seven article:nth-child(even) { padding: 22px 0; border-left: 0; }
  .steps { overflow-x: auto; }
  .steps .step { white-space: nowrap; }
  /* Five links, a status chip and a call to action do not fit in 390px. The nav becomes two rows,
     the second one a scrollable strip, instead of pushing the page 188px wide. */
  nav.top { height: auto; padding: 10px 0; gap: 8px; }
  nav.top .wrap { flex-wrap: wrap; }
  nav.top .links {
    order: 2; width: 100%; margin-left: 0; gap: 16px; padding-top: 10px;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  nav.top .links::-webkit-scrollbar { display: none; }
  nav.top .links a { font-size: 11px; white-space: nowrap; }
  nav.top .links .btn { padding: 7px 12px; }
  nav.top #chainchip { white-space: nowrap; }
  .readout { font-size: 26px; line-height: 30px; }
  .board-wrap { padding: 8px; }
  input[type="text"], input[type="number"] { font-size: 16px; }
}
