/* SHID look: one visual identity for the redesigned pages (Home, My Page, Games, Mawhiba, School practice).
   Owner, 2026-11-20: cream page, navy text, purple accents; the rounded display font only for short headings,
   the cleaner text font for descriptions, search fields and progress details; calmer headings and borders;
   colour used selectively; decoration scaled by the student's age. Rules: docs/design-rules.md.

   Age tiers: <html data-look="young|middle|older"> (set by AgeLook in api.js; Mawhiba pins "middle").
   - young  = KG–grade 2: bigger pictures, sparks, brighter accents, a little heavier lines
   - middle = grades 3–8, and the default when the grade is unknown (guests, public pages, staff)
   - older  = grades 9–12: smaller pictures, no sparks, quiet surfaces, content and actions first
   Colour palette for little ones stays with the kids look (kids.css, KG–5); the tiers only change how much
   decoration there is, so the two work together (a grade 4 student is kids colours + middle decoration).
   Pages read these tokens; they never select the shared header or menu. */
:root {
  /* Font roles */
  --look-font-display: "Fredoka", "Baloo Bhaijaan 2", "IBM Plex Sans Arabic", system-ui, sans-serif; /* short headings, numbers, buttons */
  --look-font-text: "Inter", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif; /* descriptions, search, progress */

  /* Colours (light); dark mode below */
  --look-cream: #fbf8f3;
  --look-ink: #10153a;
  --look-muted: #5b6180;
  --look-purple: #6a3fd0;
  --look-purple-deep: #5628b6;
  --look-edge: #e4dff0;          /* quiet card edge */
  --look-field-edge: #d3d5e6;    /* search box edge */
  --look-shadow: 0 1px 0 rgba(16, 21, 58, .04), 0 6px 18px rgba(16, 21, 58, .05);

  /* Type scale (desktop / phone) */
  --look-title: 46px;      --look-title-sm: 30px;   /* the page's one big heading */
  --look-h2: 28px;         --look-h2-sm: 22px;      /* card / band headings */
  --look-h3: 23px;         --look-h3-sm: 19px;      /* tile names, level names */
  --look-lead: 19px;       --look-lead-sm: 16px;    /* subtitle under the title */
  --look-text: 16px;       --look-small: 14.5px;    /* body text, counts, progress */
  --look-field: 17px;      --look-field-sm: 16px;   /* search fields */

  /* Lines and shapes */
  --look-line: 1.5px;        /* card edges, dividers */
  --look-line-bold: 2px;     /* outlined buttons and tiles (was 3–4px) */
  --look-radius-lg: 22px;  --look-radius: 16px;  --look-radius-sm: 12px;

  /* Decoration scale */
  --look-art: 1;            /* multiplier for SHID, icons and illustrations */
  --look-spark: .9;         /* multiplier for the little spark rays (hidden for older students) */
  --look-tint: 12%;         /* how much accent goes into band / surface tints */
  --look-accent-line: 70%;  /* how strong a tile's accent outline is */
}
:root[data-theme="dark"] {
  --look-cream: #121731; --look-ink: #eef0ff; --look-muted: #b3b9d9; --look-purple: #c4b2ff; --look-purple-deep: #b9adff;
  --look-edge: #2c3560; --look-field-edge: #3a4475; --look-shadow: 0 6px 18px rgba(4, 8, 24, .3);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --look-cream: #121731; --look-ink: #eef0ff; --look-muted: #b3b9d9; --look-purple: #c4b2ff; --look-purple-deep: #b9adff;
    --look-edge: #2c3560; --look-field-edge: #3a4475; --look-shadow: 0 6px 18px rgba(4, 8, 24, .3);
  }
}

/* KG–2: bigger and brighter, sparks on */
:root[data-look="young"] {
  --look-title: 54px; --look-title-sm: 34px;
  --look-h2: 30px; --look-h2-sm: 23px;
  --look-h3: 25px; --look-h3-sm: 20px;
  --look-lead: 20px;
  --look-line-bold: 2.5px;
  --look-radius-lg: 26px; --look-radius: 18px;
  --look-art: 1.1; --look-spark: 1; --look-tint: 18%; --look-accent-line: 100%;
}
/* Grades 9–12: smaller, quieter, content first */
:root[data-look="older"] {
  --look-title: 40px; --look-title-sm: 27px;
  --look-h2: 24px; --look-h2-sm: 20px;
  --look-h3: 21px; --look-h3-sm: 18px;
  --look-lead: 17px; --look-lead-sm: 15px;
  --look-line-bold: 1.5px;
  --look-radius-lg: 18px; --look-radius: 14px; --look-radius-sm: 10px;
  --look-art: .72; --look-spark: 0; --look-tint: 7%; --look-accent-line: 40%;
}
