/* Optic v2 design tokens. Every colour, size and duration in the v2 frontend
   comes from here; components never use a literal colour.
   Two themes: charcoal (near-black, the default since 2026-10-18,
   VISUAL-SPEC-DARK.md) and ivory (Light). Gold is light, not paint: it marks
   focus, selection, the mark and Milo, never chrome. */
:root {
  /* surfaces */
  --c-plane: #f6f2e9;
  --c-plane-2: #efe9dd;
  --c-raised: #fffcf6;
  --c-sunk: #e9e2d3;
  --c-logo-bg: #f6f4ef;   /* the disc a company's logo sits on, light in both themes so dark marks stay visible */
  --c-active: #fffcf6;   /* the fill of a chosen segment or tab */
  --c-scene: #1b1a18;
  --c-scene-2: #252320;
  --c-on-scene: #f4efe5;
  --c-on-scene-2: #b9b1a2;
  /* ink */
  --c-ink: #1b1a18;
  --c-ink-2: #48443d;
  --c-ink-3: #5c564b;
  --c-line: #d9d1c1;
  --c-line-2: #e6dfd1;
  /* brand and meaning */
  --c-gold: #b0861b;
  --c-gold-ink: #74580c;
  --c-gold-light: #d4b144;
  --c-gold-wash: rgba(212, 177, 68, .14);
  --c-pos: #0c743f;   /* from #0d7a42: 4.20:1 on --c-sunk failed AA text (VC audit 2026-10-27); 4.54:1 now, 5.24:1 on the plane */
  --c-neg: #b43a25;
  --c-warn: #8a5a00;
  --c-proposed: #6c43c9;
  --c-focus: #1b1a18;
  --c-on-gold: #1b1a18;   /* text on a gold fill: the primary action */
  /* chart categories, in a fixed order (they were literals in eleven places) */
  --c-cat-1: #5b7fbf; --c-cat-2: #3d8f8a; --c-cat-3: #c27a2c; --c-cat-4: #8a5fb8;
  /* the three series of a financial chart, one per metric wherever it appears: s1 the top line (revenue, gross
     margin, operating cash flow, cash, EPS), s2 the middle (operating income and margin, capital spending, debt,
     shares), s3 the bottom line (net income and margin, free cash flow). Checked with the dataviz validator in both
     themes (2026-10-20): lightness, chroma, colour-blind and normal-vision separation, contrast against a panel */
  --c-s1: #5b7fbf; --c-s2: #c27a2c; --c-s3: #c75b88;
  /* the price chart's indicators, the owner's mapping (2026-10-24): VWAP the one cool hue, EMA 50 red and dashed,
     EMA 21 green, EMA 9 the ink (white on charcoal). Red and green here are deeper and shifted from --c-neg and --c-pos
     so a line never reads as a candle, and each line is named at its right end, so none is told apart by colour alone.
     On ivory every one clears 4.5:1 against the panel, so the end labels read as text. */
  --c-ind-ema9: var(--c-ink); --c-ind-ema21: #2e7613; --c-ind-ema50: #c4283a; --c-ind-vwap: #7b4fd6;
  /* WaveTrend's pane (2026-10-30): WT1 blue, WT2 a lighter cyan; on ivory 4.7:1 and 3.5:1 against the page, on
     charcoal 6.1:1 and 12.5:1, so both clear 3:1 for a line in either theme */
  --c-ind-wt1: #3a6db5; --c-ind-wt2: #1a8ca1;
  /* charts */
  --c-chart-ink: var(--c-ink);
  --c-chart-grid: #e3dccd;
  --c-area-top: rgba(176, 134, 27, .20);
  --c-area-bottom: rgba(176, 134, 27, 0);
  --c-cone-a: rgba(176, 134, 27, .30);
  --c-cone-b: rgba(176, 134, 27, .04);
  --c-cone-edge: #8a6a14;
  --c-halo: var(--c-plane);
  --c-tip-bg: #1b1a18;
  --c-tip-ink: #f6f2e9;
  --c-scrim: rgba(20, 18, 15, .30);

  /* type: Inter reads, Space Grotesk labels and tickers */
  --f-sans: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-label: "Space Grotesk Variable", "Space Grotesk", "Inter Variable", "Inter", system-ui, sans-serif;
  --t-display: clamp(40px, 6vw, 84px);
  --t-display-m: clamp(28px, 3.4vw, 46px);
  /* the type scale (design standard, 2026-10-19, docs/frontend-v2/DESIGN-STANDARD.md): seven text sizes and
     one lead size. Half-pixel sizes were rounded up into these, so supporting text reads more easily. Figures
     larger than 24px are a component's headline number and say so where they are set. */
  --t-xs: 12px;     /* chart ticks, data tags, counts */
  --t-sm: 13px;     /* meta lines, dense labels, as-of lines in tight rows */
  --t-md: 14px;     /* labels, controls in toolbars, table cells */
  --t-base: 15px;   /* supporting text, notes, as-of lines */
  --t-lg: 16px;     /* body */
  --t-xl: 18px;     /* h3, a row's lead figure */
  --t-lead: 20px;   /* a section's one-line finding */
  --t-2xl: 24px;    /* h2, the header's price */
  --t-h2: var(--t-2xl);
  --t-h3: var(--t-xl);
  --t-body: var(--t-lg);
  --t-note: var(--t-base);
  --t-label: var(--t-md);
  --t-micro: var(--t-sm);
  --t-chart: var(--t-xs);
  --track-display: -0.035em;
  --w-display: 600;

  /* space and shape */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 40px; --s-9: 56px; --s-10: 72px;
  /* corner radii, by what the shape holds (design standard): marks and tags 4, an item inside a control 6,
     controls 8, panels, cards and menus 12, sheets 16. --r-pill is the sidebar's gold hover pill (owner's rule)
     and counts; 50% is for avatars, dots and the round icon buttons. The old names point at the new steps. */
  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-pill: 999px;
  --r-1: var(--r-md); --r-2: var(--r-lg); --r-3: var(--r-lg); --r-4: var(--r-xl);
  /* controls (buttons, segmented controls, chips, inputs, selects): squared-off, not pill-shaped (owner's
     checklist, 2026-10-19) */
  --r-ctl: var(--r-md); --r-ctl-in: var(--r-sm);
  --tap: 44px;        /* every control a finger can reach */
  /* elevation is for what floats over the page and nothing else: menus, popovers and tips; drawers and sheets */
  --sh-pop: 0 12px 32px rgba(0, 0, 0, .28);
  --sh-sheet: -24px 0 60px rgba(0, 0, 0, .30);
  --ctl-sm: 36px;     /* a dense toolbar's controls (the Chart page), with a 44px row around them */
  --rail: 236px;
  --page: 1560px;   /* one canvas for every page, Home's workspace included (2026-10-18) */

  /* motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --d-fast: 120ms; --d: 200ms; --d-slow: 320ms;
  /* the shared motion system (ui/motion.js, audit and motion session 2026-10-22), timed in the browser: a control's
     own feedback is immediate, content arriving fades in a beat, a panel slides a little longer, and anything
     leaving goes faster than it came. Nothing waits for these: they run while the work does. */
  --m-press: 90ms; --m-content: 150ms; --m-panel: 200ms; --m-exit: 130ms;
  /* 2026-10-24 (motion proposal): hover and focus colour on quiet controls; a line chart's first draw on a page, short
     enough to finish before a reader reaches for it and cancelled the moment data, a resize or a gesture arrives (it
     was 620 ms); and the one stagger, between at most the first four things that arrive together */
  --m-hover: 120ms; --m-reveal: 400ms; --m-stagger: 24ms;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);      /* entering: moves at once, settles softly */
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);   /* a sheet or drawer */
  color-scheme: light;
}
:root[data-theme="charcoal"] {
  /* four steps of emphasis (owner, 2026-10-18 second review): headings and figures (ink), supporting
     text (ink-2), labels and times (ink-3), and lines strong enough to separate panels. ink-2 and ink-3 were
     lifted on 2026-10-19 (design standard: "readable secondary text"): ink-3 is 8.4:1 on a panel, was 6.7 */
  --c-plane: #0b0b0a; --c-plane-2: #0f0f0e; --c-raised: #161614; --c-sunk: #201f1c; --c-active: #2d2c28;
  --c-scene: #080807; --c-scene-2: #121210;
  --c-ink: #f3f1eb; --c-ink-2: #d3cfc6; --c-ink-3: #b4afa5;
  --c-line: #363430; --c-line-2: #272623;
  --c-gold: #d4b144; --c-gold-ink: #e3c76f;
  --c-pos: #4cc38a; --c-neg: #f07a66; --c-warn: #e7b25a; --c-proposed: #b9a0ff; --c-focus: #f0d77c; --c-ind-ema21: #7bd64f; --c-ind-ema50: #ff5a63; --c-ind-vwap: #b28cff;
  --c-ind-wt1: #5b8fe0; --c-ind-wt2: #7fdcec;
  --c-chart-grid: #2a2925; --c-area-top: rgba(212, 177, 68, .20); --c-cone-a: rgba(212, 177, 68, .30); --c-cone-edge: #e3c76f;
  --c-tip-bg: #eceae4; --c-tip-ink: #0b0b0a; --c-scrim: rgba(0, 0, 0, .6); --c-on-gold: #0b0b0a;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --c-plane: #0b0b0a; --c-plane-2: #0f0f0e; --c-raised: #161614; --c-sunk: #201f1c; --c-active: #2d2c28;
    --c-scene: #080807; --c-scene-2: #121210;
    --c-ink: #f3f1eb; --c-ink-2: #d3cfc6; --c-ink-3: #b4afa5;
    --c-line: #363430; --c-line-2: #272623;
    --c-gold: #d4b144; --c-gold-ink: #e3c76f;
    --c-pos: #4cc38a; --c-neg: #f07a66; --c-warn: #e7b25a; --c-proposed: #b9a0ff; --c-focus: #f0d77c; --c-ind-ema21: #7bd64f; --c-ind-ema50: #ff5a63; --c-ind-vwap: #b28cff;
    --c-ind-wt1: #5b8fe0; --c-ind-wt2: #7fdcec;
    --c-chart-grid: #2a2925; --c-area-top: rgba(212, 177, 68, .20); --c-cone-a: rgba(212, 177, 68, .30); --c-cone-edge: #e3c76f;
    --c-tip-bg: #eceae4; --c-tip-ink: #0b0b0a; --c-scrim: rgba(0, 0, 0, .6); --c-on-gold: #0b0b0a;
    color-scheme: dark;
  }
}
/* The scene (one statement piece, Home only) carries its own palette so its
   charts and text stay legible in either theme. */
.scene {
  --c-ink: var(--c-on-scene); --c-ink-2: var(--c-on-scene-2); --c-ink-3: var(--c-on-scene-2);
  --c-chart-ink: var(--c-on-scene); --c-chart-grid: rgba(244, 239, 229, .07); --c-halo: var(--c-scene);
  --c-pos: #6fd39b; --c-neg: #f5907f; --c-gold-ink: var(--c-gold-light); --c-cone-edge: var(--c-gold-light);
  --c-cone-a: rgba(212, 177, 68, .38); --c-cone-b: rgba(212, 177, 68, .03);
  --c-area-top: rgba(212, 177, 68, .16); --c-area-bottom: rgba(212, 177, 68, 0); --c-focus: var(--c-gold-light);
}
