/*
 * Entry stylesheet: declares cascade order, then design tokens.
 *
 * The layer order is declared here and nowhere else, so every other stylesheet
 * can be loaded in any order and still cascade predictably. Each file assigns
 * its rules to exactly one layer:
 *
 *   tokens      application.css  design tokens only, no selectors beyond :root
 *   base        base.css         element defaults, no class selectors
 *   layout      layout.css       page shell and spacing primitives
 *   components  components.css   named, reusable pieces
 *   components  backoffice.css   Active Admin shell, Backoffice layouts only
 *
 * Deliberately generic: a neutral palette and a single accent, all expressed as
 * custom properties. Restyling means editing the tokens below, not the rules.
 * Partner branding is not applied here; the report PDF carries its own inline
 * stylesheet because it is rendered from an HTML string with no asset host.
 */

@import url("https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700&display=swap");

@layer tokens, base, layout, components;

@layer tokens {
  :root {
    /* ShadowPPC application palette. */
    --colour-neutral-0: #ffffff;
    --colour-neutral-50: #f5f4f0;
    --colour-stone: #e4e2dc;
    --colour-neutral-100: var(--colour-stone);
    --colour-neutral-200: var(--colour-stone);
    --colour-neutral-300: #c9c8c3;
    --colour-neutral-500: #62625d;
    --colour-neutral-700: #3b3b38;
    --colour-neutral-900: #0e0e0e;

    /* Single accent, swap this ramp to rebrand. */
    --colour-accent-50: #f0ebff;
    --colour-accent-200: #cbbcff;
    --colour-violet: #5b21ff;
    --colour-deep: #3a11b8;
    --colour-accent-500: var(--colour-violet);
    --colour-accent-700: var(--colour-deep);

    /* Status hues, used sparingly and always alongside text. */
    --colour-positive-500: #286744;
    --colour-caution-50: #fbf2dd;
    --colour-caution-500: #805d17;
    --colour-critical-50: #fff0ec;
    --colour-critical-500: #a33428;

    /* Semantic aliases. Rules reference these, never the ramps above. */
    --surface-page: var(--colour-neutral-50);
    --surface-raised: var(--colour-neutral-0);
    --surface-sunken: var(--colour-neutral-100);
    --text-primary: var(--colour-neutral-900);
    --text-secondary: var(--colour-neutral-700);
    --text-muted: var(--colour-neutral-500);
    --text-on-accent: var(--colour-neutral-0);
    --border-subtle: var(--colour-neutral-200);
    --border-strong: var(--colour-neutral-300);
    --accent: var(--colour-accent-500);
    --accent-strong: var(--colour-accent-700);
    --accent-wash: var(--colour-accent-50);
    --focus-ring: var(--colour-accent-500);

    /* Spacing scale, 4px base. */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;

    /* Type scale. */
    --font-sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.5rem;
    --text-2xl: 2.25rem;
    --leading-tight: 1.15;
    --leading-normal: 1.6;

    --radius-sm: 12px;
    --radius-md: 14px;
    --radius-lg: 20px;

    /* Colour belongs to the surface immediately beneath the content. */
    --surface-foreground: var(--colour-neutral-900);
    --surface-muted-foreground: var(--colour-neutral-500);
    --surface-ink: #0e0e0e;
    --surface-ink-foreground: #f5f4f0;
    --surface-ink-muted: #c9c8c3;
    --surface-violet: #5b21ff;
    --surface-violet-foreground: #f5f4f0;
    --surface-card-dark: #1a1a1a;
    --field-border: #dedcd5;

    /* Named control metrics: avoid arbitrary shadow sizes in adapters. */
    --control-height: 2.75rem;
    --control-height-compact: 2.375rem;
    --control-height-hero: 3.5rem;
    --control-radius: 12px;
    --control-radius-compact: 10px;
    --control-border-width: 2px;
    --action-offset: 5px;
    --action-offset-compact: 3px;
    --action-offset-hero: 6px;
    --action-offset-hover: 2px;
    --action-primary-shadow: var(--colour-violet);
    --action-secondary-shadow: var(--colour-neutral-300);
    --field-focus-offset: 4px;
    --motion-fast: 120ms;
    --motion-ease: ease;
    --status-success-background: #edf5ef;
    --status-caution-background: var(--colour-caution-50);
    --status-critical-background: var(--colour-critical-50);
    --status-accent-background: var(--colour-accent-50);
    --z-header: 30;
    --z-navigation: 25;
    --z-feedback: 40;

    --measure: 68ch;
    --container: 72rem;
  }
}

