/* ============================================================
   CONCEPTO P — THE NUMERALS
   Every figure in the house is set the way a museum catalogue or a fine-press book sets it, never
   like a lab or a console: no monospace, no code look.

   ONE HAND, TWO CUTS. Both are EB Garamond (SIL OFL, assets/fonts/OFL.txt), cut by
   tools/make_numeral_fonts.py. A font that carries its own small capitals and figures, so a
   place that cannot switch a feature on (a canvas, a rule written long ago) still sets them.

     --num   "CP Catalogue"     the text figures. Old-style and proportional in running text, lining in
                                display, lining and tabular where a column must align, small capitals for
                                a prefix. Weight 400 to 600. Every feature is on offer.
     --mono  "CP Catalogue SC"  the label voice. The same hand with small capitals made the default: the
                                letters are small capitals and the figures are lining figures drawn at the same
                                height, so CL 0006 and 17 OCTOBER 2026 stand at one height like a plate's
                                engraved caption (the face's own small-cap figures read OOOI for 0001, so they
                                were redrawn). --mono is REMAPPED to this cut (site.css :root), so every
                                var(--mono) in the house (a label, a count, a status, a record number) becomes
                                a catalogue label at once. The name stays so no rule had to be rewritten; the
                                voice is not mono.

   A record number needs no markup to read well: both faces carry one rule (feature rclt, which a
   non-zero letter-spacing does not switch off) that sets a hyphen or dash between a capital and three
   or more figures as a thin space. CL-0006 reads CL 0006, R-004, N-004, CP-NEG-0001 in plain text, wherever
   the face is. The hyphen stays in the text for copying and searching. AE-1, SX-70 and C-41 are names, not
   records, and keep their hyphen.

   WHAT A ROOM USES
     .num           running figures: old-style, proportional
     .num-lining    lining, for display or beside capitals
     .num-table     lining and tabular, the catalogue face: ONLY where a column must align (a register)
     .num-display   60 to 200 px: a number as an object. Lining, tight, a firmer weight. Shape alone:
                    no shadow, no glow, no gradient
     .num-label     the label voice for new markup (same as what --mono gives)
     .rec           a record number, whole: small capitals, thin space, figures at their height.
                    CP.num.rec("CL-0006") builds it with .rec-p (prefix) .rec-g .rec-n (figures)
     .folio         a page number: centred, old-style, small
     .date          17 October 2026 in old-style figures (CP.num.date formats it)
     .num-sc        small capitals on any run of text in the catalogue face
   and CP.num (assets/js/house/numerals.js) for the rest.

   TRACKING. Letter-spacing declared for a label was tuned for monospace (.2 to .3em); in small capitals
   that flies apart. The three tracking tokens are brought in below. A literal letter-spacing on a rule that
   sets a label is still the room's own to bring in (inventory/numerals.md lists them). The only
   !important in this file is on letter-spacing, in two rules: .mono and [class*="mono"], and the text fields
   inside them, so the elements that carry the old class cannot fly apart whatever their room says.

   Loaded straight after site.css and before every room sheet, so a room may still override.
   ============================================================ */

/* The fallback is cut to the metrics of the face, so that when the real one arrives the line does not
   move. Times New Roman (and its metric twins) stand in; size-adjust brings its widths to the Garamond's,
   the overrides put the baseline where the Garamond's is. */
@font-face{
  font-family:"CP Catalogue";
  src:url("../fonts/cp-catalogue.woff2") format("woff2");
  font-weight:400 600; font-style:normal; font-display:swap;
}
@font-face{
  font-family:"CP Catalogue SC";
  src:url("../fonts/cp-catalogue-sc.woff2") format("woff2");
  font-weight:400 700; font-style:normal; font-display:swap;
  /* a small capital is 0.455em tall, the old monospace capital was 0.7em: this brings a label back to the
     size and the width the monospace one had, so the same declared 11px is still a label one can read and
     a box sized in ch around one does not overflow */
  size-adjust:132%; ascent-override:77.7%; descent-override:20.8%; line-gap-override:0%;
}
@font-face{
  font-family:"CP Catalogue Fallback";
  src:local("Times New Roman"), local("Times"), local("Liberation Serif"), local("Tinos");
  font-weight:400 700; font-style:normal;
  size-adjust:91.6%; ascent-override:109.9%; descent-override:32.5%; line-gap-override:0%;
}
@font-face{
  font-family:"CP Catalogue SC Fallback";
  src:local("Times New Roman"), local("Times"), local("Liberation Serif"), local("Tinos");
  font-weight:400 700; font-style:normal;
  size-adjust:112%; ascent-override:91.5%; descent-override:24.6%; line-gap-override:0%;
}

:root{
  /* the tracking a label can bear in small capitals (they were .12, .16, .22em in monospace) */
  --tr-mono-close:.05em;   /* figures and values */
  --tr-mono:.09em;         /* labels */
  --tr-mono-wide:.13em;    /* a kicker, a running head */
  --tr-num:.01em;          /* figures set as text */
}

/* ---------- never slanted: the catalogue's faces have no italic, and nothing fakes one (type.css: font-synthesis none) ----------
   A figure or a label in either cut stands upright even inside an italic line (P's review of 17 October, T7). */
.num, .num-lining, .num-table, .num-sc, .num-display, .num-label, .rec, .rec-p, .rec-g, .rec-n, .folio, .date{ font-style:normal; }

/* ---------- the voice of the old class ---------- */
.mono, [class*="mono"]{
  font-family:var(--mono);
  font-style:normal; font-variant-numeric:normal;
  letter-spacing:.09em !important;
}
.mono input, input.mono, textarea.mono, .mono textarea, .mono select{ font-family:var(--num); letter-spacing:.02em !important; font-variant-caps:normal; }

/* ---------- running figures ---------- */
.num, .date{
  font-family:var(--num); font-variant-numeric:oldstyle-nums proportional-nums;
  font-variant-caps:normal; letter-spacing:var(--tr-num); color:inherit;
}
.num-lining{
  font-family:var(--num); font-variant-numeric:lining-nums proportional-nums;
  letter-spacing:var(--tr-num);
}
/* only a column that must align: a register, a price list, a log. Still the catalogue face. */
.num-table{
  font-family:var(--num); font-variant-numeric:lining-nums tabular-nums;
  font-variant-caps:normal; letter-spacing:0; font-feature-settings:"kern";
}
.num-sc{ font-family:var(--num); font-variant-caps:all-small-caps; font-variant-numeric:oldstyle-nums proportional-nums; letter-spacing:.07em; }

/* ---------- a record number: CL 0006 ----------
   The label cut at .76em: its capital is then the small capital of the line it stands in, and its figures
   are the same figures a label has. The hyphen in the text is set as a thin space by the face. */
.rec{
  font-family:var(--mono); font-size:max(11px, .76em); font-style:normal; font-variant-numeric:normal;
  letter-spacing:.07em; white-space:nowrap; color:inherit;
}
.rec-p, .rec-g, .rec-n{ font:inherit; letter-spacing:inherit; }   /* hooks, not different type: the thin space is set across them */

/* ---------- the label voice, for new markup ---------- */
.num-label{ font-family:var(--mono); letter-spacing:var(--tr-mono); font-variant-numeric:normal; }

/* ---------- a page number ---------- */
.folio{
  font-family:var(--num); font-variant-numeric:oldstyle-nums proportional-nums;
  font-size:13px; line-height:1; letter-spacing:.06em; text-align:center; color:inherit;
}

/* ---------- a number as an object (60 to 200 px) ----------
   The chrome 61 on stone and the brushed letters on plaster are read for their weight, their polish
   and their proportion. Here that is a lining figure cut firmer than text and set tight, in the page's
   own ink. No shadow and no glow: the shape alone is the object. */
.num-display{
  font-family:var(--num); font-weight:500;
  font-variant-numeric:lining-nums proportional-nums; font-kerning:normal;
  font-size:clamp(60px, 14vw, 200px); line-height:.9; letter-spacing:-.025em;
  color:inherit;
  text-rendering:geometricPrecision; -webkit-font-smoothing:antialiased;
}
/* a record number made large: the prefix in small capitals, the figures lining (lining-nums is
   consulted before the small-cap figures, so all-small-caps leaves the figures alone) */
.rec.num-display{ font-variant-caps:all-small-caps; }
@media (max-width:600px){
  .num-display{ font-size:clamp(60px, 26vw, 140px); }
}

/* ---------- A NUMBER IS STAMPED (CP.num.stamp in numerals.js, 20 October) ----------
   Each figure is a wheel in a window laid exactly over the real figure, which is held invisible in the line while
   the wheel turns (so no width, no baseline moves), and is the plain text again when the wheels are still.
   A number marked data-stamp is held unseen until it is first stamped. */
html.cp-st-on [data-stamp]:not(.st-seen){ visibility:hidden; }
.st-d{ position:relative; }
.st-d.is-turning{ color:transparent; -webkit-text-fill-color:transparent; }
.st-w{
  position:absolute; top:0; display:block; overflow:hidden; pointer-events:none;
  -webkit-user-select:none; user-select:none; text-shadow:none; font-style:inherit;
}
.st-c{ position:absolute; left:0; top:0; display:block; width:100%; will-change:transform; }
.st-n{ display:block; white-space:nowrap; text-align:left; text-indent:0; }
/* the breath of ink as a wheel lands: a hair heavier, then dry */
.st-w.is-inked .st-n{ animation:st-ink .54s cubic-bezier(.55,0,.25,1) both; }
@keyframes st-ink{
  0%  { text-shadow:0 0 .5px currentColor, 0 0 .02em currentColor; }
  100%{ text-shadow:0 0 0 transparent, 0 0 0 transparent; }
}
