/* Harnace design tokens. Source of truth for color in the console and any web surface.
   Palette from the brand kit (September 2026). Roles and derived values are ours.
   Verify any change with: python3 brand/contrast_check.py */

:root {
  /* Brand palette, exact values. Do not alter these. */
  --harnace-charcoal:   #1F1E1B;
  --harnace-ivory:      #FAF8F4;
  --harnace-sand:       #E7DDD1;
  --harnace-clay:       #C49A7A;
  --harnace-umber:      #8A6F56;
  --harnace-sage:       #C7CAB7;
  --harnace-mist:       #A7B0B8;
  --harnace-terracotta: #C86F4E;

  /* Derived text-safe variants. Not brand colors. Used only where an accent
     must carry text on Ivory and the brand value fails WCAG AA. */
  --harnace-umber-text:      #7D6349;
  --harnace-terracotta-text: #A85539;

  /* Semantic roles, light theme */
  --bg:            var(--harnace-ivory);
  --surface:       var(--harnace-sand);
  --text:          var(--harnace-charcoal);
  --text-muted:    var(--harnace-umber-text);
  --border:        color-mix(in srgb, var(--harnace-charcoal) 12%, transparent);
  --accent:        var(--harnace-clay);      /* fills, never text on light */
  --accent-text:   var(--harnace-umber-text);
  --alert:         var(--harnace-terracotta); /* fills and icons */
  --alert-text:    var(--harnace-terracotta-text);
  --ok:            var(--harnace-sage);
  --neutral:       var(--harnace-mist);
}

:root:not([data-theme="light"]) {
  @media (prefers-color-scheme: dark) {
    --bg:          var(--harnace-charcoal);
    --surface:     color-mix(in srgb, var(--harnace-ivory) 7%, var(--harnace-charcoal));
    --text:        var(--harnace-ivory);
    --text-muted:  var(--harnace-mist);
    --border:      color-mix(in srgb, var(--harnace-ivory) 16%, transparent);
    --accent:      var(--harnace-clay);
    --accent-text: var(--harnace-clay);       /* 6.55:1 on charcoal, safe */
    --alert:       var(--harnace-terracotta);
    --alert-text:  var(--harnace-terracotta); /* 4.64:1 on charcoal, safe */
    --ok:          var(--harnace-sage);
    --neutral:     var(--harnace-mist);
  }
}

:root[data-theme="dark"] {
  --bg:          var(--harnace-charcoal);
  --surface:     color-mix(in srgb, var(--harnace-ivory) 7%, var(--harnace-charcoal));
  --text:        var(--harnace-ivory);
  --text-muted:  var(--harnace-mist);
  --border:      color-mix(in srgb, var(--harnace-ivory) 16%, transparent);
  --accent:      var(--harnace-clay);
  --accent-text: var(--harnace-clay);
  --alert:       var(--harnace-terracotta);
  --alert-text:  var(--harnace-terracotta);
  --ok:          var(--harnace-sage);
  --neutral:     var(--harnace-mist);
}

/* Type. Inter for product and body, Tiempos Text for marketing headlines only. */
:root {
  --font-ui:        Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-editorial: "Tiempos Text", ui-serif, Georgia, "Times New Roman", serif;
}
