/* ==========================================================================
   tokens.css — the ONLY place raw color hex values may appear.
   Source: plan §3.4–3.5 + doc 07 §3 (10 refined tokens) + handoff
   asset-tokens.css (--tw-* compatibility aliases).
   Every other stylesheet references these via var(); no hard-coded hex allowed.
   ========================================================================== */

/* ---- Self-hosted fonts (woff2, swap). AR (IBM Plex Arabic) is copied to
   assets/fonts/ but intentionally NOT declared here — AR is unreleased. ---- */
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-v38-latin_latin-ext-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-v38-latin_latin-ext-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-v20-latin_latin-ext-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-v20-latin_latin-ext-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-v20-latin_latin-ext-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ---- Color palette (10 tokens — the whole vocabulary) ---------------- */
  --paper: #F6F3EC;
  --paper-raised: #FBFAF6;
  --ink: #18221C;
  --ink-muted: #556158;
  --moss-950: #10291E;
  --moss-800: #1F4734;
  --sage-300: #B8C7B5;
  --sand-200: #E8DFCF;
  --copper-600: #A7652A;
  --line: #D8D1C4;

  /* Ink as space-separated channels, for rgb(... / alpha) shadows/overlays
     without introducing a new hex value. */
  --ink-rgb: 24 34 28;
  --moss-rgb: 16 41 30;
  --paper-rgb: 246 243 236;

  /* ---- --tw-* aliases (compat with handoff asset-tokens.css + fragments).
     These point at the same 10 colors; no new values are introduced. ---- */
  --tw-paper: var(--paper);
  --tw-paper-raised: var(--paper-raised);
  --tw-ink: var(--ink);
  --tw-ink-muted: var(--ink-muted);
  --tw-moss-950: var(--moss-950);
  --tw-moss-800: var(--moss-800);
  --tw-sage-300: var(--sage-300);
  --tw-sand-200: var(--sand-200);
  --tw-copper-600: var(--copper-600);
  --tw-line: var(--line);
  /* short forms used by adapted handoff motion/fragment CSS */
  --tw-muted: var(--ink-muted);
  --tw-moss: var(--moss-950);
  --tw-sage: var(--sage-300);
  --tw-sand: var(--sand-200);
  --tw-copper: var(--copper-600);

  /* ---- Typography ------------------------------------------------------ */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --tw-font-display: var(--font-display);
  --tw-font-ui: var(--font-ui);

  /* Fluid type scale (plan §3.4) */
  --text-h1: clamp(2.5rem, 1.2rem + 4.4vw, 4.25rem);   /* 40 -> 68 */
  --text-h2: clamp(1.9rem, 1.1rem + 2.6vw, 2.9rem);
  --text-h3: clamp(1.25rem, 1.05rem + 0.8vw, 1.5rem);
  --text-body: 1.0625rem;         /* 17px */
  --text-body-long: 1.1875rem;    /* 19px long-form reading */
  --text-meta: 0.84375rem;        /* 13.5px minimum metadata */
  --text-kicker: 0.8125rem;       /* 13px eyebrow/kicker */

  --leading-h1: 1.05;
  --leading-h2: 1.12;
  --leading-h3: 1.25;
  --leading-body: 1.65;

  --tracking-h1: -0.01em;
  --tracking-kicker: 0.08em;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Reading measures */
  --measure: 68ch;
  --measure-narrow: 52ch;

  /* ---- Spacing scale (plan §3.5) --------------------------------------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-section: clamp(4.5rem, 10vh, 8.5rem);

  /* ---- Layout ---------------------------------------------------------- */
  --container: 1280px;
  --container-wide: 1440px;
  --gutter: clamp(1rem, 4vw, 2rem);

  --radius: 10px;
  --radius-lg: 16px;
  --tw-radius-s: 6px;
  --tw-radius-m: var(--radius);
  --tw-radius-l: var(--radius-lg);

  /* ---- Elevation ------------------------------------------------------- */
  --shadow-soft: 0 1px 2px rgb(var(--ink-rgb) / 0.05), 0 8px 24px rgb(var(--ink-rgb) / 0.06);
  --tw-shadow: var(--shadow-soft);

  /* ---- Motion ---------------------------------------------------------- */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-reveal: 350ms;
}
