/* Keylanet type tokens – DRAFT v0.1 (KuMii, Creative Director). Not applied to keylanet.com.
   English: Outfit (headings) + Plus Jakarta Sans (UI/body). Khmer: Kantumruy Pro (headings/UI/buttons) + Noto Sans Khmer (paragraphs; already on the site as "Keylanet Khmer").
   Switching language = set lang="km" on <html> or any container; every token below swaps automatically. */

:root {
  --ff-head: 'Outfit', 'Plus Jakarta Sans', system-ui, sans-serif;
  --ff-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ff-ui: var(--ff-body);

  --fs-display: 56px; --lh-display: 60px; --fw-display: 700; --ls-display: -0.02em; --ff-display: var(--ff-head);
  --fs-h1: 40px; --lh-h1: 46px; --fw-h1: 700; --ls-h1: -0.015em; --ff-h1: var(--ff-head);
  --fs-h2: 32px; --lh-h2: 40px; --fw-h2: 700; --ls-h2: -0.01em; --ff-h2: var(--ff-head);
  --fs-h3: 24px; --lh-h3: 32px; --fw-h3: 600; --ls-h3: 0em; --ff-h3: var(--ff-head);
  --fs-h4: 20px; --lh-h4: 28px; --fw-h4: 600; --ls-h4: 0em; --ff-h4: var(--ff-head);
  --fs-body-l: 18px; --lh-body-l: 28px; --fw-body-l: 400; --ls-body-l: 0em; --ff-body-l: var(--ff-body);
  --fs-body-m: 16px; --lh-body-m: 26px; --fw-body-m: 400; --ls-body-m: 0em; --ff-body-m: var(--ff-body);
  --fs-body-s: 14px; --lh-body-s: 22px; --fw-body-s: 400; --ls-body-s: 0em; --ff-body-s: var(--ff-body);
  --fs-caption: 12px; --lh-caption: 18px; --fw-caption: 500; --ls-caption: 0.01em; --ff-caption: var(--ff-body);
  --fs-button: 16px; --lh-button: 20px; --fw-button: 600; --ls-button: 0.01em; --ff-button: var(--ff-body);
}

:lang(km) {
  /* Khmer: never add letter-spacing; never use text-transform/italic; keep ligature features on (coeng/subscripts need them). */
  --ff-head: 'Kantumruy Pro', 'Noto Sans Khmer', 'Khmer OS Battambang', 'Leelawadee UI', sans-serif;
  --ff-body: 'Noto Sans Khmer', 'Kantumruy Pro', 'Khmer OS Battambang', 'Leelawadee UI', sans-serif;
  --ff-ui: 'Kantumruy Pro', 'Noto Sans Khmer', 'Khmer OS Battambang', 'Leelawadee UI', sans-serif;

  --fs-display: 56px; --lh-display: 78px; --fw-display: 700; --ls-display: 0; --ff-display: var(--ff-head);
  --fs-h1: 40px; --lh-h1: 58px; --fw-h1: 700; --ls-h1: 0; --ff-h1: var(--ff-head);
  --fs-h2: 34px; --lh-h2: 51px; --fw-h2: 700; --ls-h2: 0; --ff-h2: var(--ff-head);
  --fs-h3: 26px; --lh-h3: 40px; --fw-h3: 700; --ls-h3: 0; --ff-h3: var(--ff-head);
  --fs-h4: 22px; --lh-h4: 35px; --fw-h4: 600; --ls-h4: 0; --ff-h4: var(--ff-head);
  --fs-body-l: 20px; --lh-body-l: 34px; --fw-body-l: 400; --ls-body-l: 0; --ff-body-l: var(--ff-body);
  --fs-body-m: 18px; --lh-body-m: 32px; --fw-body-m: 400; --ls-body-m: 0; --ff-body-m: var(--ff-body);
  --fs-body-s: 16px; --lh-body-s: 28px; --fw-body-s: 400; --ls-body-s: 0; --ff-body-s: var(--ff-body);
  --fs-caption: 14px; --lh-caption: 24px; --fw-caption: 500; --ls-caption: 0; --ff-caption: var(--ff-body);
  --fs-button: 18px; --lh-button: 25px; --fw-button: 600; --ls-button: 0; --ff-button: var(--ff-head);
}

/* Utility classes */
.t-display { font-family: var(--ff-display); font-size: var(--fs-display); line-height: var(--lh-display); font-weight: var(--fw-display); letter-spacing: var(--ls-display); }
.t-h1 { font-family: var(--ff-h1); font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: var(--fw-h1); letter-spacing: var(--ls-h1); }
.t-h2 { font-family: var(--ff-h2); font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: var(--fw-h2); letter-spacing: var(--ls-h2); }
.t-h3 { font-family: var(--ff-h3); font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: var(--fw-h3); letter-spacing: var(--ls-h3); }
.t-h4 { font-family: var(--ff-h4); font-size: var(--fs-h4); line-height: var(--lh-h4); font-weight: var(--fw-h4); letter-spacing: var(--ls-h4); }
.t-body-l { font-family: var(--ff-body-l); font-size: var(--fs-body-l); line-height: var(--lh-body-l); font-weight: var(--fw-body-l); letter-spacing: var(--ls-body-l); }
.t-body-m { font-family: var(--ff-body-m); font-size: var(--fs-body-m); line-height: var(--lh-body-m); font-weight: var(--fw-body-m); letter-spacing: var(--ls-body-m); }
.t-body-s { font-family: var(--ff-body-s); font-size: var(--fs-body-s); line-height: var(--lh-body-s); font-weight: var(--fw-body-s); letter-spacing: var(--ls-body-s); }
.t-caption { font-family: var(--ff-caption); font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: var(--fw-caption); letter-spacing: var(--ls-caption); }
.t-button { font-family: var(--ff-button); font-size: var(--fs-button); line-height: var(--lh-button); font-weight: var(--fw-button); letter-spacing: var(--ls-button); }

/* Mobile (≤ 640px): only the large steps shrink */
@media (max-width: 640px) {
  :root {
    --fs-display: 40px; --lh-display: 44px;
    --fs-h1: 32px; --lh-h1: 38px;
    --fs-h2: 26px; --lh-h2: 32px;
    --fs-h3: 22px; --lh-h3: 30px;
    --fs-h4: 20px; --lh-h4: 28px;
  }
  :lang(km) {
    --fs-display: 40px; --lh-display: 56px;
    --fs-h1: 32px; --lh-h1: 46px;
    --fs-h2: 28px; --lh-h2: 42px;
    --fs-h3: 24px; --lh-h3: 37px;
    --fs-h4: 22px; --lh-h4: 35px;
  }
}

/* Khmer safety rules */
:lang(km) * { letter-spacing: 0; text-transform: none; font-style: normal; font-synthesis: none; }
:lang(km) { line-break: strict; word-break: normal; overflow-wrap: break-word; font-kerning: normal; text-rendering: optimizeLegibility; }
/* Khmer has no spaces between words: insert U+200B (zero-width space) at word boundaries in long strings so lines wrap cleanly. */

/* Never set overflow:hidden on a Khmer text box with line-height < 1.4 – stacked subscripts/vowels will be clipped. */
