/* The sheet's materials: paper, pens, lettering.
   -------------------------------------------------------------------------------------------
   Everything that decides how this portal looks lives here, and style.css spends it. The split
   is not tidiness: it is so that the one question a reviewer asks -- "what would it look like
   if the ground were warmer, or the linework heavier?" -- is answered by editing one screen of
   values rather than hunting 2,800 lines.

   Three scales, each with a reason:

   * Pen weights. A drawing carries its hierarchy in line weight, not in colour or shadow. Four
     pens, named for the job rather than the nib, with the conventional nib in the comment.
   * A type scale, seven steps on a ~1.21 ratio. What was here before was twenty sizes in
     half-pixel increments, which is not a scale -- nothing could be decisively larger than
     anything else.
   * A width axis. Archivo is a variable font and the family loaded here carries wdth 75..110.
     Drawing annotation is condensed and prose is not; using that axis is the cheapest way for
     this to read as a drawing rather than as a document with rules on it.

   The dark theme at the foot is a negative print: the same drawing, dark board, pale linework.
   Hoarding orange does not change role in it, because a safety colour that changed meaning in
   the dark would be a poor safety colour. */

:root {
  color-scheme: light;

  /* ---------------------------------------------------------------- the ground and the stock

     The board is warm and a clear step darker than the stock, so a sheet reads as laid on
     something rather than as a panel floating in a page background. */
  --paper: #d3d4cb;
  --sheet: #fcfcfa;
  --ink: #12304f;
  --ink-soft: #4d6279;
  --rule: #c6c8c2;
  --ghost: #aab3b8;

  /* Hoarding orange marks live works. It is 3.1:1 on the stock, which is enough for a rule, a
     fill or a 2px underline and is NOT enough for text: orange words take --flag, at 6.0:1.
     Keeping the two apart is the only reason --flag exists. */
  --hoarding: #f26a1b;
  --flag: #a8430a;
  --built: #2f7d54;
  --built-fill: #e6f2eb;
  --built-ink: #1d5a3a;

  --tint: #eaeef1;
  --warm: #fdf2e9;
  --row-hover: #f1f4f3;
  --ink-hover: #1b4670;
  --on-ink-soft: #b8c8d6;

  /* ---------------------------------------------------------------- pens

     0.13 / 0.25 / 0.35 / 0.70, the weights a hand-inked sheet actually used. Hair divides cells
     inside a block; thin rules rows; med draws a block's own edge; heavy is reserved for the
     sheet border and for a cut through the drawing. Four weights is the hierarchy. */
  --w-hair: 0.5px;
  --w-thin: 1px;
  --w-med: 1.5px;
  --w-heavy: 3px;
  /* Two strokes that mark rather than enclose: --w-mark flags an edge (a quote, a rule box,
     a band on the timeline), --w-cut is the thick stroke on a block that carries a verdict,
     drawn like a section cut. */
  --w-mark: 3px;
  --w-cut: 5px;

  /* ---------------------------------------------------------------- lettering

     Sizes. Base is 14.5px; the ratio is about 1.21. --t-num is off the scale on purpose,
     because the figures on the front sheet are meant to be read from across a room. */
  --t-xs: 11px;
  --t-sm: 12.5px;
  --t-base: 14.5px;
  --t-md: 17px;
  --t-lg: 21px;
  --t-xl: 26px;
  --t-num: 34px;

  /* Widths. --wd-annot is the drawing hand: title-block fields, column heads, status stamps.
     --wd-head is for headings and figures. Prose stays at the design width and is never
     condensed, because condensed prose is harder to read and nothing is gained by it. */
  --wd-annot: 76%;
  --wd-head: 84%;
  --wd-text: 100%;
  --ls-annot: 0.07em;

  /* Measure. `ch` is the width of a zero, and Archivo's tabular zero is 8.53px where its
     average lowercase letter is 7.28px -- so a cap set in `ch` runs about 17% longer than it
     reads. 56ch is about 66 characters, which is the line length this is actually aiming at;
     the caps already in style.css were set as though `ch` were a character and ran to 79. */
  --measure: 56ch;

  --gap: 18px;

  /* ---------------------------------------------------------------- hatching and works

     One idea, spent hard: what is not known is hatched, the way an unsurveyed area is hatched
     on a drawing, and the same hatch means the same thing on every sheet. */
  --hatch-ink: rgba(77, 98, 121, 0.17);
  --hatch: repeating-linear-gradient(
    135deg,
    transparent 0 6px,
    var(--hatch-ink) 6px 7.5px
  );
  --works: repeating-linear-gradient(
    135deg,
    var(--hoarding) 0 9px,
    var(--ink) 9px 18px
  );

  /* The board's tooth. This began as a ruled grid, which was wrong: the board is only ever
     visible as an 18px strip around the sheets, and a grid at any useful pitch shows one or
     two lines in a strip that narrow -- it read as stray ticks, not as ruling. A fine dot
     tooth has no direction and no cell, so it reads as a surface at any width. */
  --tooth: rgba(18, 48, 79, 0.1);

  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* ---------------------------------------------------------------- the negative print

   Same sheet, printed in reverse: dark board, dark stock, pale linework. The three things that
   do not simply invert are the hatch (which needs more alpha to survive on a dark ground), the
   orange (lifted, so it still reads as a signal rather than as rust) and --flag, which goes
   LIGHTER rather than darker -- on a dark ground the legible orange is the brighter one.

   Auto by preference, and overridable from the title block. The guard on the media query is so
   that a reader who has explicitly asked for the positive print keeps it on a dark system. */
@media (prefers-color-scheme: dark) {
  :root:not([data-print="positive"]) {
    color-scheme: dark;

    --paper: #0d1824;
    --sheet: #16222e;
    --ink: #e6ebe8;
    --ink-soft: #9aabb8;
    --rule: #35475a;
    --ghost: #5d7084;

    --hoarding: #ff8238;
    --flag: #ff9a5c;
    --built: #4fb584;
    --built-fill: #16311f;
    --built-ink: #7fd3a6;

    --tint: #1d2d3c;
    --warm: #2e2117;
    --row-hover: #1e2d3b;
    --ink-hover: #cfd8d5;
    --on-ink-soft: #4d6279;

    --hatch-ink: rgba(230, 235, 232, 0.15);
    --tooth: rgba(230, 235, 232, 0.07);
  }
}

:root[data-print="negative"] {
  color-scheme: dark;

  --paper: #0d1824;
  --sheet: #16222e;
  --ink: #e6ebe8;
  --ink-soft: #9aabb8;
  --rule: #35475a;
  --ghost: #5d7084;

  --hoarding: #ff8238;
  --flag: #ff9a5c;
  --built: #4fb584;
  --built-fill: #16311f;
  --built-ink: #7fd3a6;

  --tint: #1d2d3c;
  --warm: #2e2117;
  --row-hover: #1e2d3b;
  --ink-hover: #cfd8d5;
  --on-ink-soft: #4d6279;

  --hatch-ink: rgba(230, 235, 232, 0.15);
  --tooth: rgba(230, 235, 232, 0.07);
}
