/* ============================================================================
   Montivory — Typography tokens
   Display, headings, body, labels & UI: Geist.
   Monospace stays platform-native for code. Scale follows the MTVR AI
   Stylesheet — 14px body base, 150% (1.5) body line-height.
   ============================================================================ */
:root {
  /* --- Families --------------------------------------------------------- */
  /* --font-family-body / -heading / -display / -code are wired in
     tokens/brands.css (on :root AND [data-brand]) so they follow the active
     brand. Montivory code = platform mono; Mind = Noto Sans Thai. */

  /* --- Weights ---------------------------------------------------------- */
  --font-weight-normal:   400;
  --font-weight-medium:   500;
  --font-weight-semibold: 600;
  --font-weight-bold:     700;

  /* --- Raw size scale (14px body base; rem against a 16px root) --------- */
  --font-size-xs:   0.6875rem; /* 11px */
  --font-size-sm:   0.75rem;   /* 12px */
  --font-size-base: 0.875rem;  /* 14px — body default */
  --font-size-lg:   1rem;      /* 16px */
  --font-size-xl:   1.125rem;  /* 18px */
  --font-size-2xl:  1.375rem;  /* 22px */
  --font-size-3xl:  1.75rem;   /* 28px */
  --font-size-4xl:  2.25rem;   /* 36px */
  --font-size-5xl:  2.75rem;   /* 44px */

  /* --- Semantic: headings (Geist, bold) ------------------------------- */
  --text-heading-1-size: var(--font-size-3xl); --text-heading-1-weight: var(--font-weight-bold); --text-heading-1-leading: 1.2;
  --text-heading-2-size: var(--font-size-2xl); --text-heading-2-weight: var(--font-weight-bold); --text-heading-2-leading: 1.25;
  --text-heading-3-size: var(--font-size-xl);  --text-heading-3-weight: var(--font-weight-bold); --text-heading-3-leading: 1.3;
  --text-heading-4-size: var(--font-size-lg);  --text-heading-4-weight: var(--font-weight-bold); --text-heading-4-leading: 1.35;

  /* --- Semantic: display (Geist) --------------------------------------- */
  --text-display-1-size: var(--font-size-5xl); --text-display-1-weight: var(--font-weight-bold);   --text-display-1-leading: 1.1;
  --text-display-2-size: var(--font-size-4xl); --text-display-2-weight: var(--font-weight-bold);   --text-display-2-leading: 1.15;
  --text-display-3-size: var(--font-size-3xl); --text-display-3-weight: var(--font-weight-normal); --text-display-3-leading: 1.2;

  /* --- Semantic: body & supporting (Geist, 150% leading) -------------- */
  --text-large-size:      var(--font-size-xl);   --text-large-weight:      var(--font-weight-medium); --text-large-leading: 1.5;
  --text-body-size:       var(--font-size-base); --text-body-weight:       var(--font-weight-normal); --text-body-leading: 1.5;
  --text-label-size:      var(--font-size-sm);   --text-label-weight:      var(--font-weight-medium); --text-label-leading: 1.4;
  --text-supporting-size: var(--font-size-sm);   --text-supporting-weight: var(--font-weight-normal); --text-supporting-leading: 1.5;
  --text-code-size:       var(--font-size-sm);   --text-code-weight:       var(--font-weight-normal); --text-code-leading: 1.45;

  /* --- Control text sizes (Button, Input, Select — track the body scale) - */
  --control-font-size-sm: var(--font-size-sm);   /* 12px */
  --control-font-size-md: var(--font-size-base); /* 14px — default */
  --control-font-size-lg: var(--font-size-lg);   /* 16px */

  /* --- Chart axis / data labels (BarChart, BarList, Line, Pie, Radar) --- */
  /* Chart text takes the body size — axis labels are read, not decoration, and
     an SVG chart scaled to its container would shrink a 10px label below the
     legible floor. Plot padding in each chart is sized for this. */
  --chart-axis-size:     var(--font-size-base);
  --chart-row-size:      var(--font-size-base);  /* BarList rows — real HTML, same size */
  --chart-axis-weight:   var(--font-weight-normal);
  --chart-value-weight:  var(--font-weight-semibold);

  /* --- Tracking --------------------------------------------------------- */
  --letter-spacing-tight:  -0.01em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide:   0.04em;
}


/* ---------------------------------------------------------------------------
   Montivory Primary — serif heading corrections.
   Libre Baskerville ships 400 and 700 only: a 500/600 heading synthesises a
   fake bold in most browsers, so those two steps are pulled to 700 for headings
   only (body weights are untouched — body is still Geist). Its x-height also
   runs ~8% larger than Geist at the same size, so display steps are trimmed
   to keep the visual scale matched to the other brands.
   --------------------------------------------------------------------------- */
[data-brand="montivory-primary"] h1,
[data-brand="montivory-primary"] h2,
[data-brand="montivory-primary"] h3,
[data-brand="montivory-primary"] h4,
[data-brand="montivory-primary"] h5,
[data-brand="montivory-primary"] h6 {
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tight);
}
[data-brand="montivory-primary"] {
  --font-size-6xl: 3.25rem;   /* 60px → 52px */
  --font-size-5xl: 2.75rem;   /* 48px → 44px */
  --font-size-4xl: 2.125rem;  /* 36px → 34px */
}
