/* Design tokens for the "blueprint + brick" direction. Every color, size and font in the UI comes from here.
   See DESIGN.md for what each one is for. Contrast ratios are measured against the surface the token is used on. */
:root {
  color-scheme: dark;

  /* Surfaces */
  --blueprint: #00297B;        /* panels: the sidebar, cards, popovers */
  --navy: #01194A;             /* the stage behind the 3D view; the deepest surface */
  --raise: #0A3590;            /* a control or card sitting on a blueprint panel */
  --sunk: #01215F;             /* an input field set into a panel */
  --plate: #2B4F9E;            /* the 3D build plate: a step lighter than the stage so dark pieces read */

  /* Ink */
  --paper: #FFFFFF;            /* primary text and lines (13.1:1 on blueprint) */
  --muted: #B4C2E3;            /* secondary text (7.3:1 on blueprint) */
  --faint: #8FA3D1;            /* the dashed lines. Opaque on purpose: a see-through line darkens where two edges overlap at a corner. */
  --line: #8FA3D1;             /* borders of controls: inputs, chips; at least 3:1 so the edge is visible */
  --hairline: rgba(255, 255, 255, .2); /* quiet solid dividers; decoration only */

  /* Brick yellow: the one action color. Primary buttons, the active tab, the focus of attention. */
  --yellow: #ECD645;           /* 8.9:1 on blueprint, 11.5:1 on navy */
  --yellow-hover: #F6E56B;     /* a primary button under the pointer */
  --yellow-ink: #00297B;       /* text on yellow (8.9:1) */

  /* Status. Always paired with an icon or word, never color alone. */
  --danger: #FF7A5C;           /* 5.1:1 on blueprint */
  --ok: #6FE3A1;               /* 8.2:1 on blueprint */

  /* Lines. Dashes are rare (see DESIGN.md) and are drawn as backgrounds, because a CSS dashed border cannot set its gap:
     4px dash, 4px gap, 1.5px thick. Use the .dashed classes below, not `border: dashed`. */
  --dash: 4px; --gap: 4px; --weight: 1.5px;
  --rule-solid: 1.5px solid var(--paper);

  /* Type: Boldonse for the wordmark-level title and headings (always uppercase, wide and heavy: keep it short and large enough to
     read), Sofia Sans Condensed for everything else, including numbers (tabular figures). Controls (buttons, tabs, chips) use
     Sofia Sans Condensed 800 uppercase, because Boldonse is too wide for them. */
  --display: "Boldonse", "Arial Black", system-ui, sans-serif;
  --body: "Sofia Sans Condensed", "Arial Narrow", system-ui, sans-serif;
  --t-title: 400 28px/1.15 var(--display);     /* page titles */
  --t-head: 400 14px/1.35 var(--display);      /* section headings */
  --t-label: 800 17px/1 var(--body);           /* buttons, tabs, chips, field labels (uppercase) */
  --t-body: 400 16px/1.4 var(--body);
  --t-small: 400 14px/1.35 var(--body);
  --t-num: 600 13px/1.2 var(--body);           /* part IDs, counts, sizes; used with tabular-nums */
  --t-field: 600 15px/1.2 var(--body);         /* text typed into inputs */
  --track: .02em;                              /* letter spacing for uppercase labels */
  --track-head: .02em;

  /* Space and shape: a 4px grid, a 1px radius (corners are almost square) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --radius: 1px;
  --stud: 20px;                                /* the grid on the stage, one stud */
  --focus: 3px solid var(--yellow);

  /* Motion: a press is quick, a dropped brick falls, lands with a small squash, then settles. Skipped under prefers-reduced-motion. */
  --press: 90ms; --drop: 180ms; --settle: 200ms;            /* keyboard focus ring: yellow, offset 2px */
}

/* Dashed lines with a wider gap. Add the class to any box. .dashed is all four sides, .dashed-b only the bottom. */
.dashed, .dashed-b { --c: var(--faint); background-repeat: repeat-x, repeat-x, repeat-y, repeat-y; background-origin: border-box; }
.dashed {
  background-image:
    linear-gradient(90deg, var(--c) var(--dash), transparent var(--dash)), linear-gradient(90deg, var(--c) var(--dash), transparent var(--dash)),
    linear-gradient(180deg, var(--c) var(--dash), transparent var(--dash)), linear-gradient(180deg, var(--c) var(--dash), transparent var(--dash));
  background-size: calc(var(--dash) + var(--gap)) var(--weight), calc(var(--dash) + var(--gap)) var(--weight), var(--weight) calc(var(--dash) + var(--gap)), var(--weight) calc(var(--dash) + var(--gap));
  background-position: 0 0, 0 100%, 0 0, 100% 0;
}
.dashed-b {
  background-image: linear-gradient(90deg, var(--c) var(--dash), transparent var(--dash));
  background-size: calc(var(--dash) + var(--gap)) var(--weight); background-position: 0 100%; background-repeat: repeat-x;
}
