/* ---------------------------------------------------------------------------
   Geist Sans — Mindo primary UI typeface (MINDO-DS-001)
   Source: official Vercel `geist` package v1.9.2 (SIL OFL 1.1), file
   dist/fonts/geist-sans/Geist-Variable.woff2, bundled locally in
   ../fonts/ (licence: ../fonts/Geist-OFL.txt). One variable file, wght 100–900,
   includes Latin, Latin Extended and Cyrillic (і ї є ґ), ₴ $ € £ ł and the
   `tnum` feature. Geist Mono is not loaded.
   The fallback stack is used only if the font fails to load; it is
   platform-neutral and deliberately does not name SF Pro.
--------------------------------------------------------------------------- */
@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------------------------
   Mindo design tokens

   Loaded after the shared Unicornus tokens and before every Mindo stylesheet.
   It re-tunes the shared semantic tokens for Mindo's identity — a pearl
   canvas with an indigo undertone, ink-indigo text, midnight focal surface —
   and adds the few Mindo-only tokens (focal "hero" surface, brand gradient,
   data-visualisation palette). Typography uses Geist Sans (see the @font-face above);
   hierarchy comes from scale, weight and spacing. Components consume these tokens only; they do
   not introduce page-local hex values.

   Contrast (WCAG 2.2, measured, text on its own surface):
     light  muted #585872 on #f6f6fb 6.4:1      faint #6a6a84 4.9:1
     dark   muted #a2a2bd on #0b0b17 7.9:1      faint #8c8ca8 6.0:1
     hero   foreground #f4f4ff 6.3:1 or better, muted text ≥ 4.5:1 even at
            the lightest corner of the gradient (text sits well away from it)
     brand  white on both ends of --brand-gradient ≥ 5.3:1
--------------------------------------------------------------------------- */

:root {
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --canvas: #f6f6fb;
  --canvas-sunken: #eeeef6;
  --chrome: #fafafd;
  --chrome-translucent: color-mix(in srgb, #fafafd 92%, transparent);
  --surface: #ffffff;
  --surface-hover: #f9f9fd;
  --surface-raised: #ffffff;
  --surface-sunken: #f0f0f7;
  --surface-subtle: #efeff6;
  --surface-overlay: #ffffff;

  --ink: 14 14 44;
  --edge-ring: rgba(19, 19, 60, 0.08);
  --edge-ring-strong: rgba(19, 19, 60, 0.15);

  --text-primary: #13132b;
  --text-secondary: #3c3c56;
  --text-muted: #585872;
  --text-faint: #6a6a84;

  --line-soft: rgba(19, 19, 60, 0.07);
  --line: rgba(19, 19, 60, 0.11);
  --line-strong: rgba(19, 19, 60, 0.18);

  --control-line: rgba(19, 19, 60, 0.17);
  --hover-tint: rgba(19, 19, 80, 0.05);
  --press-tint: rgba(19, 19, 80, 0.08);
  --selected-tint: rgba(77, 73, 252, 0.09);

  /* Focal "midnight" surface — fixed-dark in both themes, so figures on it
     keep one known contrast. Brand stops: #3C64FC → #6B68FD over #0D0C37. */
  --hero-bg:
    radial-gradient(120% 90% at 100% 0%, rgba(107, 104, 253, 0.4) 0%, rgba(107, 104, 253, 0) 58%),
    radial-gradient(90% 80% at 0% 100%, rgba(60, 100, 252, 0.3) 0%, rgba(60, 100, 252, 0) 62%),
    linear-gradient(160deg, #1f1e72 0%, #121146 55%, #0d0c37 100%);
  --hero-fg: #f4f4ff;
  --hero-fg-muted: rgba(226, 228, 255, 0.78);
  --hero-fg-faint: rgba(222, 225, 255, 0.78);
  --hero-line: rgba(190, 196, 255, 0.2);
  --hero-chip: rgba(255, 255, 255, 0.1);
  --hero-chip-hover: rgba(255, 255, 255, 0.18);
  --hero-ring: rgba(150, 168, 255, 0.16);
  --hero-shadow: 0 1px 2px rgba(13, 12, 55, 0.18), 0 22px 44px -22px rgba(30, 30, 114, 0.6);

  /* Brand blue → violet, deepened a step so white labels clear 5:1. */
  --brand-gradient: linear-gradient(135deg, #3555ee 0%, #5753f2 100%);

  /* Panels: one soft ring plus a whisper of lift. */
  --panel-shadow: 0 0 0 1px var(--edge-ring), 0 1px 2px rgb(var(--ink) / 0.03), 0 12px 28px -20px rgb(var(--ink) / 0.14);

  /* Data visualisation. Five ranked hues plus a neutral tail. Every use is
     paired with a label and a percentage. */
  --viz-1: #4d49fc;
  --viz-2: #19a7bd;
  --viz-3: #f0a63a;
  --viz-4: #e5607a;
  --viz-5: #8a86ff;
  --viz-other: #9a9ab2;
  --viz-income: #16c784;
  --viz-expense: #4d49fc;
}

:root[data-theme="dark"] {
  --canvas: #0b0b17;
  --canvas-sunken: #090913;
  --chrome: #10101f;
  --chrome-translucent: color-mix(in srgb, #10101f 92%, transparent);
  --surface: #15152a;
  --surface-hover: #1b1b35;
  --surface-raised: #191931;
  --surface-sunken: #0f0f1f;
  --surface-subtle: #1d1d38;
  --surface-overlay: #1b1b35;

  --ink: 0 0 4;
  --edge-ring: rgba(190, 196, 255, 0.1);
  --edge-ring-strong: rgba(190, 196, 255, 0.17);

  --text-primary: #f1f1fa;
  --text-secondary: #c9c9de;
  --text-muted: #a2a2bd;
  --text-faint: #8c8ca8;

  --line-soft: rgba(190, 196, 255, 0.07);
  --line: rgba(190, 196, 255, 0.11);
  --line-strong: rgba(190, 196, 255, 0.18);

  --control: #181832;
  --control-hover: #1f1f3b;
  --control-line: rgba(190, 196, 255, 0.17);
  --hover-tint: rgba(190, 196, 255, 0.07);
  --press-tint: rgba(190, 196, 255, 0.11);

  --hero-ring: rgba(150, 168, 255, 0.24);
  --hero-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 22px 44px -20px rgba(0, 0, 0, 0.7);

  --panel-shadow: 0 0 0 1px var(--edge-ring), 0 12px 28px -20px rgba(0, 0, 0, 0.6);

  --viz-1: #7b78ff;
  --viz-2: #3cc3d8;
  --viz-3: #ffc15a;
  --viz-4: #ff8095;
  --viz-5: #aaa8ff;
  --viz-other: #7d7d99;
  --viz-income: #2fd697;
  --viz-expense: #8a86ff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0b0b17;
    --canvas-sunken: #090913;
    --chrome: #10101f;
    --chrome-translucent: color-mix(in srgb, #10101f 92%, transparent);
    --surface: #15152a;
    --surface-hover: #1b1b35;
    --surface-raised: #191931;
    --surface-sunken: #0f0f1f;
    --surface-subtle: #1d1d38;
    --surface-overlay: #1b1b35;

    --ink: 0 0 4;
    --edge-ring: rgba(190, 196, 255, 0.1);
    --edge-ring-strong: rgba(190, 196, 255, 0.17);

    --text-primary: #f1f1fa;
    --text-secondary: #c9c9de;
    --text-muted: #a2a2bd;
    --text-faint: #8c8ca8;

    --line-soft: rgba(190, 196, 255, 0.07);
    --line: rgba(190, 196, 255, 0.11);
    --line-strong: rgba(190, 196, 255, 0.18);

    --control: #181832;
    --control-hover: #1f1f3b;
    --control-line: rgba(190, 196, 255, 0.17);
    --hover-tint: rgba(190, 196, 255, 0.07);
    --press-tint: rgba(190, 196, 255, 0.11);

    --hero-ring: rgba(150, 168, 255, 0.24);
    --hero-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 22px 44px -20px rgba(0, 0, 0, 0.7);

    --panel-shadow: 0 0 0 1px var(--edge-ring), 0 12px 28px -20px rgba(0, 0, 0, 0.6);

    --viz-1: #7b78ff;
    --viz-2: #3cc3d8;
    --viz-3: #ffc15a;
    --viz-4: #ff8095;
    --viz-5: #aaa8ff;
    --viz-other: #7d7d99;
    --viz-income: #2fd697;
    --viz-expense: #8a86ff;
  }
}
