/* Design tokens — Lazy Miggy (course: CLEP College Algebra).
   Palette derived from the official icon (assets/brand): deep navy and emerald
   from its background gradient, mint and gold from the "LM" letters, warm sloth
   tones for highlights. Light mode keeps a calm warm-paper reading surface; dark
   mode uses the icon's navy. Text colour pairs are checked for WCAG AA contrast in
   tests/e2e/brand-a11y.test.mjs. */
:root {
  color-scheme: light;
  --font-ui: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --font-math: "STIX Two Math", "Cambria Math", "Latin Modern Math", "STIX Two Text", Cambria, "Times New Roman", serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --bg: #f6f5f1;
  --bg-elevated: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f1efe9;
  --surface-3: #e8e5dc;
  --ink: #18202e;
  --ink-soft: #2f3a4d;
  --muted: #586174;
  --line: #e0ddd4;
  --line-strong: #c9c5b9;

  --primary: #0d3b6e;
  --primary-hover: #0a2f58;
  --primary-ink: #ffffff;
  --primary-soft: #e2ebf5;
  --accent: #0a6e4c;
  --accent-soft: #dcf2e7;
  --brand-navy: #061427;
  --brand-emerald: #0b8a5a;
  --brand-mint: #bff3d8;
  --brand-gold: #e9b21e;
  --brand-warm: #d99a6c;
  --good: #146c37;
  --good-soft: #e1f3e7;
  --bad: #b42318;
  --bad-soft: #fbe7e5;
  --warn: #8a4b06;
  --warn-soft: #fbefdc;
  --info: #1f5d93;
  --info-soft: #e3eef8;
  --pending: #6b6577;
  --pending-soft: #eeecf1;

  --math-bg: #f4f2ec;
  --focus: #0d3b6e;
  --shadow-1: 0 1px 2px rgba(24, 32, 46, .06), 0 1px 1px rgba(24, 32, 46, .04);
  --shadow-2: 0 6px 24px rgba(24, 32, 46, .08), 0 2px 6px rgba(24, 32, 46, .05);

  --radius-sm: .5rem;
  --radius: .85rem;
  --radius-lg: 1.15rem;
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.25rem; --s6: 1.5rem; --s8: 2rem; --s10: 2.5rem; --s12: 3rem;
  --text-xs: .75rem; --text-sm: .875rem; --text-md: 1rem; --text-lg: 1.125rem; --text-xl: 1.375rem; --text-2xl: 1.75rem; --text-3xl: 2.25rem;
  --reading: 46rem;
  --sidebar: 16rem;
  --gutter: clamp(16px, 3.5vw, 40px);
  --touch: 44px;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --dur: .18s;
}

/* Text size preference (Settings → Tamaño del texto). */
:root[data-font="sm"] { font-size: 15px; }
:root[data-font="md"] { font-size: 16px; }
:root[data-font="lg"] { font-size: 17.5px; }
:root[data-font="xl"] { font-size: 19px; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #061427; --bg-elevated: #08192f; --surface: #0c2039; --surface-2: #112945; --surface-3: #1a3554;
    --ink: #e9f0f7; --ink-soft: #cfdae7; --muted: #9fb0c4; --line: #1b3250; --line-strong: #2a4668;
    --primary: #8fe6bf; --primary-hover: #b0eed2; --primary-ink: #052218; --primary-soft: #0f3a3a;
    --accent: #f2c14e; --accent-soft: #3a2f12; --brand-navy: #061427; --brand-emerald: #0b8a5a; --brand-mint: #bff3d8; --brand-gold: #e9b21e; --brand-warm: #d99a6c;
    --good: #5ad58a; --good-soft: #11321f; --bad: #ff8a80; --bad-soft: #3a1717;
    --warn: #f4bf5f; --warn-soft: #3a2a10; --info: #7fb6ea; --info-soft: #132b45; --pending: #b3abc4; --pending-soft: #1d2440;
    --math-bg: #0f2540; --focus: #8fe6bf;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .35); --shadow-2: 0 8px 28px rgba(0, 0, 0, .45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #061427; --bg-elevated: #08192f; --surface: #0c2039; --surface-2: #112945; --surface-3: #1a3554;
  --ink: #e9f0f7; --ink-soft: #cfdae7; --muted: #9fb0c4; --line: #1b3250; --line-strong: #2a4668;
  --primary: #8fe6bf; --primary-hover: #b0eed2; --primary-ink: #052218; --primary-soft: #0f3a3a;
  --accent: #f2c14e; --accent-soft: #3a2f12; --brand-navy: #061427; --brand-emerald: #0b8a5a; --brand-mint: #bff3d8; --brand-gold: #e9b21e; --brand-warm: #d99a6c;
  --good: #5ad58a; --good-soft: #11321f; --bad: #ff8a80; --bad-soft: #3a1717;
  --warn: #f4bf5f; --warn-soft: #3a2a10; --info: #7fb6ea; --info-soft: #132b45; --pending: #b3abc4; --pending-soft: #1d2440;
  --math-bg: #0f2540; --focus: #8fe6bf;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35); --shadow-2: 0 8px 28px rgba(0, 0, 0, .45);
}
