/* =========================================================================
   Varrtem X3 · Design tokens
   Single source of truth for colour, type, space, radius, elevation, motion.
   Loaded AFTER style.css so that the legacy variables (--ink, --glass, --amber…)
   used by every existing page resolve to these tokens. Pages should migrate to
   the --vx-* names; the legacy aliases at the bottom keep old CSS working.
   Theme switching: <html data-theme="dark|light"> (see js/theme.js).
   ========================================================================= */

:root{
  color-scheme:dark;

  /* ---- Brand ---------------------------------------------------------- */
  --vx-champagne:#e6b98b;          /* signature accent */
  --vx-champagne-hi:#f0cba3;
  --vx-plum:#b7a4d5;               /* secondary, used sparingly (gradients, rare highlights) */

  /* ---- Colour · text -------------------------------------------------- */
  --vx-text:#f4f1ec;
  --vx-text-2:rgba(244,241,236,.70);
  --vx-text-3:rgba(244,241,236,.50);
  --vx-text-on-accent:#1b130b;

  /* ---- Colour · surfaces (glass over the wallpaper) -------------------- */
  --vx-bg:#0d0c10;                 /* page fallback behind the wallpaper */
  --vx-glass-1:rgba(20,18,25,.66); /* floating chrome: taskbar */
  --vx-glass-2:rgba(24,22,30,.86); /* windows, start menu, popovers */
  --vx-fill-1:rgba(255,255,255,.04);  /* cards / inputs inside a surface */
  --vx-fill-2:rgba(255,255,255,.07);  /* hover */
  --vx-fill-3:rgba(255,255,255,.11);  /* pressed / selected */
  --vx-line-1:rgba(255,255,255,.07);  /* hairline dividers */
  --vx-line-2:rgba(255,255,255,.12);  /* component borders */
  --vx-line-3:rgba(255,255,255,.20);  /* emphasised borders */
  --vx-highlight:inset 0 1px 0 rgba(255,255,255,.07); /* top-edge light on glass */

  /* ---- Colour · accent states ----------------------------------------- */
  --vx-accent:var(--vx-champagne);
  --vx-accent-hi:var(--vx-champagne-hi);
  --vx-accent-fill:linear-gradient(160deg,#f0cba3,#d9a875); /* primary buttons */
  --vx-accent-soft:rgba(230,185,139,.12);
  --vx-accent-soft-2:rgba(230,185,139,.22);
  --vx-accent-line:rgba(230,185,139,.40);
  --vx-focus:var(--vx-champagne);

  /* ---- Colour · status ------------------------------------------------- */
  --vx-ok:#7bd8a4;  --vx-warn:#f0b232;  --vx-danger:#ee7d77;  --vx-info:#8fb4ff;
  --vx-danger-solid:#c42b1c;

  /* ---- Type ----------------------------------------------------------- */
  --vx-font-display:"Fraunces","Iowan Old Style","Palatino Linotype",Georgia,serif;
  --vx-font-ui:"Segoe UI Variable Text","Segoe UI Variable","Segoe UI",system-ui,-apple-system,"Helvetica Neue",sans-serif;
  --vx-fs-xs:11px;  --vx-fs-sm:12px;  --vx-fs-base:13px;  --vx-fs-md:14px;
  --vx-fs-lg:16px;  --vx-fs-xl:20px;  --vx-fs-2xl:26px;   --vx-fs-3xl:34px;
  --vx-lh-tight:1.15;  --vx-lh-snug:1.35;  --vx-lh-body:1.55;
  --vx-track-tight:-.012em;  --vx-track-wide:.02em;

  /* ---- Space (4px grid) ----------------------------------------------- */
  --vx-s-1:4px;  --vx-s-2:8px;  --vx-s-3:12px;  --vx-s-4:16px;
  --vx-s-5:20px; --vx-s-6:24px; --vx-s-8:32px;  --vx-s-10:48px;

  /* ---- Radius (outer > inner: window 14 → card 12 → control 10 → chip) -- */
  --vx-r-xs:6px;  --vx-r-sm:8px;  --vx-r-md:10px;  --vx-r-lg:12px;
  --vx-r-xl:14px; --vx-r-2xl:18px; --vx-r-pill:999px;

  /* ---- Elevation ------------------------------------------------------- */
  --vx-elev-1:0 1px 2px rgba(0,0,0,.28),0 4px 12px rgba(0,0,0,.18);          /* resting card, inactive window */
  --vx-elev-2:0 2px 6px rgba(0,0,0,.28),0 12px 28px rgba(0,0,0,.28);         /* raised / hovered card */
  --vx-elev-3:0 4px 10px rgba(0,0,0,.30),0 24px 56px rgba(0,0,0,.40);        /* active window, taskbar */
  --vx-elev-4:0 8px 16px rgba(0,0,0,.32),0 32px 80px rgba(0,0,0,.50);        /* start menu, popovers */
  --vx-glow:0 0 0 1px var(--vx-accent-line),0 0 24px rgba(230,185,139,.14);   /* rare: active/focus emphasis */

  /* ---- Blur ------------------------------------------------------------ */
  --vx-blur-sm:16px;  --vx-blur-md:28px;  --vx-blur-lg:38px;

  /* ---- Motion ---------------------------------------------------------- */
  --vx-ease:cubic-bezier(.2,.8,.2,1);          /* entrances, most transitions */
  --vx-ease-inout:cubic-bezier(.4,0,.2,1);
  --vx-ease-spring:cubic-bezier(.34,1.35,.64,1); /* small, rare overshoot */
  --vx-dur-fast:120ms;  --vx-dur-base:200ms;  --vx-dur-slow:320ms;  --vx-dur-enter:480ms;

  /* ---- Layers (match the values already used by the shell) ------------- */
  --vx-z-bar:9000;  --vx-z-panel:9500;  --vx-z-toast:9800;  --vx-z-boot:20000;
}

:root[data-theme="light"]{
  color-scheme:light;
  --vx-text:#1f2229;
  --vx-text-2:rgba(31,34,41,.70);
  --vx-text-3:rgba(31,34,41,.52);
  --vx-text-on-accent:#2a1a0a;
  --vx-bg:#ecebe8;
  --vx-glass-1:rgba(248,246,243,.74);
  --vx-glass-2:rgba(251,250,248,.92);
  --vx-fill-1:rgba(31,34,41,.035);
  --vx-fill-2:rgba(31,34,41,.065);
  --vx-fill-3:rgba(31,34,41,.10);
  --vx-line-1:rgba(31,34,41,.07);
  --vx-line-2:rgba(31,34,41,.13);
  --vx-line-3:rgba(31,34,41,.22);
  --vx-highlight:inset 0 1px 0 rgba(255,255,255,.7);
  --vx-accent:#8b5d31;
  --vx-accent-hi:#6f4822;
  --vx-accent-fill:linear-gradient(160deg,#e9c39a,#d3a06b);
  --vx-accent-soft:rgba(139,93,49,.10);
  --vx-accent-soft-2:rgba(139,93,49,.18);
  --vx-accent-line:rgba(139,93,49,.42);
  --vx-plum:#75618f;
  --vx-ok:#1f8a55;  --vx-warn:#a56a00;  --vx-danger:#c13b33;  --vx-info:#2f63c9;
  --vx-elev-1:0 1px 2px rgba(26,35,50,.10),0 4px 12px rgba(26,35,50,.07);
  --vx-elev-2:0 2px 6px rgba(26,35,50,.10),0 12px 28px rgba(26,35,50,.12);
  --vx-elev-3:0 4px 10px rgba(26,35,50,.10),0 24px 56px rgba(26,35,50,.18);
  --vx-elev-4:0 8px 16px rgba(26,35,50,.12),0 32px 80px rgba(26,35,50,.24);
  --vx-glow:0 0 0 1px var(--vx-accent-line),0 0 24px rgba(139,93,49,.10);
}

@media (prefers-reduced-motion:reduce){
  :root{--vx-dur-fast:.01ms;--vx-dur-base:.01ms;--vx-dur-slow:.01ms;--vx-dur-enter:.01ms}
}

/* ---- Legacy aliases ------------------------------------------------------
   Every existing page reads these names. `:root[data-theme]` is listed too so the
   aliases also win over the older light-theme block in style.css (same specificity,
   later in the cascade). --tb is intentionally NOT aliased: style.css changes it
   in a media query. */
:root,:root[data-theme]{
  --ink:var(--vx-text);
  --dim:var(--vx-text-2);
  --glass:var(--vx-glass-1);
  --glass2:var(--vx-glass-2);
  --line:var(--vx-line-2);
  --amber:var(--vx-accent);
  --plum:var(--vx-plum);
  --shadow:var(--vx-elev-3);
  --ease:var(--vx-ease);
  --sans:var(--vx-font-ui);
  --serif:var(--vx-font-display);
}
