/* slate — colour only. Belongs to a customer, not to a template.
   Generated by kit/make-palette.mjs from four decisions: ink #161A1D, accent
   #B4441A, paper #FAFAFA. Every role below was DERIVED until it cleared its
   contrast target against the ground it actually sits on, and the run is
   recorded at the end of this file.

   --p-* are primitives. A section may never reference one.
   --c-* are the roles a section may use, and the only ones. */
:root{
  --p-ink:#161A1D;
  --p-paper:#FAFAFA;
  --p-white:#ffffff;
  --p-accent:#B4441A;
  --p-tint:#efefef;
  --p-hair:#e1e1e2;

  --c-surface:#FAFAFA;
  --c-surface-raised:#ffffff;
  --c-text:#161a1d;
  --c-text-muted:#707274;
  --c-text-subtle:#707375;
  --c-border:#e1e1e2;
  --c-accent:#B4441A;
  --c-on-accent:#ffffff;
  --c-accent-text:#b4441a;
  --c-focus-ring:#b4441a;
}

/* An inverted band is a SCOPE, not a set of extra tokens. Same role names,
   different values. A section must never declare a --c-* on itself, or this
   stops working: a property declared on an element beats one inherited from an
   ancestor regardless of specificity. */
[data-surface="inverse"]{
  --c-surface:#161A1D;
  --c-surface-raised:#262a2d;
  --c-text:#ffffff;
  --c-text-muted:#9d9fa0;
  --c-text-subtle:#868889;
  --c-border:#494c4f;
  --c-accent:#c46b4a;
  --c-on-accent:#161A1D;
  --c-accent-text:#cb7c5f;
  --c-focus-ring:#cb7c5f;
}

/* ── DARK MODE ──────────────────────────────────────────────────────────────
   Not a second palette. The page set and the inverse set SWAP, which is the
   only arrangement that survives PLAN.md §10's trap: in dark mode "inverse" has
   to become LIGHTER, or an inverse band on a dark page is a black band on a
   black page. Both sets were already derived and proved above, so dark mode
   inherits 108 verified pairs rather than needing 108 more.

   Specificity, because this is where it goes wrong: [data-mode="dark"] and
   [data-surface="inverse"] are both (0,1,0), and a property declared ON an
   element beats one inherited from an ancestor. The two-selector rule below is
   (0,2,0) and is what makes an inverse band inside a dark page come out light.
   Order matters too — these must stay after the two blocks above. */
[data-mode="dark"]{
  --c-surface:#161A1D;
  --c-surface-raised:#262a2d;
  --c-text:#ffffff;
  --c-text-muted:#9d9fa0;
  --c-text-subtle:#868889;
  --c-border:#494c4f;
  --c-accent:#c46b4a;
  --c-on-accent:#161A1D;
  --c-accent-text:#cb7c5f;
  --c-focus-ring:#cb7c5f;
}
[data-mode="dark"] [data-surface="inverse"]{
  --c-surface:#FAFAFA;
  --c-surface-raised:#ffffff;
  --c-text:#161a1d;
  --c-text-muted:#707274;
  --c-text-subtle:#707375;
  --c-border:#e1e1e2;
  --c-accent:#B4441A;
  --c-on-accent:#ffffff;
  --c-accent-text:#b4441a;
  --c-focus-ring:#b4441a;
}

/* auto — the site owner said "follow the visitor's device". Same values. */
@media (prefers-color-scheme: dark){
  [data-mode="auto"]{
    --c-surface:#161A1D;
    --c-surface-raised:#262a2d;
    --c-text:#ffffff;
    --c-text-muted:#9d9fa0;
    --c-text-subtle:#868889;
    --c-border:#494c4f;
    --c-accent:#c46b4a;
    --c-on-accent:#161A1D;
    --c-accent-text:#cb7c5f;
    --c-focus-ring:#cb7c5f;
  }
  [data-mode="auto"] [data-surface="inverse"]{
    --c-surface:#FAFAFA;
    --c-surface-raised:#ffffff;
    --c-text:#161a1d;
    --c-text-muted:#707274;
    --c-text-subtle:#707375;
    --c-border:#e1e1e2;
    --c-accent:#B4441A;
    --c-on-accent:#ffffff;
    --c-accent-text:#b4441a;
    --c-focus-ring:#b4441a;
  }
}

/* verified 2026-09-06
   ok   page     text on surface               16.77:1  needs 4.5
   ok   page     text-muted on surface          4.63:1  needs 4.5
   ok   page     text-subtle on surface         4.57:1  needs 4.5
   ok   page     text on surface-raised        17.51:1  needs 4.5
   ok   page     text-muted on surface-raised   4.83:1  needs 4.5
   ok   page     accent-text on surface         5.32:1  needs 4.5
   ok   page     on-accent on accent            5.55:1  needs 4.5
   ok   page     border on surface              1.25:1  needs 1.2
   ok   page     focus-ring on surface          5.32:1  needs 3
   ok   inverse  text on surface               17.51:1  needs 4.5
   ok   inverse  text-muted on surface          6.59:1  needs 4.5
   ok   inverse  text-subtle on surface         4.92:1  needs 4.5
   ok   inverse  text on surface-raised        14.47:1  needs 4.5
   ok   inverse  text-muted on surface-raised   5.44:1  needs 4.5
   ok   inverse  accent-text on surface         5.49:1  needs 4.5
   ok   inverse  on-accent on accent            4.63:1  needs 4.5
   ok   inverse  border on surface              2.03:1  needs 1.2
   ok   inverse  focus-ring on surface          5.49:1  needs 3 */
