/* Masdar design tokens. Colour, shadow, radius and font values are copied from the design's
   engineering handoff (Masdar redesign · Handoff, v0.1). Same names in both themes; only the
   values change. The theme is set on <html data-theme> by the inline script in index.html. */

:root,
[data-theme="paper"] {
  --ground: #F5EFE6;  --surface: #FDFBF7;  --sunken: #ECE5DB;
  --rule: #D9D2C6;    --rule-strong: #877F75;
  --ink: #1D1814;     --ink-2: #534C45;    --ink-3: #6D665F;
  --accent: #8A1538;  --accent-text: #8A1538;
  --accent-tint: #F8DFE0;  --on-accent: #FEFCF7;
  --success: #296A3B; --success-tint: #D8EFDC;
  --warning: #895909; --warning-tint: #F9E8C4;
  --danger: #B6341F;  --danger-tint: #FEE5DD;
  --shadow-1: 0 1px 2px rgb(29 24 20 / .06),
              0 12px 28px -8px rgb(29 24 20 / .18);
  --float-border: transparent;
  --scrim: rgb(29 24 20 / .32);
  color-scheme: light;
}

[data-theme="night"] {
  --ground: #13100D;  --surface: #1C1915;  --sunken: #0C0A07;
  --rule: #312D29;    --rule-strong: #6E6862;
  --ink: #F1ECE4;     --ink-2: #C2BDB4;    --ink-3: #A09A92;
  --accent: #E08794;  --accent-text: #EAA0AA;
  --accent-tint: #411B22;  --on-accent: #13100D;
  --success: #7FC88F; --success-tint: #1A2E1E;
  --warning: #EABC6E; --warning-tint: #3A2B11;
  --danger: #FC8E72;  --danger-tint: #3E1F17;
  --shadow-1: none;   /* floating layers get a 1px rule-strong border instead */
  --float-border: var(--rule-strong);
  --scrim: rgb(0 0 0 / .55);
  color-scheme: dark;
}

:root {
  --radius-1: 3px; --radius-2: 6px; --radius-3: 10px;

  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px; --space-5: 24px;
  --space-6: 32px; --space-7: 48px; --space-8: 64px; --space-9: 96px;

  --font: "Readex Pro", "Segoe UI", Tahoma, system-ui, sans-serif;

  /* Motion: 120 / 200 / 320 ms on the handoff curve. */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --t-fast: 120ms;
  --t-mid: 200ms;
  --t-slow: 320ms;

  /* Layout */
  --rail-w: 88px;
  --tabbar-h: 56px;
  --dock-h: 52px;
  --content-max: 1104px;

  /* Type scale (desktop / Latin). Arabic gets taller lines below. */
  --display-size: 52px;  --display-lh: 60px;
  --title-1-size: 32px;  --title-1-lh: 40px;
  --title-2-size: 24px;  --title-2-lh: 32px;
  --title-3-size: 20px;  --title-3-lh: 28px;
  --body-l-size: 18px;   --body-l-lh: 28px;
  --body-size: 16px;     --body-lh: 24px;
  --small-size: 14px;    --small-lh: 20px;
  --meta-size: 13px;     --meta-lh: 18px;
  --stamp-size: 12px;    --stamp-lh: 16px;
}

@media (max-width: 719px) {
  :root {
    --display-size: 36px;  --display-lh: 44px;
    --title-1-size: 26px;  --title-1-lh: 34px;
    --title-2-size: 22px;  --title-2-lh: 30px;
    --title-3-size: 18px;  --title-3-lh: 26px;
    --body-l-size: 17px;   --body-l-lh: 26px;
  }
}

/* Arabic: same sizes, more air (+4 px at text sizes, about ×1.45 at titles). */
:root[lang="ar"] {
  --display-lh: 76px;
  --title-1-lh: 52px;
  --title-2-lh: 38px;
  --title-3-lh: 32px;
  --body-l-lh: 32px;
  --body-lh: 28px;
  --small-lh: 24px;
  --meta-lh: 22px;
  --stamp-lh: 18px;
}
@media (max-width: 719px) {
  :root[lang="ar"] { --display-lh: 56px; --title-1-lh: 44px; --title-2-lh: 34px; --title-3-lh: 30px; --body-l-lh: 30px; }
}
