/* ============================================================================
   NAVI NIGHT CHAPTER TYPE
   Consumable companion to lab/type/night-tokens.html, which derives and
   proves every value here. Load AFTER the day type tokens.

   Night is a CONTEXT, not a second scale. Sizes never change. This file
   re-declares existing token names inside .night, so layout code is
   untouched: put class="night" on the dark chapter and it applies.

   DERIVED, NOT CHOSEN. Light on dark gains apparent ink at antialiased
   edges because perceived lightness is non-linear in coverage: at 50%
   coverage an edge pixel reads 53.4% ink on dark versus 46.6% inverted.
   One measured quantity drives all of it:
     delta     = (A_night - A_day) / edge_px          per step, measured
     weight   -= 2*delta / (d stem / d weight)        d stem measured on the
                                                      real variable axis
     tracking += 2*delta / size

   SCOPE OF THE MEASUREMENT, read before trusting these numbers. This
   captures the RENDERING component of bloom only. Bloom also has a
   physiological component, light spreading on the retina, which pixel
   arithmetic cannot observe. Typographic convention drops a full weight
   step (100 units) and compensates for both at once; measurement here
   gives 15 to 20. The measured value ships because it is defensible. The
   larger conventional correction may look better on a real screen, but
   choosing it would be taste, not derivation, so it was not taken.

   Measured on flat Midnight with NO grain and NO glow, under macOS
   grayscale antialiasing. Material is not decided. Grain and glow change
   local contrast and will change the bloom. Re-measure when material locks.
   ============================================================================ */

.night{
  /* ---- weight compensation. Light on dark reads heavier. ----
     Marginal by design: at body size this moves a stem 0.072px, under one
     pixel, and unlike tracking it does not accumulate. Kept because it is
     measured and free, not because it is doing heavy lifting. */
  --wt-100:580;   /* label   600 -> 580 */
  --wt-200:400;   /* small   CLAMPED. Wants 381, locked Geist floor is 400. */
  --wt-300:400;   /* body    CLAMPED. Wants 381, locked Geist floor is 400. */
  --wt-400:485;   /* lede    500 -> 485 */
  --wt-500:580;   /* h4      600 -> 580 */
  --wt-600:685;   /* h3      700 -> 685 */
  --wt-700:690;   /* h2      700 -> 690 */
  --wt-800:695;   /* h1      700 -> 695 */
  --wt-900:690;   /* display 700 -> 690 */

  /* ---- tracking compensation. Bloom closes the gaps between glyphs. ----
     This is the lever that does the real work. Per gap it is the same
     sub-pixel order as the weight change, but it ACCUMULATES: +4.7px across
     a 65 character line at body size, which visibly changes the texture and
     colour of a text block. Values are day tracking plus 2*delta/size. */
  --ls-100:0.019em;    /* day  0.015em */
  --ls-200:0.011em;    /* day  0.007em */
  --ls-300:0.004em;    /* day  0em     */
  --ls-400:-0.002em;   /* day -0.005em */
  --ls-500:-0.007em;   /* day -0.01em  */
  --ls-600:-0.011em;   /* day -0.013em */
  --ls-700:-0.014em;   /* day -0.016em */
  --ls-800:-0.017em;   /* day -0.019em */
  --ls-900:-0.019em;   /* day -0.021em */

  /* ---- line-height: DERIVED BUT DELIBERATELY NOT SHIPPED ----
     The same 2*delta closes the gap between lines as between glyphs, but
     vertically it spreads over a whole line box instead of a one-character
     gap. It lands at +0.002 to +0.004 on ratios like 1.54, which rounds away
     at the 2dp the rest of the scale uses and is well under a pixel per
     line. Emitting it would be false precision. Night keeps the day
     line-heights. Recorded here so the omission reads as a decision:
       --lh-300 would be 1.544 vs day 1.54.  Unchanged, on purpose. */
}

/* ---- EXCEPTION ----
   The CTA label is Midnight ON coral: dark on light. It does not bloom, and
   correcting it would be correcting in the wrong direction. It keeps DAY
   values even inside the night field. Any future dark-on-light element on
   the night ground needs the same exemption. */
.night .btn{
  --wt-button:600;
  letter-spacing:0;
}
