/* Forms design tokens: the design language of formscollective.co (its second design, 2026-10-22),
   shared with bernard (AB, 2026-10-23). Authored here and copied into each product with this
   folder's commit noted.

   Variable names match bernard's public/style.css (--bg, --text, --muted, --border, --line,
   --accent, --header, the type, space and radius scales), so this drops in over its :root
   blocks. New names are added; none of bernard's are removed. The app layer's status set is set here
   (AB, 2026-11-05); bernard's own --danger and fit scale stay in its style.css.

   Two scales live here (principles.md, section C). The app scale (--fs-*, --sp-1 to --sp-5) is
   bernard's dense one. The door scale (--fs-door-*, --sp-6 to --sp-9) is the site's calm one,
   taken from forms-collective-site styles.css at 1081ba6. The site does not read this file yet:
   it keeps its own copies of the colours as --paper, --ink and --hair, and hard-codes its type
   and spacing.

   The rule it rests on: one ink on near-white, no fills. Structure is drawn, not shaded: a thick
   ink rule opens a section, hairlines divide inside it, buttons are outlined boxes that invert
   only when pressed, and labels sit in mono like the field names on a form. Inside a signed-in
   app (the app layer, AB 2026-11-05, principles F1, F2 and F4) hover and selection are a wash of
   the ink, status takes a small fixed set of colours, and only floating layers cast a shadow. The
   one exception to no fills: a status or category chip may take a tint of its colour (AB,
   2026-11-04). */

:root {
  /* Surfaces and text */
  --bg:     #fbfbf9;   /* near-white */
  --text:   #0d1b2a;   /* the one ink: near-black navy */
  --muted:  #59606a;
  --border: rgba(13, 27, 42, 0.16);   /* the hairline: section and row dividers */
  --border-strong: rgba(13, 27, 42, 0.55);   /* inputs and resting controls: 3.9:1 on the paper (AB, 2026-11-04) */
  --line:   #0d1b2a;   /* full ink: section rules, outlined buttons, a focused input */
  --stroke: 3px;       /* the thick rule and the button outline */

  /* No second colour. The old names point at the ink so existing rules keep working. */
  --brand-dark: var(--text);
  --brand-ink:  var(--bg);
  --header:     var(--bg);     /* no filled bar: the header is the page, with the mark on it */
  --header-ink: var(--text);
  --accent:     var(--text);   /* a primary button is outlined in this at --stroke, never filled */
  --accent-ink: var(--bg);     /* text on the ink, for the pressed (inverted) state only */

  /* Type: one sans for headlines and body, mono for labels, numbers and small print */
  --sans:    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono:    ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --font:    var(--sans);
  --display: var(--sans);
  --display-weight: 500;
  --display-tracking: -0.035em;
  --display-leading: 1.02;
  /* There is no serif in this language. These names are kept so bernard's .serif class (the
     wordmark, a door title, an empty list) picks up the display face until it is renamed. */
  --serif: var(--display);
  --serif-weight: var(--display-weight);
  --serif-tracking: var(--display-tracking);
  --serif-leading: var(--display-leading);

  /* Section labels: mono, small, uppercase, tracked, muted, in place of bold headings */
  --label-font: var(--mono);
  --label-size: 12px;
  --label-weight: 500;
  --label-tracking: 0.08em;

  /* App scale, as bernard has it: the dense tiers (home, list, detail, analysis) */
  --fs-label: 0.72rem;
  --fs-small: 0.8125rem;
  --fs-body:  0.9375rem;
  --fs-h1:    1.375rem;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;

  /* Door scale, as the site has it: the calm tier (landing, sign-in, the site, empty states).
     Spacing continues the app scale; nothing between steps. 96 is the gap between the site's
     lettered sections, 64 the same gap on a phone, 48 the label column's gap, 32 the space
     above a row of buttons. */
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;
  --fs-door-display: 76px;   /* the hero headline, at the display weight, tracking and leading */
  --fs-door-lede:    19px;   /* lede and terms paragraphs */
  --fs-door-body:    17px;   /* body copy on the site */
  --fs-door-title:   22px;   /* a row's title inside a section; the same size as --fs-h1 */
  --fs-door-num:     13px;   /* a row's mono number, A1, A2 */
  --fs-door-meta:    11px;   /* the footer's mono small print */
  --door-leading:    1.55;   /* body line height on the site */
  --lede-leading:    1.5;
  --door-width:      1040px; /* the site's content column */
  --measure:         58ch;   /* the longest line a lede or terms paragraph may run */

  /* Shape: every box has rounded corners (AB, 2026-10-22: "all boxes should have a slight curve
     on each corner", then "more curved edges" after 4px, then "even rounder!" after 8px).
     Controls and small boxes 12px, larger containers 16px. */
  --r-btn: 12px;
  --r-sm: 12px;
  --r-md: 16px;
  /* The F mark's square is the exception: rx 15 on its 64 viewBox (about 8px at 28px) at any
     size, so it still reads as a square (AB, 2026-10-22). SVG rx, so not a token. */
  --shadow: none;

  /* App layer (AB, 2026-11-05): inside a signed-in app only */
  --fill-hover:    rgba(13, 27, 42, 0.04);   /* the ink at 4% */
  --fill-selected: rgba(13, 27, 42, 0.08);   /* the ink at 8% */
  --status-attention: #8f5a00;   /* needs you */
  --status-danger:    #b42a1e;   /* failed */
  --status-ok:        #1f7a43;   /* done; "active" takes the ink, not a hue */
  --shadow-float: 0 12px 32px rgba(13, 27, 42, 0.18);   /* floating layers only, never a panel or row */
  --stroke-small: 1.5px;   /* small and quiet buttons; the main action keeps --stroke */
}

/* Door type steps down with the screen, as the site's does */
@media (max-width: 860px) {
  :root { --fs-door-display: 48px; }
}

@media (max-width: 480px) {
  :root { --fs-door-display: 38px; --fs-door-lede: 17px; }
}

/* Dark: the ink and the paper swap. Follows the system setting unless the page forces light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:     #0b1219;
    --text:   #eef0ee;
    --muted:  #9aa3ad;
    --border: rgba(238, 240, 238, 0.18);
    --border-strong: rgba(238, 240, 238, 0.45);   /* 4.1:1 on the dark paper */
    --line:   #eef0ee;
    --fill-hover:    rgba(238, 240, 238, 0.05);
    --fill-selected: rgba(238, 240, 238, 0.10);
    --status-attention: #e0a340;
    --status-danger:    #ef6b5e;
    --status-ok:        #5fd08a;
    --shadow-float: 0 12px 32px rgba(0, 0, 0, 0.55);
  }
}

:root[data-theme="dark"] {
  --bg:     #0b1219;
  --text:   #eef0ee;
  --muted:  #9aa3ad;
  --border: rgba(238, 240, 238, 0.18);
  --border-strong: rgba(238, 240, 238, 0.45);
  --line:   #eef0ee;
  --fill-hover:    rgba(238, 240, 238, 0.05);
  --fill-selected: rgba(238, 240, 238, 0.10);
  --status-attention: #e0a340;
  --status-danger:    #ef6b5e;
  --status-ok:        #5fd08a;
  --shadow-float: 0 12px 32px rgba(0, 0, 0, 0.55);
}
