/* Dusk — the Poppy Room design system
   Source of truth for code. Mirrors the Paper file "Cordelia Works — Design System"
   (sheets 08–10 and the PR specimen artboards, July 2026).

   Naming: role-first, no brand prefix. If these ever collide with another
   system's variables, wrap them in a scope class (.dusk) rather than renaming. */

:root {
  /* ---- Color ------------------------------------------------------------
     Two grounds, one ink ramp, one accent. Mostly monochrome by rule:
     poppy appears at most once or twice per surface (a CTA, a card dot,
     a letterhead rule). Documents (installer sets, records) are strictly
     monochrome. Poppy is never used for prose text. */
  --color-paper:       #FFFFFF;
  --color-ink:         #0A0A0A;
  --color-ink-dim:     rgb(10 10 10 / 62%);   /* secondary text            */
  --color-ink-faint:   rgb(10 10 10 / 38%);   /* metadata; >=11px caps only */
  --color-rule:        rgb(10 10 10 / 14%);   /* hairlines                 */
  --color-poppy:       #FF7A1A;               /* THE accent — special use  */

  /* On-ink equivalents */
  --color-paper-dim:   rgb(255 255 255 / 62%);
  --color-paper-faint: rgb(255 255 255 / 55%);
  --color-rule-on-ink: rgb(255 255 255 / 16%);

  /* RESERVE — data visualization only, never brand surfaces */
  --color-reserve-gold: #FC9700;
  --color-reserve-stem: #5F7D6C;
  --color-reserve-tint: #FFF1E5;

  /* ---- Type -------------------------------------------------------------
     One foundry. Archivo Variable (wght 100–900, wdth 62–125) for
     everything designed; Chivo Mono for field notes, captured data, and
     character-grid content only — never headings, prose, or labels. */
  --font-sans:  "Archivo", system-ui, sans-serif;
  --font-field: "Chivo Mono", ui-monospace, monospace;

  /* Perfect fourth scale, base 16 */
  --text-caption: 12px;  --leading-caption: 16px;
  --text-body:    16px;  --leading-body:    25px;
  --text-lede:    21px;  --leading-lede:    30px;
  --text-h3:      28px;  --leading-h3:      34px;
  --text-h2:      38px;  --leading-h2:      44px;
  --text-h1:      51px;  --leading-h1:      56px;
  --text-display: 67px;  --leading-display: 72px;
  --text-hero:    90px;  --leading-hero:    92px;

  /* Weights (named stops on the wght axis) */
  --weight-thin:     100;
  --weight-light:    300;
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;
  --weight-xbold:    800;
  --weight-black:    900;

  /* Widths (stops on the wdth axis, used via font-stretch)
     Semantics: expanded speaks for the brand, normal carries the content,
     condensed runs the apparatus. */
  --width-condensed: 62%;
  --width-narrow:    90%;   /* section/subsection headings (Ladder B) */
  --width-normal:    100%;
  --width-working:   106%;
  --width-heading:   112%;
  --width-display:   118%;
  --width-expanded:  125%;

  /* Tracking */
  --tracking-expanded:  -0.015em; /* expanded display roles          */
  --tracking-heading:   -0.02em;  /* h1–h3 at normal widths          */
  --tracking-none:       0em;     /* body, lede                      */
  --tracking-condensed:  0.02em;  /* condensed apparatus — never wide */
  --tracking-label:      0.08em;  /* uppercase labels at normal width */

  /* ---- Space ------------------------------------------------------------ */
  --space-row:     26px;
  --space-block:   56px;
  --space-gutter:  96px;
  --space-section: 144px;
  --measure-body:  544px;   /* max body text width  */
  --measure-lede:  620px;   /* max lede width       */

  /* ---- Drawing ------------------------------------------------------------
     The architectural drawing extension (DRAWING.md; Paper sheets 39–43,
     decided 2026-08-19). Ink is the drawing; the leads and warn mark what
     does not plot. Pens are device px on screen, ISO mm at plot. */
  --draw-screen:      rgb(10 10 10 / 45%);  /* halftone: context layers      */
  --draw-poche:       rgb(10 10 10 / 12%);  /* fill inside cut profiles      */
  --color-lead:       #2B5FA8;              /* blue lead: live apparatus     */
  --color-lead-dim:   rgb(43 95 168 / 62%); /* wet apparatus                 */
  --color-lead-faint: rgb(43 95 168 / 38%); /* guides, grids                 */
  --color-markup:     #BE3B2B;              /* red lead: human redlining     */
  --color-warn:       #A63A78;              /* machine-detected defects      */
  --pen-cut:     2.2px;  --pen-cut-plot:     0.50mm;
  --pen-object:  1.4px;  --pen-object-plot:  0.35mm;
  --pen-beyond:  0.9px;  --pen-beyond-plot:  0.25mm;
  --pen-surface: 0.5px;  --pen-surface-plot: 0.13mm;

  /* ---- Radius ------------------------------------------------------------
     "Rounding is the new Dusk rule" (ratified 2026-08-17, panel redesign):
     md rounds controls, chips, and containers; sm rounds nested elements
     (checkboxes, segments inside tracks, badges); pill is for switches and
     radios only. Documents and plotted sheets stay square (radius-none is a
     document rule, not a UI rule). */
  --radius-none: 0px;
  --radius-sm:   3px;
  --radius-md:   4px;
  --radius-pill: 999px;

  /* ---- Popover -----------------------------------------------------------
     One recipe for every popover in app chrome. A popover sizes to its
     content, never to a set width; the gutter is the margin it keeps from
     the screen edges, and the widest it may grow is the screen less two
     gutters. Its body scrolls when it would run off the screen. */
  --popover-surface: var(--color-paper);
  --popover-rule:    var(--color-rule);
  --popover-radius:  var(--radius-md);
  --popover-shadow:  0 12px 28px rgb(10 10 10 / 16%);
  --popover-pad:     12px;
  --popover-gutter:  12px;
}
