/* ==========================================================================
   Hyalith design tokens. v3.1, 15-Nov-2026: dark is the default register, near-black ground.
   v3.0, 08-Nov-2026. Supersedes v2.0 (bottle and citrine).
   Locked with Neel on 08-Nov after measuring every pairing in OKLCH:
   emerald does the work, copper is alive, ink blue is data.
   Emerald H162, copper H42 (120 deg, triadic), ink blue H255 (93 deg from
   emerald, 147 from copper). One job per colour, so 3 colours never read as a circus.
   The only place a colour, size, space or shape value is typed.
   ========================================================================== */

:root {
  /* ---- Ink and paper ---- */
  --ink:          #0F2119;   /* green-black. All text on light. 16.6:1 on white. */
  --paper:        #FFFFFF;   /* pure white. The only light ground. Never cream. */

  /* ---- Emerald. Everything you click: buttons, links, focus, active nav, the mark. ---- */
  --emerald:      #007D54;   /* fills: buttons, switches on, the mark on white. White label 5.2:1. */
  --emerald-600:  #055C3E;   /* text and lines: links, selected edge, chart line 1 on light. 8.1:1 */
  --emerald-700:  #024C32;   /* hover, pressed, the deep band */
  --emerald-100:  #D8F7E6;   /* selected row, active tab, success tint */
  --emerald-50:   #ECFBF3;   /* hover tint */
  --emerald-lifted: #6ED6A6; /* emerald on a dark ground: chart line 1, the mark on dark. 9.6:1 */

  /* ---- Copper. Everything alive: the live dot, the crystal facets, Undo, the chart highlight. ---- */
  --copper:       #B64C1B;   /* on light. 5.2:1. Never a button, never a fill, never a link. */
  --copper-on-dark: #FEA47C; /* on dark. 8.8:1 */
  --peach:        #FEEADB;   /* the soft field, 1 band per page at most. Ink on it 14.4:1 */

  /* ---- Ink blue. Data and information: chart series 2, info notes, 1 deep band. ---- */
  --blue:         #1D487C;   /* on light, and the deep band with white type. 9.3:1 */
  --blue-on-dark: #7CAFE8;   /* on dark. 7.4:1 */
  --blue-50:      #E7F4FF;   /* info tint. Blue on it 8.3:1 */

  /* ---- Light neutrals, emerald-biased ---- */
  --text-2:       #4F6B5C;   /* captions, metadata */
  --text-3:       #8CA698;   /* placeholders, disabled. Never body. */
  --panel:        #E8F8EF;   /* section ground, quiet cards */
  --rule:         #D3E2DA;   /* hairlines, table rows */
  --rule-strong:  rgba(15, 33, 25, 0.30);

  /* ---- Dark register, near-black with a green cast. The site default since 15-Nov-2026. ---- */
  --dark:         #060E0A;   /* the ground, sampled from the hero render's own background */
  --dark-2:       #0E1A14;   /* panels, alternate sections */
  --dark-3:       #16251D;   /* hover, selected, the journey band */
  --dark-line:    #233429;   /* hairlines on dark */
  --dark-ink:     #C9D9D0;   /* body on dark */
  --dark-ink-2:   #80998C;   /* secondary on dark. 5.6:1 */
  --dark-ink-3:   #5A6F64;   /* metadata on dark, large or non-text only. 3.2:1 */
  --dark-lit:     #055C3E;   /* the 1 lit surface per screen. White on it 8.1:1 */

  /* ---- Status. Only on a badge, dot, inline error or destructive control. ---- */
  --red-700:      #9F2A24;   --red-50: #F3DFDC;   /* failed. Sits 14 deg from copper, so copper never takes a badge. */
  --red-on-dark:  #F0A099;
  /* pending = neutral (text-2 on panel), so no amber competes with copper. success = emerald. info = blue. */

  /* ---- Legacy names, kept so existing pages and the content engine keep working. Values are the v3 colours. Do not use in new work. ---- */
  --bottle:        var(--emerald-600);
  --bottle-500:    var(--emerald);
  --bottle-700:    var(--emerald-700);
  --bottle-100:    var(--emerald-100);
  --bottle-50:     var(--emerald-50);
  --bottle-lifted: var(--emerald-lifted);
  --citrine:       var(--copper);
  --amber-700:     var(--text-2);   --amber-50: var(--panel);
  --amber-on-dark: var(--dark-ink-2);

  /* ---- Type. Objective for display and headings, Instrument Sans for everything else. ---- */
  --font:         'Instrument Sans', 'Segoe UI', sans-serif;
  --display-font: 'Objective', 'Instrument Sans', 'Segoe UI', sans-serif;
  --fs-display:   clamp(44px, 6vw, 84px);   --lh-display: 1.0;   --ls-display: -0.02em;  --fw-display: 500;
  --fs-heading:   clamp(28px, 3vw, 38px);   --lh-heading: 1.18;  --ls-heading: -0.015em; --fw-heading: 500;
  --fs-subhead:   22px;                     --lh-subhead: 1.25;  --ls-subhead: -0.01em;  --fw-subhead: 600;
  --fs-lead:      18px;                     --lh-lead:    1.5;
  --fs-body:      16px;                     --lh-body:    1.6;
  --fs-small:     14px;                     --lh-small:   1.55;
  --fs-caption:   13px;                     --lh-caption: 1.4;

  /* ---- Space ---- */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 72px; --s-9: 96px; --s-10: 140px;

  /* ---- Shape ---- */
  --radius:       0;
  --hairline:     1px solid var(--rule);
  --shadow:       none;
  --control-h:    44px;  --control-h-sm: 36px;  --control-h-lg: 52px;

  /* ---- Layout ---- */
  --container:    1140px;
  --pad:          48px;

  /* ---- Motion ---- */
  --ease:         cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-refract:    320ms;
  --t-settle:     240ms;
  --t-pulse:      1.6s;   /* the copper dot only */
}

/* ==========================================================================
   Semantic tokens per register. Components read ONLY these.
   Dark is the default since 15-Nov-2026 (Neel: "whole site dark"). Add .onlight for a light part.
   ========================================================================== */

.onlight {
  --bg:            var(--paper);
  --bg-panel:      var(--panel);
  --bg-raised:     var(--paper);
  --bg-hover:      var(--emerald-50);
  --bg-selected:   var(--emerald-100);
  --fg:            var(--ink);
  --fg-strong:     var(--ink);
  --fg-2:          var(--text-2);
  --fg-3:          var(--text-3);
  --line:          var(--rule);
  --line-input:    var(--rule-strong);
  --primary:       var(--emerald);
  --primary-hover: var(--emerald-700);
  --on-primary:    #FFFFFF;
  --link:          var(--emerald-600);
  --link-hover:    var(--emerald-700);
  --focus:         var(--emerald-600);
  --mark:          var(--emerald);
  --spark:         var(--copper);          /* alive */
  --info:          var(--blue);            /* data and information */
  --info-bg:       var(--blue-50);
  --chart-1:       var(--emerald-600);
  --chart-2:       var(--blue);
  --chart-grid:    var(--rule);
  --status-live-bg:    var(--emerald-100); --status-live-fg:    var(--emerald-600);
  --status-pending-bg: var(--panel);       --status-pending-fg: var(--text-2);
  --status-failed-bg:  var(--red-50);      --status-failed-fg:  var(--red-700);
  --status-draft-bg:   var(--panel);       --status-draft-fg:   var(--ink);
  --status-count-bg:   var(--ink);         --status-count-fg:   #FFFFFF;
  --destructive:   var(--red-700);  --on-destructive: #FFFFFF;
  --lit:           var(--emerald-100);
  --on-lit:        var(--ink);
  --on-lit-2:      var(--text-2);
  color-scheme: light;
}

:root, .ondark {
  --bg:            var(--dark);
  --bg-panel:      var(--dark-2);
  --bg-raised:     var(--dark-2);
  --bg-hover:      var(--dark-3);
  --bg-selected:   var(--dark-3);
  --fg:            var(--dark-ink);
  --fg-strong:     #FFFFFF;
  --fg-2:          var(--dark-ink-2);
  --fg-3:          var(--dark-ink-3);
  --line:          var(--dark-line);
  --line-input:    rgba(201, 217, 208, 0.35);
  --primary:       #FFFFFF;            /* on dark the button is white */
  --primary-hover: var(--emerald-lifted);   /* 15-Nov-2026: white button lights up emerald on hover (was a grey that read as disabled) */
  --on-primary:    var(--dark);
  --link:          var(--dark-ink);
  --link-hover:    #FFFFFF;
  --focus:         var(--copper-on-dark);
  --mark:          var(--emerald-lifted);
  --spark:         var(--copper-on-dark);
  --info:          var(--blue-on-dark);
  --info-bg:       rgba(124, 175, 232, 0.14);
  --chart-1:       var(--emerald-lifted);
  --chart-2:       var(--blue-on-dark);
  --chart-grid:    var(--dark-line);
  --status-live-bg:    rgba(110, 214, 166, 0.14); --status-live-fg: var(--emerald-lifted);
  --status-pending-bg: var(--dark-3);             --status-pending-fg: var(--dark-ink-2);
  --status-failed-bg:  rgba(159, 42, 36, 0.30);   --status-failed-fg:  var(--red-on-dark);
  --status-draft-bg:   var(--dark-3);             --status-draft-fg:   var(--dark-ink-2);
  --status-count-bg:   var(--dark-ink);           --status-count-fg:   var(--dark);
  --destructive:   #E05A4E;  --on-destructive: var(--dark);
  --lit:           var(--dark-lit);
  --on-lit:        #FFFFFF;
  --on-lit-2:      #B7E8D0;
  color-scheme: dark;
}
