/* Mobile only. The approved full-width wordmark paints 132px of ink on
   a 2500px source, not the height of its transparent image box. Match the
   serif capital height to that ink; the wordmark itself never changes. */
@media (max-width:767px) {
  html body {
    --mobile-brand-letter-height: calc(100vw * .0528);
    --mobile-title-glyph-ratio: .74;
    --mobile-title-ceiling: calc(var(--mobile-brand-letter-height) / var(--mobile-title-glyph-ratio));
    --site-reference-heading-size: min(calc(2 * var(--site-landing-title-size)), var(--mobile-title-ceiling));
  }
  /* Scripts with taller nominal glyphs retain the same visual, not numerical,
     ceiling. All existing serif faces and script fallbacks stay in place. */
  html:is(:lang(ar),:lang(ja),:lang(ko),:lang(th),:lang(vi),:lang(zh)) body {
    --mobile-title-glyph-ratio: .94;
  }

  html body :is(main#page,main) [data-site-text-size][data-site-reading="secondary"] {
    font-size: min(var(--site-landing-title-size), calc(.86 * var(--mobile-title-ceiling))) !important;
  }
  /* APPLY has a local desktop multiplier more specific than the shared scale. */
  html body.collection-68656582e759892761381cbc main#page #block-09429f6eb187d25e035b h3[data-site-text-size="title"] {
    font-size: var(--site-reference-heading-size) !important;
  }

  /* Home keeps its authored CERN grid and image-wordmark dimensions. Limit
     only text titles; never reduce the display-size token used by the artwork. */
  html body[data-home-cern-layout="1"] main .home-cern-layout .home-cern-layout-title:not([data-body-wordmark-heading] *),
  html body[data-home-cern-layout="1"] main .home-cern-layout .home-cern-layout-title:not([data-body-wordmark-heading] *) * {
    font-size: min(var(--cern-display-size), var(--mobile-title-ceiling)) !important;
  }
}
