/* Colors.
   Two rules govern this palette:
   1) Exactly ONE accent (moss). It means "this is what's on now". Nothing else.
   2) No semantic red for task state. Red exists only for destructive system
      actions (delete account). Overdue is never colored — it recedes.
   The primary axis is not status, it is calm: the --recede-* ramp steps content
   backwards (less contrast, less saturation) as it ages. */

:root {
  color-scheme: light;

  /* --- base ramp · warm paper -------------------------------------- */
  --paper-0: #faf7f2;   /* app background */
  --paper-1: #fffdfa;   /* raised surface / card */
  --paper-2: #f2eee6;   /* recessed surface, collapsed group */
  --paper-3: #e8e2d7;   /* hairline fills, track */

  --ink-900: #201e1a;
  --ink-700: #4a453d;
  --ink-500: #6f6a60;
  --ink-300: #9c9588;
  --ink-100: #c6bfb2;

  --line-strong: #ded7ca;
  --line: #e9e3d8;
  --line-soft: #f0ebe1;

  /* --- the one accent · moss --------------------------------------- */
  --moss-700: #3b5134;
  --moss-600: #47603f;
  --moss-500: #5a7850;
  --moss-300: #a8bd9f;
  --moss-100: #e7ede1;

  /* --- destructive only ------------------------------------------- */
  --danger: #8c3a2e;

  /* --- semantic aliases ------------------------------------------- */
  --bg-app: var(--paper-0);
  --surface-card: var(--paper-1);
  --surface-sunken: var(--paper-2);
  --surface-quiet: var(--paper-2);

  --text-agent: var(--ink-900);      /* the agent speaks */
  --text-body: var(--ink-900);
  --text-system: var(--ink-500);     /* labels, metadata — never the voice */
  --text-faint: var(--ink-300);
  --text-on-accent: #fffdfa;

  --accent: var(--moss-600);
  --accent-image: none; /* @kind other */
  /* Compatibility alias: any component still reaching for --accent-fill gets a
     solid accent instead of an unresolved token. An undefined --accent-* must
     never be able to blank the product's most important control. */
  --accent-fill: var(--accent);
  --accent-quiet: var(--moss-100);
  --accent-line: var(--moss-300);
  --accent-text: var(--moss-700);

  --border-card: var(--line);
  --border-strong: var(--line-strong);
  --border-field: var(--line-strong);

  --time-track: var(--paper-3);      /* elapsing time: emptying area */
  --time-fill: var(--moss-500);

  /* --- the "recede" ramp · age makes things quieter, never louder --- */
  --recede-0: var(--ink-900);   /* now / fresh */
  --recede-1: var(--ink-700);   /* a few days */
  --recede-2: var(--ink-500);   /* a couple of weeks */
  --recede-3: var(--ink-300);   /* old — present, not accusing */
  --recede-sat-0: 1; /* @kind other */
  --recede-sat-1: 0.75; /* @kind other */
  --recede-sat-2: 0.5; /* @kind other */
  --recede-sat-3: 0.28; /* @kind other */
}

/* Dark is not a variant, it is the likely evening mode. Equal in rank. */
.theme-dark,
[data-theme="dark"] {
  color-scheme: dark;

  --paper-0: #171613;
  --paper-1: #201f1b;
  --paper-2: #191814;
  --paper-3: #302e28;

  --ink-900: #ece9e2;
  --ink-700: #b6b0a6;
  --ink-500: #8d877b;
  --ink-300: #6b665c;
  --ink-100: #4a463f;

  --line-strong: #3a3831;
  --line: #2c2a25;
  --line-soft: #24231f;

  --moss-700: #c3d6b8;
  --moss-600: #a5bd98;
  --moss-500: #8faa81;
  --moss-300: #5c7052;
  --moss-100: #242a20;

  --danger: #cf8878;
  --text-on-accent: #171a14;

  /* The semantic aliases must be re-declared here, not only the base ramp:
     `--bg-app: var(--paper-0)` is substituted where it is DECLARED (:root), so
     redeclaring --paper-0 in a nested scope would never reach it. */
  --bg-app: var(--paper-0);
  --surface-card: var(--paper-1);
  --surface-sunken: var(--paper-2);
  --surface-quiet: var(--paper-2);
  --text-agent: var(--ink-900);
  --text-body: var(--ink-900);
  --text-system: var(--ink-500);
  --text-faint: var(--ink-300);
  --accent: var(--moss-600);
  --accent-image: none; /* @kind other */
  /* Compatibility alias: any component still reaching for --accent-fill gets a
     solid accent instead of an unresolved token. An undefined --accent-* must
     never be able to blank the product's most important control. */
  --accent-fill: var(--accent);
  --accent-quiet: var(--moss-100);
  --accent-line: var(--moss-300);
  --accent-text: var(--moss-700);
  --border-card: var(--line);
  --border-strong: var(--line-strong);
  --border-field: var(--line-strong);
  --time-track: var(--paper-3);
  --time-fill: var(--moss-500);

  --recede-0: var(--ink-900);
  --recede-1: var(--ink-700);
  --recede-2: var(--ink-500);
  --recede-3: var(--ink-300);
}

/* Reizarme Variante — for overstimulated states. Less contrast, no motion
   (motion is disabled in motion.css), accent reduced to a hairline. */
.theme-lowstim,
[data-theme="lowstim"] {
  --accent: var(--ink-700);
  --accent-quiet: var(--paper-2);
  --accent-line: var(--line-strong);
  --accent-text: var(--ink-700);
  --time-fill: var(--ink-300);
  --text-body: var(--ink-700);
  --text-agent: var(--ink-700);
}
