/*
 * orc-tokens.css — Orchestrace "Meridian" token system (Phase 1, additive)
 *
 * Tier 1 primitives -> Tier 2 semantic -> Tier 2b legacy bridge.
 * Dark theme uses the .dark-theme CLASS ONLY — never the data-theme
 * attribute, which belongs to JS/ECharts (see docs/superpowers/specs/
 * 2026-07-24-orchestrace-identity-system.md §2 and the design-system inventory).
 * Consumed ONLY by orc-* primitives in Phase 1; existing surfaces are
 * untouched and no legacy token is declared or re-pointed here.
 *
 * Meridian = deep-sea teal current on cool paper (owner-selected 2026-07-24,
 * reconciled from the earlier Copperline direction). VALUE + honest-name change
 * only: the neutral ramp is renamed cool-*, the accent teal-* / current-*
 * (full rename map in the identity spec §2 decision record). Glow-free
 * material system unchanged; shadows preserved exactly.
 */

:root {
  /* ---- Tier 1: Meridian anchor primitives (fixed points, identity spec §2) ---- */
  --orc-cool-50:  #F7FAFA;  --orc-cool-0: #FFFFFF;
  --orc-cool-200: #D9E4E6;  --orc-cool-700: #46545C;
  --orc-cool-800: #16232A;  --orc-cool-600: #5D6E76;
  --orc-teal-600: #0A6C7D; --orc-teal-700: #0B5B6B;
  --orc-green-600: #1E7A43;  --orc-green-bg: #E4F3EA;
  --orc-gold-700:  #8A6100;  --orc-gold-bg:  #F7EDD3;
  --orc-red-600:   #B3362B;  --orc-red-bg:   #F9E5E2;
  --orc-slate-600: #3B5F8A;  --orc-slate-bg: #E5EDF6;
  --orc-focus-blue: #1A6FEB;
  /* Intermediate 12-step ramp stops (hover/active tints beyond the fixed
     points above) are UNKNOWN (derive when a component needs one). Derivation
     method: OKLCH lightness ladder anchored on the fixed points; do NOT
     hand-pick hex. Not required in Phase 1. */

  /* ---- Tier 2: semantic (what phases consume; in Phase 1 only orc-* primitives do) ---- */
  --orc-bg: var(--orc-cool-50);
  --orc-surface: var(--orc-cool-0);
  --orc-ink: var(--orc-cool-800);
  --orc-ink-muted: var(--orc-cool-700);
  --orc-ink-subtle: var(--orc-cool-600);
  --orc-border: var(--orc-cool-200);
  --orc-current: var(--orc-teal-600);
  --orc-current-text: var(--orc-teal-700);
  --orc-on-current: #FFFFFF;
  /* Foreground for text/icons on a solid --orc-danger fill. White clears AA on
     the light danger (#B3362B, 6.04:1); the dark danger (#E5604F) is too light
     for white (3.43:1), so the dark theme flips to near-black ink (5.43:1). */
  --orc-on-danger: #FFFFFF;
  --orc-success: var(--orc-green-600);   --orc-success-bg: var(--orc-green-bg);
  --orc-warning: var(--orc-gold-700);    --orc-warning-bg: var(--orc-gold-bg);
  --orc-danger:  var(--orc-red-600);     --orc-danger-bg:  var(--orc-red-bg);
  --orc-info:    var(--orc-slate-600);   --orc-info-bg:    var(--orc-slate-bg);
  --orc-focus:   var(--orc-focus-blue);

  /* Tier 2b legacy compatibility bridge (--orc-compat-*) retired Phase 6:
     grep-proven zero consumers repo-wide (CSS + JS). The six-vocabulary -> orc
     correspondence it recorded is now realized directly in the migrated surfaces. */

  /* ---- Type roles (consumed only by orc-* primitives in Phase 1) ---- */
  --orc-font-ui:   'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --orc-font-data: 'Geist Mono', 'Geist Mono Fallback', ui-monospace, SFMono-Regular, Menlo, monospace;
  --orc-tracking-tight: -0.015em;
  --orc-text-2xs: 0.6875rem;   /* 11 */
  --orc-text-xs:  0.75rem;     /* 12 */
  --orc-text-sm:  0.84375rem;  /* 13.5 */
  --orc-text-base: 0.9375rem;  /* 15 */
  --orc-text-lg:  1.0625rem;   /* 17 */
  --orc-text-xl:  1.25rem;     /* 20 */
  --orc-text-2xl: 1.5rem;      /* 24 */
  --orc-text-3xl: 1.875rem;    /* 30 */
  --orc-text-display: clamp(2.125rem, 1.5rem + 3vw, 3.5rem); /* 34–56 */

  /* ---- Space / shape / elevation / motion / z (identity spec §4, §7) ---- */
  --orc-space-1: .25rem; --orc-space-2: .5rem;  --orc-space-3: .75rem; --orc-space-4: 1rem;
  --orc-space-5: 1.25rem; --orc-space-6: 1.5rem; --orc-space-7: 2rem;  --orc-space-8: 2.5rem;
  --orc-space-9: 3rem;   --orc-space-10: 4rem;  --orc-space-11: 5rem;  --orc-space-12: 6rem;
  --orc-radius-sm: 4px; --orc-radius-md: 8px; --orc-radius-lg: 12px; --orc-radius-pill: 999px;
  --orc-shadow-1: 0 1px 2px rgba(33, 27, 20, .04);
  --orc-shadow-2: 0 8px 24px rgba(33, 27, 20, .10);
  --orc-dur-fast: 120ms; --orc-dur: 200ms; --orc-dur-slow: 400ms;
  --orc-ease-enter: cubic-bezier(0.2, 0, 0.2, 1);
  --orc-ease-exit: cubic-bezier(0.4, 0, 1, 1);
  --orc-z-dropdown: 1000; --orc-z-sticky: 1020; --orc-z-fixed: 1030;
  --orc-z-modal-backdrop: 1040; --orc-z-modal: 1050; --orc-z-toast: 1060;
  --orc-z-overlay: 1070; --orc-z-tooltip: 1080;
}

.dark-theme {
  --orc-cool-50:  #0B1418;  --orc-cool-0: #12222A;
  --orc-cool-200: #24363D;  --orc-cool-700: #9FB4BB;
  --orc-cool-800: #E7EEF0;  --orc-cool-600: #7E959E;
  --orc-teal-600: #33B3C5; --orc-teal-700: #56C8DB;
  --orc-green-600: #4FBE77;  --orc-green-bg: #1B2E22;
  --orc-gold-700:  #D9A62E;  --orc-gold-bg:  #302713;
  --orc-red-600:   #E5604F;  --orc-red-bg:   #331B18;
  --orc-slate-600: #7EA4D4;  --orc-slate-bg: #1B2534;
  --orc-focus-blue: #8AB9FF;
  --orc-on-current: #0B1418;  /* text on teal current fills, dark theme */
  --orc-on-danger: #0B1418;   /* near-black ink on the lighter dark danger fill */
  --orc-shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --orc-shadow-2: 0 8px 24px rgba(0, 0, 0, .5);
}

/*
 * Fallback faces — metrics computed from the vendored woff2 via fonttools,
 * cross-validated against next/font's published Inter numbers (within ~1%).
 * UNKNOWN / verify before Phase 2 ships font swaps: regenerate in CI from the
 * exact vendored files (fonttools + brotli; weighted-average advance method)
 * and paste the reproduced numbers here.
 */
@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial');
  ascent-override: 91.24%;
  descent-override: 22.72%;
  line-gap-override: 0%;
  size-adjust: 106.17%;
}
@font-face {
  font-family: 'Geist Mono Fallback';
  src: local('Menlo'), local('Consolas');
  ascent-override: 100.52%;
  descent-override: 29.50%;
  line-gap-override: 0%;
  size-adjust: 99.98%;
}
