/* Intrados design tokens. The ONLY file in which a raw hex value may appear.
   Every component resolves colour through a semantic role below, so a palette
   change is one file. Values transcribed from brand.md. */
:root {
  /* core */
  --in-basalt:        #0F1317;
  --in-limestone:     #F2EEE7;
  --in-ochre:         #C58A2C;
  --in-ochre-deep:    #8F6118;
  --in-mortar:        #7D7A75;

  /* neutral extension */
  --in-panel:         #E9E4DB;
  --in-hairline:      #DBD5CA;
  --in-disabled:      #B6B1A7;
  --in-body-2:        #4A4843;
  --in-paper:         #FFFFFF;

  /* semantic roles: components read these, never the raw colours above */
  --in-bg:             var(--in-limestone);
  --in-surface:        var(--in-paper);
  --in-text:           var(--in-basalt);
  --in-text-secondary: var(--in-body-2);
  /* DEVIATION, see docs: brand.md sets this role to --in-mortar #7D7A75, which
     measures 3.70:1 on Limestone and fails the guide's own 4.5:1 gate for the
     eyebrow and the legal line. Darkened to the nearest compliant mortar (4.80:1).
     --in-mortar itself is unchanged and still used for the endorsement rule. */
  --in-text-muted:     #635F5A;  /* 5.48:1 on Limestone, 5.00:1 on Panel.
     The first attempt at this fix, #6B6862, cleared Limestone at 4.80 and still
     failed at 4.39 on the panel-backed sections, so the value is this dark. */
  --in-border:         var(--in-hairline);
  --in-accent:         var(--in-ochre-deep);  /* text, icons, filled buttons */
  --in-accent-rule:    var(--in-ochre);       /* the lit edge, large fills, never text */
  --in-notch:          var(--in-ochre-deep);

  /* the Basalt band inverts locally; these are its roles */
  --in-band-bg:        var(--in-basalt);
  --in-band-text:      var(--in-limestone);
  --in-band-muted:     var(--in-disabled);
  --in-band-border:    #2A3037;

  /* The BRDG endorsement, and nowhere else. DEVIATION: brand.md specifies
     #64748B, which measures 4.12:1 on Limestone and 3.92:1 on Basalt, so it
     fails AA on BOTH grounds and no single value satisfies both themes. Split
     per theme, staying in the same slate family. */
  --in-endorse-text:   #5A6478;   /* 5.15:1 on Limestone */

  /* Text that sits ON the accent fill. Must flip: the light accent is dark ochre
     so it carries light text (4.68:1); the dark accent is bright ochre, where
     light text measures 2.57:1 and dark text 6.26:1. */
  --in-on-accent:      #F7EEDC;

  /* geometry */
  --in-radius-control: 5px;
  --in-radius-card:    6px;
  --in-radius-table:   0px;
  --in-hairline-w:     1px;
  --in-lit-edge-w:     2px;
  --in-container:      1200px;
}

[data-theme="dark"] {
  --in-bg:             #0F1317;
  --in-surface:        #1B2026;
  --in-panel:          #1B2026;
  --in-text:           #F2EEE7;
  --in-text-secondary: #B6B1A7;
  --in-text-muted:     #8E8A84;
  --in-border:         #2A3037;
  --in-accent:         #C58A2C;
  --in-accent-rule:    #C58A2C;
  --in-notch:          #C58A2C;
  --in-endorse-text:   #8A97AB;   /* 6.30:1 on Basalt, 5.54:1 on the dark surface */
  --in-on-accent:      #0F1317;   /* dark text on the bright ochre fill, 6.26:1 */
  --in-band-bg:        #1B2026;
  --in-band-text:      #F2EEE7;
  --in-band-muted:     #B6B1A7;
  --in-band-border:    #2A3037;
}

/* Respect the visitor's OS preference when no explicit choice is stored. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --in-bg:             #0F1317;
    --in-surface:        #1B2026;
    --in-panel:          #1B2026;
    --in-text:           #F2EEE7;
    --in-text-secondary: #B6B1A7;
    --in-text-muted:     #8E8A84;
    --in-border:         #2A3037;
    --in-accent:         #C58A2C;
    --in-accent-rule:    #C58A2C;
    --in-notch:          #C58A2C;
    --in-endorse-text:   #8A97AB;
    --in-on-accent:      #0F1317;
    --in-band-bg:        #1B2026;
    --in-band-text:      #F2EEE7;
    --in-band-muted:     #B6B1A7;
    --in-band-border:    #2A3037;
  }
}
