/* Design tokens: the one place colours, fonts and type sizes are defined.
   styles.css reads these and holds no raw colour or font value of its own. */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --inverse: #14344a;
  --inverse-deep: #0d2536;
  --inverse-soft: #dbe7ee;
  --paper: #f3f6f8;
  --paper-light: #f9fbfc;
  --card: #ffffff;
  --ink: #17212b;
  --muted: #5d6b78;
  --accent: #1f7a80;
  --accent-soft: #cfe6e6;
  --line: rgba(20, 45, 65, .14);
  --line-inverse: rgba(255, 255, 255, .18);
  --shadow: 0 18px 60px rgba(15, 40, 60, .12);
  --shell: min(1240px, calc(100vw - 64px));

  /* Text and lines on the dark (inverse) surfaces. Every text step is at least
     4.5:1 on the lightest dark surface (dark theme --inverse, #1d4a66). */
  --on-inverse: #fff;
  --on-inverse-strong: rgba(255, 255, 255, .92);
  --on-inverse-soft: rgba(255, 255, 255, .84);
  --muted-on-inverse: rgba(255, 255, 255, .76);
  --on-inverse-subtle: rgba(255, 255, 255, .7);
  --on-inverse-faint: rgba(255, 255, 255, .64);
  --line-inverse-strong: rgba(255, 255, 255, .27);
  --fill-inverse: rgba(255, 255, 255, .06);
  --accent-on-inverse: #7fd0cf;
  --accent-line: rgba(127, 208, 207, .45);
  --surface-map: #0d2536;
  --surface-map-overlay: rgba(10, 28, 42, .94);
  --scrim: rgba(8, 20, 30, .72);
  --danger: #b0452f;
  --accent-fill: var(--accent);
  --on-accent: var(--on-inverse);

  /* Concept map: one colour per field, drawn on --surface-map */
  --map-track-1: #7fd0cf;
  --map-track-2: #e2b871;
  --map-track-3: #9db4e8;
  --map-track-4: #e39a86;
  --map-track-5: #b9c2c9;

  /* Search hits: a tint of the accent, apart from the reader's own highlight colours */
  --hit: rgba(31, 122, 128, .16);
  --hit-line: rgba(31, 122, 128, .7);
  --hit-current: rgba(31, 122, 128, .32);

  /* Print: always black on white, whatever the screen theme */
  --print-paper: #fff;
  --print-ink: #000;
  --print-muted: #555;
  --print-line: #999;

  /* Reader highlights */
  --hl-yellow: rgba(240, 200, 60, .45);
  --hl-green: rgba(95, 185, 150, .42);
  --hl-blue: rgba(125, 165, 230, .42);
  --hl-pink: rgba(230, 125, 155, .40);
  --hl-yellow-edge: #e0b830;
  --hl-green-edge: #5fb996;
  --hl-blue-edge: #7da5e6;
  --hl-pink-edge: #e67d9b;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 64px;
  --space-11: 80px;
  --space-12: 112px;

  /* Control sizes */
  --control-sm: 36px;
  --control-md: 44px;

  /* Layout measures */
  --measure: 760px;
  --measure-narrow: 640px;
  --signature-size: 260px;
  --signature-size-sm: 200px;
  --ornament-size: 560px;

  /* Corners */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Elevation (--shadow is the large one) */
  --shadow-sm: 0 1px 2px rgba(15, 40, 60, .06), 0 2px 8px rgba(15, 40, 60, .05);
  --shadow-md: 0 6px 22px rgba(15, 40, 60, .09);

  /* Type */
  --font-ui: "IBM Plex Sans Arabic", Arial, sans-serif;
  --font-reading: "IBM Plex Sans Arabic", Arial, sans-serif;
  --text-2xs: 12px;
  --text-xs: 13px;
  --text-sm: 15px;
  --text-md: 16px;
  --text-lg: 17px;
  --text-xl: 19px;
  --text-2xl: 22px;
  --text-3xl: 24px;
  --text-4xl: 27px;
  --text-5xl: 29px;
  --text-6xl: 36px;
  --leading-reading: 2.1;
  --leading-display: 1.15;
  --display-hero: clamp(40px, 5vw, 68px);
  --display-hero-sm: clamp(34px, 10vw, 46px);
  --display-figure: clamp(44px, 6vw, 72px);
  --display-figure-sm: 44px;
  --display-course: clamp(34px, 4.4vw, 52px);
  --display-course-sm: 32px;
  --display-lesson: clamp(28px, 3.4vw, 42px);
  --display-lesson-sm: clamp(25px, 7vw, 32px);
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0f171d;
  --paper-light: #141e26;
  --card: #1a2630;
  --ink: #eef3f6;
  --muted: #a3b2be;
  --inverse: #1d4a66;
  --inverse-soft: #20384a;
  --accent: #7fd0cf;
  --accent-soft: #1f4447;
  --line: rgba(225, 238, 245, .14);
  --shadow: 0 22px 80px rgba(0, 0, 0, .35);
  --danger: #f0907c;
  --accent-fill: #1f7a80;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .2);
  --shadow-md: 0 6px 22px rgba(0, 0, 0, .32);
  --hit: rgba(127, 208, 207, .2);
  --hit-line: rgba(127, 208, 207, .75);
  --hit-current: rgba(127, 208, 207, .38);
}
