/* =====================================================================
   Upstar — design tokens (ds-1.4.0; ds-1.0.0, the redesign's ink, and unslop's ink ramp: green marks a rise alone)
   ---------------------------------------------------------------------
   Dark theme is the default (:root and [data-theme="dark"]).
   Light theme applies on [data-theme="light"] (set on <html>).
   Load order on every page:
     <link rel="stylesheet" href="assets/tokens.css">
     <link rel="stylesheet" href="assets/components.css">
   Accent "rise" is reserved for a rise: star gains, a rising curve's last point,
   rising badges. Every button and what is chosen are in ink. Never decorative.
   ===================================================================== */

:root,
[data-theme="dark"] {
  color-scheme: dark;

  /* Surfaces */
  /* Unslop (ds-1.4): one neutral ramp tinted toward ink, a night sky */
  --bg: #0B0D14;
  --surface: #11141C;
  --raised: #1A1E28;
  --hover: #1A1E28;          /* row/control hover fill (never changes text color) */
  --hover-raised: #212532;   /* what hovers inside a menu, a toast or a dialog, all painted --raised: a step above it */
  --border: #232836;
  --border-strong: #2E3442;

  /* Text */
  --text: #EEF0F5;           /* 17.0:1 on --bg */
  --muted: #A3A9B8;          /* 8.3:1 on --bg  — default secondary text */
  --faint: #848C9F;          /* 5.8:1 on --bg, 5.5:1 on --surface */

  /* Accent: rising */
  --rise: #2BE38A;
  --rise-strong: #4BEB9E;    /* hover state of rise surfaces (brighter, not grayer) */
  --rise-soft: rgba(43, 227, 138, 0.12);
  --rise-line: rgba(43, 227, 138, 0.32);
  --on-rise: #04130B;
  --rise-text: #2BE38A;      /* rise used as text color (≥4.5:1 on all surfaces) */
  --spot: #FF6FAE;           /* Édito: "Spotted by Upstar" only (flag, chart mark, share images) */
  --shade: rgba(0, 0, 0, 0.5); /* menus' drop shadow */
  --rise-fill: #2BE38A;      /* a curve's last point when it rose (.sparkline__dot--up); ds-1.3's signup buttons went to ink in ds-1.4 */
  --rise-fill-strong: #4BEB9E;
  --rise-text-strong: #2BE38A; /* rise text on --rise-soft fills (pills) */

  /* Ink (ds-1.2, the redesign; ds-1.4, every button): what is chosen (segmented controls, chips) and the primary buttons */
  --ink: #EEF0F5;
  --on-ink: #0B0D14;
  --ink-hover: #FFFFFF;
  --spot-soft: rgba(255, 111, 174, 0.12);

  /* Status */
  --danger: #F0574B;
  --danger-soft: rgba(240, 87, 75, 0.12);
  --on-danger: #1A0503;
  --warning: #E8B04A;
  --warning-soft: rgba(232, 176, 74, 0.12);
  --info: #5B9DF5;
  --info-soft: rgba(91, 157, 245, 0.12);

  /* Overlays */
  --scrim: rgba(0, 0, 0, 0.6);
  --shadow-pop: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--border-strong);
  --skeleton-base: #16191E;
  --skeleton-shine: #1F2329;
}

[data-theme="light"] {
  color-scheme: light;

  --bg: #F5F7FA;             /* the ground; cards are --surface */
  --surface: #FFFFFF;
  --raised: #EEF1F6;         /* the rise's green 3.03:1 on it */
  --hover: #EFF2F6;
  --hover-raised: #E4E8EE;   /* 1.09:1 on --raised; nothing green is drawn on it */
  --border: #E3E7ED;
  --border-strong: #CBD1DA;

  --text: #111827;           /* 17.7:1 on --surface */
  --muted: #4B5565;          /* 7.5:1 on --surface, 7.0:1 on --bg */
  --faint: #5B6475;          /* 6.0:1 on --surface, 5.55:1 on --bg */

  --rise: #0E9F5B;
  --rise-strong: #0B8A4E;
  --rise-soft: rgba(14, 159, 91, 0.10);
  --rise-line: rgba(14, 159, 91, 0.35);
  --on-rise: #FFFFFF;
  --rise-text: #08703F;      /* a gain's figure: 6.2:1 on --surface, 5.8:1 on --bg */
  --spot: #B0225F;           /* Édito: "Spotted by Upstar" only, 6.4:1 on white */
  --shade: rgba(15, 17, 21, 0.08);
  --rise-fill: #0A8048;      /* a curve's last point when it rose (.sparkline__dot--up), 5.0:1 on white */
  --rise-fill-strong: #08703F; /* hover, 6.2:1 */
  --rise-text-strong: #08703F; /* 5.2:1 on --rise-soft over --surface (pills) */

  --ink: #111827;
  --on-ink: #FFFFFF;
  --ink-hover: #1F2937;
  --spot-soft: rgba(176, 34, 95, 0.08);

  --danger: #C8362B;
  --danger-soft: rgba(200, 54, 43, 0.08);
  --on-danger: #FFFFFF;
  --warning: #805508;        /* 5.5:1 on --warning-soft over --surface */
  --warning-soft: rgba(176, 120, 18, 0.10);
  --info: #2763C4;
  --info-soft: rgba(39, 99, 196, 0.08);

  --scrim: rgba(15, 17, 21, 0.4);
  --shadow-pop: 0 8px 24px rgba(15, 17, 21, 0.10), 0 0 0 1px var(--border-strong);
  --skeleton-base: #EEF0F3;
  --skeleton-shine: #F6F7F9;
}

:root {
  /* Fonts */
  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  /* ds-1.2: the small figures of tables, slugs and dates */
  --font-tab: "Geist Mono", "Geist Mono Fallback", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* Type scale */
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-16: 16px;
  --fs-20: 20px;
  --fs-24: 24px;
  --fs-32: 32px;
  --fs-48: 48px;
  --lh-body: 1.5;
  --lh-tight: 1.15;
  --lh-heading: 1.25;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* Spacing (4px base) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* Radii */
  --r-control: 6px;
  --r-card: 8px;
  --r-chip: 999px;

  /* Motion */
  --dur-fast: 150ms;
  --dur-base: 200ms;
  --dur-slow: 250ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);  /* ds-1.4: one curve for both */
  --ease-in: cubic-bezier(0.22, 1, 0.36, 1);

  /* Layout */
  --sidebar-w: 240px;
  --rail-w: 300px;
  --topbar-h: 56px;
  --bottomnav-h: 64px;
  --container: 1200px;
  --container-narrow: 720px;
  --container-wide: 1440px;

  /* Focus */
  --focus-ring: 2px solid var(--rise);
  --focus-offset: 2px;

  /* Z layers */
  --z-sticky: 20;
  --z-nav: 30;
  --z-sheet: 50;
  --z-modal: 60;
  --z-toast: 70;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur-base: 0ms;
    --dur-slow: 0ms;
  }
}
