/* ============================================================================
   palette.css: "KILN", the whole site's colour, as one file every page loads.

   Daniel picked it out of five on 2026-09-12: terracotta on warm paper. It
   replaces the cool blue that shipped two days earlier, and this file kept its
   shape while changing every value in it, which was the point of building it
   this way. (It was called cool.css until the blue went; a file named for a
   colour it no longer holds is a trap for whoever reads it next.)

   WHY IT IS SO SHORT

   It redefines assets/toolpath.css's own :root tokens. That single decision is
   what makes it small, and it is worth stating because the first attempt did the
   opposite and cost a day.

   A custom property whose value contains var() is substituted where it is
   DECLARED. toolpath.css declares `--gold: var(--accent)` on :root, so scoping
   an `--accent` override to a DESCENDANT (say `.mg`) leaves --gold resolving
   against :root's original accent. Twenty-one composed tokens behaved that way
   (--gold, --gold-soft, --gold-deep, --accent-soft, --gold-glow*, --grid,
   --shadow-card/-float/-btn/-plate, --on-enc*, --enc-line*, --enc-grid,
   --on-accent-base) and every one had to be restated by hand.

   Overriding at :root, the same element the aliases are declared on, makes all
   of them follow for free. Verified in the browser, not assumed. It also fixes
   the thing scoping never could: openSheet(), confirmDialog(), toast() and the
   FAB all mount on document.body, OUTSIDE any page wrapper, so a scoped palette
   never reached a single sheet in the product.

   Load it AFTER toolpath.css. Same specificity, so source order decides.

   THE SIGNAL, WHICH IS NOW THE OTHER WAY AROUND. Under the blue palette the one
   warm thing on screen meant "a job is waiting for you". The accent is warm now,
   so that rule would make the whole interface look like an alarm. Inverted: the
   accent is terracotta, and --new, the unanswered request, is the one COOL,
   saturated blue on the page. It is still the only colour that means that, it is
   still the only thing wearing it, and blue for unread is a convention every
   person on earth already knows from their phone.

   THE ENCLOSURE STAYS NAVY. --dark-1/-2/-3 are untouched, and that is a choice
   rather than an omission: the logo is navy outlines with vermillion fills, so
   a navy enclosure under a terracotta accent is the mark's own pairing at page
   scale.

   NOT TOUCHED, deliberately: the material ramp (--pla, --petg, --tpu, --abs,
   --resin, --wood, --acrylic, --metal, --fabric), the status colours (--ok,
   --err, --warn), WhatsApp green, --protick*, and --craft-gold. Those are
   functional colour and legend, not brand, and the craft gold is a colour a
   maker CHOSE. Repainting any of them would be a bug, not a refresh.

   Light only. No prefers-color-scheme and no [data-theme]: the design system has
   no dark variant yet, and a half dark page is worse than no dark page.

   Every pair below was measured, not eyeballed. The numbers in the comments are
   real contrast ratios against the surface named.
   ========================================================================== */

:root {
  color-scheme: only light;   /* "only": a phone's own dark mode must not repaint a light-only site */

  /* ---- the kiln palette under its own names ---------------------------- */
  --g: #F6F1EA;            /* the page ground: warm paper, not white */
  --card: #FFFDFA;
  --sunk: #EAE0D2;         /* a well in the ground */
  --glass-2: #E0D3C1;      /* a quiet fill that still reads when nested ON --soft */
  --tx: #2A2018;           /* ink, three steps: 15.7:1 / 7.7:1 / 5.8:1 on --card */
  --tx2: #5E4F42;
  --tx3: #71624F;          /* the faintest step, one shade darker than drawn: 5.8:1 on --card */
  --pri: #B0542F;          /* white on it 5.05:1, so it may carry a label */
  --pri-sh: #8E3F1F;       /* 7.2:1, and the hard offset shadow under a pressed button */
  --on-pri: #FFFFFF;
  --soft: #F4E5D8;
  --soft-tx: #8E3F1F;      /* 7.2:1 on --card, 5.9:1 on --soft, 5.6:1 on --sunk */
  /* The only place white sits on colour, and it carries a store's own name, so
     the stops move in HUE rather than in lightness: terracotta, rust, warm plum.
     White clears 7.3 / 5.1 / 6.5 on them, and 90% white still clears 4.5. */
  --grad: linear-gradient(120deg, #8E3F1F 0%, #B0542F 52%, #8C4A5E 100%);
  --sh: rgba(74,48,28,.12);
  --ok-sh: #0E8C77;        /* --ok itself is functional and stays toolpath's */
  --new: #1F5FA8;          /* THE one cool hue: a request nobody has answered */
  /* /join's measured steps (join.css, join-live.css), here so the colour stays one file */
  --jn-edge: #96806A;       /* field borders: 3.70:1 on the card, 3.72:1 on a white field */
  --jn-tile-edge: #A38C74;  /* tiles and choice cards: 3.15:1 on the card */
  --jn-ok-text: #0B6355;    /* "הכתובת פנויה": 7.06:1 on the card, 6.38:1 on paper */
  --jn-ph: var(--tx3);      /* placeholders and faint text: 5.81:1 on the card, 5.25:1 on paper */
  --jn-wa-ink: #073B2A;     /* the WhatsApp glyph on --wa #25D366 (toolpath .btn-wa's own ink), 6.35:1 */
  --mark-tile: #F7F5EF;     /* the mark's own cream plate (art.js MARK.tile), for a mark set on colour */
  /* the device on its print bed: a dark graphite body and bed, decoration only */
  --jn-dev-1: #243043; --jn-dev-2: #0B111B; --jn-dev-3: #1A2230; --jn-dev-edge: #02060C; --jn-dev-notch: #03070D;
  --jn-bed-1: #33415A; --jn-bed-2: #1B2433;
  --new-deep: #164A85;     /* 7.2:1 on the badge tint below */
  --quoted: #6F55BC;       /* the request states, as hues rather than four beiges */
  --printing: #0E7A6C;
  --printing-deep: #0B6355;
  --done: #7C7267;         /* white on it 4.7:1, because .mg-tag paints white on this */
  --on-tag: #FFFFFF;
  --mg-grid: rgba(90,55,30,.05);

  /* ---- 60 percent: the ground ------------------------------------------
     --powder also draws .receipt's punch holes, so pointing it here stops two
     stray dots floating on every review card. Its CHANNELS only ever feed
     light-on-dark ramps (--on-enc, --enc-line, --enc-grid), which still work. */
  --powder:      var(--g);
  --powder-rgb:  246,241,234;
  --powder-lift: #FCF8F2;
  --paper:       var(--card);
  --paper-rgb:   255,253,250;
  --line:        #D9C9B4;
  --line-soft:   var(--sunk);
  --glass:       var(--glass-2);

  /* ---- 30 percent: the ink ---------------------------------------------
     --graphite is the body ink AND a dark fill (.btn-primary, .toast). The
     enclosure is NOT a third role: --enc/-2/-3 read var(--dark-1...) and those
     are declared, so the color-mix fallback naming --graphite never fires.
     --dark-1/-2/-3 are already navy and are left exactly as they are. */
  --graphite:     var(--tx);
  --graphite-rgb: 42,32,24;
  --ink-soft:     #43352A;
  --steel-text:   #5F503F;   /* 7.6:1 on card, and it lands on --sunk and --soft as often as on white: 6.0 / 6.3 there */

  /* ---- 10 percent: the accent ------------------------------------------ */
  --accent:       var(--pri);
  --accent-rgb:   176,84,47;
  --accent-deep:  var(--soft-tx);
  --accent-ink:   var(--pri-sh);
  /* The far stop of .grad-text on a LIGHT ground, and nothing else reads it. It is its own token
     rather than --accent-ink, which is what toolpath.css used to point that stop at, because
     --accent-ink is the section kicker: the one piece of type Daniel said he could not read, and
     it was taken darker for him until it resolved to --pri-sh, the same #8E3F1F that --accent-deep
     already sits at 55 percent of the way along. So the second half of every light headline came
     out one flat colour. Pointing the kicker back up to lift the gradient would undo his fix, so
     the gradient gets its own value instead: #A84B23 is 5.06:1 on the ground, 5.60:1 on the card
     and 4.61:1 on --soft, which matters because Hebrew reads right to left and the 100 percent
     stop lands on the FIRST word read, so it has to clear 4.5:1 standing alone.
     themes.css declares a whole accent scale per theme and would add this beside the --accent-ink
     it already sets; no page sets data-theme today, and until one does the fallback chain in
     toolpath.css keeps every theme exactly where it is. */
  --accent-grad-end: #A84B23;
  --accent-bright: #E8905F;   /* the step that reads on the dark enclosure: 7.04:1, and 6.43:1 on a dark plate */
  /* The bright END of .grad-text on the dark ground. It was #E8905F, the same value as both stops
     after it, so an enclosure headline spent a three stop gradient painting one flat colour.
     #F4B08A is 9.36:1 on the navy #051C33 and 8.56:1 on a dark plate #08243F, so the movement is
     free: the brightest end of the sweep is also the most readable point on it. */
  --accent-glow:   #F4B08A;
  --accent-on-enc: #E8905F;
  --accent-kicker: #E8905F;
  --accent-light:  var(--soft);
  --accent-wash:   var(--soft);
  --accent-pale:      var(--sunk);
  --accent-pale-warm: var(--sunk);
  --accent-sand:      var(--sunk);
  --accent-dim:    var(--pri);
  --on-accent:     var(--on-pri);

  /* the three glyphs that bake their colour into an SVG data URI, so no token
     reaches them */
  --tick-deep: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238E3F1F' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6L9 17l-5-5'/></svg>");
  --tick-accent: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B0542F' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6L9 17l-5-5'/></svg>");
  --plus-deep: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238E3F1F' stroke-width='2.4' stroke-linecap='round'><path d='M12 5v14M5 12h14'/></svg>");
}

/* --- the exemptions: things a token cannot express --------------------------

   Rating stars stay GOLD, and they had to get DEEPER to stay gold. They follow
   --gold, which is now terracotta, and a terracotta star is not a rating, it is
   the accent. The old #E0A32B sat at 2.2:1 on the cool white card and got away
   with it; on warm paper it is the same family as the ground and vanishes.
   #B8800C is 3.4:1 on the card and 3.1:1 on the ground, clears the 3:1 a
   graphical object needs, and reads as brass rather than as the accent. */
.stars svg.on,
.stars-input button.on svg,
.stars-input button:hover svg,
/* The storefront sets its own, more specific star rules in its page <style>, which loads after this
   file, so a bare `.stars svg.on` loses on both specificity and order. The :root prefix costs one
   class of weight and is the whole reason this exemption actually applies on a store page. */
:root .store-hero .stars svg.on,
:root .plate.dark .stars svg.on { fill: #B8800C; }

/* The request states used to be two different oranges and two different beiges:
   'new' and 'quoted' both warm, meaning opposite things. Now only 'new' is cool,
   because only 'new' is waiting for the maker, and the rest take their own hue so
   a list of requests reads as a state machine instead of a row of pills. */
.badge-new     { background: color-mix(in srgb, var(--new) 14%, var(--card)); color: var(--new-deep); }
.badge-pending { background: color-mix(in srgb, var(--quoted) 16%, var(--card)); color: #4B3E9E; }
.badge-kind    { background: color-mix(in srgb, var(--printing) 16%, var(--card)); color: var(--printing-deep); }
.badge-off     { background: var(--glass-2); color: var(--steel-text); }
.row-card.new  { border-color: var(--new); box-shadow: 0 0 0 3px color-mix(in srgb, var(--new) 16%, transparent); }
.kpi .d.warn   { background: color-mix(in srgb, var(--new) 14%, var(--card)); color: var(--new-deep); }

/* A track is not a boundary. --accent on --line is 2.4:1; on --sunk it is 4.0:1.
   Stars are deliberately NOT in this list: an empty star is not a track, and at
   --sunk it drops too far, which turns 4.2 out of 5 into a row of four. */
.bar, .layers .layer, .spinner, .timeline-h .st { --line: var(--sunk); }
.plate.dark .bar                { background: var(--enc-3); }
.plate.dark .stars svg:not(.on) { fill: var(--enc-3); }

/* --ok is a FILL under a white knob here, and toolpath's --ok is light enough to
   put the knob at 2.5:1 against its own track. */
.switch input:checked + .track { background: var(--ok-sh); }
.todo-item.done .ck            { background: var(--ok-sh); border-color: var(--ok-sh); }

/* A form control's edge is the only boundary WCAG asks 3:1 of; a card edge is not.
   The :not() and the re-asserted :focus exist because a bare `input` here would
   otherwise tie with `input:focus` and kill the focus state. */
.input, input, textarea, select,
.role:not([aria-pressed="true"])                { border-color: #96806A; }
input:focus, textarea:focus, select:focus       { border-color: var(--pri); }

/* ---------------------------------------------------------------- studios
   Two new capability colours and the night of a studio section (docs/studios-spec.md 3.1). They are
   functional colour like the material ramp, so no accent swap may repaint them. The room of a studio
   page itself (--room-*) belongs to studio.css, which restates the enclosure tokens on its body.

   Measured against the ground #F6F1EA, the card #FFFDFA and the white a label would carry:
     --photo       #3B3531  10.7:1 ground, 11.9:1 card, white on it 12.1:1
     --photo-deep  #241F1B  14.5:1 ground
     --music       #7A3E6A   6.9:1 ground,  7.6:1 card, white on it 7.7:1
     --music-deep  #57294B  10.3:1 ground
     --studio-night      #0F0C0A  17.4:1 against the ground
     --studio-night-ink  #F3ECE3  16.6:1 on --studio-night; --accent-bright is 8.0:1 there
   Both hues pass 3:1 as a boundary and 4.5:1 as text on every light surface. Neither is meant for
   the navy enclosure (1.4:1 and 2.2:1): on a dark ground the chip carries its drawn icon, not a dot. */
:root {
  --photo: #3B3531;
  --photo-deep: #241F1B;
  --music: #7A3E6A;
  --music-deep: #57294B;
  --studio-night: #0F0C0A;
  --studio-night-ink: #F3ECE3;
}
.dot-photo, .c-photo { background: var(--photo); }
.dot-music, .c-music { background: var(--music); }

/* ---------------------------------------------------------------- the taxonomy crafts
   Six capability colours for the eight crafts added after the studios (docs/taxonomy-spec.md 1.2,
   T27). Functional colour like the material ramp: no accent swap may repaint them. The seller card
   sets --accent to a craft colour, so each one must work as text and as a boundary on every light
   surface. Used by: ceramics --clay, casting --pour, art --paint, events --balloon, jewelry --silver,
   yarn and sewing --thread (one textile family); graphic uses --gold.

   Measured (WCAG 2 ratio, site/assets/theme.js contrastRatio) against the ground --g #F6F1EA, the card
   #FFFDFA, white as a label on the colour, and the well --sunk #EAE0D2:
                  hue   ground   card   white on it   well
     --clay       152    4.61    5.10      5.18       3.97
     --pour       190    4.83    5.34      5.42       4.15
     --paint      282    4.63    5.12      5.20       3.99
     --balloon    348    5.55    6.14      6.24       4.78
     --silver     220    5.21    5.77      5.86       4.49   (a grey: saturation 0.10)
     --thread     337    5.05    5.59      5.68       4.35
   Every one clears 4.5:1 as text on the ground and the card, and 3:1 as a boundary on the well. None
   is blue: blue is --new, the unanswered request. Closest hues inside a picker group: --pour and
   --silver 30 degrees apart (hand work), --gold and --balloon 29 (art and decor).
   Existing exceptions, recorded and NOT repainted (functional colour and the map legend, measured on
   the ground): --pla 3.08, --petg 2.81, --tpu 3.90, --resin 2.85, --wood 3.56, --acrylic 3.09,
   --metal 4.30, --fabric 3.83, --steel 3.05. */
:root {
  --clay: #4F7563;
  --pour: #2A7382;
  --paint: #8A5A9E;
  --balloon: #B0304A;
  --silver: #5E6573;
  --thread: #A8446A;
}
.dot-clay, .c-clay { background: var(--clay); }
.dot-pour, .c-pour { background: var(--pour); }
.dot-paint, .c-paint { background: var(--paint); }
.dot-balloon, .c-balloon { background: var(--balloon); }
.dot-silver, .c-silver { background: var(--silver); }
.dot-thread, .c-thread { background: var(--thread); }

/* ---------------------------------------------------------------- the held confirm
   confirmDialog({ hold: 5 }) draws its countdown with currentColor, which on the
   outlined danger button is the error red. Nothing here to override; noted so the
   next palette does not "fix" it with a fixed tint. */

/* ---------------------------------------------------------------- pop fills (the brighter look)
   2026-09-17. The five disc colours of Daniel's avatar sheets (brand/avatars/source/), the family
   every new picture on the site is drawn in. Daniel's brief was that the site read "gloomy and
   industrial rather than hobbyist and small businesses"; these are the colours that answer it.

   THE RULE: FILLS AND WASHES ONLY.
   - Always a dark label on them, never white. White fails on every one (1.4 to 1.9:1).
   - Never a signal. No state, count, status or "new" may be told by a pop colour; that is what
     --new, --ok, --err and --warn are for, and a decoration that looks like a signal is a lie.
   - Never blue. The sheets also have a sky blue, and it stays inside the illustrations: blue in
     the interface means an unanswered request (--new). Lilac here sits at hue 262, clear of it.
   - Not the material ramp either. --pla, --petg and the rest are the map legend.

   Measured on the full-strength fill (WCAG ratio, the label named on the left):
                    --tx #2A2018   --ink-soft #43352A   --steel-text #5F503F   white
     --pop-butter      11.6:1            8.6:1                5.7:1            1.37:1
     --pop-pink         9.0:1            6.7:1                4.4:1  fails     1.77:1
     --pop-mint        10.7:1            7.9:1                5.2:1            1.49:1
     --pop-lilac        8.6:1            6.3:1                4.2:1  fails     1.86:1
     --pop-apricot      8.6:1            6.4:1                4.2:1  fails     1.85:1
   So a label ON the full colour is --tx or --ink-soft. The lighter inks are for a wash, which is
   the pop mixed into paper (color-mix(in srgb, var(--pop-*) N%, var(--g))); the landing's two
   light bands measure their own washes, and tests/look-landing.test.mjs recomputes them. */
:root {
  --pop-butter:  #FDD972;
  --pop-pink:    #FDABCB;
  --pop-mint:    #9EE2BD;
  --pop-lilac:   #CCB2F9;
  --pop-apricot: #FEAD58;
}

/* ---------------------------------------------------------------- sticker keyline on dark grounds
   The drawn chip icons (serviceIconSvg, materialIconSvg in art.js) are outlined in a fixed ink,
   #2A2018, which is what makes them stickers on paper. On navy that same ink measures 1.08:1, so
   the outline and every inked detail inside (the cnc bit, the mic stand, the printer window)
   vanished, and the steel spools sank into the chip. A real sticker is die cut with a light border,
   so on a dark ground the icon gets one: four one pixel cream offsets, a crisp keyline that follows
   the silhouette and its holes. Cream #FFF8EC on navy #051C33 is 16.3:1. On a light plate that
   happens to sit inside a dark section the cream is all but invisible, so the broad selector is safe.
   The contact shadow is hidden there: ink at 16% cannot be seen on navy, and under the keyline it
   turned into a pale smudge. art.js stays pure and theme free; the ground decides, here. */
.enclosure .mat-ic svg, .dark .mat-ic svg {
  filter: drop-shadow(1px 0 0 #FFF8EC) drop-shadow(-1px 0 0 #FFF8EC) drop-shadow(0 1px 0 #FFF8EC) drop-shadow(0 -1px 0 #FFF8EC);
}
.enclosure .mat-ic svg > ellipse, .dark .mat-ic svg > ellipse { display: none; }
