/* ============================================================================
   type.css — fluid type scale (clamp, no font-size media queries) + font stacks.
   Sarabun carries body/UI/display (loaded offline in fonts.css). Hierarchy comes
   from weight + size + space, never a second display sans. Mono = system stack.
   ============================================================================ */
:root {
  --font-sans: 'Sarabun', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;

  /* fluid scale — clamp(MIN, fluid, MAX). Thai reads best with generous body size. */
  --fs-step--1: clamp(.83rem, .80rem + .15vw, .92rem);   /* caption / small */
  --fs-step-0 : clamp(1rem,   .96rem + .20vw, 1.08rem);  /* body */
  --fs-step-1 : clamp(1.2rem, 1.10rem + .50vw, 1.40rem); /* h3 / lead */
  --fs-step-2 : clamp(1.5rem, 1.30rem + 1.0vw, 1.95rem); /* h2 */
  --fs-step-3 : clamp(2rem,   1.60rem + 2.0vw, 2.90rem); /* h1 / hero */

  --lh-body: 1.7;     /* Thai body comfort */
  --lh-tight: 1.25;   /* headings */
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-step-0);
  line-height: var(--lh-body);
  font-weight: 400;
  color: var(--c-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  line-height: var(--lh-tight);
  color: var(--c-text);
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: var(--fs-step-3); font-weight: 700; letter-spacing: -.012em; }
h2 { font-size: var(--fs-step-2); font-weight: 700; letter-spacing: -.008em; }
h3 { font-size: var(--fs-step-1); font-weight: 600; }
h4 { font-size: var(--fs-step-0); font-weight: 600; }

p, li { font-size: var(--fs-step-0); }

small, .text-sm { font-size: var(--fs-step--1); }

code, kbd, samp, pre { font-family: var(--font-mono); }
