/* planetai-theme.css — the PLANETAI programme layer.
   GENERATED by tools/gen-theme.mjs from references/planetai-layer.md. Do not edit this file:
   edit the table and regenerate. test/theme.test.js fails if the two disagree.

   This layer imports the Fab City foundation and adds to it. It redefines nothing: every token
   below is unprefixed, every --fc- token stays where Decision 0 put it.

   Contrast, computed at generation time, not asserted from memory:
   #7FA5E8 on paper #F9F5F2 = 2.29:1 — it may appear ONLY inside the dark block below.
   #20388D on ink #171717 = 1.72:1 — it may NEVER appear inside it.
   #F9F5F2 at 62% over ink #171717 composites to #A3A19F = 6.96:1, which is the wall credit lines.

   12 OPEN items are carried as comments at the token each one affects. */

@import "tokens.css";

/* JetBrains Mono, self-hosted as a latin woff2 subset. A node serves this dashboard on a LAN that
   may have no route out, so a webfont request to a CDN would leave every number in a fallback that
   is not monospace on some machines. The chain after it is real: ui-monospace resolves to SF Mono
   on Apple, then Menlo, then whatever the system calls monospace.

   The range is 400 800 because that is what the subset holds: its fvar wght axis runs 400 to 800,
   read with fontTools. The shipped node dashboard declares 100 800, which asks the browser for six
   weights the file cannot draw, and gets 400 for all of them. 229 codepoints, 394 glyphs, 31 kB. */
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* the surface a PLANETAI drawing sits on · planet-states-full.svg · Decision 0 */
  --ground: #F9F5F2;

  /* figure and type: buildings, roads, labels, provenance · kilometre.svg · Decision 0 */
  --ink: #171717;

  /* landmass fill under the grid · planet-states-full.svg · Decision 0 */
  --land: #171717;

  /* how far the landmass comes forward · planet-states-full-dark.png · A5 */
  /* OPEN: dark --land-opacity was raised from 0.12 to 0.18 by eye during the A5 re-export, not measured — using 0.18 until settled */
  --land-opacity: 0.12;

  /* an H3 cell, data, identity, a lit or selected cell · kilometre.svg, kilometre-dark@2x.png · Decision 1 */
  /* OPEN: #7FA5E8 measures 7.21:1 on ink, but the dark register has never been seen on a real display in a real room — using #7FA5E8 until settled */
  --cells: #20388D;

  /* a loop closed, a response, an act taken · rho-row.svg · Decision 0 */
  --rings: #00A057;

  /* the same green, named after what it means · rho-row.svg · R5 */
  --loop-closed: var(--rings);

  /* a signal got worse or crossed a line · node dashboard · Decision 0 */
  --signal-worse: #E62038;

  /* what only the satellite knows, and nothing else · kilometre.svg, unit-row.svg · R3, Decision 3 */
  --satellite-only: #DB7200;

  /* provenance is ink only and square, never a coloured pill · signs-contact.png · R5 */
  /* OPEN: prov-cached is a new mark, and at 12px it is 93.7% identical to prov-example: the square inside the ring fills in and what is left is the ring. A ring with a horizontal bar and a doubled ring are still on the bench — using var(--ink) until settled */
  --prov: var(--ink);

  /* a grid cell over water: a whisper · planet-states-full.svg · R2 */
  /* OPEN: the water and land cell opacities were set at 1600x800 and have never been looked at below that width — using 0.13 until settled */
  --cell-water-opacity: 0.13;

  /* a grid cell over land: the continents emerge from the tiling · planet-states-full.svg · R2 */
  --cell-land-opacity: 0.45;

  /* live: measured here, reporting now · planet-states-full.svg · A2 */
  --state-live-weight: 2.5;

  /* the res-1 cell a live node lights · planet-states-full.svg · A2 */
  --state-live-fill: 0.13;

  /* quiet: was live, nothing arriving · planet-states-full.svg · A2 */
  --state-quiet-fill: 0.05;

  /* registered: in registry.json, not up yet · planet-states-full.svg · A2 */
  --state-registered-weight: 1.5;

  /* dashed means planned · planet-states-full.svg · A2 */
  --state-registered-dash: 5 4;

  /* pilot: named in the paper, no node · planet-states-full.svg · A2 */
  --state-pilot-weight: 1;

  /* how far a pilot cell recedes · planet-states-full.svg · A2 */
  /* OPEN: a pilot cell at 45% measures 4.26:1 on ink and 2.90:1 on paper. It is a hairline and not type, but the paper register is the weaker one and neither has been checked on a wall at three metres — using 0.45 until settled */
  --state-pilot-opacity: 0.45;

  /* the res-9 mesh over the kilometre · kilometre.svg · R3 */
  --hair-res9-opacity: 0.3;

  /* the res-8 cell the plan outlines · kilometre.svg · R3 */
  --cell-res8-weight: 2;

  /* the node's own cell, as the dashboard hero's ground · node-ground.svg · A4 */
  --ground-cell-fill: 0.05;

  /* the six neighbouring cells · node-ground.svg · A4 */
  --ground-neighbour-opacity: 0.10;

  /* the seven res-9 children · node-ground.svg · A4 */
  --ground-child-opacity: 0.07;

  /* the two credit lines under a satellite frame · no artboard records this value · no round */
  /* OPEN: no round or artboard records the 0.62 opacity; it arrives from the design side. Computed here: 6.96:1 on ink and 4.89:1 on paper, and measured on the rendered page at 6.94 and 4.87. The claim of about 7:1 holds for the ink register only; on paper the same lines are AA and not AAA — using 0.62 until settled */
  --wall-line-opacity: 0.62;

  /* a closed ring in the rho row · rho-row.svg · R1 */
  --rho-closed: var(--rings);

  /* the size every sign must still read at · signs-contact.png · A */
  /* OPEN: house, machine, sensor and cube-key were drawn to the 24-unit rules, not matched to the FAB26 v2 faces, which were never exported into sources/ — using 12px until settled */
  /* OPEN: cell and prov-example are 93.9% identical at 12px: a hexagonal outline and a circular ring are the same ring on a 144-pixel grid. The contact sheet caught dido against cell and missed this pair. Both are in use, so this is a redraw, not a build fix — using 12px until settled */
  --sign-floor: 12px;

  /* every number, unit, timestamp, cell id and chip label · rho-row.svg · Decision 0 */
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* the monument numeral on the node's lead, and nothing else · node dashboard · R21 */
  /* OPEN: the monument numeral is the one figure on the page big enough to be a piece of typography rather than a reading, and nothing records whether it should stay in the mono or be set in Funnel Sans like the headline beside it. The token exists so the answer is one line either way — using var(--mono) until settled */
  --num-face: var(--mono);

  /* a reading lands: the fade · node dashboard · R6 */
  --motion-reading-fade: 120ms;

  /* a reading lands: the pulse · node dashboard · no round */
  /* OPEN: the pulse period is recorded by no round; 3s is lifted from the shipped dashboard's halo keyframe — using 3s until settled */
  --motion-reading-pulse: 3s;

  /* the day curve steps once an hour · node dashboard · R6 */
  /* OPEN: nothing records whether the day curve steps on the hour or on arrival — using 3600s until settled */
  --motion-day-curve-step: 3600s;

  /* a ring closing is an event · no artboard records this value · no round */
  /* OPEN: no round records a duration for a ring closing; 320ms is the design system's slow step — using 320ms until settled */
  --motion-ring-closed: 320ms;

  /* one Sentinel frame holds for four seconds · satellite frames · R6 */
  --motion-satellite-year: 4s;

  /* the datum changes once a year, so it does not animate · no artboard records this value · R6 */
  --motion-land-change-yoy: 0s;

  /* the node has not answered yet: the loading state holds until /issues lands · node dashboard · R24 */
  --motion-asking: until-data;

  /* the loading state is also a reading: how long it is held so the reads can be read · node dashboard · R25 */
  --motion-asking-hold: 3s;

  /* a stack arrives: one bracket cell fills per step · node dashboard · R24 */
  --motion-meter-fill: 40ms;

  /* learn mode is on: a mark floats 4 px · node dashboard · R24 */
  --motion-mark-float: 3.2s;
}

/* The dark register. A wall screen in a room at night: paper becomes the figure and ink becomes the
   ground. Only what changes is restated. */
[data-theme="dark"] {
  /* the surface a PLANETAI drawing sits on */
  --ground: #171717;

  /* figure and type: buildings, roads, labels, provenance */
  --ink: #F9F5F2;

  /* landmass fill under the grid */
  --land: #F9F5F2;

  /* how far the landmass comes forward */
  --land-opacity: 0.18;

  /* an H3 cell, data, identity, a lit or selected cell */
  --cells: #7FA5E8;

  /* what only the satellite knows, and nothing else */
  --satellite-only: #FF931E;
}

/* The variant-bound classes every SVG this layer emits carries. A hard-coded paper or ink literal
   is allowed in those files only as a dead fallback behind one of these classes — that is what
   test/variant.test.js enforces, and it has caught this bug three times. This block comes from
   BINDING_CLASSES in scripts/lib.js, which is also what goes into every SVG's own <style>, so the
   two cannot drift. */
.ground { fill: var(--ground); }
.land   { fill: var(--land); fill-opacity: var(--land-opacity); }
.cell   { fill: none; stroke: var(--cells); }
.chain  { fill: var(--cells); stroke: var(--cells); }   /* the next frame's cell: data, opacity via attribute */
.lit    { fill: var(--cells); stroke: var(--cells); color: var(--cells); }   /* a node's lit cell: same */
.ring   { fill: none; stroke: var(--rings); color: var(--rings); }
.hair   { fill: none; stroke: var(--ink); }
/* color as well as fill: a sign is a nested <svg> whose geometry is currentColor, so the class on
   the wrapper has to set the inherited colour, not only its own fill. */
.fig    { fill: var(--ink); color: var(--ink); }
.label  { fill: var(--ink); font-family: var(--mono); }
/* Two roles that are not ink and not a cell, so they need their own binding or they arrive as
   bare literals: orange means what only the satellite knows, and nothing else. Vegetation
   borrows the green — a known collision with "a loop closed", accepted at R3 because a green
   patch on a plan is never mistaken for a ring. */
.sat    { fill: var(--satellite-only); color: var(--satellite-only); }
.veg    { fill: var(--rings); color: var(--rings); }

/* Every motion on a PLANETAI surface is named after the datum that drives it. Nothing here is
   decoration: a motion with no datum behind it is deleted, not tokenised. Under reduced motion every
   one that HAS a duration goes to zero in one place, and every surface has to read frozen. A motion
   recorded as a word rather than a duration is not listed here: the state it names still happens,
   it simply stops moving, and there is no number to remove. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-reading-fade: 0s;
    --motion-reading-pulse: 0s;
    --motion-day-curve-step: 0s;
    --motion-ring-closed: 0s;
    --motion-satellite-year: 0s;
    --motion-land-change-yoy: 0s;
    --motion-asking-hold: 0s;
    --motion-meter-fill: 0s;
    --motion-mark-float: 0s;
  }
}
