/* NORHI tokens — the value set, and nothing but values. norhi-ui 1.1.0.
   Brand decided 2026-09-04 from the v66 options board; AMENDED 2026-09-09 (Victor): the green is
   #0F3D34, company-wide; the 12% and 4% derivatives follow. Blue pinned 2026-09-08 (v66 --accent).
   1.1.0 (2026-09-20): this file is :root only. The button, card and field rules that lived here
   moved to primitives/norhi-primitives.css (prefixed nui-, opt-in); element behaviour is
   base/norhi-base.css. Every other file in this repository reads these names and sets no value
   of its own, so a brand change is an edit here and a tag. */
:root {
  /* ── colour: four, plus the error red ── */
  --norhi-green:        #0F3D34;             /* text, interactive, wordmark */
  --norhi-white:        #FFFFFF;             /* ground and surface — the only background */
  --norhi-blue:         #2563EB;             /* ornament: wordmark brackets. Nowhere else. Pinned from v66. */
  --norhi-border:       rgba(15,61,52,.12);  /* the border, dividers, secondary button */
  --norhi-border-field: #7B948F;             /* a text field's edge at rest: the green at 55% on white (round(.55·#0F3D34 + .45·#FFFFFF)) — 3.24:1 on white, 3.02:1 on the tint, so 1.4.11's 3:1 holds on both grounds a form sits on (Victor, 2026-10-06). Fields only: dividers, cards and the secondary button keep --norhi-border */
  --norhi-tint:         rgba(15,61,52,.04);  /* form field fill, hover row; fields also carry --norhi-border-field at rest */
  --norhi-error:        #B42318;             /* error border + message. The only added colour. */
  --norhi-scrim:        rgba(15,61,52,.32);  /* the backdrop behind a modal <dialog> — the green again, not a fifth colour */
  --norhi-disabled:     .4;                  /* opacity — one rule for every disabled control */

  /* ── type: families ── */
  --norhi-font:         'Inter', 'Inter Fallback', system-ui, sans-serif;   /* 400 body, 700 emphatic. No other weights. */
  --norhi-mono:         'JetBrains Mono NL', ui-monospace, monospace;       /* identifiers, codes, logs — never emphasis */
  --norhi-mono-size:    .94em;               /* inline identifier, relative to its context */
  --norhi-font-patient: var(--norhi-font);   /* Deferred: Atkinson Hyperlegible Next — the swap is this line. */
  --font-patient:       var(--norhi-font-patient);  /* every patient-facing template sets type through this name */
  --norhi-features:     "ss04";                  /* GLOBAL: Inter's disambiguation set — a serifed I, a tailed l, so I / l / 1 differ — and a
                                                   PLAIN zero. 1.1.3 (Victor, from the live Scribe site): customers will not like a 0 with a
                                                   diagonal through it. ss04 is ss02 minus the zero; the identifier face (JetBrains Mono NL)
                                                   still marks its zero, which is where 0-versus-O actually matters. */
  --norhi-features-tabular: "tnum", "ss04";          /* ONLY where figures line up. 1.1.2: Inter's tnum is not a digits-only feature — it swaps 59
                                                   glyphs: the hyphen becomes 41% wider, * 29% wider, ( ) wider, and the SPACE, comma, period and
                                                   colon narrower. Global in 1.1.0–1.1.1, it re-spaced all running prose ("third - party"); found by
                                                   the design loop's renders of central-scribe on 2026-09-20. */

  /* ── type: the scale ─────────────────────────────────────────────────────────────────────
     Eight steps, from the 2026-09-10 census of 5,778 sized declarations across the six repos (89%
     already landed on the original eight), AMENDED 2026-09-20 (Victor): the floor is 12, so the 11px
     `micro` step left; 17 entered as the clinical reading step, at every width (it was already a
     dated clinical-legibility decision in boreal and central-scribe, left open on 09-10); the unit is
     rem, so the user's text-size setting works — no repo sets a root font-size, so 1rem = 16px and
     every value below renders exactly as its px did. Seven of the eight are Tailwind v4's stock
     size/leading pairs (text-xs … text-3xl): adopting the scale in a Tailwind repo is a visual no-op.
     13px and 15px stay decided out as literals. 36px and 48px (marketing) are not steps: allowlist.
     The names are --type-*, never --text-*: at :root --text-* ALREADY MEANS COLOUR in boreal and
     central-scribe (--text-heading, --text-body, --text-muted …). */
  --type-small:    .75rem;    --type-small-leading:    calc(1 / .75);       /* 12/16 — field labels, timestamps, hints. THE FLOOR */
  --type-body:     .875rem;   --type-body-leading:     calc(1.25 / .875);   /* 14/20 — running UI text, table cells, buttons. The fleet's most-used value */
  --type-control:  1rem;      --type-control-leading:  1.5;                 /* 16/24 — input, select, textarea. LOAD-BEARING: the iOS no-zoom floor */
  --type-reading:  1.0625rem; --type-reading-leading:  1.5;                 /* 17 — where the clinician reads and writes: notes, transcripts, letters */
  --type-section:  1.125rem;  --type-section-leading:  calc(1.75 / 1.125);  /* 18/28 — h3, card and section headers */
  --type-page:     1.25rem;   --type-page-leading:     1.4;                 /* 20/28 — h2, page titles */
  --type-display:  1.5rem;    --type-display-leading:  calc(2 / 1.5);       /* 24/32 — h1 */
  --type-hero:     1.875rem;  --type-hero-leading:     1.2;                 /* 30/36 — marketing lede, stat numerals */
  --type-prose-leading: 1.6;                 /* running prose and LLM output: the leading belongs to the measure, not the step */
  --type-weight-body:     400;
  --type-weight-emphatic: 700;               /* two weights, no others. Headings widened on 09-10 (24/20/18) so size carries the hierarchy */

  /* Three ROLES, for the places where the phone and the desktop differ. A role is an alias onto
     the steps; its md-up value is re-set below. Templates use a role or a step, never a literal. */
  --type-note:  var(--type-reading);  --type-note-leading: var(--type-reading-leading);  /* 17 everywhere */
  --type-ui:    var(--type-control);  --type-ui-leading:   var(--type-control-leading);  /* dense UI: 16 on the phone, 14 from md */
  --type-meta:  .8125rem;             --type-meta-leading: 1.4;                          /* metadata nobody acts on: 13 on the phone, 12 from md. Never clinical content (floor 14) */
  /* DELIBERATE, and the only one: 13px is not one of the eight steps. It is the phone value of this
     one role (ruled 2026-09-20: metadata is 13 on a phone, 12 from md) and it exists nowhere else —
     a literal 13px in a product is still off the scale (rule type_scale). Do not round it to a step. */
  --norhi-tracking-display: -0.015em;        /* headings of 20px and up; body tracking is left alone */
  --norhi-measure:      70ch;                /* notes and letters */

  /* ── space: the 4px grid × the product's density — declared below, on :root and on [data-product] ── */
  --product-density:    1;

  /* ── shape, focus, targets, icons, motion ── */
  --norhi-mark-track:   .14em;               /* [NORHI] */
  --norhi-radius-control: 0;                 /* buttons — square */
  --norhi-radius-field:   6px;               /* inputs */
  --norhi-shadow:       none;                /* flat is the brand. box-shadow fails review. */
  --norhi-focus:        2px solid var(--norhi-green);
  --norhi-focus-offset: 2px;
  --norhi-focus-on-dark:        2px solid var(--norhi-white);   /* the ring inside a dark bar or footer, set with its offset on that surface: header, footer { --norhi-focus: var(--norhi-focus-on-dark); --norhi-focus-offset: var(--norhi-focus-on-dark-offset); }. 12.09:1 on the green, 14.63:1 on #0B2E28, 18.10:1 on #021a14; the green ring there is 1.00, 1.21 and 1.50:1 (2.0.4) */
  --norhi-focus-on-dark-offset: 2px;                           /* its pair: the same 2px as --norhi-focus-offset, so the gap shows the bar and the ring is read against the bar */
  --norhi-target:       2.25rem;             /* 36px with a fine pointer; 44px under pointer: coarse (below) */
  --norhi-icon-stroke:  2;                   /* Lucide's own. 1.75 is the candidate if 2 reads heavy at 14px — decided once, on the family page */
  --norhi-motion-state: 120ms;
  --norhi-motion-panel: 240ms;
  --norhi-ease:         cubic-bezier(.4, 0, .2, 1);
  --norhi-header-h:     3.5rem;              /* a repo with a sticky header sets its real height; scroll-padding-top reads it */

  /* ── the product layer's defaults (product/<name>.css sets them) ── */
  --product-name:       '';
  --product-ornament:   var(--norhi-blue);
}

/* Spacing is re-declared wherever a product scope starts: a custom property that reads another is
   resolved where it is DECLARED, so a [data-product] section (examples/family.html) needs its own. */
:root, [data-product] {
  --norhi-space-1:  calc(.25rem * var(--product-density));
  --norhi-space-2:  calc(.5rem  * var(--product-density));
  --norhi-space-3:  calc(.75rem * var(--product-density));
  --norhi-space-4:  calc(1rem   * var(--product-density));
  --norhi-space-6:  calc(1.5rem * var(--product-density));
  --norhi-space-8:  calc(2rem   * var(--product-density));
  --norhi-space-12: calc(3rem   * var(--product-density));
}

/* The md-up values. A custom property cannot be used IN a media query, but it can be re-set by
   one — so the scale still changes in exactly one place. 48rem = 768px. */
@media (min-width: 48rem) {
  :root {
    --type-ui:   var(--type-body);   --type-ui-leading:   var(--type-body-leading);
    --type-meta: var(--type-small);  --type-meta-leading: var(--type-small-leading);
  }
}
@media (pointer: coarse) {
  :root { --norhi-target: 2.75rem; }         /* 44px */
}
