/* =====================================================================
   DOSIK TECHNOLOGY · DESIGN TOKENS
   The only file allowed to contain raw colour values. Every other file
   uses var(--token). Brand colours are sampled from the logo.
   Sections: 1 primitives · 2 semantic (light) · 3 night chapters
             4 gradients · 5 type · 6 space & layout · 7 radius & elevation
             8 motion · 9 z-index · 10 themes (high contrast, readable)
   ===================================================================== */

:root {
  --fs-scale: 1; /* accessibility text size (0.9 – 1.5), set by prefs.js / core.js */

  /* ---------- 1. primitives ---------- */
  /* teal — the front triangle of the mark */
  --teal-200: #A6EEE7;
  --teal-300: #5FD8CC;   /* accents & links on navy (10.8:1 on --night) */
  --teal-400: #2AB6AC;
  --teal-500: #2AAEA2;   /* logo teal · decorative fills, never small text */
  --teal-600: #24908A;
  --teal-650: #138F85;   /* focus ring on light (3.7:1 non-text) */
  --teal-700: #0B7268;   /* text-safe teal: 5.07:1 on --bg-2, 5.4:1 on --bg */
  --teal-800: #095E56;

  /* sky → steel → navy — the back triangles */
  --sky-300: #82CCF2;
  --sky-400: #5ABADE;
  --sky-500: #4FB3DB;
  --steel-500: #4884AE;
  --navy-400: #3C6C96;
  --navy-500: #365A8A;
  --navy-600: #2E4A84;
  --navy-700: #2B3F7A;
  --periwinkle-300: #B3C2FF;
  --charcoal: #454546;   /* wordmark grey (logo only) */

  /* cool neutrals (ink) */
  --ink-950: #0B1A2C;
  --ink-800: #1D2D42;
  --ink-700: #33445A;
  --ink-600: #536479;
  --ink-400: #8494A7;
  --ink-300: #B7C3D0;
  --ink-200: #DCE4EA;
  --ink-150: #E2EBEE;
  --ink-100: #EAF1F3;
  --ink-50:  #F4F8F9;
  --white: #FFFFFF;

  /* night (navy chapters) */
  --night-1000: #040C1F;
  --night-950: #06122B;
  --night-900: #0B1C3F;
  --night-850: #0F2249;
  --night-800: #12244A;
  --night-750: #172A52;
  --night-700: #22355E;
  --night-650: #2A4170;
  --night-600: #2E6B78;  /* hover border (teal-tinted) */

  /* status */
  --green-500: #1BAA6B;  /* "open" dot (3:1 on white) */
  --green-800: #0B5D3B;
  --green-50:  #E8F6EF;
  --red-700: #B42318;
  --red-50:  #FFF8F7;
  --amber-600: #B54708;
  --amber-50: #FFF6E8;
  --grey-dot: #8A97A8;

  /* third-party brand */
  --wa-500: #25D366;     /* WhatsApp CTA (dark text on it: 7.7:1) */
  --wa-ink: #062B1A;
  --wa-700: #128C7E;     /* floating WhatsApp disc (white glyph 4.1:1) */

  /* pillar accents (decorative fills / tints only) */
  --p-computing: #2AAEA2;
  --p-cloud: #4FB3DB;
  --p-backup: #4884AE;
  --p-security: #2E4A84;
  --p-comms: #2FB7B9;

  /* ---------- 2. semantic · light (default) ---------- */
  --bg: var(--ink-50);
  --bg-2: var(--ink-100);
  --bg-3: var(--ink-150);
  --surface: var(--white);
  --surface-2: #F7FAFB;
  --surface-glass: rgba(255, 255, 255, .66);
  --surface-glass-strong: rgba(255, 255, 255, .92);

  --text: var(--ink-950);      /* 16.4:1 on --bg */
  --text-2: var(--ink-700);    /* 9.3:1 */
  --text-3: var(--ink-600);    /* 5.67:1 on --bg, 5.3:1 on --bg-2 — minimum for informative text */
  --text-on-accent: var(--white);
  --link: var(--teal-700);
  --link-hover: var(--teal-800);
  --accent: var(--teal-500);

  --line: rgba(11, 26, 44, .09);
  --line-2: rgba(11, 26, 44, .16);
  --line-strong: rgba(11, 26, 44, .28);
  --field-line: var(--ink-400);       /* 3.1:1 non-text on white */
  --field-line-hover: #5E7086;
  --field-bg: var(--surface-2);
  --focus: var(--teal-650);
  --focus-on-dark: var(--teal-300);
  --hover-tint: rgba(11, 26, 44, .05);
  --hover-tint-2: rgba(11, 26, 44, .09);
  --accent-tint: rgba(42, 174, 162, .12);
  --accent-tint-2: rgba(42, 174, 162, .22);

  --success: var(--green-800);
  --success-bg: var(--green-50);
  --success-line: rgba(27, 170, 107, .35);
  --error: var(--red-700);
  --error-bg: var(--red-50);
  --warn: var(--amber-600);
  --warn-bg: var(--amber-50);
  --dot-open: var(--green-500);
  --dot-closed: var(--grey-dot);

  /* ---------- 3. night chapters (apply .theme-dark) ---------- */
  --night: var(--night-950);
  --night-2: var(--night-900);
  --night-3: #12295A;
  --night-card: var(--night-800);
  --night-card-2: #0C1A3A;
  --night-line: var(--night-700);
  --on-night: #F2F7FB;     /* 17.3:1 */
  --on-night-2: #BBCADC;   /* 11.2:1 */
  --on-night-3: #93A7C1;   /* 7.6:1 */
  --teal-on-night: var(--teal-300);
  --footer-bg: var(--night-1000);

  /* ---------- 4. gradients ---------- */
  /* display highlight words only (≥ 2rem, weight ≥ 600): stops 3.3 / 3.4 / 7.8:1 on --bg = AA-large */
  --grad-text: linear-gradient(to left, #13998D 0%, #2A8FC2 52%, #2F4C88 100%);
  --grad-text-dark: linear-gradient(to left, #5FD8CC 0%, #82CCF2 50%, #B3C2FF 100%);
  /* primary button: white text ≥ 5.06:1 on every stop */
  --grad-btn: linear-gradient(115deg, #0E7C73 0%, #1D6197 58%, #263F80 100%);
  --grad-brand: linear-gradient(135deg, var(--teal-400), var(--sky-400) 55%, var(--navy-500));
  --grad-line: linear-gradient(to left, var(--teal-500), var(--sky-400) 50%, var(--navy-500));
  --grad-mark: linear-gradient(135deg, #2EC2B6 0%, #1B847C 100%);

  /* ---------- 5. type ---------- */
  --f-sans: "IBM Plex Sans Hebrew", "Heebo", "Segoe UI", Arial, system-ui, sans-serif;
  --f-display: var(--f-sans);
  --f-readable: Arial, "Arial Hebrew", "Segoe UI", system-ui, sans-serif;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* fluid scale (rem → scales with the a11y text-size control) */
  --fz-display: clamp(2.55rem, 1.2rem + 3.55vw, 4.4rem);    /* home H1: 41 → 70 px */
  --fz-h1: clamp(2.2rem, 1.3rem + 2.6vw, 3.6rem);            /* inner-page H1 */
  --fz-h2: clamp(2rem, 1.2rem + 2.3vw, 3.35rem);
  --fz-h3: clamp(1.3rem, 1.08rem + .65vw, 1.75rem);
  --fz-h4: clamp(1.12rem, 1.04rem + .25vw, 1.25rem);
  --fz-statement: clamp(1.6rem, .95rem + 2.4vw, 3.25rem);
  --fz-values: clamp(3rem, .9rem + 8.2vw, 8.75rem);
  --fz-lead: clamp(1.1rem, 1.02rem + .3vw, 1.3rem);
  --fz-body: 1.0625rem;   /* 17 px (16 px on phones) */
  --fz-sm: .9375rem;      /* 15 px */
  --fz-xs: .875rem;       /* 14 px — the floor for informative text */
  --fz-micro: .8125rem;   /* 13 px — decorative / aria-hidden labels only */

  --lh-display: 1.05;
  --lh-heading: 1.15;
  --lh-snug: 1.35;
  --lh-body: 1.75;
  --lh-tight: 1.2;

  /* ---------- 6. space & layout ---------- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-9: 48px;
  --sp-10: 64px;
  --sp-11: 80px;
  --sp-12: 120px;

  --maxw: 1240px;            /* content width */
  --maxw-wide: 1360px;       /* full-bleed panels */
  --maxw-text: 68ch;         /* reading column */
  --gutter: clamp(16px, 4.2vw, 48px);
  --sec-y: clamp(72px, 8vw, 120px);
  --hdr-h: 76px;
  --chapter-r: 40px;         /* rounded overlap between light / navy chapters */

  /* ---------- 7. radius & elevation ---------- */
  --r-xs: 8px;
  --r-s: 12px;
  --r-m: 18px;
  --r-l: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  --sh-1: 0 1px 2px rgba(11, 26, 44, .06), 0 2px 8px rgba(11, 26, 44, .04);
  --sh-2: 0 2px 4px rgba(11, 26, 44, .04), 0 14px 34px -12px rgba(11, 26, 44, .18);
  --sh-3: 0 4px 12px rgba(11, 26, 44, .05), 0 34px 80px -28px rgba(11, 26, 44, .32);
  --sh-btn: inset 0 1px 0 rgba(255, 255, 255, .22), 0 10px 24px -10px rgba(14, 92, 120, .7);
  --sh-btn-hover: inset 0 1px 0 rgba(255, 255, 255, .25), 0 18px 34px -14px rgba(14, 92, 120, .8);
  --sh-night: inset 0 1px 0 #1E3260, 0 30px 60px -40px rgba(0, 0, 0, .7);

  --glass-blur: blur(18px) saturate(165%);

  /* ---------- 8. motion ---------- */
  --e-out: cubic-bezier(.16, 1, .3, 1);
  --e-inout: cubic-bezier(.65, 0, .35, 1);
  --e-spring: cubic-bezier(.34, 1.56, .64, 1);
  --t-1: 160ms;   /* colour, hover */
  --t-2: 280ms;   /* menus, buttons */
  --t-3: 520ms;   /* cards, panels */
  --t-4: 900ms;   /* reveals */
  --beat: 4.2s;   /* the monitoring heartbeat — Dosik's motion signature */

  /* ---------- 9. z-index ---------- */
  --z-base: 1;
  --z-chapter: 2;
  --z-float: 90;
  --z-header: 100;
  --z-popover: 150;
  --z-dialog: 200;
  --z-toast: 300;
  --z-skip: 1000;
}

@media (max-width: 960px) {
  :root { --hdr-h: 64px; --chapter-r: 28px; }
}
@media (max-width: 640px) {
  :root { --fz-body: 1rem; }
}

/* ---------- 10. themes ---------- */
/* High contrast (accessibility menu): pure black / white, no gradients, no glass, no canvas */
html.a11y-contrast {
  --bg: #FFFFFF; --bg-2: #FFFFFF; --bg-3: #FFFFFF; --surface: #FFFFFF; --surface-2: #FFFFFF;
  --surface-glass: #FFFFFF; --surface-glass-strong: #FFFFFF;
  --text: #000000; --text-2: #000000; --text-3: #1E1E1E;
  --link: #00564E; --link-hover: #000000;
  --line: #000000; --line-2: #000000; --line-strong: #000000; --field-line: #000000; --field-bg: #FFFFFF;
  --focus: #000000; --focus-on-dark: #FFFFFF;
  --grad-btn: linear-gradient(#000000, #000000);
  --grad-text: linear-gradient(#000000, #000000);
  --grad-text-dark: linear-gradient(#FFFFFF, #FFFFFF);
  --night: #000000; --night-2: #000000; --night-3: #000000; --night-card: #000000; --night-card-2: #000000;
  --night-line: #FFFFFF; --footer-bg: #000000;
  --on-night: #FFFFFF; --on-night-2: #FFFFFF; --on-night-3: #FFFFFF; --teal-on-night: #7CF3E8;
  --accent-tint: #FFFFFF; --hover-tint: #F0F0F0;
  --sh-1: none; --sh-2: none; --sh-3: none; --sh-btn: none; --sh-btn-hover: none; --sh-night: none;
}
/* Readable font (accessibility menu): a plain system face, more space between words and lines */
html.a11y-readable {
  --f-sans: var(--f-readable);
  --f-display: var(--f-readable);
  --lh-body: 1.85;
}
