/* El Heng's original blue storefront (dark by default). The light palette follows below.
   Load after the kit's defaults on pages that use them. */
:root {
  color-scheme: dark;
  --p-bg: #17496d; --p-surface: #295577; --p-ink: #ffffff; --p-muted: #c4d3e1;
  --p-accent: #7d9174; --p-accent-ink: #03263f; --p-accent-hi: #b0c6a6;
  --p-action: #667a5e; --p-action-ink: #ffffff; --p-action-hover: #5b6e52;
  --p-inv-bg: #09314c; --p-inv-surface: #143c5a; --p-inv-ink: #ffffff; --p-inv-muted: #bdcdda;
  --p-inv-accent: #b0c6a6; --p-inv-accent-ink: #03263f; --p-inv-action: #667a5e; --p-inv-action-ink: #ffffff;
  --p-mat: transparent;
  --p-ok: #95dfa4;           /* "In stock": 6.1:1 on the blue */
  --p-error: #f9aea7;        /* form errors: 5.3:1 on the blue, 4.4:1 on the surface (errors sit on the blue) */
  --p-focus: var(--p-ink);
  --p-hover-wash: color-mix(in srgb, var(--p-ink) 8%, transparent);
  --p-logo-filter: none;
  --p-selection: var(--p-action); --p-selection-ink: var(--p-action-ink);
  --p-seal-stroke: rgb(255 255 255 / 0.90);
  --p-menu-drop-shadow: rgb(0 0 0 / 0.45);
  --p-proof-edge: oklch(1 0 0 / 0.13);
  --p-qr-paper: #ffffff;
  --p-confirm-bg: #fff3b0; --p-confirm-ink: #17496d;
  --p-menu-shadow: rgb(0 0 0 / 0.30);
  --p-line-mix: 16%; --p-line-strong-mix: 32%; --p-control-mix: 50%;
  --p-field-option-ink: #000000;
  --font-display: "Fraunces", Georgia, serif;
  --font-text: "Figtree", system-ui, sans-serif;
  --display-weight: 400;
  --display-tracking: -0.02em;
  --display-tracking-xl: -0.025em;
  --display-axes: 'SOFT' 0, 'WONK' 0;
}

/* El Heng's blue and sage on white. Keep the exact sage on white; use its
   darker counterpart when text sits on the raised surface. */
:root[data-theme="light"] {
  color-scheme: light;
  --p-bg: #ffffff; --p-surface: #eef3f7; --p-ink: #17496d; --p-muted: #52687a;
  --p-accent: #667a5e; --p-accent-ink: var(--p-bg); --p-accent-hi: var(--p-accent);
  --p-surface-accent: #607458;
  --p-action: var(--p-ink); --p-action-ink: var(--p-bg); --p-action-hover: #0f3a59;
  --p-inv-bg: var(--p-ink); --p-inv-surface: var(--p-inv-bg);
  --p-inv-ink: var(--p-bg); --p-inv-muted: #c4d3e1;
  --p-inv-accent: #b0c6a6; --p-inv-accent-ink: var(--p-inv-bg);
  --p-inv-action: var(--p-bg); --p-inv-action-ink: var(--p-inv-bg); --p-inv-action-hover: var(--p-surface);
  --p-ok: #1d6b3f; --p-error: #b3261e;
  --p-logo-filter: brightness(0) invert(10%) sepia(100%);
  --p-focus: var(--p-ink);
  --p-line-mix: 16%; --p-line-strong-mix: 32%; --p-control-mix: 59%;
  --p-proof-edge: color-mix(in srgb, var(--p-ink) var(--p-line-mix), transparent);
  --p-inv-control-mix: 50%;
  --p-selection: var(--p-ink); --p-selection-ink: var(--p-bg);
  --p-field-option-ink: var(--p-ink);
  --p-field-option-bg: var(--p-surface);
}
/* square joinery, not app cards: photographs and panels at 2px, controls at 2px */
html[data-radius="sharp"] { --r-sm: 2px; --r-md: 2px; --r-lg: 2px; --r-btn: 2px; }

/* Traditional Chinese: Latin letters keep the dealt faces, Han characters fall through to the
   system's HK / TW faces (no CJK webfont is shipped). No negative tracking and a taller line for Han. */
:root:lang(zh) {
  --font-display: "Fraunces", "Songti TC", "Noto Serif HK", "Noto Serif TC", "PMingLiU", serif;
  --font-text: "Figtree", "PingFang HK", "PingFang TC", "Noto Sans HK", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --display-tracking: 0;
  --display-tracking-xl: 0;
}
:lang(zh) :is(h1, h2, h3, p, li) { letter-spacing: 0; line-break: strict; word-break: normal; hyphens: manual; }
:lang(zh) p { line-height: 1.8; }
/* an English run inside a Chinese page keeps the English rhythm */
:lang(zh) [lang="en"] { line-height: inherit; }
