/* Design tokens: the only place colours, type, spacing, radii and motion are defined. */
:root{
  /* Colour: warm neutral greys and one red accent */
  --bg:#F5F5F3;
  --surface:#FFFFFF;
  --surface-2:#EDEDEA;        /* tracks, hovers, quiet fills */
  --surface-3:#E2E2DE;
  --line:#E3E3DF;             /* hairlines */
  --line-strong:#CBCBC5;      /* control outlines */
  --ink:#18181A;              /* 17:1 on white */
  --ink-2:#4A4A50;            /* 8.8:1, secondary text */
  --ink-3:#6A6A70;            /* 5.4:1, tertiary text */
  --ink-4:#8E8E93;            /* 3.3:1, non-text UI only */
  --on-ink-2:#C9C9CD;         /* secondary text on dark */
  --accent:#C8102E;           /* 5.9:1; white text on it passes AA */
  --accent-strong:#A30D25;
  --accent-soft:#FBEBED;
  --on-accent:#FFFFFF;        /* text on the accent */
  --inv:#18181A;              /* inverse surface: dark in light mode, light in dark mode */
  --on-inv:#FFFFFF;
  --shimmer:rgba(255,255,255,.75);

  /* Type */
  --font:"Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-zh:"Noto Sans HK", "PingFang HK", "Microsoft JhengHei", sans-serif;
  --font-mono:ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-xs:.8125rem; --fs-sm:.875rem; --fs-md:1rem; --fs-lg:1.125rem;
  --fs-xl:1.375rem; --fs-2xl:1.75rem; --fs-3xl:2.5rem;

  /* Space: 4px base */
  --s-1:4px; --s-2:8px; --s-3:12px; --s-4:16px; --s-5:24px; --s-6:32px; --s-7:48px;
  --gutter:var(--s-4);   /* page side padding: wider on tablets and up (base.css) */

  /* Radius: a container's radius = its child's radius + the padding between them */
  --r-chip:6px;
  --r-ctl:8px;                                  /* buttons, inputs, options */
  --inset:4px;                                  /* padding of containers that hug controls */
  --r-box:calc(var(--r-ctl) + var(--inset));    /* 12px: cards, lists, button groups */
  --r-full:999px;

  /* Elevation: a 1px ring instead of a border, so padding maths stays exact */
  --ring:0 0 0 1px var(--line);
  --raise:0 0 0 1px var(--line), 0 1px 2px rgba(24,24,26,.05);

  /* Motion */
  --ease:cubic-bezier(.2,.7,.2,1);
  --t-fast:120ms; --t:200ms; --t-slow:450ms;
  --chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A4A50' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  color-scheme:light;
}

/* Dark theme. Applies when the learner picks Dark (data-theme="dark" on <html>), or picks System
   (no data-theme) and the device is in dark mode. Same roles, checked for the same contrast levels. */
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){

    --bg:#111113;
    --surface:#1B1B1E;
    --surface-2:#26262A;
    --surface-3:#313136;
    --line:#2C2C31;
    --line-strong:#45454C;
    --ink:#F3F3F0;              /* 16:1 on surface */
    --ink-2:#B9B9BF;            /* 8.7:1 */
    --ink-3:#96969D;            /* 5.8:1 */
    --ink-4:#6E6E76;            /* 3.4:1, non-text UI only */
    --on-ink-2:#4A4A50;
    --accent:#F0485E;           /* 4.7:1 as text on surface */
    --accent-strong:#FF6F82;
    --accent-soft:#2B0E13;
    --on-accent:#1B0508;        /* 5.3:1 on the accent */
    --inv:#F3F3F0;
    --on-inv:#18181A;
    --shimmer:rgba(255,255,255,.06);
    --raise:0 0 0 1px var(--line);
    --chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B9B9BF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{

    --bg:#111113;
    --surface:#1B1B1E;
    --surface-2:#26262A;
    --surface-3:#313136;
    --line:#2C2C31;
    --line-strong:#45454C;
    --ink:#F3F3F0;              /* 16:1 on surface */
    --ink-2:#B9B9BF;            /* 8.7:1 */
    --ink-3:#96969D;            /* 5.8:1 */
    --ink-4:#6E6E76;            /* 3.4:1, non-text UI only */
    --on-ink-2:#4A4A50;
    --accent:#F0485E;           /* 4.7:1 as text on surface */
    --accent-strong:#FF6F82;
    --accent-soft:#2B0E13;
    --on-accent:#1B0508;        /* 5.3:1 on the accent */
    --inv:#F3F3F0;
    --on-inv:#18181A;
    --shimmer:rgba(255,255,255,.06);
    --raise:0 0 0 1px var(--line);
    --chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B9B9BF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    color-scheme:dark;
}

