/* ============================================================================
   GREEN PACIFIC — TOKENS
   Authoritative source: projects/client-projects/green-pacific-cleaning/design-system.md
   §1 (type) · §2.1 (colour) · §3 (spacing, grid, rail) · §6.2 (motion)

   RULE: every hex literal in this build lives in this file (design-system §8.4
   assertion 8). The one exception is assets/css/review.css, which is REVIEW
   INSTRUMENTATION and is stripped before staging (§2.8, §8.3, D-9).

   RULE: no var(--…) reference anywhere in this build is undeclared here
   (§8.4 assertion 9 — the exact defect the inherited estate shipped 18 times).
   ============================================================================ */

:root{

  /* ── GROUNDS ─────────────────────────────────────────────────────────── */
  --paper:        #F7F4EF;  /* default page ground */
  --white:        #FFFFFF;  /* raised ground: media slots, table cells, READINESS */
  --blue-deep:    #0E2F52;  /* inverted ground: THE WORK, site walk, table header */
  --panel-deep:   #0B2542;  /* recessed ground inside --blue-deep only */
  --field-deep:   #12365C;  /* form input ground inside --panel-deep only (§4.6) */

  /* ── INK ─────────────────────────────────────────────────────────────── */
  --ink:          #111C29;  /* primary type on light grounds        15.67:1 on paper */
  --ink-2:        #3A4654;  /* secondary: lede, standfirst, captions  8.77:1 on paper */
  --ink-3:        #5A6675;  /* tertiary: idle rail, meta, control borders 5.33:1 */
  --ink-rev:      #EAF0F6;  /* primary type on dark grounds         11.82:1 on blue-deep */
  --ink-rev-2:    #B9C9DA;  /* secondary type on dark grounds        8.03:1 */
  --ink-rev-3:    #8FB8E0;  /* labels and mono on dark grounds       6.53:1 */

  /* ── LINE ────────────────────────────────────────────────────────────── */
  --blue:         #194E83;  /* THE LINE COLOUR. Rules, labels, links, primary CTA */
  --rule:         #D5CFC5;  /* R1 hairline — decorative division only */
  --rule-strong:  #9AA6B4;  /* R2 structural. NEVER type, NEVER a control boundary (D-4) */
  --rule-dark:    #24486F;  /* division on dark grounds */

  /* ── MARKER ──────────────────────────────────────────────────────────── */
  --mantis:       #6DC067;  /* MARKER ONLY. Never type. Never a control boundary. <=3% */
  --mantis-ink:   #2F6B2B;  /* RESERVE — proposed, unapproved (§2.6). Unused in this build */

  /* ── STATE ───────────────────────────────────────────────────────────── */
  --focus:        #194E83;
  --focus-rev:    #F7F4EF;
  --alert:        #96301B;  /* PROPOSED, not approved (§2.7). CP confirms/changes/removes */

  /* ── TYPE FAMILIES ───────────────────────────────────────────────────── */
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* ── TYPE SCALE — desktop (§1.2). D1–D3 fluid per §1.3 ───────────────── */
  --fs-d1:    clamp(2.125rem, 4.40vw + 1rem, 3.5rem);      /* 34 → 56 */
  --fs-d2:    clamp(1.625rem, 3.00vw + 0.75rem, 2.375rem); /* 26 → 38 */
  --fs-d3:    clamp(1.5rem, 2.60vw + 0.6rem, 2rem);        /* 24 → 32 */
  --fs-d4:    1.5rem;      /* 24 */
  --fs-h5:    1.3125rem;   /* 21 */
  --fs-lede:  1.1875rem;   /* 19 */
  --fs-lg:    1.0625rem;   /* 17 */
  --fs-b:     1rem;        /* 16 */
  --fs-ui:    0.9375rem;   /* 15 */
  --fs-sm:    0.875rem;    /* 14 */
  --fs-cap:   0.8125rem;   /* 13 */
  --fs-m-lg:  0.75rem;     /* 12 */
  --fs-m:     0.6875rem;   /* 11 */
  --fs-m-sm:  0.625rem;    /* 10 — ABSOLUTE MONO FLOOR (D-2) */

  /* line-heights */
  --lh-d1: 1.06;  --lh-d2: 1.14;  --lh-d3: 1.16;  --lh-d3r: 1.30;
  --lh-d4: 1.24;  --lh-h5: 1.30;  --lh-lede: 1.58; --lh-lg: 1.55;
  --lh-b: 1.62;   --lh-ui: 1.45;  --lh-sm: 1.50;   --lh-cap: 1.55;
  --lh-mono: 1.45; --lh-mono-sm: 1.90;

  /* tracking */
  --tr-d1: -0.022em; --tr-d2: -0.018em; --tr-d3: -0.016em; --tr-d3r: -0.015em;
  --tr-d4: -0.014em; --tr-h5: -0.010em; --tr-lede: -0.005em;
  --tr-m-lg: 0.14em; --tr-m: 0.11em; --tr-m-sm: 0.07em; --tr-head: 0.10em;
  --tr-descriptor: 0.13em;

  /* weights — 600 / 450 / 400 sans, 500 mono. No 700. No italic. (§1.1) */
  --w-display: 600;
  --w-read:    450;
  --w-body:    400;
  --w-mono:    500;

  /* measure caps (§1.2 / §1.3) */
  --measure-lede: 52ch;
  --measure-lg:   58ch;
  --measure-b:    68ch;

  /* ── SPACING — 4px base (§3.1) ───────────────────────────────────────── */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;  --s-5: 20px;
  --s-6: 24px;  --s-7: 32px;  --s-8: 40px;  --s-9: 48px;  --s-10: 56px;
  --s-11: 64px; --s-12: 80px; --s-13: 96px; --s-14: 104px; --s-15: 128px;

  /* ── CONTAINER AND GRID (§3.3) ───────────────────────────────────────── */
  --container: 1320px;
  --pad-x:     32px;
  --gutter:    24px;
  --gap-major: 56px;
  --gap-cell:  24px;

  /* ── THE LABEL RAIL (§3.4) ───────────────────────────────────────────── */
  --rail-w:      168px;
  --rail-gap:    32px;
  --rail-rule-w: 2px;   /* R3 */

  /* ── SECTION RHYTHM (§3.5) ───────────────────────────────────────────── */
  --sect-y-narrative: 104px;
  --sect-y-commercial: 96px;
  --hero-y-top: 80px;
  --spine-h: 64px;
  --sticky-top: 110px;

  /* ── MOTION (§6.2) ───────────────────────────────────────────────────── */
  --dur-1: 150ms;
  --dur-2: 250ms;
  --dur-3: 400ms;
  --dur-4: 750ms;
  --ease-standard: cubic-bezier(.4, 0, .2, 1);
  --ease-out-soft: cubic-bezier(.2, .7, .3, 1);
  --ease-linear:   linear;
  --rise-distance: 22px;   /* capped at 24px by §6.1 rule 4 */

  /* ── LEGACY ALIASES (§2.1 / §2.2) ────────────────────────────────────
     Present ONLY so inherited batch-04 markup does not break during any
     migration. NO NEW CODE IS AUTHORED AGAINST THESE. Delete when the
     legacy estate is retired. Nothing in this build references them. */
  --yale-blue: var(--blue);
  --mantis-legacy: var(--mantis);
  --text: var(--ink);
}

/* ── MOBILE TYPE SCALE (§1.3) — the 900px primary switch ───────────────── */
@media (max-width: 899px){
  :root{
    --fs-d4:   1.3125rem;  /* 21 */
    --fs-h5:   1.1875rem;  /* 19 */
    --fs-lede: 1.0625rem;  /* 17 */
    --fs-lg:   1rem;       /* 16 */
    --fs-ui:   1rem;       /* 16 — grows: touch targets and form values */
    --fs-m-lg: 0.6875rem;  /* 11 */

    --lh-d1: 1.10; --lh-d2: 1.18; --lh-d3: 1.22; --lh-d3r: 1.34;
    --lh-d4: 1.28; --lh-h5: 1.32; --lh-lede: 1.55; --lh-lg: 1.58;
    --tr-d1: -0.018em; --tr-d2: -0.014em;

    --measure-lede: 34ch;
    --measure-b:    42ch;

    --pad-x: 20px;
    --gap-major: 32px;
    --sect-y-narrative: 64px;
    --sect-y-commercial: 64px;
    --hero-y-top: 48px;
    --rail-w: 100%;
    --rail-gap: 0px;
  }
}

@media (max-width: 559px){
  :root{ --pad-x: 16px; }
}
