/* Volten — Persian typography base */

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Variable.woff2') format('woff2-variations'),
       url('../fonts/Vazirmatn-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

html[lang="fa"],
html[lang="fa"] body {
  font-family: 'Vazirmatn', system-ui, -apple-system, Tahoma, Arial, sans-serif;
}

/* Persian/Arabic scripts do not benefit from letter-spacing — it breaks character joining. */
html[lang="fa"] * {
  letter-spacing: 0 !important;
}

/* Force Vazirmatn on every element that declared a Latin font stack. */
html[lang="fa"] *,
html[lang="fa"] *::before,
html[lang="fa"] *::after {
  font-family: 'Vazirmatn', system-ui, -apple-system, Tahoma, Arial, sans-serif;
}

/* Keep any inline-latin content (emails, URLs) readable */
html[lang="fa"] [data-latin],
html[lang="fa"] code,
html[lang="fa"] kbd,
html[lang="fa"] samp {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  direction: ltr;
  unicode-bidi: isolate;
}

/* ============================================
   Persian layout adjustments
   ============================================
   Latin display fonts are tuned for Latin metrics (narrow ch, tight
   line-height, heavy display weight). Persian glyphs render shorter
   horizontally but with connecting kashida strokes — so ch-based
   max-widths over-wrap, and heavy weights turn the joining strokes
   into visible horizontal bars. Relax both for Persian. */

/* r-k: services title narrow max-width over-wraps Persian and strands
   single words on their own line. Use em so it scales with Persian glyph
   width instead of the Latin "0" advance. */
html[lang="fa"] .services__title {
  max-width: none;
}

/* r-k: let these two specific headings balance across lines so no single
   word is stranded. Do NOT apply to .reveal-heading broadly — it strands
   hero words on mobile where there's less room to balance. */
html[lang="fa"] .insights__heading,
html[lang="fa"] .services__title {
  text-wrap: balance;
}

/* r-k footer wordmark: at weight 600 + opacity 0.1 + 16rem, the Persian
   baseline/kashida join strokes of ولتن visually read as horizontal
   bars. Lighten the weight so the connecting strokes stay subtle, and
   give the glyphs vertical room so descenders aren't cut by the
   divider below. */
html[lang="fa"] .footer__brand-large,
html[lang="fa"] .footer__wordmark-text {
  font-weight: 200;
  line-height: 1.15;
  letter-spacing: 0;
  padding-block: 0.08em 0.14em;
}

html[lang="fa"] .footer__wordmark,
html[lang="fa"] .footer__brand-large .footer__wordmark {
  font-weight: inherit;
}

/* Vazirmatn's vertical metrics fit inside the normal line-box, so we
   don't need extra .word padding-block for Persian. The Latin defaults
   (0.08em / 0.12em set in r-k.css) would compound visibly between
   wrapped lines in Persian headings, so zero them out — the Persian
   glyphs still animate cleanly with overflow:hidden. */
html[lang="fa"] .reveal-heading .word {
  padding-block: 0;
  margin-block: 0;
}
