/* =========================================================================
 * Plumb Line Prep - theme tokens.
 * SiteConfig.theme.tokensHref -> /tokens.css. Loaded FIRST in <head>, before
 * @construct/template's base.css. That load order matters and is why this file
 * carries VALUES ONLY for the --color-* / --font-* / --space-* contract:
 * base.css declares nothing in :root except `color-scheme` and its private
 * --_* fallbacks, so every token below wins. Any RULE (as opposed to a token
 * value) that has to beat base.css lives in src/components/SiteChrome.astro,
 * which is bundled AFTER base.css.
 *
 * AUTHORITY: Lattice Visual Language (LVL). Colour law: OKLCH only, no #000 /
 * #fff / rgb() / hsl() / keywords (LVL color.md). Type law: LVL typography.md
 * (no house font; selection procedure run below). Spatial: LVL spatial.md
 * (4/8/12/16/24/32/48/64/96 only).
 *
 * -------------------------------------------------------------------------
 * IDENTITY: "Blueprint and brass"
 * -------------------------------------------------------------------------
 * A plumb line is a builder's reference for true vertical. The motif is
 * expressed STRUCTURALLY, never as clipart: every vertical rule, tick and
 * marker on the page is a 2-3px brass stroke, always vertical, never
 * decorative-diagonal. There is no plumb bob drawn anywhere except one 7px
 * rotated square terminating the wordmark's rule.
 *
 * Light scheme = paper (warm off-white, brass hue 82 tinting the neutrals).
 * Dark scheme  = blueprint (deep blue-graphite, hue 256 tinting the neutrals).
 * Both schemes share one masthead: a near-black blue-ink band that carries the
 * wordmark and the standing compliance notice. It is the darkest element on
 * the page in BOTH schemes, so its ink pair is stable across themes.
 *
 * -------------------------------------------------------------------------
 * TYPE - LVL font-selection procedure, run 2026-08-17
 * -------------------------------------------------------------------------
 * 1. Voice (brief): credible, plainspoken, built-not-bought. Audience: working
 *    Michigan tradespeople, mostly on phones, often at night.
 * 2. Voice -> class: utility/modernist grotesque for display; humanist-neutral
 *    for body (legibility at 17px on a phone at night is the governing need).
 * 3. Candidates considered - display: Archivo, Hanken Grotesk, Zilla Slab.
 *                            body:    Public Sans, IBM Plex Sans, Source Sans 3.
 * 4. PINNED:
 *    - Display: Archivo. SIL OFL 1.1. https://fonts.google.com/specimen/Archivo
 *      Sturdy American grotesque with signage/gazette lineage. Reads like a
 *      printed permit, not a startup deck.
 *    - Body: Public Sans. SIL OFL 1.1.
 *      https://fonts.google.com/specimen/Public+Sans
 *      The US Web Design System face, engineered for civic legibility. Tall
 *      x-height, open apertures, unambiguous 1/l/I - which matters on a page
 *      whose credibility rests on code section numbers.
 *    Neither is on LVL's reflex-reject list. Roboto is deliberately absent from
 *    the fallback stack below for the same reason (LVL typography.md).
 * 5. SELF-HOSTED, latin + latin-ext variable woff2, 112 KB total. No Google
 *    Fonts request: this site ships a privacy policy and follows the all-CF
 *    doctrine, so no third-party font origin.
 * ========================================================================= */

/* --- Fonts (self-hosted variable woff2; see /public/fonts) --- */
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("/fonts/public-sans-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("/fonts/public-sans-latin-ext-var.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/archivo-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/archivo-latin-ext-var.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

/* =========================================================================
 * LIGHT SCHEME - "paper"
 * Every ink/fill pair below was MEASURED (OKLab -> sRGB -> WCAG relative
 * luminance, 8-bit round-trip). Ratios are recorded inline. Floors: 4.5:1 body
 * text, 3:1 large text and non-text (borders, marks, focus).
 * ========================================================================= */
:root {
  --color-scheme: light;

  /* Canvas + surface ladder (base.css SURFACE TOKEN CONTRACT) */
  --color-bg: oklch(0.975 0.008 82);            /* warm paper */
  --color-surface: oklch(0.995 0.004 85);       /* raised card */
  --color-surface-sunken: oklch(0.945 0.01 80); /* inset band */
  --color-field-bg: oklch(0.995 0.004 85);
  --color-callout-bg: oklch(0.955 0.012 80);
  --color-ok-bg: oklch(0.945 0.035 150);
  --color-warn-bg: oklch(0.95 0.045 82);
  --color-critical-bg: oklch(0.945 0.035 25);
  --color-shadow: oklch(0.35 0.03 258);

  /* Ink */
  --color-text: oklch(0.255 0.018 258);         /* 14.66:1 on canvas */
  --color-heading: oklch(0.2 0.022 258);        /* 16.83:1 on canvas */
  --color-muted: oklch(0.445 0.017 258);        /*  7.07:1 on canvas */

  /* Structure */
  --color-border: oklch(0.875 0.01 80);
  --color-border-strong: oklch(0.6 0.014 80);   /*  3.68:1 non-text */

  /* Accent - blueprint blue */
  --color-accent: oklch(0.44 0.135 254);        /*  7.26:1 vs canvas */
  --color-accent-hover: oklch(0.365 0.12 254);
  --color-on-accent: oklch(0.98 0.005 254);     /*  7.41:1 on accent */
  --color-link: oklch(0.44 0.135 254);          /*  7.26:1 on canvas */
  --color-link-hover: oklch(0.34 0.105 254);    /* 11.03:1 on canvas */

  /* Accent 2 - brass. The plumb-line motif colour. */
  --color-brass: oklch(0.6 0.115 72);           /*  3.7:1 non-text marks */
  --color-brass-ink: oklch(0.525 0.105 72);     /*  5.11:1 as TEXT on canvas */

  --color-error: oklch(0.455 0.165 27);         /*  7.36:1 on canvas */
  --color-focus: oklch(0.6 0.115 72);           /* brass ring, 3.7:1 vs canvas */

  /* Masthead - the one element that stays dark in both schemes.
     It carries the wordmark AND the standing compliance notice. */
  --color-masthead: oklch(0.255 0.035 256);
  --color-masthead-ink: oklch(0.97 0.008 85);   /* 14.55:1 on masthead */
  --color-disclaimer-bg: oklch(0.255 0.035 256);
  /* Deliberately QUIETER than the wordmark, and measured rather than guessed.
     5.80:1 against the masthead, where the AA floor for 14px body text is
     4.5:1. Quietness is bought with lightness inside a measured margin, never
     by dropping under the floor and never with opacity. */
  --color-disclaimer-text: oklch(0.695 0.014 256); /* 5.80:1 on masthead */
  --color-masthead-brass: oklch(0.775 0.125 78);   /* 7.65:1 on masthead */

  /* -----------------------------------------------------------------------
   * TYPE SCALE - LVL ratio 1.25 (Major Third), base 17px, floor 14px.
   * 14 / 17 / 21 / 27 / 33 / 42 px
   * --------------------------------------------------------------------- */
  --font-body: "Public Sans", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Helvetica, Arial, sans-serif;
  --font-display: "Archivo", "Public Sans", ui-sans-serif, system-ui,
    -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  --font-size-fine: 0.875rem;   /* 14px - the accessibility floor, not below */
  --font-size-base: 1.0625rem;  /* 17px */
  --font-size-h2: 1.3125rem;    /* 21px */
  --font-size-h1: 1.6875rem;    /* 27px (clamps up to 42px, see SiteChrome) */
  --font-size-lede: 1.1875rem;  /* 19px */

  --weight-body: 400;
  --weight-strong: 600;
  --weight-display: 700;

  /* -----------------------------------------------------------------------
   * SPATIAL - LVL scale only: 4 8 12 16 24 32 48 64 96
   * Grid: one column. 38rem (608px) measure holds body at ~68ch in Public
   * Sans at 17px, inside LVL's 45-75ch band.
   * --------------------------------------------------------------------- */
  --content-width: 38rem;
  --space-xs: 0.25rem;  /*  4 */
  --space-sm: 0.5rem;   /*  8 */
  --space-md: 1rem;     /* 16 */
  --space-lg: 1.5rem;   /* 24 */
  --space-xl: 2rem;     /* 32 */
  --space-2xl: 3rem;    /* 48 */
  --space-3xl: 4rem;    /* 64 */
  --radius: 0.5rem;     /*  8 */
  --rule: 3px;          /* the plumb-line stroke weight */
}

/* =========================================================================
 * DARK SCHEME - "blueprint"
 * Pass 3 of the LVL colour scrub (scheme coherence): every surface literal
 * below sits on the SAME side of the lightness midpoint as its canvas. The
 * masthead is deliberately the darkest band in both schemes, and its ink pair
 * is re-measured for the dark masthead value rather than inherited.
 * ========================================================================= */
@media (prefers-color-scheme: dark) {
  :root {
    --color-scheme: dark;

    --color-bg: oklch(0.205 0.02 256);
    --color-surface: oklch(0.245 0.021 256);
    --color-surface-sunken: oklch(0.175 0.019 256);
    --color-field-bg: oklch(0.175 0.019 256);
    --color-callout-bg: oklch(0.245 0.021 256);
    --color-ok-bg: oklch(0.255 0.038 150);
    --color-warn-bg: oklch(0.255 0.042 82);
    --color-critical-bg: oklch(0.255 0.045 25);
    --color-shadow: oklch(0.08 0.02 256);

    --color-text: oklch(0.905 0.01 256);        /* 13.46:1 on canvas */
    --color-heading: oklch(0.965 0.008 256);    /* 16.18:1 on canvas */
    --color-muted: oklch(0.735 0.014 256);      /*  7.63:1 on canvas */

    --color-border: oklch(0.325 0.02 256);
    --color-border-strong: oklch(0.545 0.024 256); /* 3.61:1 non-text */

    --color-accent: oklch(0.515 0.155 256);     /*  3.14:1 vs canvas */
    --color-accent-hover: oklch(0.44 0.145 256);
    --color-on-accent: oklch(0.98 0.005 254);   /*  5.38:1 on accent */
    --color-link: oklch(0.755 0.115 250);       /*  8.25:1 on canvas */
    --color-link-hover: oklch(0.825 0.1 250);   /* 10.40:1 on canvas */

    --color-brass: oklch(0.775 0.125 78);       /*  8.63:1 vs canvas */
    --color-brass-ink: oklch(0.775 0.125 78);   /*  8.63:1 as TEXT on canvas */

    --color-error: oklch(0.735 0.135 27);       /*  7.16:1 on canvas */
    --color-focus: oklch(0.775 0.125 78);

    --color-masthead: oklch(0.145 0.022 256);
    --color-masthead-ink: oklch(0.97 0.008 85);      /* 18.22:1 */
    --color-disclaimer-bg: oklch(0.145 0.022 256);
    --color-disclaimer-text: oklch(0.665 0.014 256); /*  6.48:1 on masthead */
    --color-masthead-brass: oklch(0.775 0.125 78);   /*  9.57:1 */

    /* LVL typography.md: drop body weight one notch on dark canvases to
       compensate for perceived heaviness. Public Sans is variable, so 350 is
       a real instance rather than a synthetic one. */
    --weight-body: 350;
  }
}

/* ---------------------------------------------------------------------------
 * Top compliance band: SUPPRESSED SITE-WIDE.
 *
 * Lives here, in the global token layer, rather than in SiteChrome.astro,
 * because SiteChrome is imported per-page and /practice does not import it.
 * A rule that only reaches the pages that remembered to opt in is not a
 * site-wide rule, and the owner's instruction was "on the top of any page".
 *
 * The Construct template renders SiteConfig.disclaimer twice per page: a
 * full-width band at the top of <body> (BaseLayout.astro:140) and the footer
 * copy (SiteFooter.astro:30). We cannot fork the template, so the duplicate
 * top band is suppressed and the FOOTER copy discharges C-PSI-F5, which asks
 * for visible rendered text on every page -- one instance, never two. The
 * identical sentence is still rendered, still selectable, still in the
 * shipped bytes, and banlist_lint's built-output check passes on the footer
 * copy alone (verified, not assumed).
 *
 * Do NOT achieve this by removing `disclaimer` from SiteConfig: SiteFooter
 * would fall back to the template's generic DEFAULT_DISCLAIMER, which does
 * not name LARA or PSI, and the mandated text would vanish silently.
 * --------------------------------------------------------------------------- */
body > .site-disclaimer {
  display: none;
}
