/* FRED design tokens.
 *
 * Ported from the approved prototype. Values are authored in hex rather than
 * oklch (the original notation is kept in the comment beside each) for two
 * reasons: universal support including older Android WebViews, which is not a
 * hypothetical audience for a school platform; and so tests/test_design_tokens.py
 * can parse the real stylesheet and assert contrast, rather than asserting
 * against a copy that can drift.
 *
 * ---------------------------------------------------------------------------
 * The one rule this file exists to keep
 *
 * FRED's brand colour is red. "Overdue" is also red. A learner must never have
 * to work out which one they are looking at, so:
 *
 *   1. --brand is reserved for identity and primary action — the wordmark, the
 *      active nav pill, the Done button. It never appears inside a component
 *      that carries a status.
 *   2. --danger is a darker, desaturated red used only for status. The gap is
 *      deliberate: 11 points of lightness and a third less chroma.
 *   3. Status is never signalled by colour alone. Every status carries a dot
 *      *and* its word — Complete, Overdue, Not yet due.
 */

:root {
  /* -- Neutrals: warm off-white paper, near-black ink -------------------- */
  --paper:            #faf8f6;
  --paper-sunken:     #f2f1ef;  /* oklch(95.8% .003 90)  */
  --paper-raised:     #ffffff;  /* oklch(100%  0    0)   */
  --ink:              #221513;
  --ink-muted:        #7d6b66;
  --ink-subtle:       #8f7e79;
  --line:             #efe3df;
  --line-strong:      #e2d3ce;

  /* -- Brand: identity and primary action only --------------------------- */
  --brand:            #eb1313;
  --brand-on:         #ffffff;

  /* -- Dark surfaces: the sidebar and the Today's Lesson card ------------ */
  --dark:             #0d0d0f;  /* oklch(16%   .004 285) */
  --dark-raised:      #1f1f22;  /* oklch(24%   .006 285) */
  --dark-on:          #f5f5f4;  /* oklch(97%   .002 90)  */
  --dark-on-muted:    #9d9ea5;  /* oklch(70%   .010 285) */

  /* -- Status ------------------------------------------------------------
   * Three roles each: -dot is the signal, -soft is the fill behind it,
   * -deep is the text on that fill.
   *
   * There is no status red. Overdue, late and rejected are an ink chip with an
   * amber triangle (see .chip-overdue), so red only ever means "the main
   * action" or "where you are". tests/test_design_tokens.py holds what is left
   * to contrast and separation rules.                                         */
  --ok-dot:           #008a26;  /* oklch(54% .19  150) */
  --ok-soft:          #ccf4d3;  /* oklch(93% .06  150) */
  --ok-deep:          #00682a;  /* oklch(45% .13  150) */


  --due-dot:          #b37000;  /* oklch(60% .15  75)  */
  --due-soft:         #ffecc1;  /* oklch(95% .06  85)  */
  --due-deep:         #905d00;  /* oklch(52% .12  75)  */

  --idle-dot:         #686870;  /* oklch(52% .012 285) */
  --idle-soft:        #e9e8e5;  /* oklch(93% .004 90)  */
  --idle-deep:        #55555a;  /* oklch(45% .008 285) */

  /* -- FRED design system ------------------------------------------------
   * The redesign palette. Overlapping names above (--ink, --paper, --line,
   * --line-strong, --brand) were retuned to these values so old and new
   * components share one set of neutrals.
   *
   *   Red   primary action and the active nav item, nothing else.
   *   Amber achievement: badges, points, celebration, "up next".
   *   Teal  progress, completion, wayfinding, links.
   *   Navy  anything from the coach.
   * Text on amber, teal and every tint is --ink, never white.             */
  --surface:          #ffffff;
  --ink-soft:         #7d6b66;
  --ink-faint:        #b7a6a1;
  --empty:            #f3ece9;

  --red:              #eb1313;
  --red-shadow:       #a80c0c;
  --amber:            #f5a300;
  --amber-shadow:     #c98500;
  --teal:             #0ea394;
  --teal-shadow:      #0a7d71;  /* also the link text colour */
  --navy:             #1b2a4a;
  --navy-shadow:      #0f1a30;

  --red-tint:         #fbdcdc;
  --amber-tint:       #fceacb;
  --amber-tint-border:#f7dba6;
  --teal-tint:        #d7f2ee;
  --navy-tint:        #dce3f0;

  /* The block look: solid offset shadows, no blur anywhere. */
  --block-card:       0 5px 0 var(--line);
  --block-ghost:      0 5px 0 var(--line-strong);
  --radius-input:     8px;
  --radius-chip:      10px;
  --radius-btn:       16px;
  --radius-nav:       14px;
  --radius-card:      22px;
  --radius-hero:      28px;

  /* -- Semantic aliases -------------------------------------------------- */
  --bg:               var(--paper);
  --bg-raised:        var(--paper-raised);
  --bg-sunken:        var(--paper-sunken);
  --text:             var(--ink);
  --text-muted:       var(--ink-muted);
  --text-subtle:      var(--ink-subtle);
  --border:           var(--line);
  --border-strong:    var(--line-strong);
  --focus-ring:       var(--teal-shadow);

  /* -- Typography --------------------------------------------------------
   * Poppins for titles, headings and big numbers; Manrope for everything
   * people read at length, plus labels and buttons. Both self-hosted.      */
  --font-ui: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
             Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Poppins", "Manrope", ui-sans-serif, system-ui, -apple-system,
                  "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  --text-2xs:  0.6875rem;
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.375rem;
  --text-2xl:  1.75rem;
  --text-3xl:  2.25rem;
  --text-4xl:  3rem;            /* 1.200 minor third */

  --leading-tight:  1.15;
  --leading-snug:   1.35;
  --leading-normal: 1.55;
  --tracking-tight: -0.02em;
  --tracking-wide:   0.08em;

  /* -- Space: 4px base --------------------------------------------------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  /* -- Shape ------------------------------------------------------------- */
  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   14px;          /* the prototype's .875rem card corner */
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgb(15 15 18 / 0.05);
  --shadow:    0 1px 3px rgb(15 15 18 / 0.07), 0 6px 16px rgb(15 15 18 / 0.05);
  --shadow-lg: 0 10px 34px rgb(15 15 18 / 0.13);

  /* -- Motion ------------------------------------------------------------ */
  --ease: cubic-bezier(0.2, 0, 0.2, 1);
  --dur-fast: 110ms;
  --dur: 170ms;
  --dur-slow: 260ms;

  /* -- Layout ------------------------------------------------------------ */
  --layout-max: 1360px;
  --sidebar-w: 260px;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur: 0ms;
    --dur-slow: 0ms;
  }
}
