/* ATWA ICT design tokens. Every colour, radius, shadow and font comes from here (docs/design.md). */
:root {
  color-scheme: light;

  /* Brand */
  --brand: #2E2681;
  --brand-strong: #241E7C;
  --brand-soft: rgba(46, 38, 129, .09);
  --accent: #F97316;
  --accent-strong: #EA6A0C;
  --accent-ink: #1A0E00;

  /* System */
  --ios-blue: #007AFF;
  --ios-green: #248A3D;
  --ios-red: #D70015;
  --wa: #17A34A; /* WhatsApp-like green, dark enough for a white icon (3.3:1) */

  /* Pillars */
  --p-web: #0066D6;
  --p-it: #0E7C8F;
  --p-sw: #8E3BBE;
  --p-acad: #B04E0B;

  /* Text and surfaces */
  --text: #1D1D1F;
  --text-2: #4B4B50;
  --text-3: #6E6E73;
  --bg: #F5F5F7;
  --glass: rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .84);
  --glass-solid: #FFFFFF;
  --glass-border: rgba(255, 255, 255, .7);
  --hairline: rgba(29, 29, 31, .10);
  --field-border: #8A8A90; /* 3:1 against the field background */
  --shadow: 0 1px 2px rgba(20, 16, 60, .05), 0 12px 40px rgba(20, 16, 60, .10);
  --shadow-lg: 0 2px 6px rgba(20, 16, 60, .06), 0 24px 64px rgba(20, 16, 60, .16);

  /* Wallpaper blobs */
  --blob-1: rgba(70, 58, 210, .30);
  --blob-2: rgba(175, 82, 222, .20);
  --blob-3: rgba(249, 115, 22, .16);
  --blob-4: rgba(0, 122, 255, .14);

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ar: "SF Arabic", "Geeza Pro", "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif;
  --fs-display: clamp(2.4rem, 1.5rem + 3.6vw, 4rem);
  --fs-h1: clamp(2rem, 1.4rem + 2.4vw, 3rem);
  --fs-h2: clamp(1.65rem, 1.3rem + 1.4vw, 2.25rem);
  --fs-h3: clamp(1.15rem, 1.05rem + .4vw, 1.375rem);
  --fs-lead: clamp(1.08rem, 1rem + .35vw, 1.25rem);
  --fs-body: 1.0625rem;
  --fs-small: .9375rem;
  --fs-xs: .8125rem;
  --lh-body: 1.55;
  --lh-heading: 1.12;

  /* Shape and space (4px grid) */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-7: 32px; --s-8: 48px; --s-9: 64px; --s-10: 96px;
  --container: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --section: clamp(56px, 8vw, 112px);
  --header-h: 72px;

  /* Glass */
  --blur: saturate(180%) blur(20px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --t: .22s var(--ease);
  --focus: 0 0 0 3px var(--bg), 0 0 0 6px var(--brand);
}

/* Dark: same tokens, other values. Used for the system setting and for the manual switch. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand: #A49CFF;
    --brand-strong: #BDB7FF;
    --brand-soft: rgba(164, 156, 255, .14);
    --accent: #FB8C3A;
    --accent-strong: #FDA25F;
    --accent-ink: #1A0E00;
    --ios-blue: #0A84FF;
    --ios-green: #30D158;
    --ios-red: #FF6961;
    --p-web: #64A8FF;
    --p-it: #4FD1E0;
    --p-sw: #D18CFF;
    --p-acad: #FFA060;
    --text: #F5F5F7;
    --text-2: #C7C7CC;
    --text-3: #A1A1A6;
    --bg: #0B0B12;
    --glass: rgba(30, 30, 40, .58);
    --glass-strong: rgba(30, 30, 40, .82);
    --glass-solid: #1C1C24;
    --glass-border: rgba(255, 255, 255, .10);
    --hairline: rgba(255, 255, 255, .10);
    --field-border: #76767F;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 40px rgba(0, 0, 0, .35);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .3), 0 24px 64px rgba(0, 0, 0, .5);
    --blob-1: rgba(84, 70, 230, .42);
    --blob-2: rgba(175, 82, 222, .22);
    --blob-3: rgba(249, 115, 22, .12);
    --blob-4: rgba(10, 132, 255, .16);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #A49CFF;
  --brand-strong: #BDB7FF;
  --brand-soft: rgba(164, 156, 255, .14);
  --accent: #FB8C3A;
  --accent-strong: #FDA25F;
  --accent-ink: #1A0E00;
  --ios-blue: #0A84FF;
  --ios-green: #30D158;
  --ios-red: #FF6961;
  --p-web: #64A8FF;
  --p-it: #4FD1E0;
  --p-sw: #D18CFF;
  --p-acad: #FFA060;
  --text: #F5F5F7;
  --text-2: #C7C7CC;
  --text-3: #A1A1A6;
  --bg: #0B0B12;
  --glass: rgba(30, 30, 40, .58);
  --glass-strong: rgba(30, 30, 40, .82);
  --glass-solid: #1C1C24;
  --glass-border: rgba(255, 255, 255, .10);
  --hairline: rgba(255, 255, 255, .10);
  --field-border: #76767F;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 40px rgba(0, 0, 0, .35);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .3), 0 24px 64px rgba(0, 0, 0, .5);
  --blob-1: rgba(84, 70, 230, .42);
  --blob-2: rgba(175, 82, 222, .22);
  --blob-3: rgba(249, 115, 22, .12);
  --blob-4: rgba(10, 132, 255, .16);
}

/* Arabic typography */
:root:lang(ar) {
  --font: var(--font-ar);
  --font-display: var(--font-ar);
  --lh-body: 1.8;
  --lh-heading: 1.35;
}

/* Lighter glass on small screens (cheaper to render) */
@media (max-width: 640px) {
  :root { --blur: saturate(160%) blur(12px); }
}
