/*
 * ConnectID theme — tokens derived from ConnectID_Brand_Guidelines_V1.1.pdf
 * (see docs/connectid-ux-notes.md for the distillation and clause refs).
 *
 * Load-bearing brand rules encoded here:
 *  - Primary trio Mint #BEEDD2 / Charcoal #262626 / White; Mint appears in
 *    every layout (the notice strip), primaries >= 90% of any layout.
 *  - Never Mint on White or White on Mint (3.4); AAA pairs only for type.
 *  - ALL UI buttons are Charcoal + White pills (2.9) — never Mint CTAs (3.5).
 *  - DM Sans Regular/Medium/Bold, Arial fallback (4.1/4.2); no italics, no
 *    heavy body copy (4.4).
 *  - No background gradients, no palette-external colours on brand surfaces
 *    (3.5). Functional red/amber in DIAGNOSTIC panes only (wire detail,
 *    matrix cells) — data visualisation, not brand voice.
 *  - The symbol is never redrawn (2.11) — wordmark is set in type only.
 * Every branded surface carries the demonstration-only notice.
 */
@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/DMSans.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* Primary palette (3.1) */
  --cid-mint: #BEEDD2;
  --cid-charcoal: #262626;
  --cid-white: #ffffff;
  /* Highlights (3.2) — <=10% of any layout */
  --cid-sky: #97B6D3;
  --cid-navy: #01183D;
  --cid-beige: #FFF2EB;

  --cid-ink: var(--cid-charcoal);
  --cid-grey: rgba(38, 38, 38, 0.62);
  --cid-line: rgba(38, 38, 38, 0.18);
  --cid-bg: var(--cid-white);
  --cid-panel: rgba(38, 38, 38, 0.045);
  --cid-accent: var(--cid-charcoal);
  --cid-accent-ink: var(--cid-white);
  /* Functional (diagnostics only, not brand surfaces) */
  --cid-ok: #1d6b4a;
  --cid-err: #c0392b;
  --cid-warn: #c9a227;
  --cid-radius: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: 'DM Sans', Arial, -apple-system, system-ui, sans-serif;
  color: var(--cid-ink);
  background: var(--cid-bg);
  line-height: 1.55;
  font-style: normal;
}
em, i { font-style: normal; font-weight: 500; } /* 4.4: avoid italics */
main { max-width: 880px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

/* Mint present in every layout (3.3): the demo notice is the mint strip. */
.demo-notice {
  background: var(--cid-mint); color: var(--cid-charcoal);
  font-size: .78rem; text-align: center; padding: .4rem .75rem;
}

header.cid {
  border-bottom: 1px solid var(--cid-line);
  background: var(--cid-bg);
}
header.cid .bar {
  max-width: 880px; margin: 0 auto; padding: .9rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
}
/* Wordmark in type only — the symbol is never redrawn (2.11). */
header.cid .wordmark { font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
header.cid nav { margin-left: auto; display: flex; gap: 1rem; font-size: .92rem; }
header.cid nav a { color: var(--cid-grey); text-decoration: none; }
header.cid nav a[aria-current] { color: var(--cid-ink); font-weight: 500; }

h1 { font-size: 1.6rem; font-weight: 400; letter-spacing: -.02em; margin: 1rem 0 .35rem; }
h2 { font-size: 1.05rem; font-weight: 700; margin: 1.8rem 0 .5rem; }
p.lede { color: var(--cid-grey); margin-top: 0; }

.card {
  background: var(--cid-bg); border: 1px solid var(--cid-line);
  border-radius: var(--cid-radius); padding: 1.1rem 1.2rem; margin: 1rem 0;
}
.card.panel { background: var(--cid-panel); border-color: transparent; }
.card.mint { background: var(--cid-mint); border-color: transparent; color: var(--cid-charcoal); }

/* 2.9: UI buttons always Charcoal + White, pill-shaped. */
button, .btn {
  font: inherit; font-weight: 500; cursor: pointer;
  background: var(--cid-charcoal); color: var(--cid-white);
  border: 0; border-radius: 999px;
  padding: .7rem 1.4rem; font-size: 1rem;
}
button.ghost { background: transparent; color: var(--cid-charcoal); border: 1px solid var(--cid-charcoal); }
button:disabled { opacity: .45; cursor: default; }

label { display: block; font-size: .85rem; color: var(--cid-grey); margin: .6rem 0 .2rem; }
select, input[type="text"] {
  font: inherit; width: 100%; padding: .55rem .7rem;
  border: 1px solid var(--cid-line); border-radius: 8px; background: var(--cid-bg);
  color: var(--cid-ink);
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

/* Wire/diagnostic panes: charcoal ground, mint-tinted mono text (AAA pair). */
pre.wire {
  background: var(--cid-charcoal); color: var(--cid-mint); font-size: .78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  border-radius: 8px; padding: .8rem; overflow-x: auto; max-height: 320px;
}
.status { display: flex; align-items: center; gap: .5rem; font-weight: 500; margin: .6rem 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cid-warn); flex: none; }
.dot.ok { background: var(--cid-ok); } .dot.err { background: var(--cid-err); }

table.matrix { border-collapse: collapse; width: 100%; font-size: .85rem; }
table.matrix th, table.matrix td { border: 1px solid var(--cid-line); padding: .45rem .5rem; text-align: center; }
table.matrix th { background: var(--cid-panel); font-weight: 500; }
table.matrix td.pass { background: var(--cid-mint); color: var(--cid-charcoal); font-weight: 700; }
table.matrix td.fail { background: var(--cid-beige); color: var(--cid-err); font-weight: 700; }
table.matrix td.none { color: var(--cid-line); }

.qr { width: 220px; margin: .6rem 0; }
.qr svg { width: 100%; height: auto; }
footer { color: var(--cid-grey); font-size: .8rem; margin-top: 3rem; border-top: 1px solid var(--cid-line); padding-top: 1rem; }
/* 2.1: mandatory trademark footnote wherever ConnectID is written. */
footer .tm::after {
  content: "® ConnectID is a registered trademark of eftpos Digital Identity Pty Ltd 80 648 970 101.";
  display: block; margin-top: .3rem; font-size: .72rem;
}

/* Findings article */
article.findings h1 { font-size: 1.5rem; }
article.findings table { border-collapse: collapse; font-size: .88rem; }
article.findings th, article.findings td { border: 1px solid var(--cid-line); padding: .4rem .55rem; text-align: left; }
article.findings code { background: var(--cid-panel); padding: .1rem .3rem; border-radius: 4px; font-size: .85em; }
