/* m7kni.io fleet brand — the shared visual layer for every m7kni docs site.
 *
 * ┌─ DESIGN SEAM ───────────────────────────────────────────────────────────┐
 * │ SOURCE OF TRUTH: the "m7kni Design System" Claude Design project,        │
 * │ specifically `guidelines/docs-sites.md` and `guidelines/brand.css`.      │
 * │ This file is that guideline applied. When the design system moves, edit  │
 * │ it there first, then port the change here — not the other way round.     │
 * │                                                                          │
 * │ It must keep expressing itself as Material/Zensical custom properties    │
 * │ (--md-*) plus `.m7-*` classes. Zensical renders Material's HTML and we   │
 * │ do not control that markup, so the system's React component library      │
 * │ (components/**) cannot drop in here — it targets product surfaces.       │
 * └──────────────────────────────────────────────────────────────────────────┘
 *
 * OWNED BY THE HUB. Copied into each child clone at build time, and into the
 * hub's own docs/stylesheets/ — a repo must not keep a tracked copy.
 *
 * LOAD ORDER: first, before the repo's own project.css. The design system's
 * copy of this file says "loaded LAST in extra_css so these tokens win over
 * per-repo colours"; that was written for the pre-inversion fleet, where each
 * repo owned its own palette and brand had to beat it. Under the inverted
 * model a project stylesheet carries components only and never branding, so
 * brand goes first and per-project components build on these tokens.
 *
 * DELIBERATELY RESTRAINED, and the restraint is the design system's own
 * instruction, not our caution. From guidelines/docs-sites.md: unify colour
 * and type, then stop. Body size, line-height, nav, TOC, admonition shapes,
 * table styling and search stay as the theme ships them — "the theme has
 * spent years on those; this system has no opinion that beats them."
 *
 * FONTS ARE SELF-HOSTED, and they have to be. The obvious route is
 * `theme.font.text = "Geist"`, which makes Zensical emit a Google Fonts link,
 * plus the privacy plugin to pull those files local at build time. That does
 * not work here: ZENSICAL DOES NOT IMPLEMENT THE PRIVACY PLUGIN
 * (zensical/backlog#35, still open). Configuring it is silently inert — the
 * fleet has carried `[project.plugins.privacy]` since the migration and every
 * built page still linked fonts.gstatic.com. Measured on a real build, not
 * assumed. So `theme.font = false` turns the Google link off entirely and the
 * faces below are served from the site's own origin.
 *
 * The two variable woff2 files are google/fonts builds under the SIL Open
 * Font License 1.1, converted from the TTFs the design system vendors; the
 * licence texts sit beside them in shared/fonts/.
 */

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono-Variable.woff2") format("woff2-variations");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Accent — the one colour that means "interactive". */
  --md-primary-fg-color: #2563eb;
  --md-primary-fg-color--light: #4f8cff;
  --md-primary-fg-color--dark: #1d4ed8;
  --md-accent-fg-color: #1d4ed8;

  /* Surfaces — cool ink on warm paper, matching the products. The canvas
   * carries a trace of warmth (hue 85) while text greys stay cool (hue 260);
   * that pairing is what keeps a dense reference page from reading clinical. */
  --md-default-bg-color: #ffffff;
  --md-code-bg-color: oklch(0.945 0.009 85);
  --md-typeset-table-color: oklch(0.9 0.007 85);

  /* Geist for everything, JetBrains Mono for machine text. Set as variables
   * rather than font-family, which is what preserves the system fallback. */
  --md-text-font: "Geist", ui-sans-serif, system-ui, sans-serif;
  --md-code-font: "JetBrains Mono", ui-monospace, monospace;
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #4f8cff;
  --md-primary-fg-color--light: #6ea1ff;
  --md-primary-fg-color--dark: #2563eb;
  --md-accent-fg-color: #6ea1ff;

  /* Dark surfaces lift rather than invert: canvas 0.165 → surface 0.205. */
  --md-default-bg-color: oklch(0.205 0.009 85);
  --md-code-bg-color: oklch(0.165 0.008 85);
}

/* Brand-tint links so the accent reads consistently with the hub, without
 * altering spacing or type. */
[data-md-color-scheme="default"] .md-typeset a {
  color: var(--md-primary-fg-color);
}

/* Corners follow the system's control (6px) and card (12px) radii. */
.md-typeset code {
  border-radius: 0.375rem;
}

.md-typeset .admonition,
.md-typeset details {
  border-radius: 0.75rem;
}
