/* ==========================================================================
   company-tokens.css — the palette, the type scale, the geometry.

   Taken from the client's own brand: karlanddimarconorth.com uses copper
   #c5865c as its primary button and link colour, charcoal #272727 as its ink,
   and pairs Playfair Display with Roboto. Company wears the same identity.

   One deliberate departure. The brand copper is a mid-tone: as TEXT it reaches
   only 3.03:1 on white, and white text on a copper fill is the same 3.03:1 —
   both below the 4.5:1 WCAG AA needs. So the copper stays exactly as the
   client uses it for FILLS, where it carries the identity, and text drawn in
   it uses a darkened copper of the same hue (--co-accent-ink). Text sitting
   ON a copper fill is the client's own charcoal rather than white, which is
   both accessible and still their palette.

   Every colour in the platform is defined here, and every foreground/background
   pair is asserted in tests/test_design_system.py. A colour declared anywhere
   else — especially one declared only inside a dark-mode block — is a defect.
   ========================================================================== */
:root {
  /* Neutrals, warmed very slightly toward the copper so they read as chosen. */
  --co-ground:#f8f7f5;
  --co-surface:#ffffff;
  --co-surface-2:#f2f0ed;
  --co-surface-3:#e8e5e1;
  --co-border:#e0dcd7;
  --co-border-strong:#c9c3bc;

  --co-ink:#272727;          /* the client's charcoal, verbatim */
  --co-ink-2:#56514c;
  --co-ink-3:#716b65;

  /* The brand copper. --co-accent is the fill; --co-accent-ink is text. */
  --co-accent:#c5865c;       /* the client's primary, verbatim */
  --co-accent-ink:#8f5730;
  --co-accent-soft:#f6ece4;
  --co-accent-strong:#a86a3f;
  --co-on-accent:#2a2320;

  /* The five status tones. Semantic, and deliberately not the brand hue. */
  --co-good:#2d7751;       --co-good-soft:#e6f1ea;
  --co-active:#8f5730;     --co-active-soft:#f6ece4;
  --co-waiting:#91620a;    --co-waiting-soft:#faf0dc;
  --co-attention:#a83a2f;  --co-attention-soft:#fae9e6;
  --co-inert:#6e6862;      --co-inert-soft:#eeebe8;
  --co-info:#35688f;       --co-info-soft:#e7eff5;

  --co-shadow:0 1px 2px rgba(39,39,39,.05), 0 4px 14px rgba(39,39,39,.05);
  --co-shadow-lg:0 12px 40px rgba(39,39,39,.16);
  --co-radius:10px;
  --co-radius-sm:7px;

  --co-sidebar-w:242px;
  --co-topbar-h:60px;

  --co-font-display:"Playfair Display",Georgia,"Times New Roman",serif;
  --co-font-body:"Roboto",-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
  --co-font-mono:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,monospace;
}

/* Guarded so an explicit light choice beats a dark operating system. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --co-ground:#1c1a18; --co-surface:#242220; --co-surface-2:#2c2926;
    --co-surface-3:#37332f; --co-border:#3a3733; --co-border-strong:#4e4a45;
    --co-ink:#f2efec; --co-ink-2:#bdb6ae; --co-ink-3:#98918a;
    --co-accent:#c5865c; --co-accent-ink:#e0aa84; --co-accent-soft:#372b22;
    --co-accent-strong:#d59a71; --co-on-accent:#241f1b;
    --co-good:#6cc294;      --co-good-soft:#18301f;
    --co-active:#e0aa84;    --co-active-soft:#372b22;
    --co-waiting:#dfb160;   --co-waiting-soft:#332813;
    --co-attention:#ef8f84; --co-attention-soft:#39201c;
    --co-inert:#958f87;     --co-inert-soft:#2b2724;
    --co-info:#7fb2d8;      --co-info-soft:#152935;
    --co-shadow:0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.28);
    --co-shadow-lg:0 12px 40px rgba(0,0,0,.5);
  }
}

/* Declared again so the toggle wins in both directions. */
:root[data-theme="dark"] {
  --co-ground:#1c1a18; --co-surface:#242220; --co-surface-2:#2c2926;
  --co-surface-3:#37332f; --co-border:#3a3733; --co-border-strong:#4e4a45;
  --co-ink:#f2efec; --co-ink-2:#bdb6ae; --co-ink-3:#98918a;
  --co-accent:#c5865c; --co-accent-ink:#e0aa84; --co-accent-soft:#372b22;
  --co-accent-strong:#d59a71; --co-on-accent:#241f1b;
  --co-good:#6cc294;      --co-good-soft:#18301f;
  --co-active:#e0aa84;    --co-active-soft:#372b22;
  --co-waiting:#dfb160;   --co-waiting-soft:#332813;
  --co-attention:#ef8f84; --co-attention-soft:#39201c;
  --co-inert:#958f87;     --co-inert-soft:#2b2724;
  --co-info:#7fb2d8;      --co-info-soft:#152935;
  --co-shadow:0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.28);
  --co-shadow-lg:0 12px 40px rgba(0,0,0,.5);
}
