/* TradingCalci shared foundation — single source of truth for design tokens.
   Linked into every page by injectSeoHtml() in server.js.
   LIGHT is the default (:root); DARK overrides live under [data-theme="dark"].
   Every page references these by var(--name), so flipping data-theme themes the
   whole site. The theme is set pre-paint by an inline init script (no flash) and
   toggled from the header button. Page-specific token overrides live inline. */
:root, :root[data-theme="light"]{
    color-scheme: light;
    /* Surfaces */
    --bg: #f4f3ef;
    --bg2: #efeee9;
    --panel: #ffffff;
    --panel2: #faf9f6;
    /* Lines */
    --line: #e6e3da;
    --line2: #d6d2c6;
    /* Text */
    --ink: #1b1e25;
    --dim: #5f6776;
    --faint: #656c7a;
    --fainter: #b3b8c2;
    /* Accents */
    --amber: #b5810f;
    --amber-bg: #f6edd4;
    --cyan: #0e8fa6;
    /* Semantic up/down */
    --up: #0f9d58;
    --up-soft: rgba(15,157,88,.12);
    --up-dim: #cdeedd;
    --down: #d83a34;
    --down-soft: rgba(216,58,52,.12);
    --down-dim: #f6d6d4;
    /* Type */
    --mono: 'JetBrains Mono',ui-monospace,Menlo,monospace;
    --sans: 'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
    --serif: 'Fraunces',Georgia,serif;
    /* Shape */
    --r: 10px;
    --shadow: 0 1px 2px rgba(20,24,33,.04),0 6px 22px rgba(20,24,33,.05);
    /* other */
    --violet: #6d57c7;
    --gold: #b5810f;
    --gold2: #f7ecd0;
    --blue: #2867a8;
}
:root[data-theme="dark"]{
    color-scheme: dark;
    /* Surfaces */
    --bg: #0b0e14;
    --bg2: #0e131b;
    --panel: #141b27;
    --panel2: #10151f;
    /* Lines */
    --line: #1f2733;
    --line2: #2b3543;
    /* Text */
    --ink: #e9edf3;
    --dim: #9aa5b4;
    --faint: #7c8896;
    --fainter: #4b5563;
    /* Accents */
    --amber: #e0a53a;
    --amber-bg: #241d0e;
    --cyan: #37b6d0;
    /* Semantic up/down */
    --up: #1ecb8b;
    --up-soft: rgba(30,203,139,.14);
    --up-dim: #123026;
    --down: #ff5b64;
    --down-soft: rgba(255,91,100,.14);
    --down-dim: #33161a;
    /* Shape */
    --shadow: 0 1px 2px rgba(0,0,0,.5),0 8px 26px rgba(0,0,0,.55);
    /* other */
    --violet: #9483e6;
    --gold: #e0a53a;
    --gold2: #2a2413;
    --blue: #4d8dff;
}
*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{transition:background-color .22s ease, color .22s ease}
@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto}
  body{transition:none}
  *{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}
}
a{color:inherit;text-decoration:none}
img,svg{max-width:100%}

/* ---- header theme toggle (injected on every page) ---- */
.tc-theme-toggle{
  display:inline-flex;align-items:center;justify-content:center;
  width:38px;height:38px;flex:none;cursor:pointer;
  border:1px solid var(--line2);border-radius:9px;background:var(--panel);
  color:var(--dim);transition:.15s;padding:0;
}
.tc-theme-toggle:hover{color:var(--ink);border-color:var(--faint)}
.tc-theme-toggle svg{width:17px;height:17px}
.tc-theme-toggle .ic-moon{display:none}
:root[data-theme="dark"] .tc-theme-toggle .ic-sun{display:none}
:root[data-theme="dark"] .tc-theme-toggle .ic-moon{display:inline}
