/* ===========================================================================
   Design tokens — me.yodamad.fr

   Green is the ground, not the accent. That is the one structural decision
   everything else follows from: the page sits on deep conifer, and the
   stage-light marigold marks the few things that need attention.

   Marigold only reaches 2:1 on paper, so it is never text on a light ground.
   Light mode uses --marigold-ink for that role and keeps marigold for fills.
   Every text pairing below is >= 5.7:1.
   =========================================================================== */

:root {
  /* --- Core palette: 6 values --------------------------------------------- */
  --scene: #0C2A1E;        /* deep conifer: hero ground, dark-mode surface   */
  --scene-deep: #071A13;   /* the darker well: header bar, footer            */
  --chalk: #EAF2E8;        /* cool green-tinted off-white: text on --scene   */
  --paper: #FBFCFA;        /* cool near-white: light-mode page              */
  --marigold: #F0A92B;     /* stage light: next date, markers, focus        */
  --moss: #5E8C6A;         /* muted: secondary text, hairline rules         */

  /* --- Role variants the two grounds need -------------------------------- */
  --pine: #1A6344;         /* interactive text on --paper   6.9:1          */
  --mint: #7FD1A4;         /* interactive text on --scene   8.5:1          */
  --marigold-ink: #8A5A00; /* stage light as text on --paper 5.7:1         */
  --scene-well: #04120C;   /* below --scene-deep, for footer meta          */

  /* --- Type --------------------------------------------------------------- */
  /* Material appends its own fallback stack to these. */
  --md-text-font: "Archivo";
  --md-code-font: "Roboto Mono";

  /* --- Measure ------------------------------------------------------------ */
  --measure: 68ch;
}

/* ===========================================================================
   Light scheme
   =========================================================================== */
[data-md-color-scheme="default"] {
  --ground: var(--paper);
  --ink: var(--scene);
  --ink-soft: rgba(12, 42, 30, 0.64);
  /* Faintest text that still clears 4.5:1 on --paper. Material's own
     fg-color--lighter is for decoration and only reaches 2.1:1, so small
     real text uses this instead. */
  --ink-faint: rgba(12, 42, 30, 0.66);
  --rule: rgba(12, 42, 30, 0.14);
  /* Borders that identify a control (inputs, chips) need 3:1. */
  --edge: rgba(12, 42, 30, 0.5);
  --link: var(--pine);
  --signal: var(--marigold-ink);

  --md-default-bg-color: var(--paper);
  --md-default-fg-color: #0C2A1E;
  --md-default-fg-color--light: rgba(12, 42, 30, 0.64);
  --md-default-fg-color--lighter: rgba(12, 42, 30, 0.34);
  --md-default-fg-color--lightest: rgba(12, 42, 30, 0.07);

  --md-typeset-a-color: var(--pine);
  --md-accent-fg-color: var(--marigold-ink);
  --md-accent-fg-color--transparent: rgba(240, 169, 43, 0.18);

  --md-code-bg-color: rgba(12, 42, 30, 0.05);
  --md-code-fg-color: #123E2C;
}

/* ===========================================================================
   Dark scheme
   =========================================================================== */
[data-md-color-scheme="slate"] {
  --ground: var(--scene);
  --ink: var(--chalk);
  --ink-soft: rgba(234, 242, 232, 0.68);
  /* Faintest text that still clears 4.5:1 on --scene. */
  --ink-faint: rgba(234, 242, 232, 0.55);
  --rule: rgba(234, 242, 232, 0.16);
  /* Borders that identify a control (inputs, chips) need 3:1. */
  --edge: rgba(234, 242, 232, 0.4);
  --link: var(--mint);
  --signal: var(--marigold);

  --md-default-bg-color: var(--scene);
  --md-default-fg-color: var(--chalk);
  --md-default-fg-color--light: rgba(234, 242, 232, 0.68);
  --md-default-fg-color--lighter: rgba(234, 242, 232, 0.38);
  --md-default-fg-color--lightest: rgba(234, 242, 232, 0.10);

  --md-typeset-a-color: var(--mint);
  --md-accent-fg-color: var(--marigold);
  --md-accent-fg-color--transparent: rgba(240, 169, 43, 0.16);

  --md-code-bg-color: rgba(0, 0, 0, 0.32);
  --md-code-fg-color: #CFE6D6;
}

/* ===========================================================================
   Header and footer: the same dark brand bar in both schemes.
   `primary: custom` / `accent: custom` in mkdocs.yml means Material defines
   nothing here and expects these.
   =========================================================================== */
[data-md-color-primary="custom"] {
  --md-primary-fg-color: var(--scene-deep);
  --md-primary-fg-color--light: var(--scene);
  --md-primary-fg-color--dark: var(--scene-well);
  --md-primary-bg-color: var(--chalk);
  --md-primary-bg-color--light: rgba(234, 242, 232, 0.72);
}

[data-md-color-accent="custom"] {
  --md-accent-bg-color: var(--scene);
  --md-accent-bg-color--light: rgba(12, 42, 30, 0.8);
}

[data-md-color-scheme] {
  --md-footer-bg-color: var(--scene-deep);
  --md-footer-bg-color--dark: var(--scene-well);
  --md-footer-fg-color: var(--chalk);
  --md-footer-fg-color--light: rgba(234, 242, 232, 0.72);
  --md-footer-fg-color--lighter: rgba(234, 242, 232, 0.45);
}
