/* 2 for a Tree · brand tokens · v1.0 · 16 Nov 2026
 * Source of truth: brand/brand-core.md. OKLCH in code, hex in comments for reference.
 * Paper + Soil carry ~90% of every surface. One accent per view. No gradients outside illustrations.
 *
 * Copy of brand/tokens.css for the home page; font url()s point at the site's /fonts/.
 */

/* ---------------------------------------------------------------- fonts (all OFL) */
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/instrument-serif-400.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/hanken-grotesk-400.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/fonts/hanken-grotesk-500.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/fonts/hanken-grotesk-600.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/jetbrains-mono-400.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/fonts/jetbrains-mono-500.woff2") format("woff2"); }

/* None of the three faces ship the rupee sign (U+20B9). These one-glyph fonts carry a
 * drawn ₹ under the same family names, so "₹2" never falls back to a system font. */
@font-face { font-family: "Instrument Serif"; font-weight: 400; unicode-range: U+20B9;
  src: url("/fonts/rupee-serif.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 400 600; unicode-range: U+20B9;
  src: url("/fonts/rupee-sans.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400 500; unicode-range: U+20B9;
  src: url("/fonts/rupee-mono.woff2") format("woff2"); }

:root {
  /* ---------------------------------------------------------------- core colour */
  --color-soil:   oklch(18.8% 0.011 80.5);   /* #16130E  text on light, dark sections */
  --color-paper:  oklch(95.2% 0.015 90.2);   /* #F3EFE4  primary light background */
  --color-leaf:   oklch(52.3% 0.114 142.2);  /* #3F7A3A  the two leaves, CTAs, links */
  --color-sprout: oklch(79.4% 0.145 123.8);  /* #A9CB5B  highlight on dark only, <=5% of a view */
  --color-steel:  oklch(78.7% 0.009 134.9);  /* #B7BBB5  the coin, illustrations only */
  --color-bark:   oklch(53.4% 0.037 74.4);   /* #7A6A55  rules, captions, secondary text */

  /* ---------------------------------------------------------------- derived (tints of the core six) */
  --color-paper-2: oklch(91.6% 0.018 88);    /* #E8E3D6  cards, table stripes */
  --color-paper-3: oklch(87.5% 0.02 86);     /* #DCD5C7  hover on paper-2 */
  --color-soil-2:  oklch(25% 0.012 80);      /* #25211B  raised surface on soil */
  --color-rule:    oklch(53.4% 0.037 74.4 / 0.35);   /* bark at 35%, hairlines */
  --color-leaf-tint: oklch(52.3% 0.114 142.2 / 0.08);  /* hatch fills, clear-space diagrams */
  --color-rule-on-soil: oklch(95.2% 0.015 90.2 / 0.18);
  --color-leaf-press: oklch(45% 0.11 142);   /* #2C6427  pressed state for leaf buttons */
  --color-focus:  var(--color-leaf);         /* 4.5:1 on paper */
  --color-focus-on-soil: var(--color-sprout);

  /* Contrast (WCAG 2.x): soil/paper 16.1 · leaf on paper 4.5 (AA body) · bark on paper 4.6 (AA body)
   * sprout on soil 10.0 · leaf on soil 3.6 (large text / graphics only)
   * sprout on paper 1.6 and steel on paper 1.7: never for text. */

  /* ---------------------------------------------------------------- type */
  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;   /* roman only, no italic headings */
  --font-body: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;     /* 400 / 500 / 600 */
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace; /* numbers, ledger, codes */

  /* Display scale (Instrument Serif, line-height 1.0 to 1.05) */
  --text-display-xl: clamp(3.5rem, 9vw + 1rem, 9rem);
  --text-display:    clamp(2.75rem, 5.5vw + 1rem, 5.5rem);
  --text-display-s:  clamp(2rem, 3vw + 1rem, 3.5rem);
  --text-h3:         clamp(1.5rem, 1.2vw + 1.1rem, 2rem);
  /* Text scale (Hanken Grotesk, line-height 1.5) */
  --text-lead: 1.25rem;    /* 20px */
  --text-body: 1.0625rem;  /* 17px */
  --text-small: 0.875rem;  /* 14px */
  --text-micro: 0.75rem;   /* 12px, mono labels only */

  --leading-tight: 1.02;
  --leading-snug: 1.2;
  --leading-body: 1.55;
  --measure: 62ch;

  /* ---------------------------------------------------------------- space (4 pt) */
  --space-3xs: 0.25rem;  /*  4 */
  --space-2xs: 0.5rem;   /*  8 */
  --space-xs:  0.75rem;  /* 12 */
  --space-sm:  1rem;     /* 16 */
  --space-md:  1.5rem;   /* 24 */
  --space-lg:  2rem;     /* 32 */
  --space-xl:  3rem;     /* 48 */
  --space-2xl: 4rem;     /* 64 */
  --space-3xl: 6rem;     /* 96 */
  --space-4xl: 8rem;     /* 128 */

  /* ---------------------------------------------------------------- shape + motion */
  --radius-0: 0;
  --radius-sm: 4px;      /* inputs, chips */
  --radius-md: 10px;     /* cards, stickers */
  --radius-pill: 999px;  /* buttons */
  --rule: 1px solid var(--color-rule);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.55, 0, 1, 0.45);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 420ms;
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur-base: 0ms; --dur-slow: 120ms; }
}
