/* ==========================================================================
   PHASE 1 — DESIGN TOKENS
   Golden ratio (φ = 1.618) type scale / Fibonacci spacing / Prestige palette
   Single source of truth. No component may hardcode a raw value.
   ========================================================================== */

@layer theme, reset, base, components, utilities;

/* ---------- Persian primary typeface (self-hosted, variable) ---------- */
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: optional;
  unicode-range: U+0000-00FF, U+0600-06FF, U+0750-077F, U+08A0-08FF,
    U+200C-200F, U+2010-2027, U+2030-205E, U+FB50-FDFF, U+FE70-FEFF;
}

/* ---------- Technical micro-labels (Latin / numerals) ---------- */
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono-Variable.woff2") format("woff2-variations");
  font-weight: 100 800;
  font-style: normal;
  font-display: optional;
  unicode-range: U+0000-00FF, U+2000-206F;
}

:root {
  color-scheme: light;

  /* ---------- Geometry ---------- */
  --phi: 1.618;
  --phi-inv: 0.618;

  /* ---------- Palette / Authority (ink) ---------- */
  --ink-900: #07090d;
  --ink-800: #0b0e13;
  --ink-700: #10141b;
  --ink-600: #161b23;
  --ink-500: #1d232d;
  --ink-400: #2a323f;

  /* ---------- Palette / Prestige (brass) ---------- */
  --brass-300: #ebd3a3;
  --brass-400: #d9bc81;
  --brass-500: #c8a45c;
  --brass-600: #a8853f;
  --brass-700: #7c6130;

  /* ---------- Palette / Precision (jade) + alert ---------- */
  --jade-400: #4fd6a0;
  --jade-500: #2fbf8a;
  --jade-600: #1e9a6e;
  --alert-500: #e0574b;

  /* ---------- Palette / Office ecosystem ---------- */
  --office-word: #185abd;
  --office-excel: #107c41;
  --office-ppt: #d83b01;
  --office-word-soft: #e9eef7;
  --office-excel-soft: #dff6dd;
  --office-ppt-soft: #fce8e6;
  --btn-primary: #2b579a;
  --btn-primary-hi: #1f4680;

  /* ---------- Palette / Paper & text ---------- */
  --paper-100: #ffffff;
  --paper-200: #f1f5f9;
  --paper-300: #e2e8f0;
  --text-100: #0f172a;
  --text-200: #334155;
  --text-300: #475569;
  --text-400: #64748b;

  /* ---------- Semantic surfaces ---------- */
  --bg: #f8fafc;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --fg: var(--text-100);
  --fg-muted: var(--text-300);
  --fg-faint: var(--text-400);
  --accent: var(--office-word);
  --accent-hi: #0f4a9e;
  --accent-soft: color-mix(in oklab, var(--office-word) 12%, transparent);
  --live: var(--office-excel);

  /* ---------- Type families ---------- */
  --font-fa: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", monospace;

  /* ---------- Type scale / 17px base × φ ----------
     17 → 27.5 → 44.5 → 72 (rounded to the nearest usable step)          */
  --fs-1: 0.875rem;   /* 14 / micro copy, legal          */
  --fs-2: 1.0625rem;  /* 17 / body                       */
  --fs-3: 1.375rem;   /* 22 / lead paragraph             */
  --fs-4: 1.75rem;    /* 28 / card title / h3            */
  --fs-5: 2.25rem;    /* 36 / h2                         */
  --fs-6: 2.875rem;   /* 46 / h2 large                   */
  --fs-7: clamp(2.375rem, 1.55rem + 3.2vw, 4.25rem);  /* 38 → 68 / h1   */
  --fs-8: clamp(2.875rem, 1.6rem + 5vw, 5.5rem);      /* 46 → 88 / display */

  /* ---------- Line heights ---------- */
  --lh-display: 1.16;
  --lh-heading: 1.34;
  --lh-snug: 1.6;
  --lh-body: 1.85;

  /* ---------- Tracking (Persian never gets negative tracking) ---------- */
  --ls-tight: 0;
  --ls-label: 0.08em;

  /* ---------- Spacing / Fibonacci ---------- */
  --sp-1: 0.25rem;    /* 4   */
  --sp-2: 0.5rem;     /* 8   */
  --sp-3: 0.8125rem;  /* 13  */
  --sp-4: 1.3125rem;  /* 21  */
  --sp-5: 2.125rem;   /* 34  */
  --sp-6: 3.4375rem;  /* 55  */
  --sp-7: 5.5625rem;  /* 89  */
  --sp-8: 9rem;       /* 144 */

  /* ---------- Layout ---------- */
  --shell: 90rem;                                       /* 1440 */
  --content: 55.5rem;                                   /* 888 ≈ 1440 / φ */
  --gutter: clamp(1.25rem, 4vw, 3.4375rem);
  --split-phi: 61.8fr 38.2fr;

  /* ---------- Radii ---------- */
  --r-1: 0.5rem;
  --r-2: 0.8125rem;
  --r-3: 1.3125rem;
  --r-4: 2.125rem;
  --r-pill: 999px;

  /* ---------- Elevation ---------- */
  --shadow-1: 0 1px 2px rgb(15 23 42 / 0.05),
    0 8px 24px -14px rgb(15 23 42 / 0.12);
  --shadow-2: 0 1px 2px rgb(15 23 42 / 0.05),
    0 18px 48px -20px rgb(15 23 42 / 0.18);
  --shadow-accent: 0 12px 30px -12px
    color-mix(in oklab, var(--office-word) 38%, transparent);

  /* ---------- Motion / "smooth = premium" ---------- */
  --dur-1: 180ms;
  --dur-2: 300ms;
  --dur-3: 520ms;
  --dur-4: 840ms;
  --ease-spring: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* ---------- Z-index ---------- */
  --z-header: 100;
  --z-sticky: 200;
  --z-modal: 300;
}
