/* vanillaless design tokens: the ONE place colours, type, space and shape are defined. Every
   component (vl.css, vl_crop.css, console/admin.css) uses these variables only.
   Light = "Cream & ink" (design concept B), dark = "Velvet night" (concept A), one layout.
   The theme follows the device (prefers-color-scheme) unless Settings → Appearance picked one:
   theme.js sets <html data-theme="light|dark"> before first paint. The dark palette is written
   twice (the media query and [data-theme=dark]); tools/check_contrast.php fails if the two copies
   differ or any text pair drops under WCAG AA (4.5:1; 3:1 for focus ring and ♥ outlines). */

/* VL Serif: a Latin subset of Charis SIL 6.200 (SIL Open Font License 1.1, see fonts/OFL.txt).
   Renamed because "Charis" and "SIL" are Reserved Font Names for modified versions. */
@font-face { font-family: "VL Serif"; src: url("fonts/vl-serif-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "VL Serif"; src: url("fonts/vl-serif-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "VL Serif"; src: url("fonts/vl-serif-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "VL Serif"; src: url("fonts/vl-serif-bolditalic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }

:root {
  /* type: the serif for headings, names (always italic), prices; a system sans for UI text */
  --font-serif: "VL Serif", Charter, "Bitstream Charter", Georgia, serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Cantarell, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --fs-xs: 0.8125rem;   /* 13px meta, badges */
  --fs-sm: 0.875rem;    /* 14px secondary */
  --fs-md: 1rem;        /* 16px body */
  --fs-lg: 1.1875rem;   /* 19px card names */
  --fs-xl: 1.5rem;      /* 24px section titles */
  --fs-2xl: 2.125rem;   /* 34px profile name, prices */
  --lh-tight: 1.15;
  --lh-body: 1.45;
  /* space (4px base) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  /* shape */
  --r1: 8px; --r2: 14px; --r3: 20px; --pill: 999px;
  --tap: 44px;          /* minimum touch target */
  --focus-w: 3px;
  --dur: 180ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --w-text: 680px;      /* forms, chat, settings */
  --w-wide: 1180px;     /* Browse */
  /* over photos (lightbox, blurred images, crop editor): the same in both themes */
  --media-bg: #000000;
  --media-scrim: rgba(0, 0, 0, .55);
  --media-scrim-strong: rgba(0, 0, 0, .75);
  --on-media: #ffffff;
  --on-media-line: rgba(255, 255, 255, .45);

  /* ---- light: Cream & ink */
  color-scheme: light;
  --bg: #faf8f4;
  --surface: #fffdf9;
  --surface2: #f2eee6;
  --ink: #1d1b18;
  --muted: #67615a;
  --line: #e0d9cc;
  --line-strong: #8f877c;
  --acc: #3b3a8f;
  --on-acc: #ffffff;
  --acc-text: #3b3a8f;
  --acc-soft: #e7e6f6;
  --active-bg: #e2eee5;
  --active-ink: #22543a;
  --idle-bg: #eee9e0;
  --idle-ink: #5d5850;
  --private-bg: #e7e6f6;
  --private-ink: #36358a;
  --heart: #b3264b;
  --on-heart: #ffffff;
  --heart-soft: #f8e3e8;
  --heart-soft-ink: #8e1d3b;
  --focus: #3b3a8f;
  --out-bg: #3b3a8f;
  --out-ink: #ffffff;
  --out-meta: #dcdbf6;
  --in-bg: #f2eee6;
  --in-ink: #1d1b18;
  --in-meta: #5d5850;
  --note-bg: #f4efe3;
  --note-ink: #3d372d;
  --warn-bg: #fbf0d4;
  --warn-ink: #5a420c;
  --warn-line: #e3c77e;
  --danger: #b3261e;
  --on-danger: #ffffff;
  --danger-text: #a3221b;
  --toast-bg: #1d1b18;
  --toast-ink: #faf8f4;
  --scrim: rgba(29, 27, 24, .55);
  --glow: transparent;
  --shadow: 0 1px 2px rgba(29, 27, 24, .06), 0 6px 18px -10px rgba(29, 27, 24, .18);
  --shadow-pop: 0 18px 44px -14px rgba(29, 27, 24, .38);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* ---- dark: Velvet night */
    color-scheme: dark;
    --bg: #16111b;
    --surface: #211a28;
    --surface2: #2c2335;
    --ink: #f4ecf1;
    --muted: #bba9b9;
    --line: #3b2e45;
    --line-strong: #7a6585;
    --acc: #e9a87f;
    --on-acc: #26150c;
    --acc-text: #f0b893;
    --acc-soft: #3a2a2a;
    --active-bg: #1d3a2d;
    --active-ink: #a3e6c3;
    --idle-bg: #2c2335;
    --idle-ink: #c3b2c1;
    --private-bg: #3a2452;
    --private-ink: #e5cbff;
    --heart: #ff7598;
    --on-heart: #2a0613;
    --heart-soft: #45202f;
    --heart-soft-ink: #ffc2d1;
    --focus: #f7caa9;
    --out-bg: #5b2c50;
    --out-ink: #fdf1f7;
    --out-meta: #ebc8dc;
    --in-bg: #2c2335;
    --in-ink: #f4ecf1;
    --in-meta: #c3b2c1;
    --note-bg: #2a1f24;
    --note-ink: #f3dccb;
    --warn-bg: #3a2c14;
    --warn-ink: #f6dcae;
    --warn-line: #6e5424;
    --danger: #ff8f8a;
    --on-danger: #2a0606;
    --danger-text: #ff9f9a;
    --toast-bg: #f4ecf1;
    --toast-ink: #16111b;
    --scrim: rgba(6, 3, 9, .66);
    --glow: rgba(233, 168, 127, .16);
    --shadow: 0 18px 40px -18px rgba(0, 0, 0, .7);
    --shadow-pop: 0 22px 50px -12px rgba(0, 0, 0, .8);
  }
}
:root[data-theme="dark"] {
  /* ---- dark: Velvet night */
  color-scheme: dark;
  --bg: #16111b;
  --surface: #211a28;
  --surface2: #2c2335;
  --ink: #f4ecf1;
  --muted: #bba9b9;
  --line: #3b2e45;
  --line-strong: #7a6585;
  --acc: #e9a87f;
  --on-acc: #26150c;
  --acc-text: #f0b893;
  --acc-soft: #3a2a2a;
  --active-bg: #1d3a2d;
  --active-ink: #a3e6c3;
  --idle-bg: #2c2335;
  --idle-ink: #c3b2c1;
  --private-bg: #3a2452;
  --private-ink: #e5cbff;
  --heart: #ff7598;
  --on-heart: #2a0613;
  --heart-soft: #45202f;
  --heart-soft-ink: #ffc2d1;
  --focus: #f7caa9;
  --out-bg: #5b2c50;
  --out-ink: #fdf1f7;
  --out-meta: #ebc8dc;
  --in-bg: #2c2335;
  --in-ink: #f4ecf1;
  --in-meta: #c3b2c1;
  --note-bg: #2a1f24;
  --note-ink: #f3dccb;
  --warn-bg: #3a2c14;
  --warn-ink: #f6dcae;
  --warn-line: #6e5424;
  --danger: #ff8f8a;
  --on-danger: #2a0606;
  --danger-text: #ff9f9a;
  --toast-bg: #f4ecf1;
  --toast-ink: #16111b;
  --scrim: rgba(6, 3, 9, .66);
  --glow: rgba(233, 168, 127, .16);
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .7);
  --shadow-pop: 0 22px 50px -12px rgba(0, 0, 0, .8);
}

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