/* Clementhyme color tokens
   Light: Faience & Clementine  ·  Dark: Clementine & Egyptian Blue
   Use the role names in components (never raw hex), so both themes stay in sync. */

:root {
  color-scheme: light;

  /* Surfaces */
  --ground: #F2ECDF;          /* page background (sand) */
  --surface: #FAF6EE;         /* cards, sheets, tab bar */
  --raised: #FFFFFF;          /* inputs, open panels */
  --block: #E6DFD0;           /* date blocks, segmented-control track */
  --line: #DED6C6;            /* card borders */
  --line-soft: #E8E1D3;       /* row dividers */
  --outline: #C8C0AF;         /* secondary-button borders, dashed "Add" */

  /* Text */
  --ink: #1F2624;
  --muted: #5A635E;
  --faint: #646C67;           /* "Open", chevrons, past days */

  /* Main action: buttons, today, assistant button */
  --primary: #146B6B;         /* faience teal */
  --on-primary: #FFFFFF;
  --primary-text: #146B6B;    /* links, labels, started dots */
  --primary-tint: #D9EBE8;    /* "in progress" pill background */
  --today-row: #E6F1EF;

  /* Highlight: selected meal, active tab, current step, sparkle */
  --accent: #E8742E;          /* clementine */
  --accent-tint: #FBE2CF;
  --accent-text: #A8430F;
  --sparkle: #F5A26A;         /* icon on the assistant button */

  --danger: #A13D2D;          /* Remove */
  --scrim: rgba(31, 38, 36, 0.40);
  --shadow: 0 8px 24px rgba(31, 38, 36, 0.22);

  /* Timers: time's up, and "check it" when a range reaches its low end */
  --time-up: #A83A2A;         /* brick red from the --danger family: still one red */
  --on-time-up: #FFFFFF;
  --time-up-tint: #F6DED8;
  --time-up-text: #8E2F21;
  --check: #D9A21E;           /* saffron */
  --check-tint: #FBEDC4;
  --check-text: #6B4D00;

  /* Logo (Classic rosette) */
  --logo-rind: #146B6B;
  --logo-pith: #FBE2CF;
  --logo-fruit: #E8742E;
}

/* Dark: set data-theme="dark" on <html> from the in-app toggle */
:root[data-theme="dark"] {
  color-scheme: dark;

  --ground: #12141C;          /* deep blue-black */
  --surface: #1A1D28;
  --raised: #232736;
  --block: #262A38;
  --line: #2C3142;
  --line-soft: #262A38;
  --outline: #3F4558;

  --ink: #EEE9E1;
  --muted: #A6A8B4;
  --faint: #8A8D9B;

  --primary: #EE8434;         /* clementine leads in dark */
  --on-primary: #1D1F2A;      /* dark text: white on clementine fails contrast */
  --primary-text: #F59A55;
  --primary-tint: #2A2118;
  --today-row: #2A2118;

  --accent: #6E95E8;          /* Egyptian blue, lifted for dark backgrounds */
  --accent-tint: #1E2A4A;
  --accent-text: #8FB0F0;
  --sparkle: #1E4AA8;         /* deep Egyptian blue on the clementine button */

  --danger: #F47C7C;
  --scrim: rgba(0, 0, 0, 0.55);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);

  /* Timers: dark text on the red, as on clementine */
  --time-up: #EB5C4C;
  --on-time-up: #1D1F2A;
  --time-up-tint: #3A2022;
  --time-up-text: #F59479;
  --check: #E8BC4A;
  --check-tint: #33290F;
  --check-text: #F2D07A;

  /* Logo (Classic rosette): Egyptian-blue rind in dark */
  --logo-rind: #5A85E0;
  --logo-pith: #1A1D28;
  --logo-fruit: #EE8434;
}

/* Dark: also follow the device setting unless the toggle forces light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --ground: #12141C;          /* deep blue-black */
    --surface: #1A1D28;
    --raised: #232736;
    --block: #262A38;
    --line: #2C3142;
    --line-soft: #262A38;
    --outline: #3F4558;

    --ink: #EEE9E1;
    --muted: #A6A8B4;
    --faint: #8A8D9B;

    --primary: #EE8434;         /* clementine leads in dark */
    --on-primary: #1D1F2A;      /* dark text: white on clementine fails contrast */
    --primary-text: #F59A55;
    --primary-tint: #2A2118;
    --today-row: #2A2118;

    --accent: #6E95E8;          /* Egyptian blue, lifted for dark backgrounds */
    --accent-tint: #1E2A4A;
    --accent-text: #8FB0F0;
    --sparkle: #1E4AA8;         /* deep Egyptian blue on the clementine button */

    --danger: #F47C7C;
    --scrim: rgba(0, 0, 0, 0.55);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);

    /* Timers: dark text on the red, as on clementine */
    --time-up: #EB5C4C;
    --on-time-up: #1D1F2A;
    --time-up-tint: #3A2022;
    --time-up-text: #F59479;
    --check: #E8BC4A;
    --check-tint: #33290F;
    --check-text: #F2D07A;

    /* Logo (Classic rosette): Egyptian-blue rind in dark */
    --logo-rind: #5A85E0;
    --logo-pith: #1A1D28;
    --logo-fruit: #EE8434;
  }
}

/* Meal label tags (Breakfast / Lunch / Dinner / custom) */
:root {
  --tag-breakfast-bg: #FBE2CF; --tag-breakfast-text: #A8430F;
  --tag-lunch-bg: #D9EBE8;     --tag-lunch-text: #0F5656;
  --tag-dinner-bg: #DFE6F5;    --tag-dinner-text: #1E4AA8;
  --tag-custom-bg: #E6DFD0;    --tag-custom-text: #4E5752;
}
:root[data-theme="dark"] {
  --tag-breakfast-bg: #3A2717; --tag-breakfast-text: #F6A465;
  --tag-lunch-bg: #14302B;     --tag-lunch-text: #7FD3CB;
  --tag-dinner-bg: #1E2A4A;    --tag-dinner-text: #8FB0F0;
  --tag-custom-bg: #262A38;    --tag-custom-text: #A6A8B4;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --tag-breakfast-bg: #3A2717; --tag-breakfast-text: #F6A465;
    --tag-lunch-bg: #14302B;     --tag-lunch-text: #7FD3CB;
    --tag-dinner-bg: #1E2A4A;    --tag-dinner-text: #8FB0F0;
    --tag-custom-bg: #262A38;    --tag-custom-text: #A6A8B4;
  }
}

/* Fonts: load Source Serif 4 (600, italic 400) and DM Sans (400/500/600),
   self-hosted for the open-source build, e.g. via @fontsource packages. */
:root {
  --font-display: "Source Serif 4", Georgia, serif;
  --font-ui: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
