/* ~/www/vendor/theme.css — site-wide palette + type stack.
   Source-of-truth aesthetic: Feller Vol II study guide.
   Cache-bust by bumping the ?v= query string on every <link>. */

:root {
  color-scheme: dark;

  /* --- Palette (study-guide canonical) --- */
  --bg:        #18160f;     /* warm dark brown */
  --bg-soft:   #221f17;     /* card / elevated surface */
  --bg-deep:   #0f0d08;     /* below-bg gradient anchor */
  --fg:        #ece4cf;     /* cream */
  --fg-soft:   #b6a988;     /* muted tan, for de-emphasized text */
  --muted:     #8e836a;     /* even softer; chip / meta text */
  --rule:      #3a3326;     /* hairline border */
  --rule-strong: #4d4530;   /* slightly stronger border */
  --accent:    #f0b3a8;     /* soft coral, the universal accent */
  --accent-soft: rgba(240,179,168,0.16);
  --link:      #a8c0e8;     /* cool blue against the warm bg */
  --link-hover: #cfdcf2;
  --code-bg:   #2a2519;     /* code block / chip surface */

  /* --- Numeric / status colors --- */
  /* Re-tuned for the warm palette: drop saturation so they don't fight
     the coral accent. Keep red/green identity for PnL, but pull both
     toward warmer/duskier tones. */
  --pnl-up:    #8fb088;     /* dusky sage */
  --pnl-down:  #d0786e;     /* warm dusk red, sibling of --accent */
  --pnl-flat:  #b6a988;     /* mirrors --fg-soft so 0.0% reads neutral */
  --warn:      #d4a25a;     /* warm amber, only when truly distinct */

  /* --- Type stacks --- */
  --font-serif: 'Iowan Old Style', 'Charter', 'Iowan', 'Palatino Linotype',
                'Palatino', 'Georgia', serif;
  --font-sans:  -apple-system, BlinkMacSystemFont, 'SF Pro Text',
                system-ui, 'Helvetica Neue', sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display',
                  system-ui, sans-serif;
  --font-mono:  'SF Mono', 'JetBrains Mono', ui-monospace, SFMono-Regular,
                Menlo, monospace;

  /* --- Misc primitives --- */
  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 14px;
}

/* --- Reset + base body --- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  font-feature-settings: 'kern', 'liga', 'onum';
  text-rendering: optimizeLegibility;
}

/* --- Default headings (serif, generous leading) --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  color: var(--fg);
}

/* --- Default links --- */
a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--link-hover); }

/* --- Code blocks --- */
code, pre, kbd, samp {
  font-family: var(--font-mono);
}
code {
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.88em;
}
pre {
  background: var(--code-bg);
  padding: 0.8em 1em;
  overflow-x: auto;
  border-radius: 6px;
  font-size: 0.88em;
  line-height: 1.55;
}
pre code { background: transparent; padding: 0; font-size: 1em; }

/* --- Selection --- */
::selection      { background: var(--accent); color: var(--bg); }
::-moz-selection { background: var(--accent); color: var(--bg); }

/* --- Subtle scrollbar to harmonize with palette (Webkit) --- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--rule);
  border-radius: 999px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--rule-strong); }

/* --- Common .back home link (every page has one in slightly-different ad-hoc form today) --- */
a.back, .back {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--fg-soft);
  text-decoration: none;
  letter-spacing: 0.02em;
}
a.back:hover, .back:hover { color: var(--accent); }

/* --- Tabular numerics utility (data-dense tables opt in by adding class="tabular-nums") --- */
.tabular-nums { font-variant-numeric: tabular-nums; }
