/* tokens.css — the design system's single source of truth.
   ---------------------------------------------------------------
   Every colour, font, size, radius, shadow and duration lives here.
   Other files only use var(--…). To re-theme the app, edit this file.

   Identity: "Study desk" — cool paper, ink-blue for actions,
   a highlighter yellow for the words you are learning and for rewards.
   Green and red mean right and wrong — never decoration.

   Light only, on purpose: a bright, calm page keeps a learner alert
   through long study days. Text contrast is tuned for hours of reading.
   --------------------------------------------------------------- */

:root {
  color-scheme: light;

  /* Surfaces */
  --paper:      #f3f5f9;   /* page background */
  --surface:    #ffffff;   /* cards, panels */
  --surface-2:  #eaeef5;   /* quiet fills: inputs, tracks, chips */
  --line:       #d9dfe9;   /* borders and dividers */
  --line-strong:#b9c2d3;

  /* Text — all pass WCAG AA on --surface and --paper */
  --ink:   #141b2d;        /* headings, body */
  --ink-2: #465066;        /* secondary text */
  --ink-3: #56617a;        /* hints, meta (5.3:1 on quiet fills) */

  /* Brand: ink blue — actions, links, current place */
  --brand:      #2b48d6;
  --brand-hover:#2039b5;
  --brand-soft: #e5eaff;
  --on-brand:   #ffffff;

  /* Highlighter — the signature: marks the word being learned, rewards */
  --mark:      #ffe066;
  --mark-soft: #fff5c7;
  --on-mark:   #4a3900;

  /* Feedback */
  --good:      #0f744f;   /* ≥ 5:1 on --good-soft: the answer buttons */
  --good-soft: #dcf4e9;
  --bad:       #b3302f;   /* ≥ 5:1 on --bad-soft */
  --bad-soft:  #fce3e3;

  /* CEFR level badges — three calm steps, information only */
  --lvl-a: #0f7a6d;  --lvl-a-soft: #d9f2ee;
  --lvl-b: #2b48d6;  --lvl-b-soft: #e5eaff;
  --lvl-c: #7a3fb8;  --lvl-c-soft: #f0e6fa;

  /* Type — chosen for hours of reading and for learning spelling.
     --font-word  Atkinson Hyperlegible Next: made so look-alike letters
                  (l I 1, rn m, cl d, O 0) can't be confused. Every English
                  word you learn, and all body text, uses it.
     --font-display  Bricolage Grotesque: big screen headings only — never
                  the word being learned.
     --font-arabic   IBM Plex Sans Arabic, set a step larger than Latin
                  (Arabic looks smaller at the same size).
     --font-ipa      Charis SIL: the dictionary face, full IPA coverage. */
  --font-word:    "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --font-body:    var(--font-word);
  --font-display: "Bricolage Grotesque", var(--font-word);
  --font-arabic:  "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-ipa:     "Charis SIL", "Doulos SIL", "Noto Serif", Georgia, serif;
  --arabic-scale: 1.12;    /* Arabic text is drawn this much larger */

  /* Type scale — tuned for reading on a phone first.
     13 / 15 / 17 / 20 / 24 / 30 / 32–48. */
  --text-2xs: .75rem;      /* 12px: tab labels and badge counts only */
  --text-xs:  .8125rem;    /* 13px: meta, hints, chips */
  --text-sm:  .9375rem;    /* 15px: buttons, secondary copy */
  --text-md:  1.0625rem;   /* 17px body: easier on the eyes for long sessions */
  --text-lg:  1.25rem;     /* 20px: section titles, activity titles */
  --text-xl:  1.5rem;      /* 24px */
  --text-2xl: 1.875rem;    /* 30px: page titles on phones */
  --text-3xl: clamp(2rem, 1.4rem + 2.6vw, 3rem);

  /* Space — 4px grid */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --gutter: clamp(16px, 5vw, 32px);   /* 16px at 320, ~20px at 390, 32px at desktop */

  /* Shape */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-pill: 999px;

  /* Depth — two levels only */
  --shadow-1: 0 1px 2px rgb(20 27 45 / .06), 0 1px 1px rgb(20 27 45 / .04);
  --shadow-2: 0 10px 30px -12px rgb(20 27 45 / .25), 0 2px 6px rgb(20 27 45 / .06);

  /* Motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --fast: 140ms;
  --slow: 320ms;

  /* Layout */
  --content-max: 1120px;
  --activity-max: 720px;
  --bar-h: 64px;
  --tap: 44px;             /* minimum touch target */
}

/* Accent colours (Settings → Look). Only the action colour changes;
   the highlighter, right and wrong keep their meaning. All pass AA. */
:root[data-accent="teal"]   { --brand: #0a6f6a; --brand-hover: #085a56; --brand-soft: #d9f1ef; }
:root[data-accent="violet"] { --brand: #6a3fc4; --brand-hover: #5631a6; --brand-soft: #ece4fb; }
:root[data-accent="rose"]   { --brand: #b8325f; --brand-hover: #98264d; --brand-soft: #fbe3eb; }
:root[data-accent="plum"]   { --brand: #8a2f6b; --brand-hover: #702557; --brand-soft: #f7e4f1; }
:root[data-accent="cocoa"]  { --brand: #7a4a2b; --brand-hover: #643b21; --brand-soft: #f6ebe2; }
