/* LiNK design tokens, "Comet" system (spec 2026-10-02). Namespace --lk-*.
   Colours are 6-digit hex only: tests/test_lk_tokens.py parses this file and checks WCAG
   contrast for every pair. Light and dark follow the OS; data-theme forces one. */

:root {
  /* sampled from assets/branding/logo.png; fills and decoration only, never text in light mode */
  --lk-peach: #FCBA9B;
  --lk-rose: #E9A8B5;
  --lk-orchid: #D5A0CA;
  --lk-lavender: #C09FD3;
  --lk-sky: #B3CBF1;
  --lk-cyan: #7ED6EC;
  --lk-radius: 6px;
  --lk-font-body: "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", "Leelawadee UI", Roboto, "Noto Sans Thai", Arial, sans-serif;
  --lk-font-head: "Prompt", "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", "Leelawadee UI", Roboto, "Noto Sans Thai", Arial, sans-serif;
  --lk-font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --lk-font-money: "IBM Plex Mono", "IBM Plex Sans Thai", ui-monospace, monospace;
  /* motion (R3): entering eases out; motion.css is the only reader */
  --lk-ease-out: cubic-bezier(.2, .8, .2, 1);
  --lk-dur-1: 120ms;
  --lk-dur-2: 180ms;
  --lk-dur-3: 240ms;
  --lk-dur-4: 400ms;
}

:root, :root[data-theme="light"] {
  color-scheme: light;
  --lk-bg: #F7F6F9;
  --lk-surface: #FFFFFF;
  --lk-tint: #ECE8F5;
  --lk-ink: #1A1622;
  --lk-muted: #5E5869;
  --lk-line: #D9D5E0;
  --lk-input-line: #8A8496;
  --lk-link: #5A3EA6;
  --lk-peach-text: #9A4A2C;
  --lk-cyan-text: #0B6A82;
  --lk-btn-fill: #5A3EA6;
  --lk-btn-ink: #FFFFFF;
  --lk-focus: #6A4FC4;
  --lk-danger: #B4232C;
  --lk-danger-fill: #B4232C;
  --lk-danger-ink: #FFFFFF;
  --lk-ok: #0C7C5D;
  --lk-warn: #99620D;
  --lk-paper: #FFFFFF;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --lk-bg: #121019;
    --lk-surface: #1C1925;
    --lk-tint: #2A2440;
    --lk-ink: #EEEAF4;
    --lk-muted: #A7A0B5;
    --lk-line: #2F2B3A;
    --lk-input-line: #6F6880;
    --lk-link: #C3B2F2;
    --lk-peach-text: #FCBA9B;
    --lk-cyan-text: #7ED6EC;
    --lk-btn-fill: #C3B2F2;
    --lk-btn-ink: #17121F;
    --lk-focus: #7ED6EC;
    --lk-danger: #FF7A80;
    --lk-danger-fill: #C2333B;
    --lk-danger-ink: #FFFFFF;
    --lk-ok: #34C294;
    --lk-warn: #D69A3F;
    --lk-paper: #FFFFFF;
  }
}

/* the theme island (store.css) also wears the dark set: game heroes are dark presets today,
   so LiNK buttons and focus rings inside one keep their contrast (C6 revisits light presets).
   R3 Pb: the hero comet slot is a small night sky in both themes, so the pastel comet reads. */
.lk-comet,
.lk-theme-island,
:root[data-theme="dark"] {
  color-scheme: dark;
  --lk-bg: #121019;
  --lk-surface: #1C1925;
  --lk-tint: #2A2440;
  --lk-ink: #EEEAF4;
  --lk-muted: #A7A0B5;
  --lk-line: #2F2B3A;
  --lk-input-line: #6F6880;
  --lk-link: #C3B2F2;
  --lk-peach-text: #FCBA9B;
  --lk-cyan-text: #7ED6EC;
  --lk-btn-fill: #C3B2F2;
  --lk-btn-ink: #17121F;
  --lk-focus: #7ED6EC;
  --lk-danger: #FF7A80;
  --lk-danger-fill: #C2333B;
  --lk-danger-ink: #FFFFFF;
  --lk-ok: #34C294;
  --lk-warn: #D69A3F;
  --lk-paper: #FFFFFF;
}

/* Per-language fonts (i18n, seven languages). The self-hosted fonts are subset to Thai + Latin-1, so
   Vietnamese (Latin Extended Additional) and Chinese would fall back glyph by glyph and look mixed.
   These languages get one system stack for the whole line instead; no CJK font is shipped (a CJK
   webfont is several MB per weight). Thai and English keep the stacks above. */
html:lang(vi),
html:lang(id),
html:lang(fil) {
  --lk-font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --lk-font-head: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --lk-font-money: "IBM Plex Mono", ui-monospace, "Segoe UI", monospace;
}
html:lang(zh-Hans) {
  --lk-font-body: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --lk-font-head: var(--lk-font-body);
  --lk-font-money: "IBM Plex Mono", ui-monospace, "Microsoft YaHei", monospace;
}
html:lang(zh-Hant) {
  --lk-font-body: system-ui, -apple-system, "Segoe UI", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "Noto Sans CJK TC", "Source Han Sans TC", sans-serif;
  --lk-font-head: var(--lk-font-body);
  --lk-font-money: "IBM Plex Mono", ui-monospace, "Microsoft JhengHei", monospace;
}
