/* ==========================================================================
   Planet Design Language — FOUNDATION TOKENS
   Layer 1 of 2. Shared by every artifact the factory ships. Never edited per
   venture. Brand-specific values (colour, typefaces, atmosphere) live in
   ../themes/*.css and are consumed here only through the THEME CONTRACT vars.

   Source of truth: _ssot/design-language/LANGUAGE.md
   Reverse-engineered from: ceo-dossier.html (Dossier Nº 002)
   ========================================================================== */

:root {
  /* ---- Space: 4px grid, no exceptions -------------------------------- */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;  --s-5: 20px;
  --s-6: 24px;  --s-7: 28px;  --s-8: 32px;  --s-10: 40px; --s-12: 48px;
  --s-14: 56px; --s-16: 64px; --s-18: 72px; --s-24: 96px; --s-30: 120px;
  --s-35: 140px;

  /* ---- Layout -------------------------------------------------------- */
  --wrap: 1120px;
  --gutter: 32px;
  --rail: 180px;              /* sec-head index column */
  --touch: 44px;              /* minimum hit target (PWA) */
  --nav-h: 48px;
  --tabbar-h: 64px;

  /* ---- Radius -------------------------------------------------------- */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* ---- Type scale (fluid) ------------------------------------------- */
  --t-display: clamp(56px, 10vw, 128px);
  --t-h1: clamp(44px, 7vw, 92px);
  --t-h2: clamp(36px, 5vw, 60px);
  --t-h3: clamp(26px, 3.4vw, 40px);
  --t-h4: 24px;
  --t-h5: 18px;
  --t-quote: clamp(30px, 4.2vw, 52px);
  --t-lede: 20px;
  --t-body: 16px;
  --t-small: 14px;
  --t-caption: 13px;
  --t-label: 11px;            /* mono eyebrow */
  --t-stat: 64px;
  --t-mega: clamp(140px, 22vw, 260px);

  /* Tracking pairs with size: bigger = tighter */
  --tr-display: -0.055em;
  --tr-h2: -0.045em;
  --tr-h3: -0.04em;
  --tr-h4: -0.03em;
  --tr-body: -0.01em;
  --tr-label: 0.14em;
  --tr-italic: -0.02em;

  --lh-tight: 0.92;
  --lh-head: 1.04;
  --lh-body: 1.5;

  --w-thin: 200;              /* giant numerals only */
  --w-light: 300;             /* body */
  --w-regular: 400;
  --w-medium: 500;            /* headings */

  /* ---- Motion -------------------------------------------------------- */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --d-fast: 150ms;            /* hover, press */
  --d-base: 300ms;            /* state change */
  --d-slow: 600ms;            /* panels, sheets */
  --d-reveal: 1100ms;         /* scroll reveal (story) */
  --reveal-y: 28px;
  --reveal-blur: 6px;
  --stagger: 70ms;            /* capped at 6 steps in JS */

  /* ---- Elevation ----------------------------------------------------- */
  --z-base: 1;
  --z-nav: 50;
  --z-sheet: 80;
  --z-grain: 100;
  --z-tool: 1000;             /* dev-only tooling, e.g. prototype switcher */

  /* ---- Component metrics (density-sensitive) ------------------------ */
  --sec-pad: var(--s-35);
  --sec-head-gap: var(--s-18);
  --card-pad: var(--s-8);
  --card-r: var(--r-xl);
  --stack: var(--s-5);        /* gap between sibling cards */
  --field-h: 52px;
  --btn-h: 48px;
}

/* --------------------------------------------------------------------------
   DENSITY REGISTERS
   story (default) — dossiers, landing pages, decks, launch pages.
   app            — PWA screens, dashboards, forms, settings.
   Set on any container: <body data-density="app">
   -------------------------------------------------------------------------- */
[data-density="app"] {
  --t-display: clamp(40px, 7vw, 72px);
  --t-h1: clamp(32px, 5vw, 52px);
  --t-h2: clamp(26px, 3.6vw, 36px);
  --t-h3: clamp(22px, 2.6vw, 28px);
  --t-h4: 20px;
  --t-h5: 16px;
  --t-lede: 17px;
  --t-stat: 44px;

  --sec-pad: var(--s-12);
  --sec-head-gap: var(--s-8);
  --card-pad: var(--s-5);
  --card-r: var(--r-lg);
  --stack: var(--s-3);
  --d-reveal: 400ms;
  --reveal-y: 8px;
  --reveal-blur: 0px;
}

@media (max-width: 560px) {
  :root { --gutter: 20px; --card-pad: var(--s-6); }
  [data-density="app"] { --card-pad: var(--s-4); }
}
