/* ==========================================================================
   ds/tokens-core.css — «هادئ» (calm), the design language of يومي and منصّة الشعب, 25 Nov 2026.
   The base for every teacher screen and site page from now on. Read ds/README.md before using it.

   Studied from comma.surf/mobile (structure, rhythm, motion timings; see ~/cnte/research/comma/STACK.md). No code,
   text or asset of comma is copied: their site source is not public and their app repo is AGPL-3.0, so we wrote our own.
   Brand kept from 09-kufi: one ink, one paper tone, ONE red for the single primary action. What changes: one quiet
   Arabic family (IBM Plex Sans Arabic) instead of two loud ones, softer ink, rounded surfaces, more air.

   Load ds/fonts.css, ds/tokens-core.css, details.css and ds/components.css directly.
   Light only (user rule, 25 Nov 2026): no dark tokens, no prefers-color-scheme switch, pn.cnte.theme is ignored.
   ========================================================================== */

/* ---------- fonts ----------
   IBM Plex Sans Arabic (IBM Corp.), SIL Open Font License 1.1 (fonts/IBM-Plex-OFL.txt); the subset files are
   renamed inside to «PN Sans Arabic» because "Plex" is a Reserved Font Name and a subset is a Modified Version.
   Subset with fontTools (2026-11-25): the Arabic letters, hamza forms, tashkeel, Arabic-Indic and Western digits,
   Arabic and Latin punctuation, basic Latin; the Arabic and Latin halves merged into one file per weight.
   400 = 20 KB, 500 = 22 KB, 600 = 22 KB (WOFF2). Three weights only: regular, medium, strong. */
/* fallback with Plex's line metrics (hhea 1085 / -415 / 0), so the swap moves no line (CLS) */
@font-face{ font-family:"PN Sans Fallback"; src:local("Geeza Pro"), local("Arial"), local("Noto Sans Arabic"), local("Tahoma"); size-adjust:100%; ascent-override:108.5%; descent-override:41.5%; line-gap-override:0%; }

:root{
  /* ---------- colour (light only; every text colour is SOLID: no alpha on Arabic text, it seams at the letter joins) */
  --bg:#FFFFFF;                 /* page */
  --bg-panel:#F3F2EE;           /* cards, tiles: one tone step, never a line */
  --bg-raised:#FFFFFF;          /* a surface on a panel (sheet, popover, row on a panel) */
  --bg-sunken:#E9E8E3;          /* pressed, track of a switch, skeleton */
  --bg-inverse:#161616;         /* the ink band (footer), the user's own bubble */
  --fg-1:#161616;               /* text and icons: 18.1:1 on --bg, 16.2:1 on --bg-panel */
  --fg-2:#45443F;               /* secondary text: 9.8:1 on --bg, 8.7:1 on --bg-panel */
  --fg-3:#63625C;               /* notes, captions, meta: 6.1:1 on --bg, 5.46:1 on --bg-panel */
  --fg-on-inverse:#FFFFFF;
  --fg-on-inverse-2:#C9C8C3;    /* 11:1 on --bg-inverse */
  --hairline:#E4E3DE;           /* only where a tone step cannot separate (list rows on --bg) */
  --hairline-strong:#D3D2CC;    /* input borders, the frame of a quiet button */
  --accent:#1739A8;
  --accent-press:#12308F;
  --on-accent:#FFFFFF;          /* white on the action colour */
  --focus:var(--action);
  /* meaning colours (status only: done / needs you / lost); always with a word or an icon, never colour alone */
  --action:#1739A8;              /* ml-plan accent ink, 9.60:1 with white */
  --action-press:#12308F;
  --success:#E6F2EA;
  --danger:#E70013;

  --ok:#0B6B2E;    --ok-bg:#E6F2EA;
  --warn:#7A4A00;  --warn-bg:#FBEFD9;
  --bad:#B00012;   --bad-bg:#FBE7E8;
  --info:#1F4FBF;  --info-bg:#E8EEFB;
  --phone-bezel:#111111;        /* device frame */
  --phone-screen:#FFFFFF;

  /* ---------- type (Arabic needs ~1.06× the Latin size for the same optical size, and more line height) */
  --font:"PN Sans", "PN Sans Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --w-regular:400; --w-medium:500; --w-strong:600;          /* at most TWO of these in one view */
  --t-giant:clamp(52px, 8.4vw, 112px);    --lh-giant:1.12;  /* the closing line only */
  --t-display:clamp(30px, 3.1vw, 40px);   --lh-display:1.3; /* one per page: the h1 */
  --t-title:clamp(24px, 2.3vw, 30px);     --lh-title:1.35;  /* section titles */
  --t-subtitle:20px;                      --lh-subtitle:1.5;
  --t-body-lg:18px;                       --lh-body-lg:1.75; /* leads */
  --t-body:16px;                          --lh-body:1.75;    /* text, list rows */
  --t-small:14px;                         --lh-small:1.6;    /* captions, meta */
  --t-micro:13px;                         --lh-micro:1.5;    /* chips, status bar; never for sentences */

  /* ---------- space: one scale, 4-px base (comma's 2…128). Use these, never an odd number. */
  --s-1:2px; --s-2:4px; --s-3:6px; --s-4:8px; --s-5:12px; --s-6:16px; --s-7:20px; --s-8:24px;
  --s-9:32px; --s-10:40px; --s-11:48px; --s-12:64px; --s-13:80px; --s-14:96px; --s-15:128px;
  --gutter:clamp(16px, 4vw, 32px);
  --container:1200px;
  --measure:38rem;              /* longest line of running text (~70 Arabic characters) */
  --section-gap:clamp(96px, 10vw, 160px);
  --nav-h:56px;
  --tap:44px;                   /* minimum target */

  /* ---------- radius */
  --r-xs:4px; --r-sm:6px; --r-md:8px; --r-lg:10px; --r-xl:12px; --r-2xl:16px; --r-3xl:20px; --r-4xl:24px; --r-full:9999px;

  /* ---------- shadow (surfaces only; text never gets a shadow) */
  --shadow-sm:0 1px 2px 0 #1018280F, 0 1px 3px 0 #1018281A;
  --shadow-lg:0 4px 6px -2px #10182808, 0 12px 16px -4px #10182814;
  --shadow-2xl:0 24px 48px -12px #1018282E;
  --shadow-phone:0 40px 80px -32px #10182838, 0 12px 24px -12px #1018281F;

  /* ---------- motion: THREE durations, TWO curves (ds/README.md «الحركة الدقيقة»)
     --ease-out  = settle (a release, an arrival; a hint of spring: it overshoots by ~1 %)
     --ease-move = travel (an indicator sliding, a sheet, a list making room) */
  --dur-1:90ms;    /* press in, colour shift */
  --dur-2:180ms;   /* release, selection, toggles, fades */
  --dur-3:280ms;   /* sheets, list height, toast, page swap */
  --ease-out:cubic-bezier(.2, 1.1, .4, 1);
  --ease-move:cubic-bezier(.32, .72, 0, 1);
  /* aliases kept for older code: same two curves, same three durations */
  --ease-drawer:var(--ease-move); --ease-in-out:var(--ease-move); --ease-brand:var(--ease-out);
  --dur-fast:var(--dur-2); --dur-base:var(--dur-3); --dur-slow:var(--dur-3);
  --press-scale:.97;
  --focus-ring:2px solid var(--focus); --focus-offset:2px;

  color-scheme:light;
}

/* reduced motion: every duration collapses; components read these tokens */
/* reduced motion: nothing travels or scales; state changes are instant (components read these tokens) */
@media (prefers-reduced-motion:reduce){
  :root{ --dur-1:0ms; --dur-2:0ms; --dur-3:0ms; --press-scale:1; }
}

/* Solid, light pupil avatar colours. The same ink also outlines the face. */
:root{
  --avatar-ink:#344459;
  --avatar-face:#f9fbfa;
  --avatar-pastel-0:#dcece5;
  --avatar-pastel-1:#dceaf2;
  --avatar-pastel-2:#e8e1f2;
  --avatar-pastel-3:#f4e1e8;
  --avatar-pastel-4:#f5e9cd;
  --avatar-pastel-5:#e8edcf;
  --avatar-pastel-6:#d7ecea;
  --avatar-pastel-7:#dee4f4;
  --avatar-pastel-8:#eee1ed;
  --avatar-pastel-9:#f4e4d8;
  --avatar-pastel-10:#dae8d8;
  --avatar-pastel-11:#e4eaef;
}

/* ==========================================================================
   CRAFT tokens (28 Nov 2026, «Duolingo craft» pass; ds/README.md §6). Scoped to the working screens (body.app-actions):
   the showcase pages (how.html, body.ui) keep their approved values. Light only. Blue = primary, green = done,
   red = destructive only. Every text colour solid.
   ========================================================================== */
body.app-actions{
  /* one family on every working screen: kit.css's Kufi display face is retired there */
  --f-display:var(--font); --f-text:var(--font);
  /* type: older teachers read at arm's length. Body 18, never a sentence below 15 */
  --t-body:18px; --t-small:16px; --t-micro:15px; --t-note:16px;
  --t-h1:28px; --t-h2:22px; --t-h3:20px;
  --tap:48px;                        /* every target */
  --btn-h:54px;                      /* tactile buttons */
  --btn-edge:4px;                    /* the solid bottom edge that presses down */
  --btn-r:16px;                      /* buttons and cards share one radius */
  --card-r:16px;
  /* tactile colour pairs: face / edge (the edge is the same hue, darker, solid) */
  --primary:#1739A8;  --primary-edge:#0C2470; --primary-hover:#1C43C4; --on-primary:#FFFFFF;
  --done:#0B7A35;     --done-edge:#065A25;    --on-done:#FFFFFF;      --done-bg:#E3F4E8; --done-ink:#0B5A27;
  --destroy:#C4001A;  --destroy-edge:#8A0012; --on-destroy:#FFFFFF;
  --second:#FFFFFF;   --second-line:#D9DCE3;  --second-edge:#C9CDD6;  --on-second:#161616;
  --track:#E7E6E1;                   /* progress tracks */
  --panel:#F3F2EE;                   /* the how.html calm card */
  --focus:#1739A8;
  --t-quick:120ms; --t-move:220ms;   /* craft motion, both ≤ 250 ms */
  --ease-pop:cubic-bezier(.34, 1.4, .64, 1);
}
@media (prefers-reduced-motion:reduce){ body.app-actions{ --t-quick:0ms; --t-move:0ms; } }
html.big-text body.app-actions{ --t-body:22px; --t-note:18px; --t-small:18px; --t-micro:17px; --t-h1:32px; --t-h2:26px; --t-h3:22px; }

/* Approved showcases keep their original shared component palette. */
:root:where(:has(link[href="how.css"], link[href="how-stable.css"], link[href="/assets/home-next.css"])){
  --accent:#E70013;
  --accent-press:#B8000F;
  --focus:#E70013;
}
