/* Le Chantier: brand tokens, mapped from the Le Petit Atelier palette
   (https://github.com/lepetitatelier/handbook/blob/main/brand/design-system.md, tokens.css).
   Import after fonts:  @import url("/fonts/fonts.css"); @import url("/brand.css");

   Rules carried over from the handbook:
   - Blue dominates. Orange (--brand-accent) is never more than ~5% of a screen: one call to
     action, a badge. Never body text.
   - Green means done / impact, never decoration. Red means warning / safety.
   - Sand is a background, never text.

   WCAG 2.1 contrast, checked (AA: 4.5 normal text, 3 large text >= 24px or 19px bold, 3 UI shapes):

   Light                               ratio   AA text
   ink      #0B2B3C on paper #EAF2F4   12.99   pass
   ink      #0B2B3C on white           14.74   pass
   ink      #0B2B3C on sand  #E3D2B4    9.93   pass
   primary  #15607A on paper            6.20   pass
   primary  #15607A on white            7.03   pass
   primary  #15607A on sand             4.74   pass
   muted    #4A5A63 on paper            6.31   pass   (on sand 4.82 pass)
   green    #3E6B4F on paper            5.41   pass   (on sand 4.13: FAIL normal text, large only)
   red      #B23A2E on paper            5.23   pass   (on sand 4.00: FAIL normal text, large only)
   white    on primary #15607A          7.03   pass   (buttons)
   white    on green   #3E6B4F          6.14   pass
   white    on red     #B23A2E          5.94   pass
   tide     #3FA7BF on paper            2.47   FAIL  (on white 2.80): lines, icons >= large, never text
   accent   #E07A3F on paper            2.63   FAIL  (on white 2.99): shapes and fills only, never text
   white    on accent  #E07A3F          2.99   FAIL  normal text (passes 3:1 large/bold only, just)
   ink      on accent  #E07A3F          4.93   pass   -> use --brand-on-accent for button labels
   ink      on tide    #3FA7BF          5.26   pass

   Dark (paper #0B2B3C, surface #11384B)   on paper  on surface
   ink      #E6EEF1                          12.54     10.56   pass
   muted    #9FB4BD                           6.83      5.76   pass
   primary  #6CC3D6 (lighter Tide)            7.31      6.16   pass
   tide     #3FA7BF                           5.26      4.43   pass on paper, FAIL small text on surface
   green    #7DB892                           6.42      5.41   pass
   red      #F08A7E                           6.06      5.11   pass
   accent   #F0965E                           6.48      5.46   pass (still: sparingly)
   ink-on-dark on sand panel #352E24         11.40             pass
   #0B2B3C on primary/green/red/accent (dark buttons): 7.31 / 6.42 / 6.06 / 6.48 pass  */

:root {
  /* Palette (fixed, same in both modes) */
  --lpa-deep-harbour: #0B2B3C;
  --lpa-akaroa-blue:  #15607A;
  --lpa-tide:         #3FA7BF;
  --lpa-foam:         #EAF2F4;
  --lpa-sand:         #E3D2B4;
  --lpa-kelp:         #3E6B4F;
  --lpa-signal:       #E07A3F;
  --lpa-roof-red:     #B23A2E;

  /* Roles (light) */
  --brand-ink:       #0B2B3C;   /* text, headers */
  --brand-ink-muted: #4A5A63;   /* secondary text */
  --brand-primary:   #15607A;   /* buttons, links, headings, the brand colour */
  --brand-on-primary:#FFFFFF;
  --brand-tide:      #3FA7BF;   /* highlights, focus rings, progress lines: not small text */
  --brand-paper:     #EAF2F4;   /* page background */
  --brand-surface:   #FFFFFF;   /* cards, sheets */
  --brand-sand:      #E3D2B4;   /* warm panels (the building, timber); never text */
  --brand-green:     #3E6B4F;   /* done, impact */
  --brand-on-green:  #FFFFFF;
  --brand-accent:    #E07A3F;   /* sparingly: the one call to action, a badge */
  --brand-on-accent: #0B2B3C;   /* white on orange fails AA */
  --brand-red:       #B23A2E;   /* warnings, safety */
  --brand-on-red:    #FFFFFF;
  --brand-border:    #C9D8DC;

  /* Type */
  --font-head: "Fraunces", "Fraunces Fallback", Georgia, "Times New Roman", serif;
  --font-body: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Shape and space (8 px base) */
  --brand-radius: 4px;
  --brand-radius-lg: 12px;
  --brand-line: 2px;            /* one line weight */
  --brand-space-1: 8px;
  --brand-space-2: 16px;
  --brand-space-3: 24px;
  --brand-space-4: 40px;
  --brand-space-5: 64px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-ink:       #E6EEF1;
    --brand-ink-muted: #9FB4BD;
    --brand-primary:   #6CC3D6;
    --brand-on-primary:#0B2B3C;
    --brand-tide:      #3FA7BF;
    --brand-paper:     #0B2B3C;
    --brand-surface:   #11384B;
    --brand-sand:      #352E24;
    --brand-green:     #7DB892;
    --brand-on-green:  #0B2B3C;
    --brand-accent:    #F0965E;
    --brand-on-accent: #0B2B3C;
    --brand-red:       #F08A7E;
    --brand-on-red:    #0B2B3C;
    --brand-border:    #1E4E63;
  }
}

/* Same values when the app forces dark with <html data-theme="dark">. */
:root[data-theme="dark"] {
  --brand-ink:       #E6EEF1;
  --brand-ink-muted: #9FB4BD;
  --brand-primary:   #6CC3D6;
  --brand-on-primary:#0B2B3C;
  --brand-tide:      #3FA7BF;
  --brand-paper:     #0B2B3C;
  --brand-surface:   #11384B;
  --brand-sand:      #352E24;
  --brand-green:     #7DB892;
  --brand-on-green:  #0B2B3C;
  --brand-accent:    #F0965E;
  --brand-on-accent: #0B2B3C;
  --brand-red:       #F08A7E;
  --brand-on-red:    #0B2B3C;
  --brand-border:    #1E4E63;
}
