/* RimeDeck design tokens — shared across Web + Desktop
 *
 * Light = "Hoarfrost" (霜凝): frost-blue tinted neutrals (h ≈ 235)
 * Dark  = "Moonlit Verse" (月韵): deep indigo canvas (h ≈ 250)
 *
 * See docs/rimedeck-feature-dev-add-theme.md for rationale. */

@theme inline {
    --font-heading: var(--font-sans);
    --font-sans: var(--font-sans);
    --font-serif: var(--font-serif);
    --font-mono: var(--font-mono);
    --color-sidebar-ring: var(--sidebar-ring);
    --color-sidebar-border: var(--sidebar-border);
    --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
    --color-sidebar-accent: var(--sidebar-accent);
    --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
    --color-sidebar-primary: var(--sidebar-primary);
    --color-sidebar-foreground: var(--sidebar-foreground);
    --color-sidebar: var(--sidebar);
    --color-chart-5: var(--chart-5);
    --color-chart-4: var(--chart-4);
    --color-chart-3: var(--chart-3);
    --color-chart-2: var(--chart-2);
    --color-chart-1: var(--chart-1);
    --color-ring: var(--ring);
    --color-input: var(--input);
    --color-border: var(--border);
    --color-destructive: var(--destructive);
    --color-success: var(--success);
    --color-warning: var(--warning);
    --color-info: var(--info);
    --color-brand: var(--brand);
    --color-brand-foreground: var(--brand-foreground);
    --color-accent-foreground: var(--accent-foreground);
    --color-accent: var(--accent);
    --color-muted-foreground: var(--muted-foreground);
    --color-muted: var(--muted);
    --color-secondary-foreground: var(--secondary-foreground);
    --color-secondary: var(--secondary);
    --color-primary-foreground: var(--primary-foreground);
    --color-primary: var(--primary);
    --color-popover-foreground: var(--popover-foreground);
    --color-popover: var(--popover);
    --color-card-foreground: var(--card-foreground);
    --color-card: var(--card);
    --color-foreground: var(--foreground);
    --color-background: var(--background);
    --radius-sm: calc(var(--radius) * 0.6);
    --radius-md: calc(var(--radius) * 0.8);
    --radius-lg: var(--radius);
    --radius-xl: calc(var(--radius) * 1.4);
    --radius-2xl: calc(var(--radius) * 1.8);
    --radius-3xl: calc(var(--radius) * 2.2);
    --radius-4xl: calc(var(--radius) * 2.6);
}

:root {
    --background: oklch(0.982 0.010 230);
    --foreground: oklch(0.155 0.022 240);
    --card: oklch(0.988 0.008 230);
    --card-foreground: oklch(0.155 0.022 240);
    --popover: oklch(0.988 0.008 230);
    --popover-foreground: oklch(0.155 0.022 240);
    --primary: oklch(0.22 0.035 240);
    --primary-foreground: oklch(0.982 0.008 230);
    --secondary: oklch(0.950 0.016 230);
    --secondary-foreground: oklch(0.22 0.035 240);
    --muted: oklch(0.950 0.016 230);
    --muted-foreground: oklch(0.50 0.040 235);
    --accent: oklch(0.938 0.022 225);
    --accent-foreground: oklch(0.22 0.035 240);
    --destructive: oklch(0.577 0.245 27.325);
    --border: oklch(0.892 0.022 230);
    --input: oklch(0.892 0.022 230);
    --ring: oklch(0.58 0.10 240);
    /* Hoarfrost chart palette — blue spectrum. chart-1 anchors to the
       brand blue; trailing series fan toward teal for visual rhythm. */
    --chart-1: oklch(0.55 0.20 245);
    --chart-2: oklch(0.62 0.16 230);
    --chart-3: oklch(0.70 0.12 215);
    --chart-4: oklch(0.78 0.08 200);
    --chart-5: oklch(0.86 0.06 185);
    --radius: 0.625rem;
    --sidebar: oklch(0.972 0.012 230);
    --sidebar-foreground: oklch(0.155 0.022 240);
    --sidebar-primary: oklch(0.22 0.035 240);
    --sidebar-primary-foreground: oklch(0.982 0.008 230);
    --sidebar-accent: oklch(0.938 0.018 230);
    --sidebar-accent-foreground: oklch(0.22 0.035 240);
    --sidebar-border: oklch(0.892 0.022 230);
    --sidebar-ring: oklch(0.58 0.10 240);
    --brand: oklch(0.55 0.22 250);
    --brand-foreground: oklch(0.985 0.006 230);
    --success: oklch(0.55 0.16 152);
    --warning: oklch(0.75 0.16 85);
    --info: oklch(0.55 0.20 240);
    --scrollbar-thumb: oklch(0.45 0.06 235 / 14%);
    --scrollbar-thumb-hover: oklch(0.45 0.06 235 / 22%);
    --scrollbar-track: transparent;
}

.dark {
    --background: oklch(0.165 0.028 260);
    --foreground: oklch(0.965 0.010 230);
    --card: oklch(0.195 0.032 258);
    --card-foreground: oklch(0.965 0.010 230);
    --popover: oklch(0.195 0.032 258);
    --popover-foreground: oklch(0.965 0.010 230);
    --primary: oklch(0.905 0.016 235);
    --primary-foreground: oklch(0.195 0.032 258);
    --secondary: oklch(0.252 0.030 258);
    --secondary-foreground: oklch(0.965 0.010 230);
    --muted: oklch(0.252 0.030 258);
    --muted-foreground: oklch(0.65 0.032 235);
    --accent: oklch(0.265 0.035 252);
    --accent-foreground: oklch(0.965 0.010 230);
    --destructive: oklch(0.704 0.191 22.216);
    --border: oklch(0.55 0.06 250 / 15%);
    --input: oklch(0.55 0.06 250 / 20%);
    --ring: oklch(0.70 0.16 55);
    /* Moonlit Verse chart palette — warm hue rotation on the dark indigo
       canvas. Orange anchors the primary series; trailing series step
       through the warm spectrum (55 → 40 → 25 → 10 → 350). */
    --chart-1: oklch(0.72 0.18 55);
    --chart-2: oklch(0.65 0.15 40);
    --chart-3: oklch(0.58 0.12 25);
    --chart-4: oklch(0.50 0.10 10);
    --chart-5: oklch(0.42 0.08 350);
    --sidebar: oklch(0.185 0.032 258);
    --sidebar-foreground: oklch(0.965 0.010 230);
    --sidebar-primary: oklch(0.70 0.18 55);
    --sidebar-primary-foreground: oklch(0.15 0.02 55);
    --sidebar-accent: oklch(0.252 0.030 258);
    --sidebar-accent-foreground: oklch(0.965 0.010 230);
    --sidebar-border: oklch(0.55 0.06 250 / 15%);
    --sidebar-ring: oklch(0.70 0.16 55);
    --brand: oklch(0.70 0.18 55);
    --brand-foreground: oklch(0.15 0.02 55);
    --success: oklch(0.65 0.15 152);
    --warning: oklch(0.72 0.16 85);
    --info: oklch(0.65 0.18 245);
    --scrollbar-thumb: oklch(0.55 0.06 250 / 12%);
    --scrollbar-thumb-hover: oklch(0.55 0.06 250 / 22%);
    --scrollbar-track: transparent;
}

/* ── Zinc Classic palette override ─────────────────────────────────────
 * When [data-palette="zinc"] is set on <html>, these restore the original
 * neutral zinc palette (h ≈ 286, near-zero chroma). The rime palette
 * (above) is the default — no data attribute needed. */

:root[data-palette="zinc"] {
    --background: oklch(1 0 0);
    --foreground: oklch(0.141 0.005 285.823);
    --card: oklch(1 0 0);
    --card-foreground: oklch(0.141 0.005 285.823);
    --popover: oklch(1 0 0);
    --popover-foreground: oklch(0.141 0.005 285.823);
    --primary: oklch(0.21 0.006 285.885);
    --primary-foreground: oklch(0.985 0 0);
    --secondary: oklch(0.967 0.001 286.375);
    --secondary-foreground: oklch(0.21 0.006 285.885);
    --muted: oklch(0.967 0.001 286.375);
    --muted-foreground: oklch(0.552 0.016 285.938);
    --accent: oklch(0.967 0.001 286.375);
    --accent-foreground: oklch(0.21 0.006 285.885);
    --destructive: oklch(0.577 0.245 27.325);
    --border: oklch(0.92 0.004 286.32);
    --input: oklch(0.92 0.004 286.32);
    --ring: oklch(0.705 0.015 286.067);
    --chart-1: oklch(0.55 0.16 255);
    --chart-2: oklch(0.66 0.13 255);
    --chart-3: oklch(0.76 0.10 255);
    --chart-4: oklch(0.85 0.06 255);
    --chart-5: oklch(0.92 0.03 255);
    --sidebar: oklch(0.985 0 0);
    --sidebar-foreground: oklch(0.141 0.005 285.823);
    --sidebar-primary: oklch(0.21 0.006 285.885);
    --sidebar-primary-foreground: oklch(0.985 0 0);
    --sidebar-accent: oklch(0.95 0.002 286.375);
    --sidebar-accent-foreground: oklch(0.21 0.006 285.885);
    --sidebar-border: oklch(0.92 0.004 286.32);
    --sidebar-ring: oklch(0.705 0.015 286.067);
    --brand: oklch(0.55 0.16 255);
    --brand-foreground: oklch(0.985 0 0);
    --success: oklch(0.55 0.16 145);
    --warning: oklch(0.75 0.16 85);
    --info: oklch(0.55 0.18 250);
    --scrollbar-thumb: oklch(0 0 0 / 10%);
    --scrollbar-thumb-hover: oklch(0 0 0 / 18%);
    --scrollbar-track: transparent;
}

.dark[data-palette="zinc"],
[data-palette="zinc"] .dark {
    --background: oklch(0.18 0.005 285.823);
    --foreground: oklch(0.985 0 0);
    --card: oklch(0.21 0.006 285.885);
    --card-foreground: oklch(0.985 0 0);
    --popover: oklch(0.21 0.006 285.885);
    --popover-foreground: oklch(0.985 0 0);
    --primary: oklch(0.92 0.004 286.32);
    --primary-foreground: oklch(0.21 0.006 285.885);
    --secondary: oklch(0.274 0.006 286.033);
    --secondary-foreground: oklch(0.985 0 0);
    --muted: oklch(0.274 0.006 286.033);
    --muted-foreground: oklch(0.705 0.015 286.067);
    --accent: oklch(0.274 0.006 286.033);
    --accent-foreground: oklch(0.985 0 0);
    --destructive: oklch(0.704 0.191 22.216);
    --border: oklch(1 0 0 / 10%);
    --input: oklch(1 0 0 / 15%);
    --ring: oklch(0.552 0.016 285.938);
    --chart-1: oklch(0.72 0.16 255);
    --chart-2: oklch(0.62 0.13 255);
    --chart-3: oklch(0.52 0.10 255);
    --chart-4: oklch(0.42 0.06 255);
    --chart-5: oklch(0.32 0.03 255);
    --sidebar: oklch(0.21 0.006 285.885);
    --sidebar-foreground: oklch(0.985 0 0);
    --sidebar-primary: oklch(0.488 0.243 264.376);
    --sidebar-primary-foreground: oklch(0.985 0 0);
    --sidebar-accent: oklch(0.274 0.006 286.033);
    --sidebar-accent-foreground: oklch(0.985 0 0);
    --sidebar-border: oklch(1 0 0 / 10%);
    --sidebar-ring: oklch(0.552 0.016 285.938);
    --brand: oklch(0.65 0.16 255);
    --brand-foreground: oklch(0.985 0 0);
    --success: oklch(0.65 0.15 145);
    --warning: oklch(0.70 0.16 85);
    --info: oklch(0.65 0.18 250);
    --scrollbar-thumb: oklch(1 0 0 / 8%);
    --scrollbar-thumb-hover: oklch(1 0 0 / 18%);
    --scrollbar-track: transparent;
}
