/* Nazli — the platform's Persian text face.
   Sharif FarsiWeb Inc. GNU GPL (see COPYING.txt, AUTHORS.txt, README.md).

   WHY THIS FACE
   ─────────────
   Nazli is the free rebuild of NAZANIN, by the team that published the first
   standard set of Unicode Persian fonts. That matters twice over: it is the
   letterform the owner actually asked for — the one Persian schoolbooks and
   theses are set in — and it carries a licence that lets us ship it, where
   B Nazanin itself has no free web build and no version anyone can vouch for.

   The complaint it answers, in numbers rather than adjectives: readers said
   "everything looks bold" while body text has been font-weight 400 the whole
   time. It was never the weight. It is how much black the TYPEFACE leaves per
   line, measured across six faces at weight 400 (_font_bakeoff_shot.js):

     Vazirmatn RD 0.0469   XB Zar 0.0420   Markazi Text 0.0399
     XB Niloofar  0.0402   Roya   0.0361   NAZLI 0.0342

   Nazli is the lightest of all of them — 27% less ink than the face it
   replaces, for the same words at the same rendered size.

   And it holds up where a naskh is supposed to fail. Thin strokes usually go
   soft on a dark background, which is where most of these students read, so it
   was measured (_zwnj_night_probe.js): night edge sharpness as a share of day
   is 112.4% for Nazli against 95.4% for Vazirmatn RD. It gets CRISPER on the
   dark canvas, and the outgoing face got softer.

   Rejected, with reasons, so this is not re-run:
     XB Zar / XB Niloofar — the academic LaTeX standard, and genuinely handsome,
       but 1.40MB and 1.25MB because each carries Persian, Arabic, Urdu, Pashto,
       Kurdish and Turkish. This server compresses nothing (measured: it serves
       a 77KB stylesheet uncompressed), so that is the real wire cost. Their
       letters also run 75-76% of the em, so matching today's size would mean
       declaring 13.4px and breaking the 16px floor.
     Markazi Text — variable and only 67KB, but a newspaper face rather than a
       book face, and 15% lighter where Nazli is 27%.
     Roya (free Lotus) — the runner-up, and a fair second choice.

   WHY .woff AND NOT .woff2
   ────────────────────────
   Nazli has never been published as a webfont; TTF is all that exists, and this
   machine has no fonttools and no npm, so woff2 cannot be produced. WOFF 1.0
   can: it is the sfnt directory with each table deflated, nothing more, so
   live/tools/_ttf_to_woff.js builds it with Node's own zlib. 55,941 + 68,448
   bytes of TTF become 30,284 + 35,892 — 66KB against the outgoing face's 112KB.
   That the packer is correct is not asserted: the packed WOFF and the source
   TTF were rendered side by side and produced the same advance to the hundredth
   of a pixel (2385.06px) and the same rasterised ink mass (6,250,181). Two files
   that render identically ARE the same font.

   FOUR RULES, TWO FILES, TWO REQUESTS
   ───────────────────────────────────
   Regular and Bold, each declared twice: once as "Nazli" and once under the
   legacy name "Vazirmatn". The alias is not a second font — same two URLs. 22
   declarations across 12 other stylesheets (sidebar, workspace, quest cards,
   live-call, version controls, the <body> chain in chat-flagship-polish.css:24)
   still ask for "Vazirmatn" by name and belong to other owners. Without the
   alias, dropping the old link drops every one of them to Tahoma — measured
   during an earlier font swap: 11 visible mobile elements and 1 desktop one
   lost their webfont. The alias fixes them at the injection point, costs zero
   extra bytes, and keeps working for a stylesheet nobody has written yet, and
   for a robot nobody has created yet.

   THE MISSING WEIGHTS, STATED PLAINLY
   ───────────────────────────────────
   Nazli has 400 and 700 and nothing between. chat-canvas.css used to build
   hierarchy partly out of 500 and 600; on this face those round to 400 and 700
   and the ladder collapses silently. That is not worked around here — it is
   handled where it belongs, in chat-canvas.css, by making hierarchy come from
   SIZE and SPACE instead of weight. See the "two weights, not four" note there.

   test_chat_canvas_perf_gate.js asserts this file's shape: four rules, swap on
   every one, exactly two distinct woff URLs, both family names present, and
   each file fetched exactly once on the wire.

   The metric-matched local() stand-in is deliberately NOT here — it lives in
   Nazli-fallback.css, because it names no font file and must not be counted
   among the rules that do. */

@font-face {
  font-family: "Nazli";
  src: url('fonts/webfonts/Nazli-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nazli";
  src: url('fonts/webfonts/Nazli-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── THE COMPATIBILITY ALIAS, AND WHY IT CARRIES size-adjust ────────────────
   Same two files, same bytes, under the name that the rest of the platform
   already asks for: 22 font-family declarations across 12 stylesheets, plus
   every page outside the chat. Aliasing is what lets a stylesheet nobody has
   edited — or written — pick up the new face.

   But a name is not enough, and shipping only the name would have made 20 pages
   worse. Those pages were laid out around Vazirmatn's proportions, and the two
   faces do not agree about what a given px means: Vazirmatn's Persian body
   height is 67.2% of the em, Nazli's is 59.0% (measured, _font_bakeoff_shot.js,
   ink of سهصط above the baseline). Swapping the file underneath a page written
   for the first one shrinks every word on it by 12% — text nobody chose to make
   smaller, on the home page, the legal pages, the admin desks.

   size-adjust: 113.9% (= 67.2 / 59.0) makes the alias render at the size those
   pages were built for. One property, in one file, corrects the optical size of
   every page that has not been touched and every page not yet written.

   It is deliberately NOT on the "Nazli" faces above. The chat canvas asks for
   the real name and has its own type scale, re-derived for this face from
   measurement (chat-canvas.css, --nbgc-prose and friends). A face that silently
   resized itself there would fight numbers that were computed on purpose.

   The honest side effect, stated rather than discovered later: size-adjust
   scales advance widths too, so a line of Persian on those pages comes out
   about 10% shorter than it did in Vazirmatn (Nazli sets the same sentence 21%
   narrower; 21% back off 113.9% leaves ~10%). Shorter lines cannot overflow a
   container that already held the longer ones, so this direction is the safe
   one — and it is the reason this rounds to a measured ratio rather than to a
   number that "looks about right". */
@font-face {
  font-family: "Vazirmatn";
  src: url('fonts/webfonts/Nazli-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  size-adjust: 113.9%;
}

@font-face {
  font-family: "Vazirmatn";
  src: url('fonts/webfonts/Nazli-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  size-adjust: 113.9%;
}
