/* Moacere design tokens — extends docs/brief/assets/tokens.css (brief colours kept verbatim).
   Light theme only. Every text/background pair used by components is listed with its WCAG ratio in
   scripts/check_contrast.py; run it after changing a colour. Author: Smarketer. */

:root {
  color-scheme: light;

  /* ---- Brand (brief) ---------------------------------------------------------------------- */
  --brand: #7222ff;            /* primary purple; white text on it = 6.2:1 */
  --brand-hover: #5e16d9;      /* brief */
  --brand-active: #4d10b8;
  --brand-ink: #5b14d6;        /* purple text on white/lavender (7.6:1) */
  --brand-50: #f8f4ff;         /* = lavender */
  --brand-100: #f1e9ff;
  --brand-200: #e2d2ff;
  --brand-300: #c6a6ff;
  --brand-400: #9d66ff;
  --accent: #17c717;           /* completion green — dark ink text only (9.0:1), never small white text */
  --accent-hover: #13b313;
  --accent-50: #ecfbec;
  --accent-100: #d3f5d3;
  --ink: #03022e;              /* body text */
  --heading: #1c1b43;          /* headings */
  --muted: #686782;            /* secondary text: 5.4:1 on white, 5.0:1 on lavender, 4.9:1 on canvas */
  --muted-strong: #4b4a68;
  --lavender: #f8f4ff;
  --surface: #ffffff;
  --border: #e7e1f0;           /* decorative dividers and card outlines (not a control boundary) */

  /* ---- Surfaces ---------------------------------------------------------------------------- */
  --canvas: #f6f5fa;           /* app work area (light grey) */
  --canvas-strong: #efedf5;    /* editor document backdrop */
  --surface-sunken: #faf9fc;   /* table head, code blocks */
  --surface-dark: #03022e;     /* closing CTA band, dark footer */
  --control-border: #8f8aa8;   /* input/checkbox boundaries: 3.3:1 on white (WCAG 1.4.11) */
  --control-border-hover: #6e6990;
  --divider: #eeeaf5;
  --overlay: rgba(3, 2, 46, 0.48);

  /* ---- Status tones (bg / ink / border / solid) — every ink ≥ 4.5:1 on its bg ------------- */
  --neutral-bg: #f0eef5;   --neutral-ink: #45445f;   --neutral-border: #dcd8e6;
  --brand-bg: #f1e9ff;     --brand-tone-ink: #5211c7; --brand-border: #d9c6ff;
  --info-bg: #eaf1ff;      --info-ink: #1d4bb0;      --info-border: #c9d9fb;
  --success-bg: #eafbea;   --success-ink: #176a29;   --success-border: #b9ebc0;   /* brief */
  --warning-bg: #fff3db;   --warning-ink: #835400;   --warning-border: #f6d99a;   /* brief */
  --danger: #b42318;                                                                /* brief */
  --danger-hover: #971c13;
  --danger-bg: #fef0ef;    --danger-ink: #9b1c13;    --danger-border: #f5c7c2;
  --slate-bg: #eef1f7;     --slate-ink: #3d4a66;     --slate-border: #d3dae8;

  /* ---- Recipient colours for the editor (soft, distinct; ink ≥ 4.5:1 on bg) --------------- */
  --r1-bg: #f1e9ff; --r1-border: #9d66ff; --r1-ink: #5211c7;
  --r2-bg: #ecfbec; --r2-border: #34c234; --r2-ink: #176a29;
  --r3-bg: #fff4e0; --r3-border: #f0a92e; --r3-ink: #7a4e00;
  --r4-bg: #eaf1ff; --r4-border: #5b8cf0; --r4-ink: #1d4bb0;
  --r5-bg: #ffedf5; --r5-border: #ec6fa6; --r5-ink: #9c1f5a;
  --r6-bg: #e6f8f6; --r6-border: #2fb3a3; --r6-ink: #0d665c;

  /* ---- Typography --------------------------------------------------------------------------- */
  /* R3.2 — the geelycentre.ge type set (fonts.css): body "Moacere Sans" (BPG Glaho for Mkhedruli at
     300–500, Noto Sans Georgian at 600+, Inter for Latin/digits/₾), headlines "Moacere Display" (Noto Sans
     Georgian, Mtavruli through its "case" feature), navigation + buttons "Moacere Nav" (BPG LE Studio 02
     Caps). "* Fallback*" = metric-matched local stand-ins for the swap period; FiraGO is only the last
     fallback. Georgian inside code falls through JetBrains Mono (Latin only) to "Moacere Sans". */
  --font: "Moacere Sans", "Moacere Sans Fallback", "Moacere Sans Fallback Android", "Moacere Sans Fallback Win",
    "FiraGO", "Noto Sans Georgian", "Segoe UI", system-ui, sans-serif;
  --font-display: "Moacere Display", "Moacere Display Fallback", "Moacere Sans Fallback Android",
    "Moacere Sans Fallback Win", "FiraGO", "Noto Sans Georgian", system-ui, sans-serif;
  --font-nav: "Moacere Nav", "Moacere Nav Fallback", "Moacere Sans", "FiraGO", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Moacere Sans", ui-monospace, "SF Mono", Menlo, Consolas, "Cascadia Mono",
    "FiraGO", monospace;
  /* Mtavruli (Georgian capitals, owner's taste 2026-09-26): tracking and leading for capital-only lines.
     Mtavruli has no descenders and fills the cap height, so display lines close up to 1.1–1.2. */
  --ls-caps: 0.03em;          /* h1/h2, plan names, page titles */
  --ls-caps-tight: 0.02em;    /* hero */
  --ls-caps-label: 0.04em;    /* eyebrows, table heads, footer headings, sidebar group labels */
  --lh-caps-display: 1.12;
  --lh-caps: 1.2;
  --fs-2xs: 0.75rem;     /* 12 */
  --fs-xs: 0.8125rem;    /* 13 */
  --fs-sm: 0.875rem;     /* 14 */
  --fs-body: 1rem;       /* 16 */
  --fs-app: 0.9375rem;   /* 15 — dense app body */
  --fs-md: 1.125rem;     /* 18 */
  --fs-lg: 1.25rem;      /* 20 */
  --fs-xl: 1.5rem;       /* 24 */
  --fs-2xl: 1.75rem;     /* 28 — app title (mobile) */
  --fs-3xl: 2rem;        /* 32 — app title (desktop) */
  --fs-4xl: 2.5rem;      /* 40 — section title */
  /* Fluid scale (measured at 390 / 768 / 1440). R3.2: headlines are Mtavruli, whose capitals fill the whole
     cap height, so the display sizes step down from the Mkhedruli scale to keep the same visual weight:
     hero 34 / 44 / 56px, H2 26 / 31 / 38px, page hero 30 / 37 / 46px; card H3 20 / 22 / 24px and
     marketing body 16 / 17.5 / 18px unchanged. */
  --fs-hero: clamp(2.125rem, 1.5rem + 2.6vw, 3.5rem);
  --fs-h2: clamp(1.625rem, 1.3rem + 1.35vw, 2.375rem);
  --fs-h3: clamp(1.25rem, 1.15rem + 0.45vw, 1.5rem);
  --fs-body-marketing: clamp(1rem, 0.9rem + 0.4vw, 1.125rem);
  --fs-body-app: 0.9375rem;  /* 15 — app body (brief §3: 15–16) */
  --fs-label: 0.875rem;      /* 14 — form labels, table heads (brief §3: 13–14) */
  --fs-status: 0.75rem;      /* 12 — the floor for any status text; never 10–11px */
  --fs-section: var(--fs-h2);
  --fs-title: var(--fs-h3);  /* card / feature H3 */
  --fs-page-hero: clamp(1.875rem, 1.4rem + 1.95vw, 2.875rem);
  --measure: 40.5em;         /* ≈ 65ch of Inter; em, not ch: "ch" follows the active face's "0" and changed during the
                                font swap, re-wrapping paragraphs (CLS) — R3.2 */
  /* Mkhedruli reaches 0.75 em above and 0.22 em below the baseline (no capitals to fill the gap), so
     Georgian display lines need a little more leading than Latin: hero 1.16, H2 1.25, H3 1.35. */
  --lh-hero: 1.16;
  --lh-tight: 1.2;
  --lh-section: 1.25;
  --lh-h2: var(--lh-section);
  --lh-heading: 1.3;
  --lh-title: 1.35;
  --lh-h3: var(--lh-title);
  --lh-body: 1.6;
  --lh-lead: 1.65;
  --lh-body-marketing: 1.65;
  --lh-dense: 1.45;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-heading: var(--fw-bold);     /* display, hero, section and page titles (brief §3: 700) */
  --fw-title: var(--fw-semibold);   /* card / panel / dialog / app page titles */
  /* Mixed-case Georgian (Mkhedruli) is never tracked (letter-spacing 0 on every text set in --font; only the
     OTP digit box spaces its digits). Capitals are drawn only through the Mtavruli rule in base.css
     (--font-display + "case" + --ls-caps*); never on body copy, inputs, user content or legal text. */

  /* ---- Spacing (8px scale, with 4/12 half-steps) --------------------------------------------- */
  --space: 8px;                /* brief */
  --s-0-5: 4px;
  --s-1: 8px;
  --s-1-5: 12px;
  --s-2: 16px;
  --s-2-5: 20px;
  --s-3: 24px;
  --s-4: 32px;
  --s-5: 40px;
  --s-6: 48px;
  --s-7: 56px;
  --s-8: 64px;
  --s-10: 80px;
  --s-12: 96px;
  --s-15: 120px;

  /* ---- Radii --------------------------------------------------------------------------------- */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-input: 12px;        /* brief: controls */
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-card: 24px;         /* brief */
  --radius-pill: 999px;

  /* ---- Elevation (restrained, ink-tinted) ------------------------------------------------------ */
  --shadow-xs: 0 1px 2px rgba(28, 27, 67, 0.06);
  --shadow-sm: 0 1px 2px rgba(28, 27, 67, 0.04), 0 4px 12px -4px rgba(28, 27, 67, 0.08);
  --shadow-md: 0 2px 4px rgba(28, 27, 67, 0.04), 0 16px 32px -16px rgba(28, 27, 67, 0.18);
  --shadow-lg: 0 4px 8px rgba(28, 27, 67, 0.05), 0 32px 64px -24px rgba(28, 27, 67, 0.3);
  --shadow-brand: 0 10px 24px -10px rgba(114, 34, 255, 0.55);
  --shadow-inset: inset 0 1px 2px rgba(28, 27, 67, 0.06);

  /* ---- Focus --------------------------------------------------------------------------------- */
  --focus: #7222ff;
  --focus-on-dark: #c6a6ff;
  --focus-ring: 0 0 0 3px #fff, 0 0 0 5px var(--focus);

  /* ---- Layout -------------------------------------------------------------------------------- */
  --max-width: 1240px;         /* brief */
  --gutter: 24px;              /* brief; 16px under 640px (below) */
  --header-h: 76px;
  --topbar-h: 72px;
  --sidebar-w: 248px;
  --aside-w: 300px;
  --touch: 44px;               /* minimum touch target */
  --control-h: 48px;
  --control-h-sm: 40px;        /* visual height; hit area padded to 44px */

  /* ---- Z-index ------------------------------------------------------------------------------- */
  --z-base: 1;
  --z-sticky: 20;
  --z-header: 30;
  --z-drawer: 40;
  --z-dropdown: 50;
  --z-overlay: 60;
  --z-modal: 70;
  --z-toast: 80;
  --z-tooltip: 90;

  /* ---- Motion -------------------------------------------------------------------------------- */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --dur-fast: 120ms;
  --dur: 200ms;
  --dur-slow: 320ms;
  --dur-page: 560ms;

  /* legacy aliases from the brief tokens */
  --radius-control: var(--radius-input);
}

@media (max-width: 639.98px) {
  :root {
    --gutter: 16px;
    --header-h: 64px;
    --topbar-h: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0.01ms;
    --dur: 0.01ms;
    --dur-slow: 0.01ms;
    --dur-page: 0.01ms;
  }
}
