/* m7kni.io fleet brand alignment — the shared visual layer for every m7kni
 * documentation site.
 *
 * THIS COPY IS m7kni.com's, and it is a VERBATIM copy of `guidelines/brand.css`
 * in the m7kni design system (~/repos/m7kni-design-system). Do not edit it here
 * — fix the system and re-copy, or the two drift.
 *
 * Why m7kni.com has its own copy at all, when a hub docs repo must not: the
 * fleet's copy is `shared/stylesheets/brand.css` in rknightion/m7kni-net-site,
 * which the hub injects into each child clone at build time. m7kni.com is not
 * hub-generated and is not built by it, so nothing would inject it. That is
 * sanctioned by guidelines/docs-sites.md, which also states the obligation it
 * creates: a change to the system is not finished until BOTH copies have it.
 *
 * LOAD ORDER: FIRST, before the repo's own project.css. Earlier guidance said
 * last, so these tokens would beat per-repo colours; that was right when each
 * repo owned its palette. It no longer does — project.css carries components
 * only — so brand goes first and components build on these tokens.
 *
 * ACCENT IS JADE #00764d (light) / #3eaf86 (dark), and every value is
 * contrast-verified: white on accent 5.66:1, accent on white 5.26:1, accent
 * on its own tint 4.67:1. The blue this replaced failed AA on tinted
 * backgrounds at 3.99:1. Do not lighten these to taste.
 *
 * Deliberately restrained: this unifies colour and type only, and leaves the
 * readable Material for MkDocs / Zensical typography, layout, nav and TOC
 * alone. See guidelines/docs-sites.md for what is deliberately out of scope.
 *
 * FONTS ARE SELF-HOSTED, AND THEY HAVE TO BE. The obvious route is
 * `theme.font.text = "Geist"` plus Material's privacy plugin to pull the
 * Google-hosted files local. Zensical has not ported the privacy plugin
 * (zensical/backlog#35, open) — configuring it is silently inert, and the
 * fleet shipped a full migration cycle with `[project.plugins.privacy]` set
 * while every page still linked fonts.gstatic.com. So `theme.font = false`
 * in config, and the faces below serve from the site's own origin.
 *
 * The woff2 files are google/fonts variable builds under the SIL Open Font
 * License 1.1, converted from the TTFs in assets/fonts/; ship the licence
 * texts alongside them. Paths are relative to docs/stylesheets/.
 */

@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: #00764d;
  --md-primary-fg-color--light: #3eaf86;
  --md-primary-fg-color--dark: #00623a;
  --md-accent-fg-color: #00623a;

  /* Surfaces — warm paper, cool ink, matching the apps. */
  --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);

  /* Type. Set as variables and never as font-family — font-family here would
   * disable the theme's system-font 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: #3eaf86;
  --md-primary-fg-color--light: #54c398;
  --md-primary-fg-color--dark: #00764d;
  --md-accent-fg-color: #54c398;

  /* 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);
}

/* ROOT-SIZE CORRECTION. This system's type tokens are authored against a 16px
 * root; Material sets `html { font-size: 125% }`. Without this the whole scale
 * renders 1.25x — --text-xs measures 15px, not 12px — silently, on a clean
 * build. Type only: spacing, radius and shadow should scale with the theme's
 * larger root. See tokens/typography.css for the full note. */
:root { --m7-root-basis: 0.8; }

/* Brand-tint links so the accent reads consistently with the hub, without
 * altering spacing or type scale.
 *
 * The exclusions are load-bearing. Material paints a filled button's
 * background with --md-primary-fg-color, so tinting its label the same
 * variable makes the text invisible against its own background. Worse, it
 * cannot be undone downstream: the rule ends in a type selector, and the
 * obvious `.md-typeset .md-button--primary` override loses to it no matter
 * how late it loads. Excluding buttons here is the only fix that does not
 * require a specificity arms race.
 *
 * EVERY :not() ADDED HERE RAISES THIS RULE'S SPECIFICITY AGAIN. The bare
 * selector scored (0,2,1); with one :not() it is (0,3,1); with two, (0,4,1).
 * Each step outranks a class of downstream rules that were quietly relying on
 * load order to win. Adding `:not(.md-button)` alone did exactly that — the
 * hub's landing-page button had been surviving on load order at (0,2,1), and
 * the escalation painted its label jade-on-jade in the light scheme, silently,
 * with a clean build and a correct-looking dark mode.
 *
 * So: when you add an exclusion here, re-check every landing-page button in
 * the fleet, not just the theme's own. Verify in the LIGHT scheme with both a
 * `{ .md-button .md-button--primary }` link and a landing-page `.m7-btn`
 * primary — the dark scheme has no equivalent rule and will not show the bug. */
[data-md-color-scheme="default"] .md-typeset a:not(.md-button):not(.m7-btn) { color: var(--md-primary-fg-color); }

/* Inline code and admonition corners follow the system's 6px control radius
 * and 12px card radius. */
.md-typeset code { border-radius: 0.375rem; }
.md-typeset .admonition,
.md-typeset details { border-radius: 0.75rem; }
