/* The fonts are loaded by each page's own <link>: app/index.html and
   app/login.html without blocking the first paint, app/daily-brief.html with a
   plain link. An @import here made every open of the app wait on Google Fonts,
   after the stylesheet chain, before anything painted. */

/* === Font Variables ===
   The landing page's faces since 2026-10-13, so the product reads like the
   page that sold it: Newsreader for display, Schibsted Grotesk for text,
   JetBrains Mono for numbers. */
:root {
  --font-display: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-body:    'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-serif:   var(--font-display);
  --text-micro: 10px;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-md: 14px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 22px;
  --text-hero: 30px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-slow: 250ms cubic-bezier(0.16, 1, 0.3, 1);
  /* Spacing scale — 4px base grid. Reach for these for gap/padding/margin so
     the app's rhythm stays consistent instead of ad-hoc 7/9/11px literals. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  /* Radius scale — snap corners to these instead of the ~15 ad-hoc values
     (2..18px) scattered across the CSS. */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
}

/* === One theme, Glass (founder, 2026-11-04: "it just looks dull and plain",
   then "Def C"). A soft mint, lilac and peach mesh sits behind the page once,
   fixed. Cards and panels are translucent white over it with white hairline
   edges and large soft shadows; ink text on them. Chartreuse is the primary
   action's fill and carries ink. There is no dark theme and no toggle.

   Every text color here passes 4.5:1 on the worst composite of its surface over
   the darkest point of the mesh, which test/app-light-contract.test.mjs computes.
   That is why the big panel is 0.66 white where the mock-up had 0.62, and why
   amber is a shade darker: at the mock-up's values the up color reads 4.43 on the
   panel at full lilac, and amber 4.38. */
:root {
  color-scheme: light;

  /* The mesh, painted once by html::before in base.css. --bg-primary is the
     opaque ground under it: the canvas, the phone status bar, the manifest. */
  --bg: #f6f7fb;
  --bg-primary: #f6f7fb;
  --mesh-mint: #bff0dc;
  --mesh-lilac: #d6ccff;
  --mesh-peach: #ffe0cb;
  --page-mesh:
    radial-gradient(700px 480px at 8% -5%, var(--mesh-mint) 0%, rgba(191, 240, 220, 0) 70%),
    radial-gradient(800px 560px at 92% 4%, var(--mesh-lilac) 0%, rgba(214, 204, 255, 0) 70%),
    radial-gradient(900px 640px at 50% 62%, var(--mesh-peach) 0%, rgba(255, 224, 203, 0) 70%);

  /* Glass: what sits on the mesh, no blur (it would frost a smooth gradient to
     no visible end, at a scrolling cost). */
  --glass-panel: rgba(255, 255, 255, 0.66);   /* a big panel: the market read */
  --bg-card: rgba(255, 255, 255, 0.72);       /* a card or a rail */
  --card-bg: rgba(255, 255, 255, 0.72);
  --surface-card: rgba(255, 255, 255, 0.72);
  --bg-secondary: rgba(255, 255, 255, 0.72);  /* a plate inside a card, brighter than the card */
  --surface-sunken: rgba(255, 255, 255, 0.72);
  --glass-edge: rgba(255, 255, 255, 0.92);    /* the white hairline of anything glass */
  --pill-bg: rgba(255, 255, 255, 0.6);        /* a quiet pill button */
  --glass-top: rgba(255, 255, 255, 0.68);     /* the top row and the phone rail, blurred */

  /* Over real content these stay opaque enough to read. Tested over ink, the
     darkest thing on any page. An overlay with no blur behind it is solid, because
     at any alpha the text under it would show through sharp. */
  --surface-elevated: rgba(255, 255, 255, 0.94);
  --surface-solid: #ffffff;
  --surface-input: rgba(255, 255, 255, 0.92);
  --surface-1: #ffffff;                       /* a hollow candle hides its wick */
  --paper-veil: rgba(246, 247, 251, 0.92);
  --toggle-track: rgba(20, 22, 42, 0.05);     /* behind a segmented control's white plate */

  --graphite: #14162a;            /* the brand tile and the active tab, nothing else */
  --text-on-ink: #ffffff;
  --mask-solid: #000;             /* the solid stop of an alpha mask; never painted */
  --ink-rgb: 20, 22, 42;

  /* Rules inside a card are ink at low alpha, because a white rule on white glass
     is nothing. A lift is white, because an ink wash would take the up color
     under 4.5:1 where it sits on a card over the mesh; on an opaque surface
     (a menu, a dialog) the hover is the ink wash instead. */
  --border-soft: rgba(20, 22, 42, 0.06);
  --border: rgba(20, 22, 42, 0.08);
  --border2: rgba(20, 22, 42, 0.14);
  --border-strong: rgba(20, 22, 42, 0.28);
  --border-focus: rgba(20, 22, 42, 0.55); /* a focused field, as dark as the ring */
  --hairline: 1px solid var(--border);
  --wash: rgba(255, 255, 255, 0.72);
  --hover-bg: rgba(255, 255, 255, 0.55);
  --hover-ink: rgba(20, 22, 42, 0.05);
  --pressed-bg: rgba(20, 22, 42, 0.07);
  --overlay-bg: rgba(20, 22, 42, 0.28);
  --dot-edge: rgba(20, 22, 42, 0.35);
  --scrollbar-thumb: rgba(20, 22, 42, 0.14);
  --scrollbar-thumb-hover: rgba(20, 22, 42, 0.24);

  /* Ink */
  --text: #14162a;
  --text-1: #14162a;
  --text-primary: #14162a;
  --text-body: #33374a;
  --text-secondary: #44485a;
  --text-tertiary: #4c5063;
  --text-muted: #55596c;
  --text-faint: #55596c;          /* muted's value: a step lighter fails on the bare mesh */
  --text-on-signal: #ffffff;

  /* Chartreuse: the primary action's fill, with ink on it. Never text or a line. */
  --accent: #dff06a;
  --accent-hover: #d3e655;
  --accent-rgb: 223, 240, 106;
  --text-on-accent: #14162a;
  --accent-border: rgba(20, 22, 42, 0.14);
  --accent-bg: rgba(223, 240, 106, 0.35);
  --interactive-primary-bg: #dff06a;
  --interactive-primary-text: #14162a;
  --interactive-primary-border: rgba(20, 22, 42, 0.14);

  /* Graphic accents: fills, lines and dots, never reading text. Teal and rose
     under 4.5:1 on glass, so words that need them use the darker stops below. */
  --indigo: #5a4be0;
  --teal: #128a70;
  --rose: #d0416f;
  --step-grad: linear-gradient(135deg, #5a4be0, #128a70);
  --chip-grad: linear-gradient(90deg, #e7e2ff, #d9f6ea);
  --chip-ink: #2a2470;
  --mini-area: rgba(90, 75, 224, 0.13);

  /* The market word: one gradient family per read. Good and poor keep every stop
     at 4.5:1 on the panel. Mixed keeps the mock-up's brighter stops, the founder's
     call on 2026-11-04 for this large word only. The solid color is the fallback
     where a browser cannot clip to text. */
  --word-good: linear-gradient(90deg, #037d58, #0a7480 60%, #1f5fbf);
  --word-good-solid: #037d58;
  --word-mixed: linear-gradient(90deg, #5a4be0, #d0416f 55%, #d9701f);
  --word-mixed-solid: #5a4be0;
  --word-poor: linear-gradient(90deg, #c7322c, #b9305f 60%, #8f2f86);
  --word-poor-solid: #c7322c;

  /* A selected row is an opaque pale lilac, because a tint over glass would take
     the up and down figures in it under 4.5:1. Text selection is an indigo wash. */
  --accent-tint: #f1efff;
  --accent-selection: rgba(90, 75, 224, 0.22);

  /* Signals as text, and their tints. The tints are opaque for the same reason. */
  --green: #037d58;
  --green-bg: #e4f5ee;
  --green-border: rgba(3, 125, 88, 0.28);
  --green-flash: rgba(3, 125, 88, 0.2);
  --red: #c7322c;
  --red-dim: #a82a25;
  --red-bg: #fceceb;
  --red-border: rgba(199, 50, 44, 0.3);
  --red-flash: rgba(199, 50, 44, 0.18);
  --amber: #a25800;
  --amber-bg: #fbf1e2;
  --amber-border: rgba(162, 88, 0, 0.3);
  --warning: #a25800;
  --blue: #1f5fbf;
  --blue-bg: #e8f0fb;
  --blue-border: rgba(31, 95, 191, 0.26);
  --purple: #5a4be0;
  --purple-bg: #eeecfc;
  --cyan: #0f6f86;
  --cyan-bg: #e4f3f6;

  /* Depth: large soft shadows under a white edge, the mock-up's own values. */
  --rim-top: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --rim-top-strong: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --shadow-sm: 0 10px 26px -20px rgba(40, 40, 90, 0.5);
  --shadow-rim: 0 1px 2px rgba(40, 40, 90, 0.05);
  --shadow-chip: 0 2px 8px rgba(40, 40, 90, 0.12);
  --shadow-card: 0 18px 40px -30px rgba(60, 50, 140, 0.55), 0 1px 3px rgba(40, 40, 90, 0.05);
  --shadow-panel: 0 40px 80px -46px rgba(60, 50, 140, 0.6), 0 2px 8px rgba(40, 40, 90, 0.06);
  --shadow-md: 0 24px 50px -30px rgba(60, 50, 140, 0.6), 0 2px 6px rgba(40, 40, 90, 0.07);
  --shadow-menu: 0 24px 60px -24px rgba(60, 50, 140, 0.5), 0 2px 6px rgba(40, 40, 90, 0.08);
  --shadow-pop: 0 40px 90px -40px rgba(60, 50, 140, 0.6), 0 2px 8px rgba(40, 40, 90, 0.08);
  --shadow-top: 0 1px 0 rgba(255, 255, 255, 0.8), 0 10px 30px -22px rgba(40, 40, 90, 0.4);
  --shadow-btn-primary: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 8px 22px -12px rgba(120, 130, 30, 0.65);
  --shadow-rail: 0 -10px 30px -22px rgba(40, 40, 90, 0.4);

  /* Motion duration scale: pair with --ease. */
  --dur-fast: 140ms;
  --dur-med: 240ms;
  --dur-slow: 360ms;

  /* Focus is ink, and never chartreuse. */
  --ring-focus: 0 0 0 2px rgba(20, 22, 42, 0.55);
  --ring-active: 0 0 0 1px rgba(20, 22, 42, 0.28);
  --focus-soft: rgba(20, 22, 42, 0.1);

  /* Loading placeholders */
  --skeleton: rgba(20, 22, 42, 0.05);
  --skeleton-sweep: rgba(255, 255, 255, 0.6);

  /* The top bar's own height; the safe area adds to it. */
  --mac-header-h: 56px;

  /* Charts. A canvas cannot resolve var(), so chart.js, cockpit.js and
     sector-rrg.js read these with getComputedStyle when they build. The chart
     has no ground of its own: it stands on its frosted panel. */
  --chart-bg: transparent;
  --chart-text: #44485a;
  --chart-grid: rgba(20, 22, 42, 0.07);
  --chart-border: rgba(20, 22, 42, 0.08);
  --chart-up: #037d58;
  --chart-down: #c7322c;
  --chart-volume-up: rgba(3, 125, 88, 0.34);
  --chart-volume-down: rgba(199, 50, 44, 0.3);
  --chart-crosshair: rgba(20, 22, 42, 0.42);
  --chart-sma10: #7f700e;
  --chart-sma20: #5d6d84;
  --chart-sma50: #b45309;
  --chart-trend-resistance: #7e57c2;
  --chart-trend-support: #1e78d0;
  --chart-pattern-fill: rgba(90, 75, 224, 0.07);
  --chart-tight-fill: rgba(223, 240, 106, 0.45);
  --chart-tight-edge: rgba(111, 118, 22, 0.6);
  --chart-level: rgba(20, 22, 42, 0.55);
  --chart-last: rgba(20, 22, 42, 0.62);
  --chart-session: #a86f1a;
  --chart-session-band: rgba(125, 145, 180, 0.14);
  --chart-axis-label: #e7e2ff;
  --chart-axis-label-text: #2a2470;

  /* Sector rotation map: quadrant washes and each sector's trail. It keeps a white
     plate: its sectors are small colored marks with words beside them. */
  --rrg-bg: #ffffff;
  --rrg-grid: rgba(20, 22, 42, 0.06);
  --rrg-axis: rgba(20, 22, 42, 0.14);
  --rrg-text: rgba(20, 22, 42, 0.62);
  --rrg-label: rgba(255, 255, 255, 0.9);
  --rrg-leading: rgba(3, 125, 88, 0.05);
  --rrg-weakening: rgba(162, 88, 0, 0.05);
  --rrg-lagging: rgba(199, 50, 44, 0.05);
  --rrg-improving: rgba(31, 95, 191, 0.05);
  --rrg-xle: #ea580c;
  --rrg-xlb: #78716c;
  --rrg-xli: #64748b;
  --rrg-xly: #8c5c00;
  --rrg-xlp: #16a34a;
  --rrg-xlv: #dc2626;
  --rrg-xlf: #2563eb;
  --rrg-xlc: #db2777;
  --rrg-xlu: #7c3aed;
  --rrg-xlk: #0891b2;
  --rrg-xlre: #7f6148;
  --rrg-asset-class: #9d7242;
  --rrg-other: #4f74b2;

  /* Market Map: monochrome SPY candles, and one tint per theme run, each at
     least 3.8:1 on the card at the mesh's darkest. */
  --mm-wick: rgba(20, 22, 42, 0.55);
  --mm-candle: rgba(20, 22, 42, 0.8);
  --run-tint-1: #a06a3a;
  --run-tint-2: #2f6fd6;
  --run-tint-3: #398354;
  --run-tint-4: #a0559b;
  --run-tint-5: #8b7126;
  --run-tint-6: #4a7a80;
}
