/* Typeface. Loaded last. DM Sans (self-hosted, variable, OFL) is the one face for
   the interface and for display (brand, room titles); Space Grotesk handles
   figures. Every earlier system-ui / Helvetica / Inter stack now points at
   --font-ui. */

/* Metric-matched fallbacks so the swap does not reflow the layout. */

@font-face{
  font-family:"DM Sans";
  src:url("../fonts/dm-sans-latin-wght-normal.woff2") format("woff2");
  font-weight:100 1000;
  font-style:normal;
  font-display:swap;
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face{
  font-family:"DM Sans Fallback";
  src:local("Arial");
  size-adjust:104%;
  ascent-override:92%;
  descent-override:29%;
  line-gap-override:0%;
}
:root{
  --font-ui:"DM Sans","DM Sans Fallback",system-ui,-apple-system,"Segoe UI",sans-serif;
  --font-display:var(--font-ui);
}

html.graphite63 body,
html.graphite63 :is(button,select,input,textarea,summary,legend,output){
  font-family:var(--font-ui);
}
html.graphite63 body{font-optical-sizing:auto;font-synthesis:none}

/* Display voice: brand and titles. */
html.graphite63 :is(
  h1,h2,.brand49,.rail59 .brand49,
  .gallery-heading59 :is(h1,h2),
  #palette-panel h2,
  #detail .finish-toolbar #name,
  #gallery-head63 h1,
  #library-title63,#motion-title50,#post-title50,#export-heading49,#palette-heading
){
  font-family:var(--font-display);
  font-weight:650;
  letter-spacing:-.03em;
  font-optical-sizing:auto;
}

/* One step heavier for small UI on dark. */
html.graphite63 :is(button,summary,label,legend){font-weight:500}

/* Brand mark: the logo replaces the old pale-green disc in the rail. */
html.graphite63 .rail59 .brand49::before{
  border-radius:7px;
  background:url("../favicon.svg") center/contain no-repeat;
  box-shadow:none;
}

/* Space Grotesk: the technical voice. Used for figures, ratios, counts, sizes
   and tooltips, where its geometric numerals read as measurement. Not used for
   running UI text. */
@font-face{
  font-family:"Space Grotesk";
  src:url("../fonts/space-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight:300 700;
  font-style:normal;
  font-display:swap;
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face{
  font-family:"Space Grotesk Fallback";
  src:local("Arial");
  size-adjust:103%;
  ascent-override:92%;
  descent-override:25%;
  line-gap-override:0%;
}
:root{--font-tech:"Space Grotesk","Space Grotesk Fallback","DM Sans",system-ui,sans-serif}

html.graphite63 :is(
  output,
  input[type=number],
  .gallery-count59,
  #gallery-work-count48,
  #gallery-ink-scope63,
  .motion-size57,
  .seg .seg__item,
  .settings-count63,
  .rail59 .rail-label59,
  [data-tip64]::after,
  .tip64,
  #batch-grid50 small,
  [id$=-value45],[id$=-number45]
){
  font-family:var(--font-tech);
  font-variant-numeric:tabular-nums;
}
