/* admin-fonts.css — the three self-hosted faces of the KasirBiru admin surfaces.
 *
 * Inter carries text, Space Grotesk carries headings and figures, JetBrains Mono
 * carries identifiers. The families themselves are authored in
 * design/tokens/laundry.tokens.json (`type-bo.font-family-*`) and reach CSS as
 * --sn-font-family / -display / -mono through gen/admin-theme.css; this file only
 * declares the @font-face sources and says which elements take which family.
 *
 * SELF-HOSTED, never a CDN. `default-src 'self'` (pkg/webui/secheaders.go) would
 * reject fonts.gstatic.com outright, and the design mockup's Google Fonts <link>
 * is the one thing in it that could not be ported as written. The upside is the
 * one pkg/webui/static/base.css already records: changing the product's typeface
 * cost zero CSP change, and it still does.
 *
 * The src URLs are RELATIVE for the same reason base.css's are: this file is
 * served at <mount>/static/admin-fonts.css and a root-absolute path would resolve
 * against the host root, not the mount.
 *
 * Latin subsets only. Indonesian is fully covered by latin; shipping latin-ext,
 * Cyrillic and Greek would have quadrupled 180 KB for glyphs no screen renders.
 *
 * WEIGHTS ARE DELIBERATELY SPARSE. Inter has 400/500/600/700 because the ramp in
 * type-bo uses all four. Space Grotesk starts at 500 — it is never body text, so
 * a 400 would be dead weight. JetBrains Mono ships 500/600 and NO 400: it renders
 * shift codes and licence keys, always at label weight or heavier. If a 400 mono
 * is ever genuinely needed, take it from @fontsource/jetbrains-mono rather than
 * letting the browser synthesise one. */

@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/SpaceGrotesk-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/SpaceGrotesk-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/SpaceGrotesk-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/JetBrainsMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/JetBrainsMono-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---- who gets which family ------------------------------------------------
 *
 * body already reads --sn-font-family in base.css, so Inter arrives with no rule
 * here. Only the two departures from body text need saying. */

h1, h2, h3, h4, h5, h6,
.card-title,
.app-title,
.kpi-value,
.stat {
  font-family: var(--sn-font-family-display);
  letter-spacing: -0.01em;
}

/* Identifiers and quantities: anything a person reads DIGIT BY DIGIT rather than
 * as a word. A proportional 0/O or 1/l costs a support ticket when the string is
 * a licence key being read down a phone line. `.num` also takes tabular figures
 * so a column of rupiah stays in a column. */
.num,
.num-positive,
.num-negative,
code,
kbd,
samp {
  font-family: var(--sn-font-family-mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Figures inside a heading keep Space Grotesk — it has tabular numerals of its
 * own, and swapping mid-heading would break the line's colour. */
h1 .num, h2 .num, h3 .num, h4 .num, h5 .num, h6 .num,
.kpi-value .num, .stat .num {
  font-family: inherit;
  font-weight: inherit;
}
