/* Shared by the document and the desert hero's shadow root.
 * Primary typeface: DM Sans (Google Fonts, SIL OFL 1.1). Its @font-face rules
 * live in fonts.css (document only), so the hero build never touches font files.
 */

:root,
:host {
  --font-latin: 'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-vietnamese: 'Plus Jakarta Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-primary: var(--font-latin);
  --font-heading: var(--font-primary);
  --font-body: var(--font-primary);
  --font-ui: var(--font-primary);
  --font-icon: Arial, sans-serif;
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-size-service-compact: clamp(48px, 16vw, 58px);
  --font-size-growth-compact: clamp(38px, 12.5vw, 45px);
}

/* Vietnamese: DM Sans has no Vietnamese glyphs, so a VI page (and the hero
 * shadow root, which inherits the language) switches to Plus Jakarta Sans. */
:root:lang(vi),
:host(:lang(vi)) {
  --font-primary: var(--font-vietnamese);
}

/* English pages: a Vietnamese name keeps DM Sans; only the glyphs DM Sans lacks
 * (ơ, ư, ớ…) fall back to Plus Jakarta Sans instead of a system font.
 * Zero specificity beyond the attribute, so page rules (Gieo Nhớ serif) still win. */
:where(:root:lang(en)) [lang="vi"] {
  font-family: 'DM Sans', 'Plus Jakarta Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
/* …without the fallback font's taller metrics changing the card's line height. */
:where(:root:lang(en)) .portfolio-caption [lang="vi"] {
  line-height: 0;
}

html,
body,
:host {
  font-family: var(--font-body);
  font-weight: var(--font-weight-regular);
  font-synthesis: none;
}

:where(h1, h2, h3, h4, h5, h6) {
  font-family: var(--font-heading);
}

:where(button, input, select, textarea) {
  font-family: var(--font-ui);
}

/* Preserve the existing symbol silhouettes independently of text typography. */
.spark, .hero-asterisk, .journal-cover-motion > span,
.reel-button > span, .back-top, .close-dialog, .service-toggle {
  font-family: var(--font-icon);
}

/* Keep long display words inside the original columns on narrow phones. */
@media (max-width: 360px) {
  .services .service h3 button {
    font-size: var(--font-size-service-compact);
  }
  #hero-title {
    font-size: var(--font-size-growth-compact);
  }
}
