/* ─────────────────────────────────────────────────────────────
   LAYER 2 — PROJECT IDENTITY PROFILE (the override surface)

   A project sets ONLY the variables in this block. Everything
   downstream — semantic roles, components, flagships — derives
   from them. Changing these is not changing the design system.

   Override by redeclaring on :root in a project stylesheet
   loaded after styles.css, or by scoping to [data-profile="…"].
   ───────────────────────────────────────────────────────────── */
:root{
  /* Palette inputs */
  --profile-bg-primary:#EDE7DC;
  --profile-bg-secondary:#E3DBCB;
  --profile-bg-inverse:#0C0C0A;
  --profile-ink:#0C0C0A;
  --profile-ink-soft:#1A1A17;
  --profile-structure:#5A6167;
  --profile-structure-light:#8E9499;
  --profile-brand-primary:#0C0C0A;
  --profile-brand-secondary:#5A6167;
  --profile-brand-signal:#FF3B14;
  --profile-brand-signal-deep:#C42A08;

  /* Type inputs — four roles, not four families.
     A project may map all four to one family, or bring its own. */
  --profile-font-display:"Archivo","Helvetica Neue",Helvetica,sans-serif;
  --profile-font-functional:"Archivo","Helvetica Neue",Helvetica,sans-serif;
  --profile-font-editorial:"Newsreader",Georgia,serif;
  --profile-font-data:"Archivo","Helvetica Neue",Helvetica,sans-serif;

  /* Behavior inputs */
  --profile-motion:1; /* @kind other */
  --profile-radius:0;        /* Core is square. A project may soften. */
  --profile-rule-hair-o:26%; /* hairline opacity against the ground */
}

/* ─────────────────────────────────────────────────────────────
   SEMANTIC ROLES — what components are allowed to reference.
   No component may name a palette value directly.
   Mapped on :root AND on any [data-profile] scope, so a profile can be
   swapped on a subtree and the semantic roles recompute there.
   ───────────────────────────────────────────────────────────── */
:root,[data-profile]{
  --color-background-primary:var(--profile-bg-primary);
  --color-background-secondary:var(--profile-bg-secondary);
  --color-background-inverse:var(--profile-bg-inverse);

  --color-text-primary:var(--profile-ink);
  --color-text-secondary:var(--profile-structure);
  --color-text-tertiary:var(--profile-structure-light);
  --color-text-inverse:var(--profile-bg-primary);

  --color-brand-primary:var(--profile-brand-primary);
  --color-brand-secondary:var(--profile-brand-secondary);
  --color-brand-signal:var(--profile-brand-signal);
  --color-brand-signal-deep:var(--profile-brand-signal-deep);

  --color-rule:color-mix(in oklab,var(--profile-ink) var(--profile-rule-hair-o),transparent);
  --color-rule-strong:var(--profile-ink);
  --color-rule-inverse:color-mix(in oklab,var(--profile-bg-primary) 28%,transparent);

  --color-action:var(--profile-ink);
  --color-action-hover:var(--profile-brand-signal-deep);

  --color-status-success:#2C6B4A;
  --color-status-warning:#8A5A10;
  --color-status-error:var(--profile-brand-signal-deep);

  --font-display:var(--profile-font-display);
  --font-editorial:var(--profile-font-editorial);
  --font-functional:var(--profile-font-functional);
  --font-data:var(--profile-font-data);
}

/* Inverse ground — a section, a band or a whole page. */
[data-surface="inverse"]{
  --color-background-primary:var(--profile-bg-inverse);
  --color-background-secondary:var(--profile-ink-soft);
  --color-text-primary:var(--profile-bg-primary);
  --color-text-secondary:color-mix(in oklab,var(--profile-bg-primary) 68%,transparent);
  --color-text-tertiary:color-mix(in oklab,var(--profile-bg-primary) 48%,transparent);
  --color-text-inverse:var(--profile-ink);
  --color-rule:var(--color-rule-inverse);
  --color-rule-strong:var(--profile-bg-primary);
  --color-action:var(--profile-bg-primary);
  --color-action-hover:var(--profile-brand-signal);
}
