/* Masttech — design tokens (Datum Line + Atelier spacing + Kinetic engineering).
   Single source for colour, type, spacing and motion. Change only with design approval.

   Token hierarchy (each level only reads the level above; nothing hard-codes colours):
     GLOBAL     :root            --color-*, --font-*, --fs-*            (this file)
     PAGE       body             may re-declare --color-* for one page
     SECTION    section root     --<section>-*   e.g. --org-entry-bg, --gh-bg, --ft-bg
     MODULE     module root      --<module>-*    e.g. --org-node-bg, --org-connector
     COMPONENT  component        same module tokens re-declared on the component element
   The development-only Design Lab writes overrides at these same levels (inline custom properties). */
:root {
  /* Colour — balance ≈ 70–75 warm neutrals / 10–15 ink+brown / 8–10 olive+bronze / ≤5 red */
  --color-bg-primary: #F6F1E7;
  --color-surface: #FBF8F2;
  --color-bg-secondary: #E9DFCC;
  --color-text-primary: #2B2119;
  --color-dimension: #7B604C;      /* dimension brown: drawings, dimension lines, resting values */
  --color-accent-olive: #4C523C;
  --color-accent-bronze: #A48B6A;
  --color-accent-copper: #B8642A;    /* hero "[ MAST ]" wordmark (approved lockup ref 2026-10-15) */
  --color-brand-red: #E2010F;        /* ONLY active / moving / selected / action */
  --color-text-secondary: #5C4A3A;
  --color-text-tertiary: #7F6A55;
  --color-border: #CDBDA4;
  --color-grid-minor: #E8DECE;
  --color-grid-major: #DCCDB4;
  /* UI states and form surfaces (career module, HR admin, notices) — moved here from the career shell copy, values unchanged */
  --color-brand-red-deep: #B8000C;
  --color-on-red: #FFFFFF;
  --color-border-soft: #DDD0BA;
  --color-field: #FFFDF9;
  --color-cta-alt-border: #D8CCB8;
  --color-warn-bg: #FBF3DC;
  --color-warn-border: #D9BD72;
  --color-warn-text: #5C4510;
  --color-ok-bg: #EEF0E6;
  --color-ok-border: #9AA58A;
  --color-bad-bg: #F8EAE6;
  --color-bad-border: #D9A296;
  --color-bad-text: #8A2A1E;
  --color-backdrop: rgb(43 33 25 / .45);
  /* Dark warm-brown surface — footer default, approved 2026-10-16 (no pure black) */
  --color-bg-dark-warm: #3A2D24;
  --color-text-on-dark: #F6F1E7;
  --color-text-on-dark-2: #D8CCB8;

  /* Typography */
  /* Language-aware type: Latin and Arabic families are chosen for visual equivalence, not identical names.
     Components only use the generic tokens below; html[lang="ar"] remaps them (see end of :root block). */
  --font-display-latin: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body-latin: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  --font-tech-latin: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --font-label-latin: "Barlow Condensed", "Arial Narrow", sans-serif;   /* small labels only */
  --font-display-ar: "IBM Plex Sans Arabic", "Noto Sans Arabic", Tahoma, sans-serif;
  --font-body-ar: "IBM Plex Sans Arabic", "Noto Sans Arabic", Tahoma, sans-serif;
  --font-tech-ar: "Noto Kufi Arabic", "IBM Plex Sans Arabic", Tahoma, sans-serif;
  --font-display: var(--font-display-latin);
  --font-body: var(--font-body-latin);
  --font-mono: var(--font-tech-latin);
  --font-label: var(--font-label-latin);
  --font-arabic: var(--font-body-ar); /* legacy alias */
  --font-hand: "Architects Daughter", cursive; /* only the "Atlas" wordmark */
  --display-stretch: 110%;  /* Archivo wdth 108–114 */
  --display-weight: 600;
  --display-ls: -.01em;
  --display-tt: none;
  --body-weight: 400;
  --label-weight: 600;
  --label-ls: .12em;
  --label-tt: uppercase;

  /* Type scale 72 / 48 / 32 / 22 / 17 / 14 (fluid) */
  --fs-1: clamp(40px, 5.2vw, 72px);
  --fs-2: clamp(32px, 3.6vw, 48px);
  --fs-3: clamp(24px, 2.4vw, 32px);
  --fs-4: clamp(19px, 1.6vw, 22px);
  --fs-5: 17px;
  --fs-6: 14px;
  --fs-label: 13px;
  --lh-tight: 1.04;
  --lh-body: 1.55;

  /* Space — atelier spacing: generous, 8px base */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 72px; --s-9: 112px; --s-10: 160px;
  --gutter: clamp(16px, 4.4vw, 72px);
  --max: 1440px;
  --header-h: 76px;          /* approved 2026-10-15: same bar height as Mast Atlas (/atlas/) */
  --header-h-compact: 76px;  /* no shrink on scroll: the approved bar keeps its size */

  /* Lines */
  --line: 1px;
  --line-datum: 1.5px;

  /* Motion — mechanical, no elastic easing */
  --ease-stage: cubic-bezier(.3, 0, .1, 1);
  --ease-out: cubic-bezier(.2, 0, 0, 1);
  --t-hover: 200ms;
  --t-stage: 350ms;
  --t-reveal: 300ms;
  --draw-speed: 600; /* px per second for drawn lines */
}

:root[lang="ar"] {
  --font-display: var(--font-display-ar);
  --font-body: var(--font-body-ar);
  --font-label: var(--font-tech-ar);
  --font-mono: "IBM Plex Mono", var(--font-tech-ar); /* codes, numbers, units stay Latin mono; Arabic words fall to Kufi */
}

@media (max-width: 640px) {
  :root { --header-h: 64px; --header-h-compact: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --t-hover: 0ms; --t-stage: 0ms; --t-reveal: 0ms; }
}

/* base for the career module (was body.ms-body in prototype/src/shell.css), scoped to main.tc */
main.tc { background: var(--color-bg-primary); color: var(--color-text-primary);
  font: var(--body-weight) var(--fs-5)/var(--lh-body) var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
main.tc *, main.tc *::before, main.tc *::after { box-sizing: border-box; }
main.tc img { display: block; max-width: 100%; }
main.tc [hidden] { display: none !important; }
:where(main.tc) a { color: inherit; }
:where(main.tc) button { font: inherit; color: inherit; }
:where(main.tc) :focus-visible { outline: 2px solid var(--color-brand-red); outline-offset: 3px; }
