/*
 * Typography — one type system for every page. Loaded LAST on every page (after tokens, clone,
 * service-page, insights, site-nav), so the rules here are the final word on font, size, weight,
 * line height and letter spacing. Change a size here, not in the page stylesheets.
 *
 * Decisions (Kamin, 30 Nov 2026):
 *   - One family: Google Sans, for English AND Thai (it ships Thai glyphs). Replaces ITC Avant Garde
 *     (headings), Scandia (text), Nexa (labels) and the Webflow Figtree/Gabarito.
 *   - Headings Semibold 600, text Regular 400.
 *   - A fixed scale. Each size shrinks smoothly from desktop to phone with clamp(); nothing below
 *     12px outside the decorative mock UIs on the home page.
 *   - Headings in sentence case (copy, not CSS — written that way in src/components/home/).
 */

:root {
  --font-display: 'Google Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Google Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Google Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-label: var(--font-mono);

  --fw-heading: 600;
  --fw-strong: 600;

  /* Scale — desktop → phone */
  --fs-hero: clamp(2.75rem, 1.55rem + 4.3vw, 4.75rem);   /* 76 → 44  home hero */
  --fs-title: clamp(2.5rem, 1.7rem + 2.9vw, 4rem);       /* 64 → 40  service, article, report titles */
  --fs-h2: clamp(2.125rem, 1.55rem + 2.1vw, 3.25rem);    /* 52 → 34  section headings */
  --fs-h2-sm: clamp(1.875rem, 1.5rem + 1.3vw, 2.5rem);   /* 40 → 30  secondary section headings */
  --fs-h3: clamp(1.5rem, 1.35rem + .55vw, 1.75rem);      /* 28 → 24  large card headings */
  --fs-h4: 1.25rem;                                       /* 20       small card headings */
  --fs-h5: 1.125rem;                                      /* 18       compact card headings */
  --fs-lead: clamp(1.125rem, 1.06rem + .25vw, 1.25rem);  /* 20 → 18  text under titles */
  --fs-body: clamp(1rem, .97rem + .12vw, 1.0625rem);      /* 17 → 16  body text */
  --fs-small: .875rem;                                    /* 14       supporting text */
  --fs-label: .75rem;                                     /* 12       capitals labels */

  --lh-display: 1.06;
  --lh-heading: 1.12;
  --lh-h3: 1.22;
  --lh-h4: 1.3;
  --lh-lead: 1.55;
  --lh-body: 1.6;

  --ls-display: -.028em;
  --ls-heading: -.022em;
  --ls-h3: -.012em;
  --ls-label: .12em;

  /* Spacing */
  --space-section: clamp(64px, 2.4rem + 4.4vw, 96px);    /* 96 → 64 between sections */
  --space-heading-text: 18px;                             /* heading → its text */
  --space-text-action: 30px;                              /* text → button */
}

/* Thai: taller lines so tone marks and vowels above/below never touch the line above, and no
   negative tracking (it collides Thai clusters). */
html:lang(th) {
  --lh-display: 1.22;
  --lh-heading: 1.28;
  --lh-h3: 1.32;
  --lh-h4: 1.4;
  --lh-lead: 1.7;
  --lh-body: 1.75;
  --ls-display: 0;
  --ls-heading: 0;
  --ls-h3: 0;
}

/* ---------- Base ---------- */
html body { font-family: var(--font-body); font-size: var(--fs-body); line-height: var(--lh-body); }
html body button, html body input, html body textarea, html body select { font-family: inherit; }
html body h1, html body h2, html body h3, html body h4 {
  font-family: var(--font-display);
  font-weight: var(--fw-heading);
}
html body strong, html body b { font-weight: var(--fw-strong); }

/* Webflow buttons (home) used Figtree. */
html body .button, html body .w-button, html body .service-button {
  font-family: var(--font-body);
  font-size: .9375rem;            /* 15 */
  font-weight: 600;
  letter-spacing: 0;
}

/* ---------- Labels: one style, never below 12px ---------- */
html body .eyebrow,
html body .insights-eyebrow,
html body .related-eyebrow,
html body .licensing-features-eyebrow,
html body .licensing-customers-label,
html body .insight-toc-label,
html body .insight-more-label,
html body .insight-sources > h2,
html body .insight-sidenote-kind,
html body .insight-gate-kicker,
html body .service-nav-group,
html body .hero-scorecard figcaption span,
html body .bmk-cover-eyebrow,
html body .bmk-cover-meta {
  font-family: var(--font-label);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: var(--ls-label);
  line-height: 1.4;
}
html body header.section .eyebrow { font-size: .8125rem; }   /* 13 — the hero's eyebrow, a touch larger */
/* The impact strip's and the footer's column headings are h2s styled as labels. */
html body #section-partners .impact-strip_label,
html body .footer-nav-group h2 {
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: var(--ls-label);
}

/* ---------- Home (Webflow classes) ---------- */
/* clone.css sets these classes to 700 one class deep; restate the system weight. */
html body .heading_hero,
html body .heading_primary,
html body .heading_secondary,
html body .heading_small { font-family: var(--font-display); font-weight: var(--fw-heading); }
html body .heading_hero {
  font-size: var(--fs-hero);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
}
html body .heading_primary {
  font-size: var(--fs-h2);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
}
html body .heading_secondary {
  font-size: var(--fs-h3);
  font-weight: var(--fw-heading);   /* Webflow drops this to 400 under 992px */
  line-height: var(--lh-h3);
  letter-spacing: var(--ls-h3);
}
html body .heading_small {
  font-size: var(--fs-h4);
  line-height: var(--lh-h4);
  letter-spacing: var(--ls-h3);
}
html body .subheading { font-size: var(--fs-body); line-height: var(--lh-body); }
html body header.section .subheading { font-size: var(--fs-lead); line-height: var(--lh-lead); }
html body .header .subheading { font-size: var(--fs-lead); line-height: var(--lh-lead); }
/* Even section rhythm: 96px on desktop, 64px on phones (was 128px everywhere, phones included). */
html body section.section:not(.padding_none) { padding-top: var(--space-section); padding-bottom: var(--space-section); }
html body header.section { padding-bottom: var(--space-section); }

/* Hero: headline → chips → text → button. The text sat 6px under the chips. */
html body header.section .heading_hero { margin-bottom: 0; }
html body .service-chips.hero-chips { margin: 26px 0 22px; }
html body header.section .subheading { margin: 0; max-width: 36rem; }
html body header.section .button-group { margin-top: var(--space-text-action); }

html body .card-cta { font-family: var(--font-body); font-size: var(--fs-small); font-weight: 600; letter-spacing: 0; }
html body .service-chip { font-size: .8125rem; font-weight: 600; }   /* 13 */

/* The photo card in Services ("Smiles guaranteed") is a <p class="heading_small"> on the image —
   it must not drop to the 20px card-heading size the class gives everything else. */
html body .text-color_inverse .max-width_xsmall.heading_small { font-size: var(--fs-h2-sm); line-height: var(--lh-heading); letter-spacing: var(--ls-heading); }

/* Licensing band, FDE card, contact. */
html body .licensing-card .heading_small { font-size: var(--fs-h3); }
html body .licensing-feature-title { font-size: var(--fs-h5); font-weight: var(--fw-heading); }
html body .licensing-feature-list li { font-size: var(--fs-small); }
html body .fde-card-title { font-size: var(--fs-h3); line-height: var(--lh-h3); }
html body .fde-step-title { font-weight: var(--fw-heading); }
html body .fde-step-body { font-size: var(--fs-small); }
html body #section-cta .heading_primary { font-size: var(--fs-h2); }
html body #section-cta .textbutton { font-family: var(--font-display); font-weight: var(--fw-heading); }

/* Impact numbers. On phones the three cards stack, instead of squeezing three 10px labels into one row. */
/* .counter-number also carries .heading_secondary, so it restates its own (larger) size. */
html body .heading_secondary.counter-number { font-size: clamp(2.25rem, 1.6rem + 2.2vw, 3.25rem); font-family: var(--font-display); font-weight: var(--fw-heading); line-height: 1.1; letter-spacing: var(--ls-heading); }
html body section:has(#section-impact) .paragraph_large { font-size: var(--fs-body) !important; line-height: 1.45 !important; }
@media (max-width: 560px) {
  html body section:has(#section-impact) .grid_3-col { grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; }
  html body section:has(#section-impact) .card_body { padding: 22px 18px !important; }
  html body section:has(#section-impact) .heading_secondary.counter-number { font-size: 2.25rem !important; letter-spacing: var(--ls-heading) !important; }
}

/* Home cards on phones: the earlier per-element shrinks (9–12px) are no longer needed at one
   column — restore the system sizes. */
@media (max-width: 800px) {
  html body #section-differentiators .heading_secondary { font-size: var(--fs-h3); line-height: var(--lh-h3); }
  html body #section-differentiators .eyebrow { font-size: var(--fs-label); }
  html body #section-differentiators .subheading { font-size: var(--fs-body); line-height: var(--lh-body); }
  html body #section-differentiators .text-button { font-size: var(--fs-small); }
}

/* ---------- Service pages ---------- */
html body .service-hero-copy h1 {
  font-size: var(--fs-title);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
}
html body .service-lead { font-size: var(--fs-lead); line-height: var(--lh-lead); margin-top: 22px; }
html body .service-actions { margin-top: var(--space-text-action); }
html body .service-section { padding-block: var(--space-section); }
html body .service-section h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
}
html body .why-grid h2,
html body .service-related h2,
html body .service-cta h2 {
  font-size: var(--fs-h2-sm);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
}
html body .service-section h3 {
  font-family: var(--font-display);
  font-size: var(--fs-h4);
  font-weight: var(--fw-heading);
  line-height: var(--lh-h4);
  letter-spacing: var(--ls-h3);
}
html body .service-section p,
html body .service-section li { font-size: var(--fs-body); line-height: var(--lh-body); }
/* About 65 characters a line: on tablets these ran to ~100. */
html body .service-section p { max-width: 65ch; }
html body .service-section summary { font-size: var(--fs-body); font-weight: 600; }
html body .related-card h3 { font-family: var(--font-display); font-size: var(--fs-h5); font-weight: var(--fw-heading); }
html body .related-card p { font-size: var(--fs-small); }
html body .service-nav-links a, html body .service-nav-dropdown a { font-size: var(--fs-small); }
html body .service-nav .service-button { font-size: .8125rem; }   /* 13 — was 11–12px on phones */

/* ---------- Insights ---------- */
html body .insights-hero h1,
html body .insight-article h1,
html body .insight-head h1 {
  font-size: var(--fs-title);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
}
html body .insights-lead, html body .insight-lead { font-size: var(--fs-lead); line-height: var(--lh-lead); }
html body .insight-card h3 { font-size: var(--fs-h4); line-height: var(--lh-h4); letter-spacing: var(--ls-h3); }
html body .insight-card p { font-size: var(--fs-small); }
html body .insight-body { font-size: 1.0625rem; line-height: 1.75; }   /* 17 — long reading */
html body .insight-body h2 { font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: var(--ls-h3); }
html body .insight-body h3 { font-size: var(--fs-h4); line-height: var(--lh-h4); }
html body .insight-body blockquote p { font-size: 1.375rem; font-weight: 500; line-height: 1.4; }
html body .insight-cta h2, html body .insight-gate h2 { font-size: var(--fs-h3); line-height: var(--lh-h3); }
html body .insight-toc a.is-sub { font-size: .8125rem; }
html body .insight-stat-value { font-weight: var(--fw-heading); letter-spacing: var(--ls-heading); }

/* ---------- Benchmark / assessment titles ---------- */
html body .bmk-hero h1, html body .rdy-hero h1 { letter-spacing: var(--ls-display); }

/* ---------- Floor: no reading text below 12px ----------
   Small labels that were 9–11px. Size only — each keeps its own case and letter spacing.
   Exempt on purpose: the mock app screens in the home cards (.output-dashboard, .skill-chat), which
   are pictures of a UI, and the readiness bar-chart segment labels (.rdy-tt-seg). */
html body .fde-badge,
html body .lead-trust-eyebrow,
html body .footer-email-label,
html body .footer-legal,
html body .preferences-dock .language-label,
html body .service-subnav span,
html body .insight-tag,
html body .insight-card-meta,
html body .rdy-why span,
html body .rdy-stamp,
html body .rdy-profile-head,
html body .rdy-coverfig figcaption,
html body .rdy-band,
html body .rdy-pattern-tag,
html body .rdy-rec-dim,
html body .rdy-preview-visible > span,
html body .rdy-preview-locked article > span,
html body .fari-tip b,
html body .fari-tip em { font-size: var(--fs-label); }
