/* ui/tokens.css — the "Ledger" design tokens (docs/DESIGN.md, section 1).
   Every color, type size, spacing and rule used by the site and the app is here;
   no other stylesheet may introduce a value that is not a token. */

/* Fonts: two families, self-hosted, four weights in total (Instrument Sans is one
   variable file covering 400–700; Courier Prime 400 and 700). */
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/ui/fonts/InstrumentSans-Variable.woff2") format("woff2");
}
@font-face {
  font-family: "Courier Prime";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/ui/fonts/CourierPrime-400.woff2") format("woff2");
}
@font-face {
  font-family: "Courier Prime";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/ui/fonts/CourierPrime-700.woff2") format("woff2");
}

:root {
  /* Color */
  --paper: #FBFAF7;
  --paper-2: #F3F1EA;
  --card: #FFFFFF;
  --ink: #141A24;
  --ink-2: #4A5468;
  --ink-3: #626C7C;
  --rule: #E6E3DA;
  --shadow: #E4E1D8;
  --blue: #1B3A6B;
  --blue-2: #2E5597;
  --stamp: #C8352C;
  --stamp-bg: #FBEAE8;
  --pass: #1B6B4A;
  --pass-bg: #E6F2EC;
  --pending: #7A6C29;

  /* Type */
  --font-body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --font-chrome: "Courier Prime", "Courier New", Courier, monospace;
  --fs-caption: 13px;   --lh-caption: 1.5;
  --fs-body: 14.5px;    --lh-body: 1.6;
  --fs-lead: 16.5px;    --lh-lead: 1.5;
  --fs-h4: 20px;        --lh-h4: 1.35;
  --fs-h3: 26px;        --lh-h3: 1.25;
  --fs-h2: 34px;        --lh-h2: 1.15;
  --fs-h1-site: 49px;   --lh-h1-site: 1.06;
  --fs-h1-app: 30px;    --lh-h1-app: 1.15;
  --fs-footer: 11.5px;
  --fs-stamp: 13px;
  --ls-display: -0.03em;
  --ls-body: 0;
  --ls-chrome: 0.06em;
  --ls-stamp: 0.11em;
  --measure: 62ch;

  /* Layout */
  --site-max: 1180px;
  --site-gutter: 34px;
  --site-gap: 24px;
  --app-gutter: 30px;
  --rule-structure: 1.5px;
  --rule-inside: 1px;
  --radius-control: 3px;
  --stamp-border: 2.5px;
  --shadow-offset: 7px;

  /* Motion (the only three; docs/DESIGN.md "Motion") */
  --motion-stamp: 160ms;
  --motion-ledger-stagger: 40ms;
  --motion-rule: 260ms;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: var(--ls-display); color: var(--ink); }
h1 { font-size: var(--fs-h1-app); line-height: var(--lh-h1-app); font-weight: 700; }
h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: 700; }
h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); }
h4, .h4 { font-size: var(--fs-h4); line-height: var(--lh-h4); font-weight: 600; }
p { margin: 0 0 1em; max-width: var(--measure); }
.lead { font-size: var(--fs-lead); line-height: var(--lh-lead); color: var(--ink-2); }
.caption { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--ink-3); }
a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--blue-2); }
.chrome, code, kbd { font-family: var(--font-chrome); letter-spacing: var(--ls-chrome); }
code { font-size: 0.95em; }

/* Focus: every interactive element, 2px blue, offset 2px. */
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* Controls share the 3px radius; nothing else is rounded. */
button, input, select, textarea { font: inherit; color: inherit; border-radius: var(--radius-control); }

/* Screen-reader only text. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
