/* Mintmark public site. Static, self-contained, no CDN — same rule as the
   engine's own dashboard. Tokens follow the validated reference palette
   (dataviz method): ink for text, categorical slots for identity in diagrams,
   status colors for verdict states, emerald reserved for brand chrome only. */

:root {
  color-scheme: light;
  --plane: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --hairline: #e1e0d9;
  --baseline: #c3c2b7;
  --ring: rgba(11, 11, 11, 0.10);

  --brand: #047857;          /* emerald chrome: links, wordmark, accents */
  --brand-ink: #065f46;

  --slot-1: #2a78d6;         /* identity: compute / services   */
  --slot-2: #eb6834;         /* identity: storage / records    */
  --slot-3: #1baf7a;         /* identity: human surfaces       */

  --role-4: #4a3aa7;         /* identity: the Tidewaiter (violet) */
  --role-5: #eda100;         /* identity: the Binder (amber)      */
  --role-6: #e87ba4;         /* identity: the Gauger (magenta)    */

  --status-good: #0ca30c;    /* commit  */
  --status-warn: #fab219;    /* stage   */
  --status-crit: #d03b3b;    /* block   */
  --good-text: #006300;

  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --plane: #0d0d0d;
    --surface: #1a1a19;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --hairline: #2c2c2a;
    --baseline: #383835;
    --ring: rgba(255, 255, 255, 0.10);
    --brand: #34d399;
    --brand-ink: #6ee7b7;
    --slot-1: #3987e5;
    --slot-2: #d95926;
    --slot-3: #199e70;
    --role-4: #9085e9;
    --role-5: #c98500;
    --role-6: #d55181;
    --good-text: #0ca30c;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --plane: #0d0d0d;
  --surface: #1a1a19;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --hairline: #2c2c2a;
  --baseline: #383835;
  --ring: rgba(255, 255, 255, 0.10);
  --brand: #34d399;
  --brand-ink: #6ee7b7;
  --slot-1: #3987e5;
  --slot-2: #d95926;
  --slot-3: #199e70;
  --role-4: #9085e9;
  --role-5: #c98500;
  --role-6: #d55181;
  --good-text: #0ca30c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--plane);
  color: var(--ink);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre {
  font-family: var(--mono);
  font-size: 0.86em;
}
code {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 0.08em 0.35em;
}
pre {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 14px 18px;
  overflow-x: auto;
  line-height: 1.55;
}
pre code { background: none; border: none; padding: 0; }

/* ---- layout ---- */
.wrap { max-width: 880px; margin: 0 auto; padding: 0 24px; }

header.site {
  border-bottom: 1px solid var(--hairline);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 5;
}
header.site .wrap {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 56px;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--ink);
  font-size: 17px;
}
.wordmark:hover { text-decoration: none; }
.wordmark svg { display: block; }
nav.site { display: flex; gap: 18px; margin-left: auto; }
nav.site a { color: var(--ink-2); font-size: 14.5px; }
nav.site a[aria-current="page"] { color: var(--ink); font-weight: 600; }
#theme-toggle {
  border: 1px solid var(--hairline);
  background: none;
  color: var(--ink-2);
  border-radius: 6px;
  width: 30px; height: 30px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

main { padding: 48px 0 80px; }

h1 { font-size: 34px; line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 10px; }
h2 { font-size: 23px; letter-spacing: -0.01em; margin: 52px 0 12px; }
h3 { font-size: 17px; margin: 30px 0 8px; }
p, ul, ol { color: var(--ink-2); max-width: 68ch; }
li { margin: 4px 0; }
strong { color: var(--ink); }
.lede { font-size: 19px; line-height: 1.6; }
.kicker {
  color: var(--brand);
  font-size: 13px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 6px;
}

hr { border: none; border-top: 1px solid var(--hairline); margin: 48px 0; }

/* ---- cards / pillars ---- */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 30px 0; }
@media (max-width: 720px) { .pillars { grid-template-columns: 1fr; } }
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 18px 20px;
}
.card h3 { margin: 0 0 6px; font-size: 15.5px; }
.card p { font-size: 14px; margin: 0; line-height: 1.55; }

/* ---- component roster ---- */
.roster { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 26px 0; }
@media (max-width: 720px) { .roster { grid-template-columns: 1fr; } }
.roster .card { display: grid; grid-template-columns: 46px 1fr; gap: 14px; }
.roster .card .avatar { grid-row: 1 / span 2; }
.roster .card h3 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }

/* role avatars: a coin-shaped badge, one hue per office, icon + adjacent
   text label always together (color never carries identity alone) */
.avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--role, var(--brand));
  background: color-mix(in srgb, var(--role, var(--brand)) 10%, var(--surface));
  color: var(--role, var(--brand));
  flex: none;
}
.avatar svg { display: block; }
.avatar.role-braingate    { --role: var(--slot-1); }
.avatar.role-exchequer    { --role: var(--slot-2); }
.avatar.role-remembrancer { --role: var(--slot-3); }
.avatar.role-customs      { --role: var(--role-4); }
.avatar.role-binder       { --role: var(--role-5); }
.avatar.role-gauger       { --role: var(--role-6); }
.roster .card h3 .tag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}

/* ---- figures / diagrams ---- */
figure.diagram {
  margin: 26px 0;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 20px 18px 12px;
  overflow-x: auto;
}
figure.diagram svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }
figure.diagram figcaption {
  color: var(--muted);
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-top: 12px;
  font-size: 13px;
  color: var(--ink-2);
}
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.legend .swatch {
  width: 11px; height: 11px;
  border-radius: 3px;
  display: inline-block;
}

/* ---- tables ---- */
table { border-collapse: collapse; width: 100%; margin: 18px 0; font-size: 14.5px; }
th {
  text-align: left;
  color: var(--muted);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  padding: 8px 12px 6px;
  border-bottom: 1px solid var(--baseline);
}
td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-2);
  vertical-align: top;
}
td:first-child { color: var(--ink); white-space: nowrap; }
tr:last-child td { border-bottom: none; }

/* ---- status chips: color never alone (icon + label) ---- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink);
  white-space: nowrap;
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip.good .dot { background: var(--status-good); }
.chip.warn .dot { background: var(--status-warn); }
.chip.crit .dot { background: var(--status-crit); }

/* ---- home hero ---- */
.hero { padding: 26px 0 8px; }
.hero .mark-line {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.cta-row { display: flex; gap: 12px; margin: 26px 0 8px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid var(--hairline);
  color: var(--ink);
  background: var(--surface);
}
.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
:root[data-theme="dark"] .btn.primary { color: #062a1e; }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .btn.primary { color: #062a1e; }
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }

/* ---- flow strip (home) ---- */
.flow-strip {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 26px 0;
  overflow-x: auto;
  padding-bottom: 4px;
}
.flow-strip .step {
  flex: 1 1 0;
  min-width: 104px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-2);
  position: relative;
  margin-right: 22px;
}
.flow-strip .step:last-child { margin-right: 0; }
.flow-strip .step::after {
  content: "→";
  position: absolute;
  right: -19px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--baseline);
  font-size: 15px;
}
.flow-strip .step:last-child::after { content: none; }
.flow-strip .step b { display: block; color: var(--ink); font-size: 13.5px; margin-bottom: 2px; }

footer.site {
  border-top: 1px solid var(--hairline);
  padding: 26px 0 40px;
  color: var(--muted);
  font-size: 13.5px;
}
footer.site .wrap { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
