/* Self-hosted so the workspace and portal typefaces load under the same-origin CSP.
   `optional` avoids late layout shifts, so every face here must also be preloaded by the page. */
@font-face {
  font-family: Figtree;
  font-style: normal;
  font-weight: 300 900;
  font-display: optional;
  src: url("/assets/fonts/figtree-variable-latin.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: optional;
  src: url("/assets/fonts/ibm-plex-mono-latin-400.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: optional;
  src: url("/assets/fonts/ibm-plex-mono-latin-500.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: optional;
  src: url("/assets/fonts/ibm-plex-mono-latin-600.woff2") format("woff2");
}

/* The product type system. Workspace and portal CSS may only use these tokens;
   scripts/check-typography.mjs enforces it in npm run build. :host serves the landing hero's IDE shadow root. */
:root,
:host {
  --font-ui: Figtree, system-ui, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  /* Counts, keycaps, badges and diagram pin labels only. */
  --text-2xs: 10px;
  /* Uppercase labels, metadata and timestamps. */
  --text-xs: 11px;
  /* Dense data: tree rows, tables, tags and code. */
  --text-sm: 12px;
  /* Default control and body text. */
  --text-md: 13px;
  /* Dialog body and emphasized body text. */
  --text-lg: 14px;
  /* Panel and section titles. */
  --text-xl: 16px;
  /* Page and dialog titles. */
  --text-2xl: 20px;
  /* Empty-state and page hero headings. */
  --text-3xl: 24px;
  /* The few landing headings of a whole page. */
  --text-display: clamp(28px, 3vw, 36px);
  /* Inline runs inside text of any size, such as inline code. */
  --text-inline: .9em;

  /* Uppercase labels. */
  --tracking-caps: .06em;
  /* Titles from --text-xl up. */
  --tracking-tight: -.01em;
  /* --text-3xl and --text-display headings. */
  --tracking-display: -.03em;
}
