/*
 * groundwork → Centauri, the Computing America house system.
 *
 * Load `tokens/centauri.css` (the spine's flat build: every color as hex per
 * mode, emitted by centauri's generate.mjs beside centauri.spine.css) or the spine
 * itself, then one profile (`centauri.console.css` or `centauri.field.css`), then
 * `contract.css`, then this. Set `data-theme` on the root, or let the OS
 * preference decide; every value here is a `var()` into a centauri token rather
 * than a color, so the theme and the profile carry through.
 *
 * Centauri's idiom is rules, not boxes (invariant 5), and its status colors are
 * a text step solved at 4.5:1 on the worst ground of each theme plus a
 * pastel mark that owes only greyscale rank. So the tones here are Carbon's
 * construction rather than Material's: a neutral fill — the sunken surface —
 * with the meaning on the leading edge in the status color. A refused edge
 * is the strong neutral stroke, which is what the contract asks for and what
 * Centauri already draws its confirmed readings in.
 *
 * Centauri's profiles change 23 scaled tokens and no static one, so density is
 * not the adapter's decision: `--gw-space-*`, the sizes and the control
 * height read the profile's scaled tokens, and a product on the field profile
 * gets groundwork at 40px controls and a 16px body without a second adapter.
 *
 * Nothing is released. Every pair the contract declares is measured against
 * the flat build in both modes by check-contrast.mjs, and centauri's own
 * check.mjs proves the flat build against the spine.
 *
 * @contrast
 *   --gw-text on --gw-surface >= 7
 */

:root {
  --gw-surface: var(--color-surface);
  --gw-surface-sunken: var(--color-surface-alt);
  --gw-surface-raised: var(--color-card);

  --gw-text: var(--color-strong);
  --gw-text-muted: var(--color-muted);
  /* Non-text only: centauri's `edge` is the 3:1 step, named for the duty. */
  --gw-text-faint: var(--color-edge);

  --gw-border: var(--color-hairline);
  --gw-border-strong: var(--color-edge-strong);
  /* Achromatic focus (invariant 2): the ring is a neutral, never a hue. The
     spine carries the ramp, not the ring, so the two modes are named here. */
  --gw-focus: var(--color-quartz-700);

  /* Tones: neutral fill, the meaning on the edge. */
  --gw-tone-done-fill: var(--color-surface-alt);
  --gw-tone-done-ink: var(--color-strong);
  --gw-tone-done-edge: var(--color-status-success);

  --gw-tone-waiting-fill: var(--color-surface-alt);
  --gw-tone-waiting-ink: var(--color-strong);
  --gw-tone-waiting-edge: var(--color-status-notice);

  --gw-tone-mixed-fill: var(--color-surface-alt);
  --gw-tone-mixed-ink: var(--color-strong);
  --gw-tone-mixed-edge: var(--color-status-warning);

  --gw-tone-refused-fill: var(--color-surface-alt);
  --gw-tone-refused-ink: var(--color-strong);
  --gw-tone-refused-edge: var(--color-edge-strong);

  --gw-tone-faulted-fill: var(--color-surface-alt);
  --gw-tone-faulted-ink: var(--color-strong);
  --gw-tone-faulted-edge: var(--color-status-critical);

  /* The profile's ramp, from its second step: console 4 8 12 16 20 24,
     field 8 12 16 20 24 32. */
  --gw-space-1: var(--centauri-scaled-2);
  --gw-space-2: var(--centauri-scaled-3);
  --gw-space-3: var(--centauri-scaled-4);
  --gw-space-4: var(--centauri-scaled-5);
  --gw-space-5: var(--centauri-scaled-6);
  --gw-space-6: var(--centauri-scaled-7);

  /* Near-square (invariant 6): a control corner and a card corner. */
  --gw-radius-1: var(--radius-control);
  --gw-radius-2: var(--radius-card);

  --gw-font: var(--font-sans);
  --gw-font-mono: var(--font-mono);
  /* The four-step reading ladder, and the title above it. `datum` is the
     step a value is read at, which is the step the contract named after it. */
  --gw-size-body: var(--text-body);
  --gw-size-datum: var(--text-datum);
  --gw-size-small: var(--text-small);
  --gw-size-micro: var(--text-micro);
  --gw-size-title: var(--text-title-sm);

  --gw-control-height: var(--centauri-scaled-control-height);
  --gw-target-min: var(--centauri-static-target-min);

  /* The enter set; exits are the components' own and shorter. */
  --gw-duration-fast: var(--centauri-static-enter-fast);
  --gw-duration: var(--centauri-static-enter-base);
  --gw-duration-slow: var(--centauri-static-enter-slow);
  --gw-ease: var(--ease-standard);
}

/* The product's own chrome. The action is the accent, the only filled hue on a
   resting screen; its ink is the card in light and the surface in dark, which
   is what centauri's own primary button is made of. The rail and the sheet are
   `--color-sheet`, one step off the surface, so the shell follows the theme. */
:root {
  --gw-action: var(--color-accent);
  --gw-action-ink: var(--color-card);
  --gw-action-muted: var(--color-surface-alt);
  --gw-action-muted-ink: var(--color-strong);
  --gw-link: var(--color-accent);
  --gw-field: var(--color-card);
  --gw-hover: var(--color-quartz-100);
  --gw-active: var(--color-quartz-200);
  --gw-surface-accent: var(--color-surface-alt);
  --gw-shell: var(--color-sheet);
  --gw-shell-ink: var(--color-strong);
  --gw-shell-ink-muted: var(--color-muted);
  --gw-shell-hover: var(--color-surface-alt);
  --gw-shell-accent: var(--color-accent);
}

/* The four tokens whose two modes are not one role in the spine: the ring, the
   action's ink, and the two interaction layers. Said twice — by preference and
   by choice — and check-contrast.mjs refuses the pair if they drift. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --gw-focus: var(--color-quartz-100);
    --gw-action-ink: var(--color-surface);
    --gw-hover: var(--color-quartz-850);
    --gw-active: var(--color-quartz-800);
  }
}
:root[data-theme="dark"] {
  --gw-focus: var(--color-quartz-100);
  --gw-action-ink: var(--color-surface);
  --gw-hover: var(--color-quartz-850);
  --gw-active: var(--color-quartz-800);
}

/* ---------------------------------------------------------------------------
 * The one rule here that is not a token, and why it has to be.
 *
 * Centauri's nav layer hides the rail's collapse control below 600px, because
 * below 600px the nav is a TAB BAR and a bar does not collapse to icons — it
 * slides away on `data-bar`, driven by the scroll rather than by a button. Left
 * visible it takes a sixth seat in a bar budgeted for three to five, and it is a
 * control that, pressed, changes an attribute nothing at that width reads.
 *
 * The layer says so as `.centauri-nav__toggle { display: none }`. That is one
 * class, and so is `.gw-nav__toggle { display: inline-flex }` in components.css,
 * which loads after every design-system layer by the documented order — tokens,
 * contract, adapter, components. A tie on specificity is decided by order, and
 * groundwork wins every one of them. The fix is not to reorder the stack, which
 * would break the far more numerous cases where the component's value is the
 * one that should lose; it is to say this in the adapter, at two classes, where
 * the load order stops mattering.
 *
 * Measured 2026-09-15 at 375x812: five destinations at 70px and the toggle
 * taking the remaining 25 of the 375.
 * ------------------------------------------------------------------------- */
@media (max-width: 599.98px) {
  .centauri-nav .gw-nav__toggle { display: none; }
}
