/* ==========================================================================
   MiniKen Public Site — Theme Core (single source of truth)
   Palette F (light) / G (dark) · semantic layer · per-theme Chinese font
   Authority: wiki/PRIVATE/BRAND/visual-canonical.md v1.1.0 §4/§5/§7/§9
   ========================================================================== */

/* ---- Self-hosted Chinese (subset WOFF2; see scripts/build-fonts.sh) ---- */
@font-face{font-family:"LxgwWenKai";src:url("/fonts/LxgwWenKaiTC-Regular.subset.woff2") format("woff2");font-weight:400;font-display:swap;}
@font-face{font-family:"LxgwWenKai";src:url("/fonts/LxgwWenKaiTC-Medium.subset.woff2")  format("woff2");font-weight:700;font-display:swap;}
@font-face{font-family:"GenWanMin"; src:url("/fonts/GenWanMin2TC-R.subset.woff2") format("woff2");font-weight:400;font-display:swap;}
@font-face{font-family:"GenWanMin"; src:url("/fonts/GenWanMin2TC-M.subset.woff2") format("woff2");font-weight:700;font-display:swap;}

/* ---- Shared, theme-independent ---- */
:root{
  --maxw:1280px; --pad-x:clamp(20px,4vw,56px);
  --r-sm:8px; --r-md:14px; --r-lg:22px;
  --font-mark:"DM Sans","Noto Sans TC",system-ui,sans-serif;
  --font-latin:"Source Sans 3","Noto Sans TC",system-ui,sans-serif;
  --font-mono:"Source Code Pro",ui-monospace,monospace;
  --hairline:1px solid var(--c-divider);
}

/* ---- Palette F · light (silver + rose-gold + topaz + ink) ---- */
[data-theme="f"]{
  --c-bg:#EDECE8; --c-surface:#F8F6F1; --c-surface-2:#F0EDE6;
  --c-border:#D8D4CC; --c-divider:rgba(168,106,78,0.20);
  --c-text:#1A1A1A; --c-text-mid:#4A4A4A; --c-text-soft:#7A7A7A; --c-text-faint:#B0B0B0;
  --c-warm:#C9886F; --c-warm-strong:#A86A4E; --c-warm-soft:#E5BFAC; --c-warm-glaze:rgba(201,136,111,0.10);
  --c-cool:#7CB5C7; --c-cool-strong:#467E92; --c-cool-soft:#B8D5DE; --c-cool-glaze:rgba(124,181,199,0.12);
  --c-on-warm:#EDECE8;
  --brand-text:#A86A4E; --brand-dot:#467E92;
  --font-content:"Source Sans 3","LxgwWenKai","Songti TC",serif;
  color-scheme:light;
}

/* ---- Palette G · dark (dark-silver + emerald + gold + cream) ---- */
[data-theme="g"]{
  --c-bg:#1A1B1E; --c-surface:#25272A; --c-surface-2:#2F3134;
  --c-border:#3A3D42; --c-divider:rgba(140,145,152,0.20);
  --c-text:#F5F4EF; --c-text-mid:#C8C5BD; --c-text-soft:#95938B; --c-text-faint:#5F5D57;
  --c-warm:#C9A867; --c-warm-strong:#E5C883; --c-warm-soft:#9C7C36; --c-warm-glaze:rgba(201,168,103,0.12);
  --c-cool:#14A172; --c-cool-strong:#2BC58E; --c-cool-soft:#0D7B5D; --c-cool-glaze:rgba(20,161,114,0.12);
  --c-on-warm:#1A1B1E;
  --brand-text:#E5C883; --brand-dot:#2BC58E;
  --font-content:"Source Sans 3","GenWanMin","Songti TC",serif;
  color-scheme:dark;
}

/* ---- Smooth theme switch (only after first paint; not on load) ---- */
html.theme-ready body, html.theme-ready body *{
  transition: background-color .3s ease, color .3s ease, border-color .3s ease, fill .3s ease;
}

/* ---- 3-state theme toggle (injected by site.js) ---- */
.theme-toggle{ display:inline-flex; gap:2px; padding:3px; border-radius:999px;
  background:var(--c-surface-2); border:1px solid var(--c-border); }
.theme-seg{ font-family:var(--font-mark); font-size:12px; font-weight:600; line-height:1;
  padding:6px 10px; border-radius:999px; color:var(--c-text-soft); cursor:pointer; transition:color .15s, background .15s; }
.theme-seg:hover{ color:var(--c-text); }
.theme-seg.on{ background:var(--c-warm-strong); color:var(--c-on-warm); }
