/* ───────────────────────────────────────────────────────────────
   sulci-web design tokens — SINGLE SOURCE OF TRUTH.

   Loaded by:
     - index.html         (main React app: <link href="/tokens.css">)
     - public/privacy.html
     - public/terms.html

   Any consumer that renders sulci.io chrome or content should link
   this file directly rather than duplicating tokens. To change a
   palette value, edit here ONLY — every surface picks it up on the
   next reload.

   Naming: --c-* is the canonical prefix used by the React app
   (`src/lib/constants.js` exports these as `C.*`). The static HTML
   pages use short --* names (--bg, --lime, --text, etc.) that live
   as CSS var aliases pointing at the --c-* source. Change --c-lime
   and --lime tracks it automatically.

   Palette: PRIMER (adopted 2026-07-06 via PR #68). Dark, technical,
   terminal/orchestration-console aesthetic. Categorical peer accents
   (cyan/violet/amber) are distinct, not aliased to brand. Semantic
   red is reserved strictly for cache MISS — never form errors or
   destructive actions. See sulci_palette_primer.md for the rationale.
─────────────────────────────────────────────────────────────── */

/* ───────────────────────────────────────────────────────────────
   Web fonts — SELF-HOSTED (adopted 2026-07-06).

   Previously loaded from fonts.googleapis.com; migrated to self-hosted
   .woff2 files to eliminate the third-party dependency, remove the
   Google Fonts processor from the privacy policy, and prevent visitor
   IP leakage to Google (relevant under GDPR / German Munich ruling).

   All three families are OFL-1.1 licensed; license texts in public/fonts/.
   Files subsetted to Latin only (English + EU accented characters).
   font-display: swap renders the fallback stack immediately then swaps
   to the custom face when loaded — no invisible-text flash.

   Files under /fonts/ (loaded by React app + privacy.html + terms.html):
     - Azeret Mono:      300, 400 (regular), 500, 600, 700
     - Epilogue:         400 (regular), 500, 700, 800, 900
     - Playfair Display: 400 italic (used for lime accent hero lines)
─────────────────────────────────────────────────────────────── */

/* Standard Google Fonts Latin unicode-range subset. */
@font-face {
  font-family: 'Azeret Mono';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/fonts/azeret-mono-v21-latin-300.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Azeret Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/azeret-mono-v21-latin-regular.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Azeret Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/azeret-mono-v21-latin-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Azeret Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/azeret-mono-v21-latin-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Azeret Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/azeret-mono-v21-latin-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Epilogue';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/epilogue-v20-latin-regular.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Epilogue';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/epilogue-v20-latin-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Epilogue';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/epilogue-v20-latin-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Epilogue';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/fonts/epilogue-v20-latin-800.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Epilogue';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('/fonts/epilogue-v20-latin-900.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/playfair-display-v40-latin-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* ── PRIMER NIGHT ─────────────────────────────────────────────── */
  /* Surfaces — primer's near-black stack */
  --c-bg:        #060810;
  --c-surface:   #0c1018;
  --c-card:      #11151f;
  --c-codebg:    #070b12;
  --c-border:    #1c2230;
  --c-borderHi:  #1b2433;
  --c-borderAc:  rgba(170, 255, 62, 0.30);

  /* Brand — electric lime family */
  --c-lime:      #aaff3e;
  --c-limeDim:   rgba(170, 255, 62, 0.14);
  --c-limeGlow:  rgba(170, 255, 62, 0.22);
  --c-green:     #00ee88;
  --c-greenDim:  rgba(0, 238, 136, 0.14);

  /* Categorical peer accents — distinct, not aliased */
  --c-cyan:      #00d4ff;
  --c-cyanDim:   rgba(0, 212, 255, 0.10);
  --c-violet:    #aa66ff;
  --c-violetDim: rgba(170, 102, 255, 0.10);
  --c-amber:     #ffaa00;
  --c-amberDim:  rgba(255, 170, 0, 0.10);

  /* Semantic — MISS reserved for one thing */
  --c-red:       #ff5d6c;
  --c-redDim:    rgba(255, 93, 108, 0.14);
  --c-spring:    #00ee88;
  --c-springDim: rgba(0, 238, 136, 0.14);

  /* Text — primer ink ramp. text-mid + text-dim brightened 2026-07-07
     (readability pass): mid #7c8699 → #8f99ac, dim #8B9099 → #9aa0aa.
     Both increase contrast against --c-bg #060810; AAA (>7:1) both. */
  --c-text:      #e8edf5;
  --c-textMid:   #8f99ac;
  --c-textDim:   #9aa0aa;
  --c-white:     #e8edf5;
  --c-raised:    #1b2433;

  /* ── HTML-page aliases ─────────────────────────────────────────── */
  /* Short names used by public/privacy.html + public/terms.html.
     These are pure aliases — they inherit any theme change on --c-*
     automatically. Do not set values here; set on --c-* above. */
  --bg:          var(--c-bg);
  --surface:     var(--c-surface);
  --border:      var(--c-border);
  --border-hi:   var(--c-borderHi);
  --lime:        var(--c-lime);
  --lime-dim:    var(--c-limeDim);
  --cyan:        var(--c-cyan);
  --violet:      var(--c-violet);
  --amber:       var(--c-amber);
  --green:       var(--c-green);
  --text:        var(--c-text);
  --text-mid:    var(--c-textMid);
  --text-dim:    var(--c-textDim);
  --white:       var(--c-white);
}

[data-theme="light"] {
  /* ── PRIMER DAY ────────────────────────────────────────────────── */
  /* Invented complement (primer doc has no light spec). Each accent
     deepened ~30% L for AA on cool near-white canvas. Categorical
     peers stay distinct. --* aliases inherit automatically. */

  --c-bg:        #FAFBFD;
  --c-surface:   #F0F2F7;
  --c-card:      #FFFFFF;
  --c-codebg:    #F5F7FA;
  --c-border:    #D6DAE3;
  --c-borderHi:  #B0B6C4;
  --c-borderAc:  rgba(74, 142, 0, 0.30);

  --c-lime:      #4a8e00;
  --c-limeDim:   rgba(74, 142, 0, 0.08);
  --c-limeGlow:  rgba(74, 142, 0, 0.12);
  --c-green:     #00865a;
  --c-greenDim:  rgba(0, 134, 90, 0.08);

  --c-cyan:      #0078a0;
  --c-cyanDim:   rgba(0, 120, 160, 0.08);
  --c-violet:    #5533aa;
  --c-violetDim: rgba(85, 51, 170, 0.08);
  --c-amber:     #a06400;
  --c-amberDim:  rgba(160, 100, 0, 0.08);

  --c-red:       #b5102a;
  --c-redDim:    rgba(181, 16, 42, 0.08);
  --c-spring:    #00865a;
  --c-springDim: rgba(0, 134, 90, 0.08);

  --c-text:      #1A1D22;
  --c-textMid:   #4d5765;
  --c-textDim:   #6a7280;
  --c-white:     #000000;
  --c-raised:    #FFFFFF;
}
