/* Persian (/fa) typography and phone layout. Loaded last on every /fa page, so it wins over the shared (English-first) styles.
   Persian letters join each other, sit lower and reach higher than Latin capitals, so the English display rules
   (letter-spacing, line-height under 1, narrow line masks) break or clip them. */

/* letter-spacing pulls Persian letters apart (Safari draws them unjoined) and widens every gap: never on /fa */
html:lang(fa) body, html:lang(fa) body *:not(:lang(en)) { letter-spacing: 0 !important; }
html:lang(fa) body { line-height: 1.85; font-feature-settings: "kern"; text-rendering: optimizeLegibility; }
html:lang(fa) :where(p, li, dd, summary, figcaption, label) { overflow-wrap: break-word; }
html:lang(fa) em, html:lang(fa) i { font-style: normal; }

/* big display type: Persian needs room above and below the line */
html:lang(fa) :is(.titlecard__title, .story__title, .big, .credits__name, .hero__kinetic, .feature__title, .w-hero__title, .w-feature__text strong,
  .w-row__title, .f-film__title, .f-next__main strong, .w-cta__title, .b-post__title, .b-card__title, .work__title, .card h3, .rules-strip h3, .contact__title) {
  font-family: "Vazirmatn", Tahoma, sans-serif; font-stretch: 100%; text-transform: none; line-height: 1.32; overflow-wrap: normal; word-break: normal; hyphens: none;
}
html:lang(fa) :is(.titlecard__title, .story__title, .big, .credits__name, .w-hero__title, .f-film__title, .f-next__main strong, .w-cta__title, .b-post__title) { font-weight: 900; }
html:lang(fa) .titlecard__title em { font: inherit; line-height: inherit; color: var(--accent); }
html:lang(fa) .story__title em, html:lang(fa) .big em, html:lang(fa) .w-hero__title em, html:lang(fa) .w-cta__title em { font-family: inherit; font-size: 1em; }
html:lang(fa) .rules-strip h3 { font-weight: 800; font-size: clamp(19px, 1.5vw, 23px); line-height: 1.55; }
html:lang(fa) .card h3 { font-weight: 900; line-height: 1.45; }
html:lang(fa) .card p:not(.mono), html:lang(fa) .rules-strip p, html:lang(fa) .titlecard__lede, html:lang(fa) .story__p { line-height: 1.95; }
html:lang(fa) .endcard__title { font-family: "Vazirmatn", Tahoma, sans-serif; font-stretch: 100%; font-weight: 900; line-height: 1.15; }
html:lang(fa) .hud__name { font-weight: 800; line-height: 1.3; }

/* line masks (text that slides up into view): give the Persian dots and tails room so they are never cut off */
html:lang(fa) :is(.story__l, .tl, .w-line, .hero__kinetic .mask) { padding-block: .14em .3em; margin-block: -.14em -.3em; }
html:lang(fa) .endcard__title .story__l { padding: .12em .06em .28em; margin-block: -.12em -.28em; }

/* small labels: Persian at 10-11px is unreadable */
html:lang(fa) .mono { font-size: 13px; line-height: 1.6; text-transform: none; }
html:lang(fa) :is(.titlecard__slate, .intro__tags, .story__list li, .work__kind, .work__client, .work__page, .work__play, .reel__all, .b-card__meta, .b-post__by, .b-tags a, .contact__form label) { font-size: 13px; }
html:lang(fa) .contact__form label { text-transform: none; font-family: "Vazirmatn", Tahoma, sans-serif; color: #a49b94; }

/* Persian inputs and dropdowns: the arrow sits on the left, the text on the right */
html:lang(fa) .contact__form :is(input, select, textarea) { font-family: "Vazirmatn", Tahoma, sans-serif; font-size: 17px; line-height: 1.7; }
html:lang(fa) .contact__form input[type="email"] { direction: ltr; text-align: right; }
html[dir="rtl"] .contact__form select { background-position: 14px 55%, 20px 55%; padding-inline-end: 16px; padding-inline-start: 40px; }

/* buttons: Persian words, not spaced capitals */
html:lang(fa) :is(.intro__btn, .intro__ghost, .cta-float, .contact__send, .s-ghost, .work__play, .work__page, .hud__lang) { font-family: "Vazirmatn", Tahoma, sans-serif; text-transform: none; }
html:lang(fa) :is(.intro__btn, .contact__send) { font-weight: 800; font-size: 15px; }

/* the fixed header stays readable when text scrolls under it */
@media (max-width: 860px) {
  html:lang(fa) .hud { background: linear-gradient(180deg, #07080a 0%, rgba(7, 8, 10, .94) 62%, rgba(7, 8, 10, 0) 100%); padding-bottom: 26px; }
}

/* phones: sizes that fit a 360px screen without a word running off the edge */
@media (max-width: 600px) {
  html:lang(fa) .titlecard__title { font-size: clamp(38px, 11.4vw, 64px); }
  html:lang(fa) .story__title { font-size: clamp(36px, 10.6vw, 60px); }
  html:lang(fa) .big { font-size: clamp(36px, 10.6vw, 60px); }
  html:lang(fa) .credits__name { font-size: clamp(54px, 17vw, 96px); }
  html:lang(fa) .w-hero__title, html:lang(fa) .w-cta__title { font-size: clamp(44px, 13vw, 76px); }
  html:lang(fa) .f-film__title { font-size: clamp(36px, 10.4vw, 60px); }
  html:lang(fa) .f-next__main strong { font-size: clamp(36px, 11vw, 64px); }
  html:lang(fa) .w-feature__text strong { font-size: clamp(40px, 12vw, 70px); }
  html:lang(fa) .w-row__title { font-size: clamp(24px, 7vw, 36px); line-height: 1.4; }
  html:lang(fa) .s-page .b-post__title, html:lang(fa) .b-post__title { font-size: clamp(34px, 10vw, 56px); line-height: 1.35; }
  html:lang(fa) .s-page .s-title--post { font-size: clamp(28px, 8.2vw, 44px); line-height: 1.45; }
  html:lang(fa) .s-page .b-card--lead .b-card__title, html:lang(fa) .b-card__title { font-size: clamp(21px, 6.2vw, 28px); line-height: 1.55; }
  html:lang(fa) .card h3 { font-size: clamp(24px, 7vw, 32px); }
  html:lang(fa) .work__title { font-size: 24px; line-height: 1.45; }
  html:lang(fa) .endcard__title { font-size: clamp(110px, 34vw, 180px); }
  html:lang(fa) .s-block__title { font-size: clamp(23px, 6.6vw, 30px); }
  html:lang(fa) .s-cta strong { font-size: 21px; }
  html:lang(fa) .s-faq summary { font-size: 17px; }
  html:lang(fa) .contact__send { width: 100%; justify-content: center; }
}
