/* =============================================================================
   Devicely DESIGN SYSTEM (ds.css) — loaded LAST, authoritative token layer.
   Color pivot: TRUST-BLUE is the working accent (CTA/links/focus/trust);
   PURPLE becomes the rationed signature spark (logo, hero word, brand gradient).
   OKLCH semantic tokens, warm off-white base, cool ink, light default + dark scaffold.
   Research-backed (trust=conversion gate; dark-blue=only study-backed trust hue;
   grades = calm ordinal ramp, never traffic-light; <10% accent area).
   ========================================================================== */

:root{
  color-scheme: light;

  /* ---- neutral ramp (warm paper, cool ink — the "inspection sheet" feel) ---- */
  --paper:#FBFBF9; --bg:#FBFBF9;
  --surface:#FFFFFF;
  --paper-2:#F2F3F1; --panel:#F2F3F1; --surface-2:#F2F3F1;
  --ink:#14181B; --carbon:#14181B;
  --ink-soft:#5B6570;
  --steel:#6E7883; --mute:#9AA2AB; --ink-2:#374151; --ink-3:#5F6975;
  --line:#E4E5E2; --line-2:#EEEFEC;
  --hair:rgba(20,24,27,.10); --hair-2:rgba(20,24,27,.055);
  --hair-d:rgba(255,255,255,.12); --hair-d2:rgba(255,255,255,.07);
  --dark:#0D0E14; --dark-2:#15171F;

  /* ---- TRUST-BLUE: the working accent (CTAs, links, focus, trust) ---- */
  --accent:#1F4FD8; --blue:#1F4FD8;
  --accent-press:#173FAE;
  --accent-weak:#EAF0FE;
  --accent-ring:color-mix(in oklch,var(--accent) 30%,transparent);
  --accent-soft:color-mix(in oklch,var(--accent) 10%,transparent);

  /* ---- SIGNATURE PURPLE: identity only (logo, hero word, brand gradient) ---- */
  --signature:#5A47E6;
  --signature-bright:#8D6DFF;
  --signature-deep:#4334C7;
  --grad:linear-gradient(100deg,#8D6DFF,#5A47E6 46%,#1F4FD8);

  /* ---- semantic state colors (always paired with icon + text) ---- */
  --state-stock:#1E7A4D;   --state-stock-bg:#EAF7EF;
  --state-warn:#B65C00;    --state-warn-bg:#FBF1E6;  --caution:#B65C00;
  --state-deal:#C0341D;    --state-deal-bg:#FCEDEA;
  --state-error:#C0341D;
  --state-eco:#2E7D5B;
  --good:#1E7A4D;

  /* ---- grade ordinal ramp (darker = higher grade; colorblind-safe) ---- */
  --grade-a-bg:#14181B; --grade-a-fg:#FFFFFF;
  --grade-b-bg:#475160; --grade-b-fg:#FFFFFF;
  --grade-c-bg:#7A828C; --grade-c-fg:#FFFFFF;

  /* shadows tuned for the cooler palette */
  --sh-1:0 1px 2px rgba(16,18,22,.04),0 6px 16px rgba(16,18,22,.06);
  --sh-2:0 2px 6px rgba(16,18,22,.06),0 18px 40px rgba(16,18,22,.10);
  --sh-3:0 30px 80px rgba(10,12,20,.34);
}

/* ============================== DARK "SHOW" MODE =========================== */
/* Opt-in via <html data-theme="dark"> (server-set from a cookie → no flash).
   Flips the neutral ramp + lines + shadows; keeps trust-blue/signature; inverts
   the grade ordinal so A stays the brightest. Media tiles are forced light in
   system.css so product photos (shot on white, multiply-blended) stay visible. */
:root[data-theme="dark"]{
  color-scheme: dark;

  --paper:#0E1016; --bg:#0E1016;
  --surface:#171A22;
  --paper-2:#1E212B; --panel:#1E212B; --surface-2:#1E212B;
  --ink:#EDEFF2; --carbon:#EDEFF2;
  --ink-soft:#A6AEB9;
  --steel:#7E8893; --mute:#69707A; --ink-2:#C7CDD6; --ink-3:#9BA3AF;
  --line:#2A2E39; --line-2:#23262F;
  --hair:rgba(255,255,255,.12); --hair-2:rgba(255,255,255,.07);
  --dark:#0A0B10; --dark-2:#0E1016;

  --accent:#3D6BF2; --blue:#3D6BF2;
  --accent-press:#2F58D8;
  --accent-weak:rgba(61,107,242,.16);
  /* --accent-ring / --accent-soft / --grad derive via color-mix → auto-update */

  --state-stock:#3DBE85; --state-stock-bg:rgba(61,190,133,.14);
  --state-warn:#E2912F;  --state-warn-bg:rgba(226,145,47,.14);  --caution:#E2912F;
  --state-deal:#E76A52;  --state-deal-bg:rgba(231,106,82,.14);  --state-error:#E76A52;
  --state-eco:#46B98A;   --good:#3DBE85;

  /* grade ordinal inverts on dark: A = brightest, C = dimmest */
  --grade-a-bg:#EDEFF2; --grade-a-fg:#14181B;
  --grade-b-bg:#8A93A0; --grade-b-fg:#14181B;
  --grade-c-bg:#4C5562; --grade-c-fg:#EDEFF2;

  --sh-1:0 1px 2px rgba(0,0,0,.40),0 6px 18px rgba(0,0,0,.42);
  --sh-2:0 2px 8px rgba(0,0,0,.46),0 18px 44px rgba(0,0,0,.52);
  --sh-3:0 30px 90px rgba(0,0,0,.70);
}

/* ============================== grade chips → calm ordinal ramp ============= */
/* (overrides the older traffic-light + accent-tint chip styling) */
.grade-chip,.grade-chip[data-g]{
  font-family:var(--mono);font-size:10.5px;font-weight:600;letter-spacing:.03em;
  padding:2px 9px;border-radius:999px;border:1px solid transparent;
  background:var(--paper-2);color:var(--ink-soft);display:inline-flex;align-items:center;gap:5px}
.grade-chip[data-g="A"]{background:var(--grade-a-bg);color:var(--grade-a-fg);border-color:transparent}
.grade-chip[data-g="B"]{background:var(--grade-b-bg);color:var(--grade-b-fg)}
.grade-chip[data-g="C"]{background:var(--grade-c-bg);color:var(--grade-c-fg)}
.grade-chip.best{box-shadow:0 0 0 2px var(--accent-soft)}

/* ============================== signature alignments ======================= */
/* brand word + brand numerals use the signature gradient (purple→blue).
   NB: never !important on the `background` shorthand here — it would force
   background-clip back to border-box and fill the box instead of the text. */
.x-hero h1 em{background:var(--grad);-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}
.x-stats .num em{background:var(--grad);-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}
.x-progress{background-image:var(--grad)}

/* trust-blue CTA hover glow uses the blue ring */
.btn-accent:hover{box-shadow:0 8px 24px -8px var(--accent-ring)}
