/* ==========================================================================
   XpressGrow — themes
   --------------------------------------------------------------------------
   Each theme is a complete swap of the colour tokens declared in site.css.
   Nothing else changes: no layout, no type, no spacing. If a theme looks wrong
   somewhere, the cause is a hard-coded colour in a component — fix it there by
   adding a token, never by patching the theme.

   Midnight is the default and lives in site.css :root, so the site works with
   this file absent.

   LIGHT THEMES: two things must invert or they fail silently —
     · --line/--fill are white-alpha on dark and MUST become black-alpha, or
       every hairline and panel wash vanishes on a pale canvas.
     · --shadow is near-black on dark; at 0.85 under a white card it reads as
       a dirty smudge rather than elevation. Light themes use a much softer,
       slightly blue-black shadow.
   ========================================================================== */

/* ── 02 · Daylight ──────────────────────────────────────────────────────────
   The safe enterprise choice: white canvas, the same signal blue. What a CFO
   expects a business system to look like, and what prints legibly.
   ────────────────────────────────────────────────────────────────────────── */
:root[data-theme="daylight"] {
  /* the sticky nav + page index are translucent over this canvas */
  --bg-rgb: 255, 255, 255;
  --hover:  rgba(11, 22, 44, 0.05);
  /* alpha variants elsewhere compose from these — without them the glows and
     soft fills stay Midnight blue on top of this theme's palette. */
  --brand-rgb: 29, 78, 216;
  --money-rgb: 4, 120, 87;
  --risk-rgb:  220, 38, 38;
  --warn-rgb:  194, 102, 10;
  --bg:        #FFFFFF;
  --bg-2:      #F5F7FA;
  --surface:   #FFFFFF;
  --surface-2: #F2F5F9;
  --surface-3: #E8EDF4;

  --line:   rgba(11, 22, 44, 0.10);
  --line-2: rgba(11, 22, 44, 0.16);
  --line-3: rgba(11, 22, 44, 0.28);
  --fill:   rgba(11, 22, 44, 0.014);
  --fill-2: rgba(11, 22, 44, 0.030);

  --ink:   #0C1220;
  --ink-2: #4A5567;
  --ink-3: #6E7A8D;
  --ink-4: #9AA5B4;

  --brand:      #1D4ED8;
  --brand-soft: rgba(29, 78, 216, 0.08);
  --brand-line: rgba(29, 78, 216, 0.28);
  --brand-hi:   #2563EB;
  --brand-ink:  #1D4ED8;
  --money:      #047857;
  --money-soft: rgba(4, 120, 87, 0.10);
  --money-a:    #059669;
  --money-b:    #047857;
  --risk:       #DC2626;
  --risk-soft:  rgba(220, 38, 38, 0.09);
  --risk-a:     #EF4444;
  --risk-b:     #DC2626;
  --warn:       #C2660A;

  --accent-a: #1D4ED8;
  --accent-b: #0EA5E9;

  /* The consoles stay dark on a light page — on purpose. They are a device
     screen, and a dark inset is how the eye reads "this is the product, not
     the page". It is also the only element that carries the Midnight identity
     through into the light themes. */
  --console-a: #0C1526;
  --console-b: #080D18;
  --shelf-a:   #10182a;
  --shelf-b:   #0b1220;

  --shadow:      rgba(13, 26, 51, 0.13);
  --shadow-deep: rgba(13, 26, 51, 0.17);
  --shadow-soft: rgba(13, 26, 51, 0.08);
}

/* ── 03 · Graphite ──────────────────────────────────────────────────────────
   Neutral dark with no blue cast, and amber instead of blue. Reads as
   industrial/工具 rather than "tech startup" — closer to a weighbridge or a
   plant HMI than a SaaS landing page.
   ────────────────────────────────────────────────────────────────────────── */
:root[data-theme="graphite"] {
  /* the sticky nav + page index are translucent over this canvas */
  --bg-rgb: 14, 14, 15;
  --hover:  rgba(255, 255, 255, 0.055);
  /* alpha variants elsewhere compose from these — without them the glows and
     soft fills stay Midnight blue on top of this theme's palette. */
  --brand-rgb: 232, 135, 30;
  --money-rgb: 63, 185, 80;
  --risk-rgb:  248, 81, 73;
  --warn-rgb:  210, 153, 34;
  --bg:        #0E0E0F;
  --bg-2:      #141415;
  --surface:   #1A1A1C;
  --surface-2: #202023;
  --surface-3: #2A2A2E;

  --line:   rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --line-3: rgba(255, 255, 255, 0.24);
  --fill:   rgba(255, 255, 255, 0.020);
  --fill-2: rgba(255, 255, 255, 0.034);

  --ink:   #F2F1EF;
  --ink-2: #A8A6A2;
  --ink-3: #706E6A;
  --ink-4: #474543;

  --brand:      #E8871E;
  --brand-soft: rgba(232, 135, 30, 0.13);
  --brand-line: rgba(232, 135, 30, 0.34);
  --brand-hi:   #F59433;
  --brand-ink:  #F0A94A;
  --money:      #3FB950;
  --money-soft: rgba(63, 185, 80, 0.12);
  --money-a:    #4FCB60;
  --money-b:    #2EA043;
  --risk:       #F85149;
  --risk-soft:  rgba(248, 81, 73, 0.12);
  --risk-a:     #FF6B63;
  --risk-b:     #DA3633;
  --warn:       #D29922;

  --on-brand: #1A1205;
  --on-money: #06150A;

  --accent-a: #E8871E;
  --accent-b: #F5C542;

  --console-a: #1C1C1F;
  --console-b: #131315;
  --shelf-a:   #232326;
  --shelf-b:   #1A1A1D;

  --shadow:      rgba(0, 0, 0, 0.8);
  --shadow-deep: rgba(0, 0, 0, 0.88);
  --shadow-soft: rgba(0, 0, 0, 0.55);
}

/* ── 04 · Deep Sea ──────────────────────────────────────────────────────────
   Teal-black with an emerald signal. Calmer and less "notification red" than
   Midnight; money-green and the brand sit in the same family, which suits a
   page whose whole argument is about money.
   ────────────────────────────────────────────────────────────────────────── */
:root[data-theme="deepsea"] {
  /* the sticky nav + page index are translucent over this canvas */
  --bg-rgb: 4, 19, 22;
  --hover:  rgba(190, 255, 250, 0.055);
  /* alpha variants elsewhere compose from these — without them the glows and
     soft fills stay Midnight blue on top of this theme's palette. */
  --brand-rgb: 20, 184, 166;
  --money-rgb: 52, 211, 153;
  --risk-rgb:  251, 113, 133;
  --warn-rgb:  251, 191, 36;
  --bg:        #041316;
  --bg-2:      #06191D;
  --surface:   #082126;
  --surface-2: #0C2C32;
  --surface-3: #113940;

  --line:   rgba(190, 255, 250, 0.08);
  --line-2: rgba(190, 255, 250, 0.14);
  --line-3: rgba(190, 255, 250, 0.24);
  --fill:   rgba(190, 255, 250, 0.020);
  --fill-2: rgba(190, 255, 250, 0.032);

  --ink:   #E6F5F3;
  --ink-2: #93AFAF;
  --ink-3: #5F7C7D;
  --ink-4: #3B5254;

  --brand:      #14B8A6;
  --brand-soft: rgba(20, 184, 166, 0.13);
  --brand-line: rgba(20, 184, 166, 0.34);
  --brand-hi:   #2DD4BF;
  --brand-ink:  #5EEAD4;
  --money:      #34D399;
  --money-soft: rgba(52, 211, 153, 0.12);
  --money-a:    #4ADE80;
  --money-b:    #16A34A;
  --risk:       #FB7185;
  --risk-soft:  rgba(251, 113, 133, 0.12);
  --risk-a:     #FB7185;
  --risk-b:     #E11D48;
  --warn:       #FBBF24;

  --on-brand: #02231F;
  --on-money: #04140D;

  --accent-a: #2DD4BF;
  --accent-b: #67E8F9;

  --console-a: #082026;
  --console-b: #04151A;
  --shelf-a:   #0C2930;
  --shelf-b:   #061C21;

  --shadow:      rgba(0, 10, 12, 0.85);
  --shadow-deep: rgba(0, 10, 12, 0.9);
  --shadow-soft: rgba(0, 10, 12, 0.6);
}

/* ── 05 · Parchment ─────────────────────────────────────────────────────────
   Warm off-white with deep ink and a terracotta signal. Editorial rather than
   technical — reads like a well-set document, and is the only theme here that
   looks nothing like a dashboard. Deliberately the furthest from the "generic
   dark SaaS" default the site was built to avoid.
   ────────────────────────────────────────────────────────────────────────── */
:root[data-theme="parchment"] {
  /* the sticky nav + page index are translucent over this canvas */
  --bg-rgb: 251, 249, 244;
  --hover:  rgba(48, 38, 24, 0.05);
  /* alpha variants elsewhere compose from these — without them the glows and
     soft fills stay Midnight blue on top of this theme's palette. */
  --brand-rgb: 168, 71, 30;
  --money-rgb: 47, 107, 79;
  --risk-rgb:  179, 38, 30;
  --warn-rgb:  176, 113, 12;
  --bg:        #FBF9F4;
  --bg-2:      #F4F0E7;
  --surface:   #FFFDF9;
  --surface-2: #F2EDE2;
  --surface-3: #E8E1D2;

  --line:   rgba(48, 38, 24, 0.12);
  --line-2: rgba(48, 38, 24, 0.18);
  --line-3: rgba(48, 38, 24, 0.30);
  --fill:   rgba(48, 38, 24, 0.016);
  --fill-2: rgba(48, 38, 24, 0.032);

  --ink:   #1E1913;
  --ink-2: #554C3E;
  --ink-3: #7C7161;
  --ink-4: #A79C8A;

  --brand:      #A8471E;
  --brand-soft: rgba(168, 71, 30, 0.09);
  --brand-line: rgba(168, 71, 30, 0.28);
  --brand-hi:   #C2551F;
  --brand-ink:  #A8471E;
  --money:      #2F6B4F;
  --money-soft: rgba(47, 107, 79, 0.10);
  --money-a:    #3D8A65;
  --money-b:    #2F6B4F;
  --risk:       #B3261E;
  --risk-soft:  rgba(179, 38, 30, 0.09);
  --risk-a:     #C7362C;
  --risk-b:     #B3261E;
  --warn:       #B0710C;

  --accent-a: #A8471E;
  --accent-b: #C98B2E;

  /* Warm-black consoles so the inset device screen doesn't read as a cold
     blue hole punched in a paper page. */
  --console-a: #241E17;
  --console-b: #16120D;
  --shelf-a:   #2D2619;
  --shelf-b:   #1E1911;

  --shadow:      rgba(60, 45, 25, 0.14);
  --shadow-deep: rgba(60, 45, 25, 0.18);
  --shadow-soft: rgba(60, 45, 25, 0.08);
}

/* ── The picker ─────────────────────────────────────────────────────────────
   Lives in the header (.nav-in), injected by theme.js — deliberately NOT inside
   .nav-links, which collapses into the burger dropdown under 900px and would
   hide the control on the device most people will judge a theme on.
   ────────────────────────────────────────────────────────────────────────── */
.theme-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 5px;
  /* order:1 parks it after the nav links without disturbing their
     margin-left:auto. */
  order: 1;
  margin-left: 14px;
  background: var(--fill-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  flex: none;
}
.theme-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--line-3);
  cursor: pointer;
  padding: 0;
  flex: none;
  transition: transform 0.16s var(--ease);
}
.theme-dot:hover { transform: scale(1.18); }
/* Ring in the page background THEN the brand, so the selected dot reads on any
   canvas — a plain outline vanishes against its own theme's colour. */
.theme-dot[aria-pressed="true"] {
  box-shadow: 0 0 0 1.5px var(--bg), 0 0 0 3px var(--brand);
}
.theme-dot[data-t="midnight"]  { background: linear-gradient(135deg, #06090F 50%, #2E6BFF 50%); }
.theme-dot[data-t="daylight"]  { background: linear-gradient(135deg, #FFFFFF 50%, #1D4ED8 50%); }
.theme-dot[data-t="graphite"]  { background: linear-gradient(135deg, #0E0E0F 50%, #E8871E 50%); }
.theme-dot[data-t="deepsea"]   { background: linear-gradient(135deg, #041316 50%, #14B8A6 50%); }
.theme-dot[data-t="parchment"] { background: linear-gradient(135deg, #FBF9F4 50%, #A8471E 50%); }

@media (max-width: 900px) {
  /* The picker stays visible next to the burger rather than collapsing into it
     — a theme gets judged on a phone more than on a desktop. The burger keeps
     the right edge (thumb reach), so the picker is pushed right and the burger
     ordered after it. */
  .theme-bar { order: 0; margin-left: auto; margin-right: 10px; }
  .burger { order: 1; margin-left: 0; }
}
@media (max-width: 380px) {
  .theme-dot { width: 15px; height: 15px; }
  .theme-bar { gap: 4px; }
}
